Reference material for your training session.
| Function | Purpose |
|---|---|
strcmp(s1, s2) |
Returns 0 if strings match. |
strncmp(s1, s2, n) |
Compare first n chars. |
strlen(s) |
Get string length. |
strings binary.exe -> dumps all ASCII strings.
\0).| Op | Code | Desc |
|---|---|---|
| AND | & |
1 if both are 1. |
| OR | | |
1 if either is 1. |
| XOR | ^ |
1 if different. (Key Property: A^B=C, C^B=A) |
XOR EAX, EAX -> Zero out register (EAX = 0).TEST EAX, EAX -> Check if 0.CMP EAX, EBX -> Compare numbers.Data is passed to functions via Registers (x64) or Stack (x86).
// Helper Function Example
int check(int a) {
return a + 5;
}
// Main
if (check(input) == 10) ...
// This means input MUST be 5.
Tip: In Ghidra, double-click a function name to "Step Into" it and see what it does.
State Variable: A variable (usually int state) tracks progress.
Switch/Case: Compiled as a "Jump Table" or series of CMP/JE.
Break: Look for jumps that leave the loop structure.
while(state != DONE) {
if (state == 0) { ... state = 1; }
else if (state == 1) { ... }
}
| Key | Action |
|---|---|
G |
Go to Address (Jump to mock memory). |
L |
Re-label / Rename a variable or function. |
; |
Add a comment. |
Ctrl+E |
Show/Hide Entropy (Not in mock, but real life). |
F5 |
Decompile (Refresh). |