Addresses in reverse engineering
2023年7月17日
Relative Virtual Address (RVA)
RVA通常用module name + 地址
表示。如图,CheatEngine的Memory Viewer显示的是RVA。

v2game.exe+563d47
in CheatEngine notationx64dbg可以转换各种地址。在CPU tab,右击选择Go to -> Expression (ctrl+G),输入module name + 地址
[1],下方会显示section offset。x64dbg不显示.exe
。点击OK,CPU tab就会显示那一行代码。注意下方的status bar,第一个地址是section offset,第二个是RVA,第三个是file offset。

.text:010b3d47
是section offset,v2game.exe:$563147
是RVA,#563147
是file offset。Virtual Address (VA)
RVA + ImageBase = VA
VA不经常用到。
注意,《The IDA Pro Book, 2nd Edition: The Unofficial Guide to the World’s Most Popular Disassembler》(Chapter 5.1)把virtual address当作section offset。
Section offset
PE文件格式定义了多个sections,包括.text
, .data
, .rdata
, .idata
, .reloc
, .rsrc
, .debug
等。[2] .text
指的是程序代码。
所以Section offset .text:010b3d47
指的是在.text
section里的第010b3d47行。
File offset
File offset指的是一行代码在整个exe文件中的位置。
在IDA Interactive Disassembler,用file offset跳转比较方便。在菜单选择 Jump -> Jump to file offset,然后输入地址,这里不需要输入module name。点击OK,当前view就会跳转到那一行。
在Disassembly view,左边是section offset,下面状态栏的第一个地址是file offset。

Hex Editor一般显示的是file offset。我用HxD Hex Editor搜索字符串teleport,发现其中一个位置是9ee880。这是file offset。把该地址输入IDA, Jump to file offset,发现该地址是在.rdata
section。
参考资料
- . Values. x64dbg documentation. [2023-07-18].↑
- SATYAJIT DAULAGUPHU. A Comprehensive Guide To PE Structure, The Layman’s Way. . 2022-08-15 [2023-07-18].↑