Windows x64 的近绝对调用 (0xFF 0x15) 寻址
Near absolute call (0xFF 0x15) addressing for windows x64
我发现与 Linux 相关的主题x86_64绝对寻址:x86_64 中运行时代码替换的绝对寻址。有人告诉 linux 不支持绝对寻址。
Windows x64怎么样,是否支持接近绝对调用?
对于 Windows x86,可以通过以下方式从接近绝对的调用 (0xFF 0x15) 中获取函数的地址:
unsigned char call_nearAbsolute[2] = {0xFF, 0x15};
if(memcmp(bytes, call_nearAbsolute, sizeof(call_nearAbsolute)) == 0) {
{
unsigned char offset[] = {
*(bytes + 0x5),
*(bytes + 0x4),
*(bytes + 0x3),
*(bytes + 0x2)
};
PDWORD_PTR absolute_addr =
(PDWORD_PTR)(((offset[0] & 0xFF) << 24) |
((offset[1] & 0xFF) << 16) |
((offset[2] & 0xFF) << 8) |
offset[3] & 0xFF);
}
如果x64支持,如何正确获取过程地址?
使用
MOV rax, address(your routine)'
CALL rax
在 1 个命令(营销或任何愚蠢的原因)中,该模式下(尚)没有绝对调用。上述组合(必要时用其他临时寄存器替换它)可让您获得所需的内容。预测器应至少通过其在内存中的位置来识别此类调用,而不会受到惩罚(调用命令本身)。我没有测试第一个呼叫惩罚,但它应该与间接地址的呼叫相同或更低(正确对齐)。
相关文章:
- 在 c++ 上,您通常使用什么 int 值、'255' 和十六进制值'0xff'?
- 为什么在将窄字符串转换为宽字符串时用0xFF屏蔽字符?
- COM 端口C++读取0xFF
- 为什么0xff等于负 0 C++
- 为什么将0xff移位 24 位会导致值不正确?
- 这是我的代码,它正在返回Process返回的255(0xff)码块
- QSerialPort::write() - 只有有符号值?(最多 127 个十进制)?我需要发送0xFF(12月255
- (无符号字符)str 与 str + 0xff 或(无符号整数)值与值 + 0xffff 中的哪一种更快和首选
- Windows x64 的近绝对调用 (0xFF 0x15) 寻址
- SDL 代码中0xFF的含义
- program.exe:Native' 已退出,代码为 255 (0xff)
- 为什么 (int)'\xff' != 0xff 但 (int)'\x7f' == 0x7f?
- 为什么(a % 256)与(a & 0xFF)不同?
- 可视C++标头 #define 函数 (x) ('ABC\0' |('0'+(x &0xFF)))
- 我如何读取0xFF文件与libc++ istream_iterator
- 如何将有符号字符初始化为无符号值,如c++中的0xFF
- 进程返回 255 <0xFF>,C++,程序停止工作