Skip to content

Commit 49fbbac

Browse files
committed
main: 修复序号导入函数.
Signed-off-by: deadash <dead.ash@hotmail.com>
1 parent bdbfe07 commit 49fbbac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ fn main() -> Result<()> {
189189
// 内存加载以基地址为准, 这里应该加上基地址
190190
new_offset.insert(int.offset + image_base, func_offset + image_base);
191191
func_offset += 4usize;
192-
new_int.push(name_offset);
193192
if int.rva == 0 {
194-
name_offset += 2;
193+
// nothing
194+
new_int.push((int.ordinal) as usize | 0x8000_0000);
195195
} else {
196+
new_int.push(name_offset);
196197
name_offset += 2 + int.name.len() + 1;
197198
}
198199
}
@@ -242,8 +243,7 @@ fn main() -> Result<()> {
242243
for int in iat_sec.1 {
243244
// OrdinalNumber
244245
if int.rva == 0 {
245-
// TODO: 暂时不支持
246-
out.gwrite_with::<u16>(int.ordinal | 0x8000u16, &mut p_name, LE)?;
246+
// write nothing
247247
// HintNameTableRVA
248248
} else {
249249
out.gwrite_with::<u16>(int.ordinal, &mut p_name, LE)?;

0 commit comments

Comments
 (0)