没有合适的资源?快使用搜索试试~ 我知道了~
x86x64软件逆向分析【提高篇】 1
需积分: 0 7 下载量 75 浏览量
2022-08-08
18:17:49
上传
评论
收藏 894KB DOCX 举报
温馨提示
试读
32页
X86/X64软件逆向分析【提高篇】课前准备&工具安装与配置(1)课程回顾:《x86/x64软件逆向分析入门》Visual Studio 2019开发套件:ht
资源详情
资源评论
资源推荐
X86/X64 软件逆向分析【提高篇】
第1课、 课前准备&工具安装与配置(1)
1) 课程回顾:《x86/x64 软件逆向分析入门》
2) Visual Studio 2019 开发套件:http://www.microsoft.com
3) 动态调试工具:
x64dbg:https://x64dbg.com
4) 静态分析工具
IDA Pro:https://www.hex-rays.com/
Ghidra:https://github.com/NationalSecurityAgency/ghidra
5) 文本查看比较工具
Notepad++: https://notepad-plus-plus.org/
Beyond Compare: https://www.scootersoftware.com/
6) 参考文档:
英特尔 64 和 IA-32 体系结构软件开发人员手册(Intel® 64 and IA-32 Architectures Software Develo
per Manuals) https://software.intel.com/content/www/cn/zh/develop/articles/intel-sdm.html
7) 课程源代码:https://github.com/zmrbak/ReverseAnalysis2
8) 如何下载课程源代码
第2课、 课前准备&工具安装与配置(2)
第3课、 如何将机器码转成汇编代码(1)
0x12345678
低->高
12,34,56,78
77551000 12345678 7755C150 001E001C 7755C130
77551000 78 56 34 12 50 C1 55 77 1C 00 1E 00 30 C1 55 77 xV4.PÁUw....0ÁUw
77600E0B
890D B4576777
mov dword ptr ds:[776757B4],ecx
77600DFD
59
pop ecx
59
POPd64 into general register rCX/r9
POP ECX
77600E09
33C9
xor ecx,ecx
33C9
XOR Gv, Ev
.
G:
The reg field of the ModR/M byte selects a general register (for example, AX (000))
v:
Word, doubleword or quadword (in 64-bit mode), depending on operand-size attribute.
E:
A ModR/M byte follows the opcode and specifies the operand. The operand is either a general-purpose
register or a memory address. If it is a memory address, the address is computed from a segment register
and any of the following values: a base register, an index register, a scaling factor, a displacement.
ECX/CX/CL/MM/XMM1
ECX
XOR ECX, ECX
//532页
77600E1C | 74 05 | je ntdll.77600E23 |
74 05
Jccf64, Jb - Short-displacement jump on condition Z/E
J
The instruction contains a relative offset to be added to the instruction pointer register (for example,
JMP(0E9), LOOP).
b:
Byte, regardless of operand-size attribute.
jcc offset 05
77600E29 | 8BEC | mov ebp,esp |
8BEC
MOV Gb, Eb
MOV EBP,ESP
77600DF3
8B4D F0
mov ecx,dword ptr ss:[ebp-10]
8B4D F0
MOV Gb, Eb
MOV ECX, [EBP]� F0
MOV ECX, [EBP]���
MOV ECX, dowrd prt ss: [EBP����
MOV ECX, [EBP����
77600E03
64:A1 30000000
mov eax,dword ptr fs:[30]
64:A1 30 00 00 00
64
SEG=FS (Prefix)
MOV EAX, Ov
O
The instruction has no ModR/M byte. The offset of the operand is coded as a word or double word (depending
on address size attribute) in the instruction. No base register, index register, or scaling factor can be applied (for
example, MOV (A0–A3)).
MOV EAX,dword ptr FS:[30]
MOV EAX,FS:[30]
第二卷,
APPENDIX A OPCODE MAP
A.3 ONE, TWO, AND THREE-BYTE OPCODE MAPS ,P2672
CHAPTER 2 INSTRUCTION FORMAT
2.1 INSTRUCTION FORMAT FOR PROTECTED MODE, REAL-ADDRESS MODE, AND VIRTUAL-8086 MODE
2.1.5 Addressing-Mode Encoding of ModR/M and SIB Bytes,P532
第4课、 如何将机器码转成汇编代码(2)
第5课、 程序的优化编译与 SIMD 指令(1)
MOVUPS
Move four unaligned packed single-precision floating-point values between XMM registers or between and
XMM register and memory.
32 位*4=128 位
SSE Data Transfer Instructions
SSE SIMD Single-Precision Floating-Point Instructions
SSE:Streaming SIMD Extensions.
SIMD:Single Instruction, Multiple Data
一条指令,处理多个数据
FPU,SIMD
图像,音频,视频,加密解密
PADDD
Add packed doubleword integers.
Dword 32位
16字节,每一个字节8位,一共16*8=128位
VMOVDQU32/64
VMOVDQU with 32/64-bit granular conditional update.
VZEROUPPER
Zero upper 128 bits of all YMM registers
VZEROALL
Zero all YMM registers
第6课、 程序的优化编译与 SIMD 指令(1)
第7课、 编译器内置的 SIMD 指令支持(1)
typedef union __declspec(intrin_type) __declspec(align(16)) __m128i {
__int8 m128i_i8[16];
__int16 m128i_i16[8];
__int32 m128i_i32[4];
__int64 m128i_i64[2];
unsigned __int8 m128i_u8[16];
unsigned __int16 m128i_u16[8];
unsigned __int32 m128i_u32[4];
unsigned __int64 m128i_u64[2];
} __m128i;
https://docs.microsoft.com/zh-cn/cpp/cpp/declspec?view=msvc-160
__declspec
Microsoft 专用
用于指定存储类信息的扩展特性语法使用 __declspec 关键字,该关键字指定给定类型的实例将与下面列出的 Microsoft 特定存
储类特性一起存储。 其他存储类修饰符的示例包括 static 和 extern 关键字。 但是,这些关键字是 C 和 C++ 语言的 ANSI
规范的一部分,并且本身不包含在扩展特性语法中。 扩展特性语法简化并标准化了 Microsoft 专用的 C 和 C ++ 语言扩展。
//内存16字节对齐
_mm_load_si128
__m128i _mm_load_si128 (__m128i *p);
MOVDQA
//不需要16字节对齐
_mm_loadu_si128.
__m128i _mm_loadu_si128 (__m128i *p);
MOVDQU
MOVUPS __m128 _mm_loadu_ps ( float * p);
x86 内部函数列表
https://docs.microsoft.com/zh-cn/cpp/intrinsics/x86-intrinsics-list?view=msvc-160
Intel 内部函数指南
https://software.intel.com/sites/landingpage/IntrinsicsGuide/
__m128i _mm_lddqu_si128 (__m128i const* mem_addr)
#include <pmmintrin.h>
Instruction: lddqu xmm, m128
CPUID Flags: SSE3
__m128i _mm_loadu_si128 (__m128i const* mem_addr)
#include <emmintrin.h>
Instruction: movdqu xmm, m128
CPUID Flags: SSE2
__m128i _mm_add_epi32 (__m128i a, __m128i b)
#include <emmintrin.h>
Instruction: paddd xmm, xmm
CPUID Flags: SSE2
Add packed 32-bit integers in a and b, and store the results in dst.
FOR j := 0 to 3
i := j*32
dst[i+31:i] := a[i+31:i] + b[i+31:i]
ENDFOR
第8课、 编译器内置的 SIMD 指令支持(2)
第9课、 X86/X64 平台中寄存器的使用(1)
16位,指针16位,0-2^16, 65,536
32位,指针32位,0-2^32, 4,294,967,296
64位,指针64位,0-2^64, 18,446,744,073,709,551,616
X86-64
mov eax, 0x11111111
mov ax, 0x2222
7
6
5
4
3
2
1
0
RAX
EAX
AX
AH
AL
00007FFF615FF781
48:B8 1111111111111111
mov rax,1111111111111111
00007FFF615FF78B
B8 22222222
mov eax,22222222
00007FFF615FF790
66:B8 3333
mov ax,3333
00007FFF615FF794
B0 44
mov al,44
44:'D'
00007FFF615FF796
B4 55
mov ah,55
55:'U'
00007FFF615FF798
49:B9 1111111111111111
mov r9,1111111111111111
剩余31页未读,继续阅读
Period熹微
- 粉丝: 21
- 资源: 307
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0