การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน
ก้าวไปไกลกว่าการถอดแยกส่วนแบบสถิต โดยสังเกตโปรแกรมขณะทำงานผ่านการติดตามการเรียกระบบ การติดตามไลบรารี และการดักฟังก์ชัน เพื่อทำความเข้าใจพฤติกรรมจริง
การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน เป็นบทเรียน Assembly Language & x86 Low-Level Systems Programming ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Assembly Language & x86 Low-Level Systems Programming และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Assembly Language & x86 Low-Level Systems Programming มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Static vs Dynamic Analysis
Static analysis inspects a binary without running it (disassembly, strings). Dynamic analysis watches the program while it executes, revealing behavior that only appears at runtime, such as decrypted strings or network calls.
Why Dynamic Analysis Wins
Packed or obfuscated binaries hide their logic from a disassembler. But to actually do anything, the code must eventually run real instructions and make real syscalls — and that is exactly what dynamic tools capture.
System Call Tracing with strace
On Linux, strace logs every system call a process makes. It instantly shows files opened, network connections, and arguments passed to the kernel.
strace -f ./target # follow child processes
strace -e trace=network ./bin # only network syscalls
strace -p 1234 # attach to running PID 1234Reading strace Output
Each line is a syscall with arguments and return value:
openat(AT_FDCWD, "/etc/passwd", O_RDONLY) = 3
This reveals the program read /etc/passwd and got file descriptor 3 — behavior invisible in static text.
Library Call Tracing with ltrace
ltrace traces calls into shared libraries, like strcmp, malloc, or getenv. This is gold for cracking password checks where the comparison happens in libc.
ltrace ./crackme
# strcmp("hunter2", "letmein") = -1Function Hooking
Hooking intercepts a function call to inspect or change arguments and return values. You redirect the original function pointer to your own code, do your work, then optionally call the original.
LD_PRELOAD Interception
On Linux you can override any libc function by exporting a replacement in a preloaded shared object. The loader resolves your symbol first.
export LD_PRELOAD=./myhook.so
./target # calls now route through your hookA Simple Hook in C
This overrides strcmp to log every comparison, then calls the real one via dlsym(RTLD_NEXT, ...).
#define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>
#include <string.h>
int strcmp(const char *a, const char *b) {
int (*real)(const char*, const char*) = dlsym(RTLD_NEXT, "strcmp");
fprintf(stderr, "strcmp: %s vs %s\n", a, b);
return real(a, b);
}Hardware and Software Breakpoints
Dynamic debuggers use breakpoints to pause execution. A software breakpoint replaces a byte with 0xCC (INT 3). A hardware breakpoint uses the CPU debug registers DR0-DR3 and can also trip on memory reads/writes.
Instrumentation Frameworks
For heavy automation, frameworks like Frida and Intel Pin inject instrumentation at runtime. Frida lets you script hooks in JavaScript while the target runs — ideal for mobile and live analysis.
Anti-Debugging Awareness
Malware fights back. It may call ptrace(PTRACE_TRACEME) to detect a debugger, check timing, or scan for 0xCC bytes. Recognizing these checks is part of dynamic reverse engineering.
Quick Check
Test your dynamic-analysis knowledge.
Recap
You learned to analyze running programs:
- Dynamic analysis reveals runtime behavior static tools miss
- strace traces syscalls; ltrace traces library calls
- Hooking via LD_PRELOAD or Frida intercepts function calls
- Breakpoints (INT 3 / debug registers) and anti-debugging tricks shape the work
เรียนรู้ Assembly ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Assembly Language & x86 Low-Level Systems Programming ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Assembly Language & x86 Low-Level Systems Programming มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน”
ก้าวไปไกลกว่าการถอดแยกส่วนแบบสถิต โดยสังเกตโปรแกรมขณะทำงานผ่านการติดตามการเรียกระบบ การติดตามไลบรารี และการดักฟังก์ชัน เพื่อทำความเข้าใจพฤติกรรมจริง คุณปฏิบัติ Assembly Language & x86 Low-Level Systems Programming ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Assembly Language & x86 Low-Level Systems Programming หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Assembly Language & x86 Low-Level Systems Programming บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Assembly Language & x86 Low-Level Systems Programming นี้ได้ไหม
ได้ บทเรียน Assembly Language & x86 Low-Level Systems Programming ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- การใช้ GDB ดีบักภาษาแอสเซมบลี
- แนะนำเครื่องมือถอดประกอบโค้ด
- เทคนิคพื้นฐานวิศวกรรมย้อนกลับ
- การวิเคราะห์แบบไดนามิกด้วยการติดตามและการดักฟังก์ชัน