C++反汇编与逆向分析技术揭秘第2版逆向工程领域标志性著作第1版畅销10年安全领域瑰宝侯捷等全球15位专家口碑力荐 (钱林松 张延清)(Z-Library)
C/C++/C#
No Description
173
Views
0
Downloads
0.00
Total Donations
AI Guide
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
【One-Line Pitch】
A hands-on, assembly-level guide to C++ reverse engineering, showing how compilers (MSVC, GCC, Clang) translate high-level C++ constructs into x86/x64 machine code — essential reading for security researchers, malware analysts, and anyone who wants to truly understand what their C++ code becomes at runtime.
【Book Arc】
- **Opening (~0%–8%)**: Sets up the entire toolchain — installing Visual Studio 2019, GCC (MinGW-w64), Clang, and the debuggers OllyDbg, x64dbg, and WinDbg, plus the static analyzer IDA. This stage solves the "where do I start" problem by giving you a working environment and explaining the difference between dynamic debugging and static disassembly.
- **Early (~8%–34%)**: Dives into the fundamentals of data representation in memory — integers (signed/unsigned), floats, characters (ASCII vs. Unicode), booleans, and constants. The key insight here is that **types are just interpretations of raw bytes**, and the book demonstrates this with side-by-side assembly listings showing how different pointer types read the same memory address differently.
- **Early–Middle (~34%–55%)**: Explores pointer arithmetic and references in depth. You'll see exactly why `p1 += 1` adds 4 bytes for an `int*` but only 1 byte for a `char*`, and how references are secretly implemented as pointers under the hood — the compiler just handles the dereferencing for you. This is where the "aha" moment about C++'s memory model happens.
- **Middle–Late (~55%–78%)**: Moves into expression evaluation and compiler optimization. Using simple arithmetic (addition, subtraction) as a case study, the book reveals how Debug vs. Release builds differ dramatically, and how optimizations like **constant folding, constant propagation, and copy propagation** can eliminate entire variables and pre-compute results at compile time.
- **Late–Ending (~78%–100%)**: Continues the optimization deep-dive with more complex examples, showing how changing a variable's initial value from a constant to a runtime value (like `argc`) forces the compiler to keep variables alive. The book walks through the exact transformation steps, making the optimizer's logic transparent and predictable.
【Key Takeaways】
- **Toolchain mastery is the prerequisite** (Opening): The book assumes you'll set up VS2019, GCC, Clang, OllyDbg, x64dbg, and IDA before proceeding. The choice of compiler and optimization level (`-O0` vs `-O2`) dramatically changes the assembly you'll see, so knowing which tool produced the binary is half the battle.
- **Types are interpretations, not properties of memory** (Early): A raw byte sequence like `78 56 34 12` means nothing until a pointer type tells you how to read it. The book shows `int*`, `char*`, and `short*` all pointing at the same address, each extracting different values — this is the foundation for recognizing data structures in unknown binaries.
- **Pointer arithmetic scales by type size** (Early–Middle): `p += 1` compiles to `add eax, 4` for `int*`, `add eax, 1` for `char*`, and `add eax, 2` for `short*`. Recognizing these scaled additions in assembly is a reliable way to infer pointer types during reverse engineering.
- **References are pointers in disguise** (Middle): The assembly for a reference parameter is identical to a pointer parameter — both store an address and dereference it. The only difference is that the compiler handles the dereferencing automatically for references, which is why they're safer but not fundamentally different at the machine level.
- **Compiler optimizations are predictable patterns** (Late): Constant folding (`1 + 2` becomes `3` at compile time), constant propagation (replacing variable references with known constants), and copy propagation (eliminating redundant variables) follow clear rules. Once you learn these patterns, you can mentally "un-optimize" Release binaries back to their source logic.
- **Debug vs. Release is a different language** (Late): The same C++ source produces wildly different assembly depending on build mode. Debug builds keep every variable in memory for easy inspection; Release builds aggressively eliminate dead code and pre-compute values. Knowing which mode you're looking at prevents massive confusion.
- **Runtime values block optimization** (Ending): When a variable's initial value comes from `argc` (unknown at compile time), the compiler cannot fold or propagate constants through it. This forces variables to stay alive in memory — a key insight for understanding why some code survives optimization while other code vanishes.
【Reading Tips】
- **Skim the tool installation chapters** (~0%–8%) if you already have a working reverse engineering environment; just note which compilers the book uses (MSVC, GCC, Clang) and move on. Come back only if you hit tool-specific issues.
- **Deep-read the pointer and reference sections** (~8%–55%): These are the heart of the book. Pay close attention to the side-by-side x86 vs. x64 listings — the differences (like `ebp` vs. `rsp`-relative addressing) are crucial for real-world analysis of modern 64-bit malware.
- **Treat the optimization chapters as a pattern library** (~55%–100%): Don't just read the explanations — write down the optimization patterns (constant folding, propagation, dead code elimination) as a cheat sheet. You'll use these to mentally reconstruct source code from Release binaries.
- **Expect repetition**: The book shows the same C++ snippet compiled with multiple compilers and architectures. This is intentional — use it to your advantage by focusing on the *differences* between MSVC, GCC, and Clang output, which reveal compiler-specific idioms you'll encounter in the wild.
- **Skip the raw assembly listings on first read**: If you're new to assembly, read the explanatory text first, then go back to the listings to verify your understanding. The prose explains *what* happens; the listings show *how* — you need both, but not simultaneously.
【Coverage Limits】
This guide covers the book's opening sections (tooling, data types, pointers, references) and the early optimization chapters (arithmetic expressions). The excerpts do not cover the later chapters on control flow, functions, classes, virtual functions, inheritance, exception handling, or the practical reverse engineering case studies (PEiD, OllyDbg internals, malware analysis) — those are beyond the scope of this sample.
Passage locations
Excerpt 1
常处理机制 15.5 加载调试程序 15.6 本章小结 第16章 大灰狼远控木马逆向分析 16.1 调试环境配置 16.2 病毒程序初步分析 16.3 启动过程分析 16.4 通信协议分析 16.5 远控功能分析 16.6 本章小结 第17章 WannaCry勒索病毒逆向分析 17.1 tasksche.exe勒...
View in text
Recommended for You
{{#thumbnailUrl}}
{{/thumbnailUrl}}
{{^thumbnailUrl}}
{{/thumbnailUrl}}
Loading recommended books...
Failed to load, please try again later
Tip the Site
Scan the WeChat Pay or Alipay code to tip. No login required.
WeChat Pay
Alipay