Skip to content

Commit

Permalink
chore: dump cputype and cpusubtype as hex numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Jan 31, 2024
1 parent c4867e9 commit 936e189
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcffaedfe
cputype: 16777223
cpusubtype: 3
cputype: 0x1000007
cpusubtype: 0x3
filetype: 8
ncmds: 28
sizeofcmds: 2936
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcefaedfe
cputype: 7
cpusubtype: 3
cputype: 0x7
cpusubtype: 0x3
filetype: 2
ncmds: 20
sizeofcmds: 2120
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xfeedface
cputype: 18
cpusubtype: 0
cputype: 0x12
cpusubtype: 0x0
filetype: 2
ncmds: 18
sizeofcmds: 2616
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcffaedfe
cputype: 16777228
cpusubtype: 0
cputype: 0x100000c
cpusubtype: 0x0
filetype: 6
ncmds: 107
sizeofcmds: 11416
Expand Down
4 changes: 2 additions & 2 deletions yara-x/src/modules/macho/tests/testdata/macho_ppc_file.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xfeedface
cputype: 18
cpusubtype: 0
cputype: 0x12
cpusubtype: 0x0
filetype: 2
ncmds: 10
sizeofcmds: 1484
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcffaedfe
cputype: 16777223
cpusubtype: 3
cputype: 0x1000007
cpusubtype: 0x3
filetype: 6
ncmds: 13
sizeofcmds: 744
Expand Down
4 changes: 2 additions & 2 deletions yara-x/src/modules/macho/tests/testdata/macho_x86_file.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcefaedfe
cputype: 7
cpusubtype: 3
cputype: 0x7
cpusubtype: 0x3
filetype: 2
ncmds: 17
sizeofcmds: 1098
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcefaedfe
cputype: 7
cpusubtype: 3
cputype: 0x7
cpusubtype: 0x3
filetype: 1
ncmds: 3
sizeofcmds: 228
Expand Down
4 changes: 2 additions & 2 deletions yara-x/src/modules/macho/tests/testdata/tiny_macho.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
magic: 0xcefaedfe
cputype: 7
cpusubtype: 3
cputype: 0x7
cpusubtype: 0x3
filetype: 2
ncmds: 2
sizeofcmds: 136
Expand Down
16 changes: 8 additions & 8 deletions yara-x/src/modules/macho/tests/testdata/tiny_universal.out
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
fat_magic: 0xcafebabe
nfat_arch: 2
fat_arch:
- cputype: 7
cpusubtype: 3
- cputype: 0x7
cpusubtype: 0x3
offset: 4096
size: 8512
align: 12
reserved: 0
- cputype: 16777223
cpusubtype: 2147483651
- cputype: 0x1000007
cpusubtype: 0x80000003
offset: 16384
size: 8544
align: 12
reserved: 0
file:
- magic: 0xcefaedfe
cputype: 7
cpusubtype: 3
cputype: 0x7
cpusubtype: 0x3
filetype: 2
ncmds: 16
sizeofcmds: 1060
Expand Down Expand Up @@ -165,8 +165,8 @@ file:
locreloff: 0
nlocrel: 0
- magic: 0xcffaedfe
cputype: 16777223
cpusubtype: 2147483651
cputype: 0x1000007
cpusubtype: 0x80000003
filetype: 2
ncmds: 16
sizeofcmds: 1296
Expand Down
12 changes: 6 additions & 6 deletions yara-x/src/modules/protos/macho.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ message Segment {
}

message FatArch {
optional uint32 cputype = 1;
optional uint32 cpusubtype = 2;
optional uint32 cputype = 1 [(yaml.field).fmt = "x"];
optional uint32 cpusubtype = 2 [(yaml.field).fmt = "x"];
optional uint64 offset = 3;
optional uint64 size = 4;
optional uint32 align = 5;
Expand All @@ -77,8 +77,8 @@ message FatArch {

message File {
optional uint32 magic = 1 [(yaml.field).fmt = "x"];
optional uint32 cputype = 2;
optional uint32 cpusubtype = 3;
optional uint32 cputype = 2 [(yaml.field).fmt = "x"];
optional uint32 cpusubtype = 3 [(yaml.field).fmt = "x"];
optional uint32 filetype = 4;
optional uint32 ncmds = 5;
optional uint32 sizeofcmds = 6;
Expand All @@ -98,8 +98,8 @@ message File {
message Macho {
// Set Mach-O header and basic fields
optional uint32 magic = 1 [(yaml.field).fmt = "x"];
optional uint32 cputype = 2;
optional uint32 cpusubtype = 3;
optional uint32 cputype = 2 [(yaml.field).fmt = "x"];
optional uint32 cpusubtype = 3 [(yaml.field).fmt = "x"];
optional uint32 filetype = 4;
optional uint32 ncmds = 5;
optional uint32 sizeofcmds = 6;
Expand Down

0 comments on commit 936e189

Please sign in to comment.