| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#, Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#, Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#}; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().; |
| 3 | |
| 4 | use memoffsetrust-analyzer cargo memoffset 0.8.0 crate/::offset_ofrust-analyzer cargo memoffset 0.8.0 offset_of/; |
| 5 | use objectrust-analyzer cargo object 0.39.1 crate/::endianrust-analyzer cargo object 0.39.1 endian/::{LittleEndianrust-analyzer cargo object 0.39.1 endian/LittleEndian# as LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#, U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#, U16rust-analyzer cargo object 0.39.1 endian/U16#, U32rust-analyzer cargo object 0.39.1 endian/U32#}; |
| 6 | use objectrust-analyzer cargo object 0.39.1 crate/::perust-analyzer cargo object 0.39.1 pe/::*; |
| 7 | use objectrust-analyzer cargo object 0.39.1 crate/::podrust-analyzer cargo object 0.39.1 pod/::bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().; |
| 8 | |
| 9 | use craterust-analyzer cargo implib 0.3.3 crate/::defrust-analyzer cargo implib 0.3.3 def/::{ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#, ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport#}; |
| 10 | use craterust-analyzer cargo implib 0.3.3 crate/::{arrust-analyzer cargo implib 0.3.3 ar/, ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember#, MachineTyperust-analyzer cargo implib 0.3.3 MachineType#}; |
| 11 | |
| 12 | const NULL_IMPORT_DESCRIPTOR_SYMBOL_NAMErust-analyzer cargo implib 0.3.3 msvc/NULL_IMPORT_DESCRIPTOR_SYMBOL_NAME.: &str = "__NULL_IMPORT_DESCRIPTOR"; |
| 13 | |
| 14 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 15 | #[repr(u16)] |
| 16 | enum ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType# { |
| 17 | /// Code, function |
| 18 | Coderust-analyzer cargo implib 0.3.3 msvc/ImportType#Code#, |
| 19 | /// Data |
| 20 | Datarust-analyzer cargo implib 0.3.3 msvc/ImportType#Data#, |
| 21 | /// Constant |
| 22 | Construst-analyzer cargo implib 0.3.3 msvc/ImportType#Const#, |
| 23 | } |
| 24 | |
| 25 | impl ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport# { |
| 26 | fn import_typerust-analyzer cargo implib 0.3.3 msvc/impl#[ShortExport]import_type().(&self) -> ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType# { |
| 27 | if self.datarust-analyzer cargo implib 0.3.3 def/ShortExport#data. { |
| 28 | ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType#::Datarust-analyzer cargo implib 0.3.3 msvc/ImportType#Data# |
| 29 | } else if self.constantrust-analyzer cargo implib 0.3.3 def/ShortExport#constant. { |
| 30 | ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType#::Construst-analyzer cargo implib 0.3.3 msvc/ImportType#Const# |
| 31 | } else { |
| 32 | ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType#::Coderust-analyzer cargo implib 0.3.3 msvc/ImportType#Code# |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 38 | #[repr(u16)] |
| 39 | enum ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType# { |
| 40 | /// Import is by ordinal. This indicates that the value in the Ordinal/Hint |
| 41 | /// field of the import header is the import's ordinal. If this constant is |
| 42 | /// not specified, then the Ordinal/Hint field should always be interpreted |
| 43 | /// as the import's hint. |
| 44 | Ordinalrust-analyzer cargo implib 0.3.3 msvc/ImportNameType#Ordinal# = IMPORT_OBJECT_ORDINALrust-analyzer cargo object 0.39.1 pe/IMPORT_OBJECT_ORDINAL., |
| 45 | /// The import name is identical to the public symbol name |
| 46 | Namerust-analyzer cargo implib 0.3.3 msvc/ImportNameType#Name# = IMPORT_OBJECT_NAMErust-analyzer cargo object 0.39.1 pe/IMPORT_OBJECT_NAME., |
| 47 | /// The import name is the public symbol name, but skipping the leading ?, |
| 48 | /// @, or optionally _. |
| 49 | NameNoPrefixrust-analyzer cargo implib 0.3.3 msvc/ImportNameType#NameNoPrefix# = IMPORT_OBJECT_NAME_NO_PREFIXrust-analyzer cargo object 0.39.1 pe/IMPORT_OBJECT_NAME_NO_PREFIX., |
| 50 | /// The import name is the public symbol name, but skipping the leading ?, |
| 51 | /// @, or optionally _, and truncating at the first @. |
| 52 | NameUndecoraterust-analyzer cargo implib 0.3.3 msvc/ImportNameType#NameUndecorate# = IMPORT_OBJECT_NAME_UNDECORATErust-analyzer cargo object 0.39.1 pe/IMPORT_OBJECT_NAME_UNDECORATE., |
| 53 | } |
| 54 | |
| 55 | impl MachineTyperust-analyzer cargo implib 0.3.3 MachineType# { |
| 56 | fn is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().(&self) -> bool { |
| 57 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]::ARMNTrust-analyzer cargo implib 0.3.3 MachineType#ARMNT# | Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]::I386rust-analyzer cargo implib 0.3.3 MachineType#I386#) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /// MSVC flavored Windows import library generator |
| 62 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 63 | pub struct MsvcImportLibraryrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary# { |
| 64 | defrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#def.: ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#, |
| 65 | machinerust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#machine.: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#, |
| 66 | } |
| 67 | |
| 68 | impl MsvcImportLibraryrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary# { |
| 69 | /// Create new import library generator from `ModuleDef` |
| 70 | pub fn newrust-analyzer cargo implib 0.3.3 msvc/impl#[MsvcImportLibrary]new().(mut def: ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#, machine: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#) -> Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[MsvcImportLibrary] { |
| 71 | // If ext_name is set (if the "ext_name = name" syntax was used), overwrite |
| 72 | // name with ext_name and clear ext_name. When only creating an import |
| 73 | // library and not linking, the internal name is irrelevant. |
| 74 | for export in &mut def.exportsrust-analyzer cargo implib 0.3.3 def/ModuleDef#exports. { |
| 75 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ext_name) = export.ext_namerust-analyzer cargo implib 0.3.3 def/ShortExport#ext_name..takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]take().() { |
| 76 | export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name. = ext_name; |
| 77 | } |
| 78 | } |
| 79 | // Skipped i386 handling |
| 80 | // See https://github.com/llvm/llvm-project/blob/09c2b7c35af8c4bad39f03e9f60df8bd07323028/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp#L197-L212 |
| 81 | MsvcImportLibraryrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary# { defrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#def., machinerust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#machine. } |
| 82 | } |
| 83 | |
| 84 | fn get_name_typerust-analyzer cargo implib 0.3.3 msvc/impl#[MsvcImportLibrary]get_name_type().(&self, sym: &str, ext_name: &str) -> ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType# { |
| 85 | // Skipped mingw64 handling |
| 86 | // See https://github.com/llvm/llvm-project/blob/09c2b7c35af8c4bad39f03e9f60df8bd07323028/llvm/lib/Object/COFFImportFile.cpp#L96-L105 |
| 87 | if ext_name.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('_') && ext_name.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().('@') { |
| 88 | ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType#::Namerust-analyzer cargo implib 0.3.3 msvc/ImportNameType#Name# |
| 89 | } else if sym rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().ext_name { |
| 90 | ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType#::NameUndecoraterust-analyzer cargo implib 0.3.3 msvc/ImportNameType#NameUndecorate# |
| 91 | } else if self.machinerust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#machine. rust-analyzer cargo implib 0.3.3 impl#[MachineType][`PartialEq<Self>`]eq().==rust-analyzer cargo implib 0.3.3 impl#[MachineType][`PartialEq<Self>`]eq(). rust-analyzer cargo implib 0.3.3 impl#[MachineType][`PartialEq<Self>`]eq().MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::I386rust-analyzer cargo implib 0.3.3 MachineType#I386# && sym.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('_') { |
| 92 | ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType#::NameNoPrefixrust-analyzer cargo implib 0.3.3 msvc/ImportNameType#NameNoPrefix# |
| 93 | } else { |
| 94 | ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType#::Namerust-analyzer cargo implib 0.3.3 msvc/ImportNameType#Name# |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /// Write out the import library |
| 99 | pub fn write_torust-analyzer cargo implib 0.3.3 msvc/impl#[MsvcImportLibrary]write_to().<W: Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#>(&self, writer: &mut W) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> { |
| 100 | let mut members = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 101 | let factory = ObjectFactoryrust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#::newrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]new().(&self.defrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#def..import_namerust-analyzer cargo implib 0.3.3 def/ModuleDef#import_name., self.machinerust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#machine.); |
| 102 | |
| 103 | let import_descriptor = factory.create_import_descriptorrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_import_descriptor().(); |
| 104 | members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(import_descriptor.create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().()); |
| 105 | |
| 106 | let null_import_descriptor = factory.create_null_import_descriptorrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_null_import_descriptor().(); |
| 107 | members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(null_import_descriptor.create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().()); |
| 108 | |
| 109 | let null_thunk = factory.create_null_thunkrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_null_thunk().(); |
| 110 | members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(null_thunk.create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().()); |
| 111 | |
| 112 | for export in &self.defrust-analyzer cargo implib 0.3.3 msvc/MsvcImportLibrary#def..exportsrust-analyzer cargo implib 0.3.3 def/ModuleDef#exports. { |
| 113 | if export.privaterust-analyzer cargo implib 0.3.3 def/ShortExport#private. { |
| 114 | continue; |
| 115 | } |
| 116 | let sym = if export.symbol_namerust-analyzer cargo implib 0.3.3 def/ShortExport#symbol_name..is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]is_empty().() { |
| 117 | &export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name. |
| 118 | } else { |
| 119 | &export.symbol_namerust-analyzer cargo implib 0.3.3 def/ShortExport#symbol_name. |
| 120 | }; |
| 121 | let name_type = if export.no_namerust-analyzer cargo implib 0.3.3 def/ShortExport#no_name. { |
| 122 | ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType#::Ordinalrust-analyzer cargo implib 0.3.3 msvc/ImportNameType#Ordinal# |
| 123 | } else { |
| 124 | self.get_name_typerust-analyzer cargo implib 0.3.3 msvc/impl#[MsvcImportLibrary]get_name_type().(sym, &export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name.) |
| 125 | }; |
| 126 | let name = if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ext_name) = &export.ext_namerust-analyzer cargo implib 0.3.3 def/ShortExport#ext_name. { |
| 127 | replacerust-analyzer cargo implib 0.3.3 msvc/replace().(sym, &export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name., ext_name)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 128 | } else { |
| 129 | sym.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() |
| 130 | }; |
| 131 | |
| 132 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().export.alias_targetrust-analyzer cargo implib 0.3.3 def/ShortExport#alias_target..is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]is_empty().() && name rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().export.alias_targetrust-analyzer cargo implib 0.3.3 def/ShortExport#alias_target. { |
| 133 | let weak_non_imp = factory.create_weak_externalrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_weak_external().(&export.alias_targetrust-analyzer cargo implib 0.3.3 def/ShortExport#alias_target., &name, false); |
| 134 | members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(weak_non_imp.create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().()); |
| 135 | |
| 136 | let weak_imp = factory.create_weak_externalrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_weak_external().(&export.alias_targetrust-analyzer cargo implib 0.3.3 def/ShortExport#alias_target., &name, true); |
| 137 | members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(weak_imp.create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().()); |
| 138 | } |
| 139 | let short_import = |
| 140 | factory.create_short_importrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_short_import().(&name, export.ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal., export.import_typerust-analyzer cargo implib 0.3.3 msvc/impl#[ShortExport]import_type().(), name_type); |
| 141 | members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(short_import.create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().()); |
| 142 | } |
| 143 | |
| 144 | let identifiers = members |
| 145 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 146 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(header, _)| header.identifierrust-analyzer cargo implib 0.3.3 ar/impl#[Header]identifier().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()) |
| 147 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(); |
| 148 | let symbol_table: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>>> = members |
| 149 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 150 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(_, member)| { |
| 151 | member |
| 152 | .symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols. |
| 153 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 154 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|s| s.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().into_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]into_bytes().()) |
| 155 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>>>() |
| 156 | }) |
| 157 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(); |
| 158 | let mut archive = |
| 159 | arrust-analyzer cargo implib 0.3.3 ar/::GnuBuilderrust-analyzer cargo implib 0.3.3 ar/write/GnuBuilder#::new_with_symbol_tablerust-analyzer cargo implib 0.3.3 ar/write/impl#[`GnuBuilder<W>`]new_with_symbol_table().(writer, true, identifiers, symbol_table)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 160 | for (header, member) in members { |
| 161 | archive.appendrust-analyzer cargo implib 0.3.3 ar/write/impl#[`GnuBuilder<W>`]append().(&header, &member.datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 162 | } |
| 163 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | fn replacerust-analyzer cargo implib 0.3.3 msvc/replace().(sym: &str, from: &str, to: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> { |
| 168 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#; |
| 169 | |
| 170 | match sym.findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]find().(from) { |
| 171 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(pos) => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}{}{}", &sym[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...pos]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., to, &sym[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().pos +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). from.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()..]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().)), |
| 172 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => { |
| 173 | if from.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('_') && to.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('_') { |
| 174 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(pos) = sym.findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]find().(&from[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().) { |
| 175 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 176 | "{}{}{}", |
| 177 | &sym[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...pos]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 178 | &to[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1..]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 179 | &sym[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().pos +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). from.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). 1..]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 180 | )); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().( |
| 186 | ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#, |
| 187 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}: replacing '{}' with '{}' failed", sym, from, to), |
| 188 | )) |
| 189 | } |
| 190 | |
| 191 | /// Constructs various small object files necessary to support linking |
| 192 | /// symbols imported from a DLL. The contents are pretty strictly defined and |
| 193 | /// nearly entirely static. The details of the structures files are defined in |
| 194 | /// WINNT.h and the PE/COFF specification. |
| 195 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 196 | struct ObjectFactoryrust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#<'a> { |
| 197 | machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine.: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#, |
| 198 | import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name.: &'a str, |
| 199 | import_descriptor_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_descriptor_symbol_name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 200 | null_thunk_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#null_thunk_symbol_name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 201 | } |
| 202 | |
| 203 | impl<'a> ObjectFactoryrust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#<'a> { |
| 204 | fn newrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]new().(import_name: &'a str, machine: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#) -> Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`] { |
| 205 | let library = if import_name.ends_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]ends_with().(".dll") || import_name.ends_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]ends_with().(".exe") { |
| 206 | &import_name[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#import_name.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 207 | } else { |
| 208 | import_name |
| 209 | }; |
| 210 | Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`] { |
| 211 | machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine., |
| 212 | import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name., |
| 213 | import_descriptor_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_descriptor_symbol_name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("__IMPORT_DESCRIPTOR_{}", library), |
| 214 | null_thunk_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#null_thunk_symbol_name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("\x7f{}_NULL_THUNK_DATA", library), |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | fn write_string_tablerust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]write_string_table().(buffer: &mut Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>, strings: &[&str]) { |
| 219 | // The COFF string table consists of a 4-byte value which is the size of the |
| 220 | // table, including the length field itself. This value is followed by the |
| 221 | // string content itself, which is an array of null-terminated C-style |
| 222 | // strings. The termination is important as they are referenced to by offset |
| 223 | // by the symbol entity in the file format. |
| 224 | let offset = buffer.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(); |
| 225 | |
| 226 | // Skip over the length field, we will fill it in later as we will have |
| 227 | // computed the length while emitting the string content itself. |
| 228 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(&[0, 0, 0, 0]); |
| 229 | |
| 230 | for s in strings { |
| 231 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(s.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()); |
| 232 | buffer.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'\0'); |
| 233 | } |
| 234 | |
| 235 | // Backfill the length of the table now that it has been computed. |
| 236 | let size = (buffer.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().offset) as u32; |
| 237 | buffer[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().offset..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()..copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(&size.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().()); |
| 238 | } |
| 239 | |
| 240 | /// Creates an Import Descriptor. This is a small object file which contains a |
| 241 | /// reference to the terminators and contains the library name (entry) for the |
| 242 | /// import name table. It will force the linker to construct the necessary |
| 243 | /// structure to import symbols from the DLL. |
| 244 | fn create_import_descriptorrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_import_descriptor().(&self) -> ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 245 | const NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS.: usize = 2; |
| 246 | const NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS.: usize = 7; |
| 247 | const NUM_RELOCATIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_RELOCATIONS.: usize = 3; |
| 248 | |
| 249 | let mut buffer = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 250 | |
| 251 | let pointer_to_symbol_table = size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() |
| 252 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>() |
| 253 | // .idata$2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). |
| 254 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_RELOCATIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_RELOCATIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageRelocationrust-analyzer cargo object 0.39.1 pe/ImageRelocation#>() |
| 255 | // .idata$4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). |
| 256 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1; |
| 257 | let characteristics = if self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { |
| 258 | IMAGE_FILE_32BIT_MACHINErust-analyzer cargo object 0.39.1 pe/IMAGE_FILE_32BIT_MACHINE. |
| 259 | } else { |
| 260 | 0 |
| 261 | }; |
| 262 | let header = ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader# { |
| 263 | machinerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#machine.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine. as u16), |
| 264 | number_of_sectionsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_sections.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. as u16), |
| 265 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImageFileHeader#time_date_stamp.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 266 | pointer_to_symbol_tablerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#pointer_to_symbol_table.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, pointer_to_symbol_table as u32), |
| 267 | number_of_symbolsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_symbols.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS. as u32), |
| 268 | size_of_optional_headerrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#size_of_optional_header.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 269 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#characteristics.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, characteristics), |
| 270 | }; |
| 271 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&header)); |
| 272 | |
| 273 | // Section Header Table |
| 274 | let section_header_table = [ |
| 275 | ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader# { |
| 276 | namerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'2'], |
| 277 | virtual_sizerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_size.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 278 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_address.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 279 | size_of_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#size_of_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#>() as _), |
| 280 | pointer_to_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 281 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 282 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>()) |
| 283 | as _, |
| 284 | ), |
| 285 | pointer_to_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_relocations.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 286 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 287 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() |
| 288 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>() |
| 289 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#>()) as _, |
| 290 | ), |
| 291 | pointer_to_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_linenumbers.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 292 | number_of_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_relocations.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_RELOCATIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_RELOCATIONS. as _), |
| 293 | number_of_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_linenumbers.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 294 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#characteristics.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 295 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 296 | IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES. |
| 297 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA. |
| 298 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. |
| 299 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE., |
| 300 | ), |
| 301 | }, |
| 302 | ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader# { |
| 303 | namerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'6'], |
| 304 | virtual_sizerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_size.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 305 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_address.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 306 | size_of_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#size_of_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, (self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) as _), |
| 307 | pointer_to_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 308 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 309 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() |
| 310 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>() |
| 311 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#>() |
| 312 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_RELOCATIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_RELOCATIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageRelocationrust-analyzer cargo object 0.39.1 pe/ImageRelocation#>()) as _, |
| 313 | ), |
| 314 | pointer_to_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_relocations.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 315 | pointer_to_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_linenumbers.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 316 | number_of_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_relocations.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 317 | number_of_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_linenumbers.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 318 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#characteristics.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 319 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 320 | IMAGE_SCN_ALIGN_2BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_2BYTES. |
| 321 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA. |
| 322 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. |
| 323 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE., |
| 324 | ), |
| 325 | }, |
| 326 | ]; |
| 327 | for section in section_header_table { |
| 328 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(§ion)); |
| 329 | } |
| 330 | |
| 331 | // .idata$2 |
| 332 | let import_descriptor = ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor# { |
| 333 | original_first_thunkrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#original_first_thunk.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 334 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#time_date_stamp.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 335 | forwarder_chainrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#forwarder_chain.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 336 | namerust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#name.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 337 | first_thunkrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#first_thunk.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 338 | }; |
| 339 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&import_descriptor)); |
| 340 | |
| 341 | let relocation_table = [ |
| 342 | ImageRelocationrust-analyzer cargo object 0.39.1 pe/ImageRelocation# { |
| 343 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageRelocation#virtual_address.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, offset_ofrust-analyzer cargo memoffset 0.8.0 offset_of/offset_of!!(ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#, namerust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#name.) as _), |
| 344 | symbol_table_indexrust-analyzer cargo object 0.39.1 pe/ImageRelocation#symbol_table_index.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 2), |
| 345 | typrust-analyzer cargo object 0.39.1 pe/ImageRelocation#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..img_rel_relocationrust-analyzer cargo implib 0.3.3 impl#[MachineType]img_rel_relocation().()), |
| 346 | }, |
| 347 | ImageRelocationrust-analyzer cargo object 0.39.1 pe/ImageRelocation# { |
| 348 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageRelocation#virtual_address.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 349 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 350 | offset_ofrust-analyzer cargo memoffset 0.8.0 offset_of/offset_of!!(ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#, original_first_thunkrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#original_first_thunk.) as _, |
| 351 | ), |
| 352 | symbol_table_indexrust-analyzer cargo object 0.39.1 pe/ImageRelocation#symbol_table_index.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 3), |
| 353 | typrust-analyzer cargo object 0.39.1 pe/ImageRelocation#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..img_rel_relocationrust-analyzer cargo implib 0.3.3 impl#[MachineType]img_rel_relocation().()), |
| 354 | }, |
| 355 | ImageRelocationrust-analyzer cargo object 0.39.1 pe/ImageRelocation# { |
| 356 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageRelocation#virtual_address.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 357 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 358 | offset_ofrust-analyzer cargo memoffset 0.8.0 offset_of/offset_of!!(ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#, first_thunkrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#first_thunk.) as _, |
| 359 | ), |
| 360 | symbol_table_indexrust-analyzer cargo object 0.39.1 pe/ImageRelocation#symbol_table_index.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 4), |
| 361 | typrust-analyzer cargo object 0.39.1 pe/ImageRelocation#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..img_rel_relocationrust-analyzer cargo implib 0.3.3 impl#[MachineType]img_rel_relocation().()), |
| 362 | }, |
| 363 | ]; |
| 364 | for relocation in &relocation_table { |
| 365 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(relocation)); |
| 366 | } |
| 367 | |
| 368 | // .idata$6 |
| 369 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()); |
| 370 | buffer.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'\0'); |
| 371 | |
| 372 | // Symbol Table |
| 373 | let sym5_offset = |
| 374 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.import_descriptor_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_descriptor_symbol_name..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1).to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]to_le_bytes().(); |
| 375 | let sym6_offset = (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() |
| 376 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.import_descriptor_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_descriptor_symbol_name..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() |
| 377 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1 |
| 378 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NULL_IMPORT_DESCRIPTOR_SYMBOL_NAMErust-analyzer cargo implib 0.3.3 msvc/NULL_IMPORT_DESCRIPTOR_SYMBOL_NAME..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() |
| 379 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) |
| 380 | .to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]to_le_bytes().(); |
| 381 | let symbol_table = [ |
| 382 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 383 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [0, 0, 0, 0, size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() as _, 0, 0, 0], |
| 384 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 385 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 1), |
| 386 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 387 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_EXTERNAL., |
| 388 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 389 | }, |
| 390 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 391 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'2'], |
| 392 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 393 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 1), |
| 394 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 395 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_SECTIONrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_SECTION., |
| 396 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 397 | }, |
| 398 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 399 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'6'], |
| 400 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 401 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 2), |
| 402 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 403 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_STATICrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_STATIC., |
| 404 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 405 | }, |
| 406 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 407 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'4'], |
| 408 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 409 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 410 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 411 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_SECTIONrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_SECTION., |
| 412 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 413 | }, |
| 414 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 415 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'5'], |
| 416 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 417 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 418 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 419 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_SECTIONrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_SECTION., |
| 420 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 421 | }, |
| 422 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 423 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [ |
| 424 | 0, |
| 425 | 0, |
| 426 | 0, |
| 427 | 0, |
| 428 | sym5_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 429 | sym5_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 430 | sym5_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 431 | sym5_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 432 | ], |
| 433 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 434 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 435 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 436 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_EXTERNAL., |
| 437 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 438 | }, |
| 439 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 440 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [ |
| 441 | 0, |
| 442 | 0, |
| 443 | 0, |
| 444 | 0, |
| 445 | sym6_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 446 | sym6_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 447 | sym6_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 448 | sym6_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 449 | ], |
| 450 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 451 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 452 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 453 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_EXTERNAL., |
| 454 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 455 | }, |
| 456 | ]; |
| 457 | for table in &symbol_table { |
| 458 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(table)); |
| 459 | } |
| 460 | |
| 461 | Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]::write_string_tablerust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]write_string_table().( |
| 462 | &mut buffer, |
| 463 | &[ |
| 464 | &self.import_descriptor_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_descriptor_symbol_name., |
| 465 | NULL_IMPORT_DESCRIPTOR_SYMBOL_NAMErust-analyzer cargo implib 0.3.3 msvc/NULL_IMPORT_DESCRIPTOR_SYMBOL_NAME., |
| 466 | &self.null_thunk_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#null_thunk_symbol_name., |
| 467 | ], |
| 468 | ); |
| 469 | ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 470 | namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 471 | datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: buffer, |
| 472 | symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![self.import_descriptor_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_descriptor_symbol_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()], |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | /// Creates a NULL import descriptor. This is a small object file whcih |
| 477 | /// contains a NULL import descriptor. It is used to terminate the imports |
| 478 | /// from a specific DLL. |
| 479 | fn create_null_import_descriptorrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_null_import_descriptor().(&self) -> ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 480 | const NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS.: usize = 1; |
| 481 | const NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS.: usize = 1; |
| 482 | |
| 483 | let mut buffer = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 484 | |
| 485 | let pointer_to_symbol_table = size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() |
| 486 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>() |
| 487 | // .idata$3rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). |
| 488 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#>(); |
| 489 | let characteristics = if self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { |
| 490 | IMAGE_FILE_32BIT_MACHINErust-analyzer cargo object 0.39.1 pe/IMAGE_FILE_32BIT_MACHINE. |
| 491 | } else { |
| 492 | 0 |
| 493 | }; |
| 494 | let header = ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader# { |
| 495 | machinerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#machine.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine. as u16), |
| 496 | number_of_sectionsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_sections.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. as u16), |
| 497 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImageFileHeader#time_date_stamp.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 498 | pointer_to_symbol_tablerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#pointer_to_symbol_table.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, pointer_to_symbol_table as u32), |
| 499 | number_of_symbolsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_symbols.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS. as u32), |
| 500 | size_of_optional_headerrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#size_of_optional_header.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 501 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#characteristics.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, characteristics), |
| 502 | }; |
| 503 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&header)); |
| 504 | |
| 505 | // Section Header Table |
| 506 | let section_header_table = ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader# { |
| 507 | namerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'3'], |
| 508 | virtual_sizerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_size.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 509 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_address.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 510 | size_of_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#size_of_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#>() as _), |
| 511 | pointer_to_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 512 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 513 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>()) |
| 514 | as _, |
| 515 | ), |
| 516 | pointer_to_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_relocations.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 517 | pointer_to_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_linenumbers.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 518 | number_of_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_relocations.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 519 | number_of_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_linenumbers.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 520 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#characteristics.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 521 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 522 | IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES. |
| 523 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA. |
| 524 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. |
| 525 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE., |
| 526 | ), |
| 527 | }; |
| 528 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(§ion_header_table)); |
| 529 | |
| 530 | // .idata$3 |
| 531 | let import_descriptor = ImageImportDescriptorrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor# { |
| 532 | original_first_thunkrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#original_first_thunk.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 533 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#time_date_stamp.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 534 | forwarder_chainrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#forwarder_chain.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 535 | namerust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#name.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 536 | first_thunkrust-analyzer cargo object 0.39.1 pe/ImageImportDescriptor#first_thunk.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 537 | }; |
| 538 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&import_descriptor)); |
| 539 | |
| 540 | // Symbol Table |
| 541 | let symbol_table = ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 542 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [0, 0, 0, 0, size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() as _, 0, 0, 0], |
| 543 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 544 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 1), |
| 545 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 546 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_EXTERNAL., |
| 547 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 548 | }; |
| 549 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&symbol_table)); |
| 550 | |
| 551 | Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]::write_string_tablerust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]write_string_table().(&mut buffer, &[NULL_IMPORT_DESCRIPTOR_SYMBOL_NAMErust-analyzer cargo implib 0.3.3 msvc/NULL_IMPORT_DESCRIPTOR_SYMBOL_NAME.]); |
| 552 | ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 553 | namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 554 | datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: buffer, |
| 555 | symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![NULL_IMPORT_DESCRIPTOR_SYMBOL_NAMErust-analyzer cargo implib 0.3.3 msvc/NULL_IMPORT_DESCRIPTOR_SYMBOL_NAME..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()], |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | /// Create a NULL Thunk Entry. This is a small object file which contains a |
| 560 | /// NULL Import Address Table entry and a NULL Import Lookup Table Entry. It |
| 561 | /// is used to terminate the IAT and ILT. |
| 562 | fn create_null_thunkrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_null_thunk().(&self) -> ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 563 | const NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS.: usize = 2; |
| 564 | const NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS.: usize = 1; |
| 565 | |
| 566 | let mut buffer = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 567 | |
| 568 | let va_size = if self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { 4 } else { 8 }; |
| 569 | let pointer_to_symbol_table = size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() |
| 570 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>() |
| 571 | // .idata$5rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). |
| 572 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().va_size |
| 573 | // .idata$4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). |
| 574 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().va_size; |
| 575 | let characteristics = if self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { |
| 576 | IMAGE_FILE_32BIT_MACHINErust-analyzer cargo object 0.39.1 pe/IMAGE_FILE_32BIT_MACHINE. |
| 577 | } else { |
| 578 | 0 |
| 579 | }; |
| 580 | let header = ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader# { |
| 581 | machinerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#machine.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine. as u16), |
| 582 | number_of_sectionsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_sections.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. as u16), |
| 583 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImageFileHeader#time_date_stamp.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 584 | pointer_to_symbol_tablerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#pointer_to_symbol_table.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, pointer_to_symbol_table as u32), |
| 585 | number_of_symbolsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_symbols.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS. as u32), |
| 586 | size_of_optional_headerrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#size_of_optional_header.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 587 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#characteristics.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, characteristics), |
| 588 | }; |
| 589 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&header)); |
| 590 | |
| 591 | // Section Header Table |
| 592 | let align = if self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { |
| 593 | IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES. |
| 594 | } else { |
| 595 | IMAGE_SCN_ALIGN_8BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_8BYTES. |
| 596 | }; |
| 597 | let section_header_table = [ |
| 598 | ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader# { |
| 599 | namerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'5'], |
| 600 | virtual_sizerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_size.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 601 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_address.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 602 | size_of_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#size_of_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, va_size as _), |
| 603 | pointer_to_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 604 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 605 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>()) |
| 606 | as _, |
| 607 | ), |
| 608 | pointer_to_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_relocations.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 609 | pointer_to_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_linenumbers.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 610 | number_of_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_relocations.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 611 | number_of_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_linenumbers.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 612 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#characteristics.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 613 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 614 | align |
| 615 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA. |
| 616 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. |
| 617 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE., |
| 618 | ), |
| 619 | }, |
| 620 | ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader# { |
| 621 | namerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#name.: [b'.', b'i', b'd', b'a', b't', b'a', b'$', b'4'], |
| 622 | virtual_sizerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_size.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 623 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_address.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 624 | size_of_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#size_of_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, va_size as _), |
| 625 | pointer_to_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 626 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 627 | (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() |
| 628 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>() |
| 629 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().va_size) as _, |
| 630 | ), |
| 631 | pointer_to_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_relocations.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 632 | pointer_to_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_linenumbers.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 633 | number_of_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_relocations.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 634 | number_of_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_linenumbers.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 635 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#characteristics.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().( |
| 636 | LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, |
| 637 | align |
| 638 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA. |
| 639 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. |
| 640 | |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE., |
| 641 | ), |
| 642 | }, |
| 643 | ]; |
| 644 | for section in section_header_table { |
| 645 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(§ion)); |
| 646 | } |
| 647 | |
| 648 | // .idata$5, ILT |
| 649 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(0u32.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().()); |
| 650 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { |
| 651 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(0u32.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().()); |
| 652 | } |
| 653 | |
| 654 | // .idata$4, IAT |
| 655 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(0u32.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().()); |
| 656 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine..is_32bitrust-analyzer cargo implib 0.3.3 msvc/impl#[MachineType]is_32bit().() { |
| 657 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(0u32.to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().()); |
| 658 | } |
| 659 | |
| 660 | // Symbol Table |
| 661 | let symbol_table = ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 662 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [0, 0, 0, 0, size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() as _, 0, 0, 0], |
| 663 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 664 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 1), |
| 665 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 666 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_EXTERNAL., |
| 667 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 668 | }; |
| 669 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&symbol_table)); |
| 670 | |
| 671 | Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]::write_string_tablerust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]write_string_table().(&mut buffer, &[&self.null_thunk_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#null_thunk_symbol_name.]); |
| 672 | ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 673 | namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 674 | datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: buffer, |
| 675 | symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![self.null_thunk_symbol_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#null_thunk_symbol_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()], |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | /// Create a short import file which is described in PE/COFF spec 7. Import |
| 680 | /// Library Format. |
| 681 | fn create_short_importrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_short_import().( |
| 682 | &self, |
| 683 | sym: &str, |
| 684 | ordinal: u16, |
| 685 | import_type: ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType#, |
| 686 | name_type: ImportNameTyperust-analyzer cargo implib 0.3.3 msvc/ImportNameType#, |
| 687 | ) -> ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 688 | // +2 for NULs |
| 689 | let import_name_size = self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().sym.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().2; |
| 690 | let size = size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImportObjectHeaderrust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().import_name_size; |
| 691 | let mut buffer = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(size); |
| 692 | |
| 693 | // Write short import header |
| 694 | let import_header = ImportObjectHeaderrust-analyzer cargo object 0.39.1 pe/ImportObjectHeader# { |
| 695 | sig1rust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#sig1.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 696 | sig2rust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#sig2.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0xFFFF), |
| 697 | versionrust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#version.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 698 | machinerust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#machine.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine. as _), |
| 699 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#time_date_stamp.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 700 | size_of_datarust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#size_of_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, import_name_size as _), |
| 701 | ordinal_or_hintrust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#ordinal_or_hint.: if ordinal rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().0 { |
| 702 | U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, ordinal) |
| 703 | } else { |
| 704 | U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0) |
| 705 | }, |
| 706 | name_typerust-analyzer cargo object 0.39.1 pe/ImportObjectHeader#name_type.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, ((name_type as u16) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().2) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().import_type as u16), |
| 707 | }; |
| 708 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&import_header)); |
| 709 | |
| 710 | let symbols = if matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(import_type, ImportTyperust-analyzer cargo implib 0.3.3 msvc/ImportType#::Datarust-analyzer cargo implib 0.3.3 msvc/ImportType#Data#) { |
| 711 | vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("__imp_{}", sym)] |
| 712 | } else { |
| 713 | vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("__imp_{}", sym), sym.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()] |
| 714 | }; |
| 715 | |
| 716 | // Write symbol name and DLL name |
| 717 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(sym.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()); |
| 718 | buffer.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'\0'); |
| 719 | buffer.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()); |
| 720 | buffer.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'\0'); |
| 721 | |
| 722 | ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 723 | namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 724 | datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: buffer, |
| 725 | symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols., |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | /// Create a weak external file which is described in PE/COFF Aux Format 3. |
| 730 | fn create_weak_externalrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]create_weak_external().(&self, sym: &str, weak: &str, imp: bool) -> ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 731 | const NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS.: usize = 1; |
| 732 | const NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS.: usize = 5; |
| 733 | |
| 734 | let mut buffer = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 735 | |
| 736 | let pointer_to_symbol_table = |
| 737 | size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#>(); |
| 738 | let header = ImageFileHeaderrust-analyzer cargo object 0.39.1 pe/ImageFileHeader# { |
| 739 | machinerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#machine.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, self.machinerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#machine. as u16), |
| 740 | number_of_sectionsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_sections.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SECTIONSrust-analyzer cargo implib 0.3.3 msvc/NUM_SECTIONS. as u16), |
| 741 | time_date_stamprust-analyzer cargo object 0.39.1 pe/ImageFileHeader#time_date_stamp.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 742 | pointer_to_symbol_tablerust-analyzer cargo object 0.39.1 pe/ImageFileHeader#pointer_to_symbol_table.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, pointer_to_symbol_table as u32), |
| 743 | number_of_symbolsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#number_of_symbols.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, NUM_SYMBOLSrust-analyzer cargo implib 0.3.3 msvc/NUM_SYMBOLS. as u32), |
| 744 | size_of_optional_headerrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#size_of_optional_header.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 745 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageFileHeader#characteristics.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 746 | }; |
| 747 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(&header)); |
| 748 | |
| 749 | // Section Header Table |
| 750 | let section_header_table = ImageSectionHeaderrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader# { |
| 751 | namerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#name.: [b'.', b'd', b'r', b'e', b'c', b't', b'v', b'e'], |
| 752 | virtual_sizerust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_size.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 753 | virtual_addressrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#virtual_address.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 754 | size_of_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#size_of_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 755 | pointer_to_raw_datarust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_raw_data.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 756 | pointer_to_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_relocations.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 757 | pointer_to_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#pointer_to_linenumbers.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 758 | number_of_relocationsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_relocations.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 759 | number_of_linenumbersrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#number_of_linenumbers.: U16rust-analyzer cargo object 0.39.1 endian/U16#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 760 | characteristicsrust-analyzer cargo object 0.39.1 pe/ImageSectionHeader#characteristics.: U32rust-analyzer cargo object 0.39.1 endian/U32#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, IMAGE_SCN_LNK_INFOrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_LNK_INFO. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_LNK_REMOVErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_LNK_REMOVE.), |
| 761 | }; |
| 762 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(§ion_header_table)); |
| 763 | |
| 764 | // Symbol Table |
| 765 | let prefix = if imp { "__imp_" } else { "" }; |
| 766 | let sym3_offset = (size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().sym.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().prefix.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1).to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]to_le_bytes().(); |
| 767 | let symbol_table = [ |
| 768 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 769 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [b'@', b'c', b'o', b'm', b'p', b'.', b'i', b'd'], |
| 770 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 771 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0xFFFF), |
| 772 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 773 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_STATICrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_STATIC., |
| 774 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 775 | }, |
| 776 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 777 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [b'@', b'f', b'e', b'a', b't', b'.', b'0', b'0'], |
| 778 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 779 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0xFFFF), |
| 780 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 781 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_STATICrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_STATIC., |
| 782 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 783 | }, |
| 784 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 785 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [0, 0, 0, 0, size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>() as _, 0, 0, 0], |
| 786 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 787 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 788 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 789 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_EXTERNAL., |
| 790 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 791 | }, |
| 792 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 793 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [ |
| 794 | 0, |
| 795 | 0, |
| 796 | 0, |
| 797 | 0, |
| 798 | sym3_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 799 | sym3_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 800 | sym3_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 801 | sym3_offset[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 802 | ], |
| 803 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 804 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 805 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 806 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_WEAK_EXTERNALrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_WEAK_EXTERNAL., |
| 807 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 1, |
| 808 | }, |
| 809 | ImageSymbolrust-analyzer cargo object 0.39.1 pe/ImageSymbol# { |
| 810 | namerust-analyzer cargo object 0.39.1 pe/ImageSymbol#name.: [2, 0, 0, 0, IMAGE_WEAK_EXTERN_SEARCH_ALIASrust-analyzer cargo object 0.39.1 pe/IMAGE_WEAK_EXTERN_SEARCH_ALIAS. as u8, 0, 0, 0], |
| 811 | valuerust-analyzer cargo object 0.39.1 pe/ImageSymbol#value.: U32Bytesrust-analyzer cargo object 0.39.1 endian/U32Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U32<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 812 | section_numberrust-analyzer cargo object 0.39.1 pe/ImageSymbol#section_number.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 813 | typrust-analyzer cargo object 0.39.1 pe/ImageSymbol#typ.: U16Bytesrust-analyzer cargo object 0.39.1 endian/U16Bytes#::newrust-analyzer cargo object 0.39.1 endian/impl#[`U16<E>`]new().(LErust-analyzer cargo object 0.39.1 endian/LittleEndian#, 0), |
| 814 | storage_classrust-analyzer cargo object 0.39.1 pe/ImageSymbol#storage_class.: IMAGE_SYM_CLASS_NULLrust-analyzer cargo object 0.39.1 pe/IMAGE_SYM_CLASS_NULL., |
| 815 | number_of_aux_symbolsrust-analyzer cargo object 0.39.1 pe/ImageSymbol#number_of_aux_symbols.: 0, |
| 816 | }, |
| 817 | ]; |
| 818 | for table in &symbol_table { |
| 819 | buffer.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(bytes_ofrust-analyzer cargo object 0.39.1 pod/bytes_of().(table)); |
| 820 | } |
| 821 | |
| 822 | // __imp_ String Table |
| 823 | Selfrust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]::write_string_tablerust-analyzer cargo implib 0.3.3 msvc/impl#[`ObjectFactory<'a>`]write_string_table().( |
| 824 | &mut buffer, |
| 825 | &[ |
| 826 | &formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}{}", prefix, sym), |
| 827 | &formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}{}", prefix, weak), |
| 828 | ], |
| 829 | ); |
| 830 | ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# { |
| 831 | namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: self.import_namerust-analyzer cargo implib 0.3.3 msvc/ObjectFactory#import_name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 832 | datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: buffer, |
| 833 | symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), |
| 834 | } |
| 835 | } |
| 836 | } |