@@ -14,6 +14,7 @@ import (
14
14
15
15
var dumpKernel = flag .String ("dump_kernel" , "" , "dump uncompressed kernel to the filename given" )
16
16
var dumpSymtab = flag .String ("dump_symtab" , "" , "dump symbol table to the filename given" )
17
+ var isUncompressed = flag .Bool ("is_uncompressed" , false , "whether the passed zImage is an Image" )
17
18
18
19
// lzop tries decompressing in with lzop, ignoring warnings (i.e. trailing garbage).
19
20
func lzop (in []byte ) ([]byte , error ) {
@@ -102,9 +103,9 @@ func (s *symbol) lds() string {
102
103
// 0x00
103
104
//
104
105
// The code relies on being able to spot an entry in the list of names by a
105
- // well-known and expected name (currently: kallsyms_lookup_name ).
106
+ // well-known and expected name (currently: cpu_active_mask ).
106
107
func getSymtab (kernel []byte ) ([]* symbol , error ) {
107
- const sym = "\x00 kallsyms_lookup_name \x00 "
108
+ const sym = "\x00 cpu_active_mask \x00 "
108
109
109
110
// Find the symbol in the string table.
110
111
i := bytes .Index (kernel , []byte (sym ))
@@ -210,9 +211,14 @@ func main() {
210
211
log .Fatalf ("Can't read zImage: %v" , err )
211
212
}
212
213
213
- kernel , err := findKernel (zImage )
214
- if err != nil {
215
- log .Fatalf ("Kernel not found in zImage: %v" , err )
214
+ var kernel []byte
215
+ if * isUncompressed {
216
+ kernel = zImage
217
+ } else {
218
+ kernel , err = findKernel (zImage )
219
+ if err != nil {
220
+ log .Fatalf ("Kernel not found in zImage: %v" , err )
221
+ }
216
222
}
217
223
zImage = nil
218
224
0 commit comments