逆向知识
汇编基础
mov:数据传送指令
CALL:1.把当前的IP压入栈中,2.跳转到指定位置
RET:用栈中所保存的数据赋值给IP,跳转回来
PUSH:先减ESP,再把数据放进去
POP:先把数据POP出,再加ESP
LEAVE:MOV SP,BP;POP BP
- 通用寄存器
- 8位AL AH BL,BH
- 16位AX BX CX DX
- 32位EAX EBX ECX EDX
- 64位RAX RBX RCX RDX
- 指令指针寄存器:IP{指向下一条要取值的指令地址}
- 基址寄存器:BP(指针)
- 栈堆寄存器:SP(指针)
指针
- 指针存放内存地址的变量
- 内存地址范围(虚拟地址),在调试器中看到的所有的地址都是虚拟地址。
- 32位系统地址范围:0x0000000-0xFFFFFFFF
- 64位系统地址范围:
0x00000000000000-0xFFFFFFFFFFFFFFFF - 32位系统指针大小:4字节
- 64位系统指针大小:8字节
数据域,存储节点中的数据
指针域,存储指针指向下一个节点
gdb调试
.s为汇编代码
file xxx//指定要调试的二进制文件
breakpoint xxxx//简写为b 下断点
delete xxx//简写为d 删除断点
information//简写i 查看信息
run//简写r 开始执行
ni//执行下一条语句
BYTE在IDA中1个字节
QWORD是4个字节
nop 对应的hex值为90 90
LD_PRELOAD 偷梁换柱
ptrace 反调试
步骤:1.反调试
2.初始化链表
3.循环查找链表
4.比较
注重pwn