Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions format/apple/macho/macho.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func machoDecode(d *decode.D) any {
LC_REEXPORT_DYLIB:
d.FieldStruct("dylib_command", func(d *decode.D) {
offset := d.FieldU32("offset", scalar.UintHex)
d.FieldU32("timestamp", timestampMapper)
d.FieldU32("timestamp", scalar.UintActualUnixTimeDescription(time.Second, time.RFC3339))
d.FieldU32("current_version")
d.FieldU32("compatibility_version")
d.FieldUTF8NullFixedLen("name", int(cmdSize)-int(offset))
Expand Down Expand Up @@ -882,11 +882,6 @@ func parseSectionFlags(d *decode.D) {
}
}

var timestampMapper = scalar.UintFn(func(s scalar.Uint) (scalar.Uint, error) {
s.Sym = time.UnixMilli(int64(s.Actual)).UTC().String()
return s, nil
})

func threadStateI386Decode(d *decode.D) {
d.FieldU32("eax")
d.FieldU32("ebx")
Expand Down
4 changes: 2 additions & 2 deletions format/apple/macho/testdata/darwin_aarch64/a_dynamic.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ $ fq dv a_dynamic
0x0520| 28 00 00 00 | (... | cmdsize: 40 0x524-0x528 (4)
| | | dylib_command{}: 0x528-0x548 (32)
0x0520| 18 00 00 00 | .... | offset: 0x18 0x528-0x52c (4)
0x0520| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x52c-0x530 (4)
0x0520| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x52c-0x530 (4)
0x0530|00 00 00 00 |.... | current_version: 0 0x530-0x534 (4)
0x0530| 00 00 00 00 | .... | compatibility_version: 0 0x534-0x538 (4)
0x0530| 6c 69 62 62 62 62 2e 73| libbbb.s| name: "libbbb.so" 0x538-0x548 (16)
Expand All @@ -544,7 +544,7 @@ $ fq dv a_dynamic
0x0540| 38 00 00 00| 8...| cmdsize: 56 0x54c-0x550 (4)
| | | dylib_command{}: 0x550-0x580 (48)
0x0550|18 00 00 00 |.... | offset: 0x18 0x550-0x554 (4)
0x0550| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x554-0x558 (4)
0x0550| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x554-0x558 (4)
0x0550| 05 64 0c 05 | .d.. | current_version: 84698117 0x558-0x55c (4)
0x0550| 00 00 01 00| ....| compatibility_version: 65536 0x55c-0x560 (4)
0x0560|2f 75 73 72 2f 6c 69 62 2f 6c 69 62 53 79 73 74|/usr/lib/libSyst| name: "/usr/lib/libSystem.B.dylib" 0x560-0x580 (32)
Expand Down
2 changes: 1 addition & 1 deletion format/apple/macho/testdata/darwin_aarch64/a_static.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ $ fq dv a_static
0x0520| 38 00 00 00 | 8... | cmdsize: 56 0x524-0x528 (4)
| | | dylib_command{}: 0x528-0x558 (48)
0x0520| 18 00 00 00 | .... | offset: 0x18 0x528-0x52c (4)
0x0520| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x52c-0x530 (4)
0x0520| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x52c-0x530 (4)
0x0530|05 64 0c 05 |.d.. | current_version: 84698117 0x530-0x534 (4)
0x0530| 00 00 01 00 | .... | compatibility_version: 65536 0x534-0x538 (4)
0x0530| 2f 75 73 72 2f 6c 69 62| /usr/lib| name: "/usr/lib/libSystem.B.dylib" 0x538-0x558 (32)
Expand Down
4 changes: 2 additions & 2 deletions format/apple/macho/testdata/darwin_aarch64/a_stripped.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ $ fq dv a_stripped
0x0520| 28 00 00 00 | (... | cmdsize: 40 0x524-0x528 (4)
| | | dylib_command{}: 0x528-0x548 (32)
0x0520| 18 00 00 00 | .... | offset: 0x18 0x528-0x52c (4)
0x0520| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x52c-0x530 (4)
0x0520| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x52c-0x530 (4)
0x0530|00 00 00 00 |.... | current_version: 0 0x530-0x534 (4)
0x0530| 00 00 00 00 | .... | compatibility_version: 0 0x534-0x538 (4)
0x0530| 6c 69 62 62 62 62 2e 73| libbbb.s| name: "libbbb.so" 0x538-0x548 (16)
Expand All @@ -524,7 +524,7 @@ $ fq dv a_stripped
0x0540| 38 00 00 00| 8...| cmdsize: 56 0x54c-0x550 (4)
| | | dylib_command{}: 0x550-0x580 (48)
0x0550|18 00 00 00 |.... | offset: 0x18 0x550-0x554 (4)
0x0550| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x554-0x558 (4)
0x0550| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x554-0x558 (4)
0x0550| 05 64 0c 05 | .d.. | current_version: 84698117 0x558-0x55c (4)
0x0550| 00 00 01 00| ....| compatibility_version: 65536 0x55c-0x560 (4)
0x0560|2f 75 73 72 2f 6c 69 62 2f 6c 69 62 53 79 73 74|/usr/lib/libSyst| name: "/usr/lib/libSystem.B.dylib" 0x560-0x580 (32)
Expand Down
4 changes: 2 additions & 2 deletions format/apple/macho/testdata/darwin_aarch64/libbbb.so.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ $ fq dv libbbb.so
0x03c0| 28 00 00 00 | (... | cmdsize: 40 0x3c4-0x3c8 (4)
| | | dylib_command{}: 0x3c8-0x3e8 (32)
0x03c0| 18 00 00 00 | .... | offset: 0x18 0x3c8-0x3cc (4)
0x03c0| 01 00 00 00| ....| timestamp: "1970-01-01 00:00:00.001 +0000 UTC" (1) 0x3cc-0x3d0 (4)
0x03c0| 01 00 00 00| ....| timestamp: 1 (1970-01-01T00:00:01Z) 0x3cc-0x3d0 (4)
0x03d0|00 00 00 00 |.... | current_version: 0 0x3d0-0x3d4 (4)
0x03d0| 00 00 00 00 | .... | compatibility_version: 0 0x3d4-0x3d8 (4)
0x03d0| 6c 69 62 62 62 62 2e 73| libbbb.s| name: "libbbb.so" 0x3d8-0x3e8 (16)
Expand Down Expand Up @@ -493,7 +493,7 @@ $ fq dv libbbb.so
0x04c0| 38 00 00 00| 8...| cmdsize: 56 0x4cc-0x4d0 (4)
| | | dylib_command{}: 0x4d0-0x500 (48)
0x04d0|18 00 00 00 |.... | offset: 0x18 0x4d0-0x4d4 (4)
0x04d0| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x4d4-0x4d8 (4)
0x04d0| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x4d4-0x4d8 (4)
0x04d0| 05 64 0c 05 | .d.. | current_version: 84698117 0x4d8-0x4dc (4)
0x04d0| 00 00 01 00| ....| compatibility_version: 65536 0x4dc-0x4e0 (4)
0x04e0|2f 75 73 72 2f 6c 69 62 2f 6c 69 62 53 79 73 74|/usr/lib/libSyst| name: "/usr/lib/libSystem.B.dylib" 0x4e0-0x500 (32)
Expand Down
4 changes: 2 additions & 2 deletions format/apple/macho/testdata/darwin_amd64/a_dynamic.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ $ fq dv a_dynamic
0x04c0| 28 00 00 00| (...| cmdsize: 40 0x4cc-0x4d0 (4)
| | | dylib_command{}: 0x4d0-0x4f0 (32)
0x04d0|18 00 00 00 |.... | offset: 0x18 0x4d0-0x4d4 (4)
0x04d0| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x4d4-0x4d8 (4)
0x04d0| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x4d4-0x4d8 (4)
0x04d0| 00 00 00 00 | .... | current_version: 0 0x4d8-0x4dc (4)
0x04d0| 00 00 00 00| ....| compatibility_version: 0 0x4dc-0x4e0 (4)
0x04e0|6c 69 62 62 62 62 2e 73 6f 00 00 00 00 00 00 00|libbbb.so.......| name: "libbbb.so" 0x4e0-0x4f0 (16)
Expand All @@ -507,7 +507,7 @@ $ fq dv a_dynamic
0x04f0| 38 00 00 00 | 8... | cmdsize: 56 0x4f4-0x4f8 (4)
| | | dylib_command{}: 0x4f8-0x528 (48)
0x04f0| 18 00 00 00 | .... | offset: 0x18 0x4f8-0x4fc (4)
0x04f0| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x4fc-0x500 (4)
0x04f0| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x4fc-0x500 (4)
0x0500|00 00 1f 05 |.... | current_version: 85917696 0x500-0x504 (4)
0x0500| 00 00 01 00 | .... | compatibility_version: 65536 0x504-0x508 (4)
0x0500| 2f 75 73 72 2f 6c 69 62| /usr/lib| name: "/usr/lib/libSystem.B.dylib" 0x508-0x528 (32)
Expand Down
2 changes: 1 addition & 1 deletion format/apple/macho/testdata/darwin_amd64/a_static.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ $ fq dv a_static
0x04c0| 38 00 00 00| 8...| cmdsize: 56 0x4cc-0x4d0 (4)
| | | dylib_command{}: 0x4d0-0x500 (48)
0x04d0|18 00 00 00 |.... | offset: 0x18 0x4d0-0x4d4 (4)
0x04d0| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x4d4-0x4d8 (4)
0x04d0| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x4d4-0x4d8 (4)
0x04d0| 00 00 1f 05 | .... | current_version: 85917696 0x4d8-0x4dc (4)
0x04d0| 00 00 01 00| ....| compatibility_version: 65536 0x4dc-0x4e0 (4)
0x04e0|2f 75 73 72 2f 6c 69 62 2f 6c 69 62 53 79 73 74|/usr/lib/libSyst| name: "/usr/lib/libSystem.B.dylib" 0x4e0-0x500 (32)
Expand Down
4 changes: 2 additions & 2 deletions format/apple/macho/testdata/darwin_amd64/a_stripped.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ $ fq dv a_stripped
0x04c0| 28 00 00 00| (...| cmdsize: 40 0x4cc-0x4d0 (4)
| | | dylib_command{}: 0x4d0-0x4f0 (32)
0x04d0|18 00 00 00 |.... | offset: 0x18 0x4d0-0x4d4 (4)
0x04d0| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x4d4-0x4d8 (4)
0x04d0| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x4d4-0x4d8 (4)
0x04d0| 00 00 00 00 | .... | current_version: 0 0x4d8-0x4dc (4)
0x04d0| 00 00 00 00| ....| compatibility_version: 0 0x4dc-0x4e0 (4)
0x04e0|6c 69 62 62 62 62 2e 73 6f 00 00 00 00 00 00 00|libbbb.so.......| name: "libbbb.so" 0x4e0-0x4f0 (16)
Expand All @@ -497,7 +497,7 @@ $ fq dv a_stripped
0x04f0| 38 00 00 00 | 8... | cmdsize: 56 0x4f4-0x4f8 (4)
| | | dylib_command{}: 0x4f8-0x528 (48)
0x04f0| 18 00 00 00 | .... | offset: 0x18 0x4f8-0x4fc (4)
0x04f0| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x4fc-0x500 (4)
0x04f0| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x4fc-0x500 (4)
0x0500|00 00 1f 05 |.... | current_version: 85917696 0x500-0x504 (4)
0x0500| 00 00 01 00 | .... | compatibility_version: 65536 0x504-0x508 (4)
0x0500| 2f 75 73 72 2f 6c 69 62| /usr/lib| name: "/usr/lib/libSystem.B.dylib" 0x508-0x528 (32)
Expand Down
4 changes: 2 additions & 2 deletions format/apple/macho/testdata/darwin_amd64/libbbb.so.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ $ fq dv libbbb.so
0x0370| 28 00 00 00| (...| cmdsize: 40 0x37c-0x380 (4)
| | | dylib_command{}: 0x380-0x3a0 (32)
0x0380|18 00 00 00 |.... | offset: 0x18 0x380-0x384 (4)
0x0380| 01 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.001 +0000 UTC" (1) 0x384-0x388 (4)
0x0380| 01 00 00 00 | .... | timestamp: 1 (1970-01-01T00:00:01Z) 0x384-0x388 (4)
0x0380| 00 00 00 00 | .... | current_version: 0 0x388-0x38c (4)
0x0380| 00 00 00 00| ....| compatibility_version: 0 0x38c-0x390 (4)
0x0390|6c 69 62 62 62 62 2e 73 6f 00 00 00 00 00 00 00|libbbb.so.......| name: "libbbb.so" 0x390-0x3a0 (16)
Expand Down Expand Up @@ -449,7 +449,7 @@ $ fq dv libbbb.so
0x0470| 38 00 00 00 | 8... | cmdsize: 56 0x474-0x478 (4)
| | | dylib_command{}: 0x478-0x4a8 (48)
0x0470| 18 00 00 00 | .... | offset: 0x18 0x478-0x47c (4)
0x0470| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x47c-0x480 (4)
0x0470| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x47c-0x480 (4)
0x0480|00 00 1f 05 |.... | current_version: 85917696 0x480-0x484 (4)
0x0480| 00 00 01 00 | .... | compatibility_version: 65536 0x484-0x488 (4)
0x0480| 2f 75 73 72 2f 6c 69 62| /usr/lib| name: "/usr/lib/libSystem.B.dylib" 0x488-0x4a8 (32)
Expand Down
8 changes: 4 additions & 4 deletions format/apple/macho/testdata/darwin_fat/a_dynamic.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ $ fq dv a_dynamic
0x044c0| 28 00 00 00| (...| cmdsize: 40 0x44cc-0x44d0 (4)
| | | dylib_command{}: 0x44d0-0x44f0 (32)
0x044d0|18 00 00 00 |.... | offset: 0x18 0x44d0-0x44d4 (4)
0x044d0| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x44d4-0x44d8 (4)
0x044d0| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x44d4-0x44d8 (4)
0x044d0| 00 00 00 00 | .... | current_version: 0 0x44d8-0x44dc (4)
0x044d0| 00 00 00 00| ....| compatibility_version: 0 0x44dc-0x44e0 (4)
0x044e0|6c 69 62 62 62 62 2e 73 6f 00 00 00 00 00 00 00|libbbb.so.......| name: "libbbb.so" 0x44e0-0x44f0 (16)
Expand All @@ -527,7 +527,7 @@ $ fq dv a_dynamic
0x044f0| 38 00 00 00 | 8... | cmdsize: 56 0x44f4-0x44f8 (4)
| | | dylib_command{}: 0x44f8-0x4528 (48)
0x044f0| 18 00 00 00 | .... | offset: 0x18 0x44f8-0x44fc (4)
0x044f0| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x44fc-0x4500 (4)
0x044f0| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x44fc-0x4500 (4)
0x04500|00 00 1f 05 |.... | current_version: 85917696 0x4500-0x4504 (4)
0x04500| 00 00 01 00 | .... | compatibility_version: 65536 0x4504-0x4508 (4)
0x04500| 2f 75 73 72 2f 6c 69 62| /usr/lib| name: "/usr/lib/libSystem.B.dylib" 0x4508-0x4528 (32)
Expand Down Expand Up @@ -1080,7 +1080,7 @@ $ fq dv a_dynamic
0x10520| 28 00 00 00 | (... | cmdsize: 40 0x10524-0x10528 (4)
| | | dylib_command{}: 0x10528-0x10548 (32)
0x10520| 18 00 00 00 | .... | offset: 0x18 0x10528-0x1052c (4)
0x10520| 02 00 00 00| ....| timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x1052c-0x10530 (4)
0x10520| 02 00 00 00| ....| timestamp: 2 (1970-01-01T00:00:02Z) 0x1052c-0x10530 (4)
0x10530|00 00 00 00 |.... | current_version: 0 0x10530-0x10534 (4)
0x10530| 00 00 00 00 | .... | compatibility_version: 0 0x10534-0x10538 (4)
0x10530| 6c 69 62 62 62 62 2e 73| libbbb.s| name: "libbbb.so" 0x10538-0x10548 (16)
Expand All @@ -1090,7 +1090,7 @@ $ fq dv a_dynamic
0x10540| 38 00 00 00| 8...| cmdsize: 56 0x1054c-0x10550 (4)
| | | dylib_command{}: 0x10550-0x10580 (48)
0x10550|18 00 00 00 |.... | offset: 0x18 0x10550-0x10554 (4)
0x10550| 02 00 00 00 | .... | timestamp: "1970-01-01 00:00:00.002 +0000 UTC" (2) 0x10554-0x10558 (4)
0x10550| 02 00 00 00 | .... | timestamp: 2 (1970-01-01T00:00:02Z) 0x10554-0x10558 (4)
0x10550| 05 64 0c 05 | .d.. | current_version: 84698117 0x10558-0x1055c (4)
0x10550| 00 00 01 00| ....| compatibility_version: 65536 0x1055c-0x10560 (4)
0x10560|2f 75 73 72 2f 6c 69 62 2f 6c 69 62 53 79 73 74|/usr/lib/libSyst| name: "/usr/lib/libSystem.B.dylib" 0x10560-0x10580 (32)
Expand Down
Loading