当前位置:网站首页>Reverse analysis from x86 to x64tips
Reverse analysis from x86 to x64tips
2022-06-12 13:56:00 【HyperCall】
Tips1
An article written before 3 The process under the ring is hidden —-64 position windows 10 A question raised in :
Originally thought x64 The address below is 8 byte , therefore jmp Of address need -9 Of , As a result, the debugging found that it was still the same as x86 equally -5 That's it …..
Here is the x86—->x64 One thing to pay special attention to in the process of reverse analysis ,jmp Instructions and call Changes in instructions
Although in OD There are many jump instructions jmp xxxxx, But a closer look at his binary code reveals a big difference
There are several binary codes that can be interpreted as jmp, But they have different meanings
1>
x86 Next :
EB Short jump , He will put EB Later on 1 Bytes are interpreted as the relative address of the jump .
The formula for calculating the relative jump address is : EB XX= The address to jump to -EB Where the command is located -2
x64 Next :
identical , It is also after parsing 1 Bytes are relative addresses , The calculation formula is the same
2>
x86 Next :
E9 It means relative jump , He will put E9 Later on 4 Bytes are interpreted as the relative address of the jump .
The formula for calculating the relative jump address is : E9 XXXXXXXX= The address to jump to -E9 Where the command is located -5
x64 Next :
identical , It is also after parsing 4 Bytes are relative addresses , The calculation formula is the same
3>
x86 Next :
FF25 xxxxxxxx among xxxxxxxx It's an absolute address (FF25 Will solve the current absolute address * Number , That is, the absolute address [ Destination address ])
x64 Next :
FF25 xxxxxxxx among xxxxxxxx It's the relative address (FF25 The current relative address will be solved * Number , That is, the relative address [ Destination address ])
So x64 The biggest difference is his FF25 It is not absolute address resolution , It also becomes a relative address ,x64 There is no absolute address for the jump .
because x64 The address pointer of should be greater than x86 It's doubled , But to prevent the jump instruction length from increasing , So it's all done as absolute address jump
Tips2
The function calling convention is in 32 For CNOOC in the system cdecl,stdcall,fastcall several , To 64 The system is unified as fastcall, The parameter transfer method is
Parameters ————— Integer type ————— real
1st——————RCX—————–XMM0
2nd—————–RDX—————–XMM1
3rd——————R8——————-XMM2
4th——————R9——————-XMM3
From 5 The parameters are passed by stack , The stack cleaning after parameter transfer is cleared by the caller . But although the function's front 4 Parameters are stored in registers but space is still reserved in the stack space , That is to say, No 5 The storage location of the parameters is not in rsp, It is rsp+sizeof(1+2+3+4)
Tips3
x64 Hardly used RBP register , Even if he still has a stack , So the stack depends on RSP Register implementation
边栏推荐
- Data type conversion and conditional control statements
- 阿里云开发板HaaS510响应UART串口指令
- [semidrive source code analysis] [x9 chip startup process] 25 - Introduction to mailbox inter core communication mechanism (code analysis) rpmsg-ipcc RTOS & QNX
- Codeforces 1629 B. GCD arrays - simple thinking
- Codeforces 1629 F2. Game on sum (hard version) - Yang Hui's triangle, violence, finding rules
- SystemC common errors
- 阿里云开发板HaaS510报送设备属性
- Cdeforces 1638 C. inversion graph - simple thinking
- Codeforces 1629 A. download more RAM - simple greed
- Hash tables, sets, maps, trees, heaps, and graphs
猜你喜欢

Dismantle and modify the advertising machine - Amateur decompression

Data type conversion and conditional control statements

肝了一个月的原创小袁个人博客项目开源啦(博客基本功能都有,还包含后台管理)

Go language functions as parameters of functions

阿里云开发板HaaS510将串口获取数据发送到物联网平台

Single bus temperature sensor 18B20 data on cloud (Alibaba cloud)

Paw advanced user guide

Introduction to database system (Fifth Edition) notes Chapter 1 Introduction

事件的传递和响应以及使用实例

Codeforces 1637 D. yet another minimization problem - Mathematics, DP
随机推荐
工具笔记 —— 常用自定义工具类(正则,随机数等)
Debug code to quickly locate the error location
Cdeforces 1638 C. inversion graph - simple thinking
After reading the question, you will point to offer 16 Integer power of numeric value
Implementation of Ackermann function with simulated recursion
Explanation of static and extern keywords
Factory mode of "object creation" mode
Codeforces 1638 A. reverse - simple thinking
Alibaba cloud development board haas510 submission device attributes
Understanding recursion
Go language functions as parameters of functions
Codeforces 1629 E. grid XOR - simple thinking
Démontage et modification de la machine publicitaire - décompression amateur
简述CGI与FASTCGI区别
chapter19 Allocation
如果要打造品牌知名度,可以选择什么出价策略?
Summary of virtual box usage problems
【mysql进阶】mysql索引数据结构的演变(四)
AVFoundation
Codeforces 1637 C. Andrew and stones - simple thinking