From c6971f3f2df6417b41a33add4c2c6385a850c30b Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 9 Mar 2025 22:45:29 -0600 Subject: [PATCH] Add initial support for x86-64 relocations --- objdiff-core/src/arch/x86.rs | 123 +- objdiff-core/tests/arch_x86.rs | 14 + objdiff-core/tests/data/x86_64/vs2022.o | Bin 0 -> 5703 bytes .../tests/snapshots/arch_x86__read_x86.snap | 2 +- .../snapshots/arch_x86__read_x86_64-2.snap | 279 +++ .../snapshots/arch_x86__read_x86_64-3.snap | 25 + .../snapshots/arch_x86__read_x86_64.snap | 1505 +++++++++++++++++ 7 files changed, 1914 insertions(+), 34 deletions(-) create mode 100644 objdiff-core/tests/data/x86_64/vs2022.o create mode 100644 objdiff-core/tests/snapshots/arch_x86__read_x86_64-2.snap create mode 100644 objdiff-core/tests/snapshots/arch_x86__read_x86_64-3.snap create mode 100644 objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap diff --git a/objdiff-core/src/arch/x86.rs b/objdiff-core/src/arch/x86.rs index c17ab2d..87db44f 100644 --- a/objdiff-core/src/arch/x86.rs +++ b/objdiff-core/src/arch/x86.rs @@ -15,17 +15,36 @@ use crate::{ #[derive(Debug)] pub struct ArchX86 { - bits: u32, + arch: Architecture, endianness: object::Endianness, } +#[derive(Debug)] +enum Architecture { + X86, + X86_64, +} + impl ArchX86 { pub fn new(object: &object::File) -> Result { - Ok(Self { bits: if object.is_64() { 64 } else { 32 }, endianness: object.endianness() }) + let arch = match object.architecture() { + object::Architecture::I386 => Architecture::X86, + object::Architecture::X86_64 => Architecture::X86_64, + _ => bail!("Unsupported architecture for ArchX86: {:?}", object.architecture()), + }; + Ok(Self { arch, endianness: object.endianness() }) } fn decoder<'a>(&self, code: &'a [u8], address: u64) -> Decoder<'a> { - Decoder::with_ip(self.bits, code, address, DecoderOptions::NONE) + Decoder::with_ip( + match self.arch { + Architecture::X86 => 32, + Architecture::X86_64 => 64, + }, + code, + address, + DecoderOptions::NONE, + ) } fn formatter(&self, diff_config: &DiffObjConfig) -> Box { @@ -38,6 +57,27 @@ impl ArchX86 { formatter.options_mut().set_space_after_operand_separator(diff_config.space_between_args); formatter } + + fn reloc_size(&self, flags: RelocationFlags) -> Option { + match self.arch { + Architecture::X86 => match flags { + RelocationFlags::Coff(typ) => match typ { + pe::IMAGE_REL_I386_DIR16 | pe::IMAGE_REL_I386_REL16 => Some(2), + pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32 => Some(4), + _ => None, + }, + _ => None, + }, + Architecture::X86_64 => match flags { + RelocationFlags::Coff(typ) => match typ { + pe::IMAGE_REL_AMD64_ADDR32NB | pe::IMAGE_REL_AMD64_REL32 => Some(4), + pe::IMAGE_REL_AMD64_ADDR64 => Some(8), + _ => None, + }, + _ => None, + }, + } + } } impl Arch for ArchX86 { @@ -88,10 +128,9 @@ impl Arch for ArchX86 { // memory operand. let mut reloc_replace = None; if let Some(reloc) = resolved.relocation { - const PLACEHOLDER: u64 = 0x7BDE3E7D; // chosen by fair dice roll. - // guaranteed to be random. + const PLACEHOLDER: u64 = 0x7BDE3E7D; // chosen by fair dice roll. guaranteed to be random. let reloc_offset = reloc.relocation.address - resolved.ins_ref.address; - let reloc_size = reloc_size(reloc.relocation.flags).unwrap_or(usize::MAX); + let reloc_size = self.reloc_size(reloc.relocation.flags).unwrap_or(usize::MAX); let offsets = decoder.get_constant_offsets(&instruction); if reloc_offset == offsets.displacement_offset() as u64 && reloc_size == offsets.displacement_size() @@ -148,12 +187,28 @@ impl Arch for ArchX86 { _relocation: &object::Relocation, flags: RelocationFlags, ) -> Result { - match flags { - RelocationFlags::Coff(pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32) => { - let data = section.data()?[address as usize..address as usize + 4].try_into()?; - Ok(self.endianness.read_i32_bytes(data) as i64) - } - flags => bail!("Unsupported x86 implicit relocation {flags:?}"), + match self.arch { + Architecture::X86 => match flags { + RelocationFlags::Coff(pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32) => { + let data = + section.data()?[address as usize..address as usize + 4].try_into()?; + Ok(self.endianness.read_i32_bytes(data) as i64) + } + flags => bail!("Unsupported x86 implicit relocation {flags:?}"), + }, + Architecture::X86_64 => match flags { + RelocationFlags::Coff(pe::IMAGE_REL_AMD64_ADDR32NB | pe::IMAGE_REL_AMD64_REL32) => { + let data = + section.data()?[address as usize..address as usize + 4].try_into()?; + Ok(self.endianness.read_i32_bytes(data) as i64) + } + RelocationFlags::Coff(pe::IMAGE_REL_AMD64_ADDR64) => { + let data = + section.data()?[address as usize..address as usize + 8].try_into()?; + Ok(self.endianness.read_i64_bytes(data)) + } + flags => bail!("Unsupported x86-64 implicit relocation {flags:?}"), + }, } } @@ -168,27 +223,29 @@ impl Arch for ArchX86 { } fn reloc_name(&self, flags: RelocationFlags) -> Option<&'static str> { - match flags { - RelocationFlags::Coff(typ) => match typ { - pe::IMAGE_REL_I386_DIR32 => Some("IMAGE_REL_I386_DIR32"), - pe::IMAGE_REL_I386_REL32 => Some("IMAGE_REL_I386_REL32"), + match self.arch { + Architecture::X86 => match flags { + RelocationFlags::Coff(typ) => match typ { + pe::IMAGE_REL_I386_DIR32 => Some("IMAGE_REL_I386_DIR32"), + pe::IMAGE_REL_I386_REL32 => Some("IMAGE_REL_I386_REL32"), + _ => None, + }, + _ => None, + }, + Architecture::X86_64 => match flags { + RelocationFlags::Coff(typ) => match typ { + pe::IMAGE_REL_AMD64_ADDR64 => Some("IMAGE_REL_AMD64_ADDR64"), + pe::IMAGE_REL_AMD64_ADDR32NB => Some("IMAGE_REL_AMD64_ADDR32NB"), + pe::IMAGE_REL_AMD64_REL32 => Some("IMAGE_REL_AMD64_REL32"), + _ => None, + }, _ => None, }, - _ => None, } } - fn data_reloc_size(&self, flags: RelocationFlags) -> usize { reloc_size(flags).unwrap_or(1) } -} - -fn reloc_size(flags: RelocationFlags) -> Option { - match flags { - RelocationFlags::Coff(typ) => match typ { - pe::IMAGE_REL_I386_DIR16 | pe::IMAGE_REL_I386_REL16 => Some(2), - pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32 => Some(4), - _ => None, - }, - _ => None, + fn data_reloc_size(&self, flags: RelocationFlags) -> usize { + self.reloc_size(flags).unwrap_or(1) } } @@ -343,7 +400,7 @@ mod test { #[test] fn test_scan_instructions() { - let arch = ArchX86 { bits: 32, endianness: object::Endianness::Little }; + let arch = ArchX86 { arch: Architecture::X86, endianness: object::Endianness::Little }; let code = [ 0xc7, 0x85, 0x68, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x04, 0x85, 0x00, 0x00, 0x00, 0x00, @@ -362,7 +419,7 @@ mod test { #[test] fn test_process_instruction() { - let arch = ArchX86 { bits: 32, endianness: object::Endianness::Little }; + let arch = ArchX86 { arch: Architecture::X86, endianness: object::Endianness::Little }; let code = [0xc7, 0x85, 0x68, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00]; let opcode = iced_x86::Mnemonic::Mov as u16; let mut parts = Vec::new(); @@ -398,7 +455,7 @@ mod test { #[test] fn test_process_instruction_with_reloc_1() { - let arch = ArchX86 { bits: 32, endianness: object::Endianness::Little }; + let arch = ArchX86 { arch: Architecture::X86, endianness: object::Endianness::Little }; let code = [0xc7, 0x85, 0x68, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00]; let opcode = iced_x86::Mnemonic::Mov as u16; let mut parts = Vec::new(); @@ -443,7 +500,7 @@ mod test { #[test] fn test_process_instruction_with_reloc_2() { - let arch = ArchX86 { bits: 32, endianness: object::Endianness::Little }; + let arch = ArchX86 { arch: Architecture::X86, endianness: object::Endianness::Little }; let code = [0x8b, 0x04, 0x85, 0x00, 0x00, 0x00, 0x00]; let opcode = iced_x86::Mnemonic::Mov as u16; let mut parts = Vec::new(); @@ -486,7 +543,7 @@ mod test { #[test] fn test_process_instruction_with_reloc_3() { - let arch = ArchX86 { bits: 32, endianness: object::Endianness::Little }; + let arch = ArchX86 { arch: Architecture::X86, endianness: object::Endianness::Little }; let code = [0xe8, 0x00, 0x00, 0x00, 0x00]; let opcode = iced_x86::Mnemonic::Call as u16; let mut parts = Vec::new(); diff --git a/objdiff-core/tests/arch_x86.rs b/objdiff-core/tests/arch_x86.rs index da0e249..717e2b9 100644 --- a/objdiff-core/tests/arch_x86.rs +++ b/objdiff-core/tests/arch_x86.rs @@ -26,3 +26,17 @@ fn read_x86_combine_sections() { let obj = obj::read::parse(include_object!("data/x86/rtest.obj"), &diff_config).unwrap(); insta::assert_debug_snapshot!(obj.sections); } + +#[test] +#[cfg(feature = "x86")] +fn read_x86_64() { + let diff_config = diff::DiffObjConfig::default(); + let obj = obj::read::parse(include_object!("data/x86_64/vs2022.o"), &diff_config).unwrap(); + insta::assert_debug_snapshot!(obj); + let symbol_idx = + obj.symbols.iter().position(|s| s.name == "?Dot@Vector@@QEAAMPEAU1@@Z").unwrap(); + let diff = diff::code::no_diff_code(&obj, symbol_idx, &diff_config).unwrap(); + insta::assert_debug_snapshot!(diff.instruction_rows); + let output = common::display_diff(&obj, &diff, symbol_idx, &diff_config); + insta::assert_snapshot!(output); +} diff --git a/objdiff-core/tests/data/x86_64/vs2022.o b/objdiff-core/tests/data/x86_64/vs2022.o new file mode 100644 index 0000000000000000000000000000000000000000..646b8ce54069188b311922c011ae2effbcd1f62a GIT binary patch literal 5703 zcmYdklVI=(Je|Ikn}H#c0Rr?=ic*tH%2FXb1_pfw28JulFdmfV5@66vNlhwER|$rS zFw9|KU|?o}@gTGVgMgD>NoqxjN^TxRgn?l#BLl;H76t|%Hi!s60|SEsLqGz$x?Tnb zhDT5}5S0uJ3Idqw!WkGC^4Vc3AT&00nG6gJ$B0lD#K6Fy&jB$9MuN?&NJ%V7go!XP zfRr?X2!s%WgMfj9UID5)9tH-6P7Vf!sZh0`paiSKV%}z`8kmt_by&>X&B4HM9I6(d zc~7Bg2$}bmgMr~ER4qR9#5rLmL1 zr<1d9h!U!xzmJQbqpxeQk^A{6D$@wX% zdie}i3^sy{Nem1Z7=#(r81fq#;IwaMa#4P9ep-owMv$h0e?duRZe~?xUb=#Fer`c# zPHGVY1H)&2!59?#PJ}MDl8IRr&6%7wK_cOnsi%JQI577wb zSA6Cda8aq?*8{u0imjBz=)mh5uwcn&{x}zv3a~PWNDaR}SXoizXMO=Ni(lVGrKZU1 zGrvHLN)5=35Z^#O-rJ+n!N9-(aZL9VNH`%2B8Ns1%Lc~ROhyMhx_@|dpYiAw1qByW z>v2#hgTvJL3`D5$2q-q<4_h)YFoZHNFtC7Y5@9f_h5;1eAhFd93=E*0%))RK&bq?D zz#s%x_k@9g0b~mc!*>P-hCr~G93zaS!N|Z60u~EmWMBZLP!@)CMwrPRj0_C+VA)0ra<`-c2%pb!D4padYaR-*q{4tI!U>Olq z84i#P2Utb|95n);`6FFa1U~Z%_^60{=8puE5eLD12{2#cGk?TEkLDu^@rO|z1GZEF z-ZzYuo;D20J4au5x|GN8r;1E_3*ut0^eGFS|(!w8}S)IRo$m>C$km>9T(*uZ)~%>j^V5SEAQ zfUrP1Ou=F$`2qQvc_l_5RUllFA6$@;S_E!Hm89l^O#+F-Feo#EDk2y^0$MS__@H79 zSso@nSZGk?itH8(1_lOO1_lO31`h@X1{*L7jwh^gB_S9>A}n(%P7Gh1`QEV zNdjshNr6KVWFn|}2%PQojN_aFhHs*SXqf$LZTQ{8Ft8-o1P%VdI@P{fJ!8iv7Qt z%@+Hst@?9Pv$s^laI*LE*`nLeuVxNe`m*kkT8DJyq;#+E?uNf^cK*KQm#VkNVWIwm zg&z<6i@5!9_lj$J&ANud3o~EeZhZ6bNOCOt?e zGb5-`50QhB$jx+6Dqv;=#Tcj&|1DrOC|fWvFd(Y|#U3*wET`&;@W(TNU4^U$RDm%w z!t(#B)$Z3Z)qr{e%#5)7YtFqR6;lnUbj4Upd;9UG7c zD}w^qMGOpHATGGtfQe*4McCkKTA(8AaFJC|5oWl^O{fUMuD2K>zcEBOLD2#hh1o8J zBBJ8sXAG8RU|;}+7#jn!2*`h^BA^gM6#<10SOk<^!A5~%kc|Pk$qmY5%#0usq~Nfe zR5L5sHW1GU>K>3RGXru*2h`SQW(4JAkcszyJ&s4{3We$dt3j~~)OtnOr5q8yn+0xH zIaC)|4T@ddpb`LX7xx6a69`>%p}N3oQ0xM`4el?if&(dRaJvpcb%E8O*u{%t*M!|m z&Lea^gX#jSL9vSutP2!MpiqN)e_8%pw1L11;`&>0`F)uFr+|rfz^PV!Z4Q!(g8wJTdXoYA7H`q{93#ieD@afB+_S3-{ zz{DP?F0dK~J*3VXs7cAp2y!P#;d~_-P-~olfg!#uKPNW@BnD{`GNW|mKyHJiF^~%( zs-VHb@Cj-cSPeuMv||TqjN;P80SahngB4^KqMHY*k(e2w(h#elB?|+C98?&jh6yDG zK}}YKuClF9dl99U9#j`d4aC)UP!W*vObqd9IVGjVsZig8^ywjW6G1g0Gb5;Z4pNQ4 z0W1s*_MUkqsYM0(If*5yKACx`iA4@!smUezMGg*uu8xio0j`drh7Jb44p9vDF8L)W zlD-g0uvBJoNpK-9+2GP76e*agAe|7~;=$d;(!`?F6bFY$N3h8d83zZDD(u}$kkWWR zkSkzn4Ztpq4+?RP2X|0|OA?c_!xD>%8Ngzmd6^|niN&c9UT{WfNlJcs9z%S*d$31h zUP?}C5m*;Pe0*_ga%oX!No9O8sGl33oS&banaZG2npd8gm!g6vC{)1XG!IjbVvJ zE~&-IWaxA&O3Y1l0SzR=lN3n-#Q=*0(sZF@0`LeHXrv1)3d;;&QBd(0A77N3nB!mo S1q@KWahe5K1SO9^at8oEAt&Gf literal 0 HcmV?d00001 diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86.snap index e802d9d..74c6f36 100644 --- a/objdiff-core/tests/snapshots/arch_x86__read_x86.snap +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86.snap @@ -4,7 +4,7 @@ expression: obj --- Object { arch: ArchX86 { - bits: 32, + arch: X86, endianness: Little, }, endianness: Little, diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86_64-2.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86_64-2.snap new file mode 100644 index 0000000..64657a7 --- /dev/null +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86_64-2.snap @@ -0,0 +1,279 @@ +--- +source: objdiff-core/tests/arch_x86.rs +expression: diff.instruction_rows +--- +[ + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 0, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 5, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 10, + size: 1, + opcode: 640, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 11, + size: 4, + opcode: 740, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 15, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 20, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 25, + size: 4, + opcode: 448, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 29, + size: 4, + opcode: 460, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 33, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 38, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 43, + size: 5, + opcode: 448, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 48, + size: 5, + opcode: 460, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 53, + size: 4, + opcode: 11, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 57, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 62, + size: 5, + opcode: 414, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 67, + size: 5, + opcode: 448, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 72, + size: 5, + opcode: 460, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 77, + size: 4, + opcode: 11, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 81, + size: 4, + opcode: 7, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 85, + size: 1, + opcode: 590, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, + InstructionDiffRow { + ins_ref: Some( + InstructionRef { + address: 86, + size: 1, + opcode: 662, + }, + ), + kind: None, + branch_from: None, + branch_to: None, + arg_diff: [], + }, +] diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86_64-3.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86_64-3.snap new file mode 100644 index 0000000..fb42f7d --- /dev/null +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86_64-3.snap @@ -0,0 +1,25 @@ +--- +source: objdiff-core/tests/arch_x86.rs +expression: output +--- +[(Address(0), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(16)), Normal, 0), (Basic("]"), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Opaque("rdx")), Normal, 0), (Eol, Normal, 0)] +[(Address(5), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(8)), Normal, 0), (Basic("]"), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Opaque("rcx")), Normal, 0), (Eol, Normal, 0)] +[(Address(10), Normal, 5), (Spacing(4), Normal, 0), (Opcode("push", 640), Normal, 10), (Argument(Opaque("rdi")), Normal, 0), (Eol, Normal, 0)] +[(Address(11), Normal, 5), (Spacing(4), Normal, 0), (Opcode("sub", 740), Normal, 10), (Argument(Opaque("rsp")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Unsigned(16)), Normal, 0), (Eol, Normal, 0)] +[(Address(15), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("rax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(32)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(20), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("rcx")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(40)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(25), Normal, 5), (Spacing(4), Normal, 0), (Opcode("movss", 448), Normal, 10), (Argument(Opaque("xmm0")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rax")), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(29), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mulss", 460), Normal, 10), (Argument(Opaque("xmm0")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rcx")), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(33), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("rax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(32)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(38), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("rcx")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(40)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(43), Normal, 5), (Spacing(4), Normal, 0), (Opcode("movss", 448), Normal, 10), (Argument(Opaque("xmm1")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rax")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(4)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(48), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mulss", 460), Normal, 10), (Argument(Opaque("xmm1")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rcx")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(4)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(53), Normal, 5), (Spacing(4), Normal, 0), (Opcode("addss", 11), Normal, 10), (Argument(Opaque("xmm0")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Opaque("xmm1")), Normal, 0), (Eol, Normal, 0)] +[(Address(57), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("rax")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(32)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(62), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mov", 414), Normal, 10), (Argument(Opaque("rcx")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rsp")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(40)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(67), Normal, 5), (Spacing(4), Normal, 0), (Opcode("movss", 448), Normal, 10), (Argument(Opaque("xmm1")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rax")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(8)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(72), Normal, 5), (Spacing(4), Normal, 0), (Opcode("mulss", 460), Normal, 10), (Argument(Opaque("xmm1")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Basic("["), Normal, 0), (Argument(Opaque("rcx")), Normal, 0), (Argument(Opaque("+")), Normal, 0), (Argument(Signed(8)), Normal, 0), (Basic("]"), Normal, 0), (Eol, Normal, 0)] +[(Address(77), Normal, 5), (Spacing(4), Normal, 0), (Opcode("addss", 11), Normal, 10), (Argument(Opaque("xmm0")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Opaque("xmm1")), Normal, 0), (Eol, Normal, 0)] +[(Address(81), Normal, 5), (Spacing(4), Normal, 0), (Opcode("add", 7), Normal, 10), (Argument(Opaque("rsp")), Normal, 0), (Basic(","), Normal, 0), (Spacing(1), Normal, 0), (Argument(Unsigned(16)), Normal, 0), (Eol, Normal, 0)] +[(Address(85), Normal, 5), (Spacing(4), Normal, 0), (Opcode("pop", 590), Normal, 10), (Argument(Opaque("rdi")), Normal, 0), (Eol, Normal, 0)] +[(Address(86), Normal, 5), (Spacing(4), Normal, 0), (Opcode("ret", 662), Normal, 10), (Eol, Normal, 0)] diff --git a/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap b/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap new file mode 100644 index 0000000..b3bdf8b --- /dev/null +++ b/objdiff-core/tests/snapshots/arch_x86__read_x86_64.snap @@ -0,0 +1,1505 @@ +--- +source: objdiff-core/tests/arch_x86.rs +expression: obj +--- +Object { + arch: ArchX86 { + arch: X86_64, + endianness: Little, + }, + endianness: Little, + symbols: [ + Symbol { + name: "@comp.id", + demangled_name: None, + address: 0, + size: 0, + kind: Object, + section: None, + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "@feat.00", + demangled_name: None, + address: 0, + size: 0, + kind: Object, + section: None, + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "@vol.md", + demangled_name: None, + address: 0, + size: 0, + kind: Object, + section: None, + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.drectve]", + demangled_name: None, + address: 0, + size: 47, + kind: Section, + section: Some( + 0, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.debug$S]", + demangled_name: None, + address: 0, + size: 156, + kind: Section, + section: Some( + 1, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.text$mn]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 2, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.text$mn]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 3, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.text$mn]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 4, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.text$mn]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 5, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.text$mn]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 6, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "?InterpolateLinear@Vector@@QEAAXPEAU1@0M@Z", + demangled_name: Some( + "public: void __cdecl Vector::InterpolateLinear(struct Vector *, struct Vector *, float)", + ), + address: 0, + size: 0, + kind: Function, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Dot@Vector@@QEAAMPEAU1@@Z", + demangled_name: Some( + "public: float __cdecl Vector::Dot(struct Vector *)", + ), + address: 0, + size: 87, + kind: Function, + section: Some( + 4, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?DistSq@Vector@@QEAAMPEAU1@@Z", + demangled_name: Some( + "public: float __cdecl Vector::DistSq(struct Vector *)", + ), + address: 0, + size: 141, + kind: Function, + section: Some( + 3, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Sub@Vector@@QEAAXPEAU1@0@Z", + demangled_name: Some( + "public: void __cdecl Vector::Sub(struct Vector *, struct Vector *)", + ), + address: 0, + size: 105, + kind: Function, + section: Some( + 5, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Vector_MagSquared@@YAMPEAUVector@@@Z", + demangled_name: Some( + "float __cdecl Vector_MagSquared(struct Vector *)", + ), + address: 0, + size: 82, + kind: Function, + section: Some( + 6, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + address: 0, + size: 429, + kind: Function, + section: Some( + 2, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "_RTC_CheckStackVars", + demangled_name: None, + address: 0, + size: 0, + kind: Function, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "_RTC_InitBase", + demangled_name: None, + address: 0, + size: 0, + kind: Function, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "_RTC_Shutdown", + demangled_name: None, + address: 0, + size: 0, + kind: Function, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "__GSHandlerCheck", + demangled_name: None, + address: 0, + size: 0, + kind: Function, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "__security_check_cookie", + demangled_name: None, + address: 0, + size: 0, + kind: Function, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "$LN3", + demangled_name: None, + address: 0, + size: 0, + kind: Unknown, + section: Some( + 4, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$LN3", + demangled_name: None, + address: 0, + size: 0, + kind: Unknown, + section: Some( + 3, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$LN3", + demangled_name: None, + address: 0, + size: 0, + kind: Unknown, + section: Some( + 5, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$LN3", + demangled_name: None, + address: 0, + size: 0, + kind: Unknown, + section: Some( + 6, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$LN8", + demangled_name: None, + address: 0, + size: 0, + kind: Unknown, + section: Some( + 2, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.xdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 7, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$unwind$?Dot@Vector@@QEAAMPEAU1@@Z", + demangled_name: None, + address: 0, + size: 8, + kind: Object, + section: Some( + 7, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.pdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 8, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$pdata$?Dot@Vector@@QEAAMPEAU1@@Z", + demangled_name: None, + address: 0, + size: 12, + kind: Object, + section: Some( + 8, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.xdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 9, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$unwind$?DistSq@Vector@@QEAAMPEAU1@@Z", + demangled_name: None, + address: 0, + size: 8, + kind: Object, + section: Some( + 9, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.pdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 10, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$pdata$?DistSq@Vector@@QEAAMPEAU1@@Z", + demangled_name: None, + address: 0, + size: 12, + kind: Object, + section: Some( + 10, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.xdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 11, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$unwind$?Sub@Vector@@QEAAXPEAU1@0@Z", + demangled_name: None, + address: 0, + size: 8, + kind: Object, + section: Some( + 11, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.pdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 12, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$pdata$?Sub@Vector@@QEAAXPEAU1@0@Z", + demangled_name: None, + address: 0, + size: 12, + kind: Object, + section: Some( + 12, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.xdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 13, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$unwind$?Vector_MagSquared@@YAMPEAUVector@@@Z", + demangled_name: None, + address: 0, + size: 8, + kind: Object, + section: Some( + 13, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.pdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 14, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$pdata$?Vector_MagSquared@@YAMPEAUVector@@@Z", + demangled_name: None, + address: 0, + size: 12, + kind: Object, + section: Some( + 14, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.rdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 15, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$0", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + address: 0, + size: 16, + kind: Object, + section: Some( + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$1", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + address: 16, + size: 12, + kind: Object, + section: Some( + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcName$2", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + address: 28, + size: 20, + kind: Object, + section: Some( + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcVarDesc", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + address: 48, + size: 192, + kind: Object, + section: Some( + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z$rtcFrameData", + demangled_name: Some( + "bool __cdecl Tools_CapsuleTestMagSq(struct Vector *, struct Vector *, struct Vector *, float)", + ), + address: 240, + size: 16, + kind: Object, + section: Some( + 15, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.xdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 16, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$unwind$?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", + demangled_name: None, + address: 0, + size: 20, + kind: Object, + section: Some( + 16, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.pdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 17, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "$pdata$?Tools_CapsuleTestMagSq@@YA_NPEAUVector@@00M@Z", + demangled_name: None, + address: 0, + size: 12, + kind: Object, + section: Some( + 17, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.voltbl]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 18, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "_volmd", + demangled_name: None, + address: 0, + size: 16, + kind: Object, + section: Some( + 18, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.rtc$IMZ]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 19, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "_RTC_InitBase.rtc$IMZ", + demangled_name: None, + address: 0, + size: 8, + kind: Object, + section: Some( + 19, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.rtc$TMZ]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 20, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "_RTC_Shutdown.rtc$TMZ", + demangled_name: None, + address: 0, + size: 8, + kind: Object, + section: Some( + 20, + ), + flags: FlagSet(Local | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.rdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 21, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "__real@00000000", + demangled_name: None, + address: 0, + size: 4, + kind: Object, + section: Some( + 21, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.rdata]", + demangled_name: None, + address: 0, + size: 0, + kind: Section, + section: Some( + 22, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + Symbol { + name: "__real@3f800000", + demangled_name: None, + address: 0, + size: 4, + kind: Object, + section: Some( + 22, + ), + flags: FlagSet(Global | SizeInferred), + align: None, + virtual_address: None, + }, + Symbol { + name: "__security_cookie", + demangled_name: None, + address: 0, + size: 0, + kind: Object, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "_fltused", + demangled_name: None, + address: 0, + size: 0, + kind: Object, + section: None, + flags: FlagSet(Global), + align: None, + virtual_address: None, + }, + Symbol { + name: "[.chks64]", + demangled_name: None, + address: 0, + size: 192, + kind: Section, + section: Some( + 23, + ), + flags: FlagSet(Local), + align: None, + virtual_address: None, + }, + ], + sections: [ + Section { + id: ".drectve-0", + name: ".drectve", + address: 0, + size: 47, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".debug$S-0", + name: ".debug$S", + address: 0, + size: 156, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".text$mn-0", + name: ".text$mn", + address: 0, + size: 429, + kind: Code, + data: SectionData( + 429, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 4, + ), + address: 57, + target_symbol: 62, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 89, + target_symbol: 12, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 124, + target_symbol: 12, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 171, + target_symbol: 13, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 197, + target_symbol: 13, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 212, + target_symbol: 11, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 228, + target_symbol: 14, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 247, + target_symbol: 59, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 286, + target_symbol: 59, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 296, + target_symbol: 61, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 338, + target_symbol: 10, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 359, + target_symbol: 12, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 392, + target_symbol: 47, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 397, + target_symbol: 16, + addend: 0, + }, + Relocation { + flags: Coff( + 4, + ), + address: 416, + target_symbol: 20, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".text$mn-1", + name: ".text$mn", + address: 0, + size: 141, + kind: Code, + data: SectionData( + 141, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".text$mn-2", + name: ".text$mn", + address: 0, + size: 87, + kind: Code, + data: SectionData( + 87, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".text$mn-3", + name: ".text$mn", + address: 0, + size: 105, + kind: Code, + data: SectionData( + 105, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".text$mn-4", + name: ".text$mn", + address: 0, + size: 82, + kind: Code, + data: SectionData( + 82, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".xdata-0", + name: ".xdata", + address: 0, + size: 8, + kind: Data, + data: SectionData( + 8, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".pdata-0", + name: ".pdata", + address: 0, + size: 12, + kind: Data, + data: SectionData( + 12, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 3, + ), + address: 0, + target_symbol: 21, + addend: 0, + }, + Relocation { + flags: Coff( + 3, + ), + address: 4, + target_symbol: 21, + addend: 87, + }, + Relocation { + flags: Coff( + 3, + ), + address: 8, + target_symbol: 27, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".xdata-1", + name: ".xdata", + address: 0, + size: 8, + kind: Data, + data: SectionData( + 8, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".pdata-1", + name: ".pdata", + address: 0, + size: 12, + kind: Data, + data: SectionData( + 12, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 3, + ), + address: 0, + target_symbol: 22, + addend: 0, + }, + Relocation { + flags: Coff( + 3, + ), + address: 4, + target_symbol: 22, + addend: 141, + }, + Relocation { + flags: Coff( + 3, + ), + address: 8, + target_symbol: 31, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".xdata-2", + name: ".xdata", + address: 0, + size: 8, + kind: Data, + data: SectionData( + 8, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".pdata-2", + name: ".pdata", + address: 0, + size: 12, + kind: Data, + data: SectionData( + 12, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 3, + ), + address: 0, + target_symbol: 23, + addend: 0, + }, + Relocation { + flags: Coff( + 3, + ), + address: 4, + target_symbol: 23, + addend: 105, + }, + Relocation { + flags: Coff( + 3, + ), + address: 8, + target_symbol: 35, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".xdata-3", + name: ".xdata", + address: 0, + size: 8, + kind: Data, + data: SectionData( + 8, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".pdata-3", + name: ".pdata", + address: 0, + size: 12, + kind: Data, + data: SectionData( + 12, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 3, + ), + address: 0, + target_symbol: 24, + addend: 0, + }, + Relocation { + flags: Coff( + 3, + ), + address: 4, + target_symbol: 24, + addend: 82, + }, + Relocation { + flags: Coff( + 3, + ), + address: 8, + target_symbol: 39, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".rdata-0", + name: ".rdata", + address: 0, + size: 256, + kind: Data, + data: SectionData( + 256, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 1, + ), + address: 56, + target_symbol: 45, + addend: 0, + }, + Relocation { + flags: Coff( + 1, + ), + address: 72, + target_symbol: 44, + addend: 0, + }, + Relocation { + flags: Coff( + 1, + ), + address: 88, + target_symbol: 43, + addend: 0, + }, + Relocation { + flags: Coff( + 1, + ), + address: 248, + target_symbol: 46, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".xdata-4", + name: ".xdata", + address: 0, + size: 20, + kind: Data, + data: SectionData( + 20, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 3, + ), + address: 12, + target_symbol: 19, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".pdata-4", + name: ".pdata", + address: 0, + size: 12, + kind: Data, + data: SectionData( + 12, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 3, + ), + address: 0, + target_symbol: 25, + addend: 0, + }, + Relocation { + flags: Coff( + 3, + ), + address: 4, + target_symbol: 25, + addend: 429, + }, + Relocation { + flags: Coff( + 3, + ), + address: 8, + target_symbol: 49, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".voltbl-0", + name: ".voltbl", + address: 0, + size: 16, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".rtc$IMZ-0", + name: ".rtc$IMZ", + address: 0, + size: 8, + kind: Data, + data: SectionData( + 8, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 1, + ), + address: 0, + target_symbol: 17, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".rtc$TMZ-0", + name: ".rtc$TMZ", + address: 0, + size: 8, + kind: Data, + data: SectionData( + 8, + ), + flags: FlagSet(), + relocations: [ + Relocation { + flags: Coff( + 1, + ), + address: 0, + target_symbol: 18, + addend: 0, + }, + ], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".rdata-1", + name: ".rdata", + address: 0, + size: 4, + kind: Data, + data: SectionData( + 4, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".rdata-2", + name: ".rdata", + address: 0, + size: 4, + kind: Data, + data: SectionData( + 4, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + Section { + id: ".chks64-0", + name: ".chks64", + address: 0, + size: 192, + kind: Unknown, + data: SectionData( + 0, + ), + flags: FlagSet(), + relocations: [], + line_info: {}, + virtual_address: None, + }, + ], + split_meta: None, + path: None, + timestamp: None, +}