Reversing Tools & Basic Methods
This skill provides guidance on reverse engineering tools and methodologies for various platforms, languages, and binary formats.
Quick Reference by Target Type
| Target |
Primary Tools |
| .NET assemblies |
dnSpy, ILSpy, dotPeek |
| Java |
JADX, JD-GUI |
| Shellcode |
Blobrunner, jmp2it, scdbg, Cutter |
| Wasm |
wabt, wasmdec, Jeb |
| GBA games |
no$gba, mgba, GhidraGBA |
| Delphi |
IDR, IDA-For-Delphi |
| Golang |
IDAGolangHelper |
| Obfuscated (movfuscator) |
demovfuscator |
.NET Decompilation & Debugging
Tool Selection
- dotPeek (JetBrains): Best for examining .dll, .winmd, .exe files. Can save as Visual Studio project.
- ILSpy: Cross-platform, has VSCode extension. Good for quick decompilation.
- dnSpy/dnSpyEx: Use when you need to decompile, modify, and recompile. Right-click → "Modify Method" to edit functions.
Debugging .NET Applications
To debug a .NET application with dnSpy:
Modify assembly attributes to enable debugging:
// Change from:
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
// To:
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default |
DebuggableAttribute.DebuggingModes.DisableOptimizations |
DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints |
DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
Compile and save the modified module via File → Save module...
If running under IIS, restart with:
iisreset /noforce
Attach debugger:
- Close all opened files in dnSpy
- Debug Tab → Attach to Process...
- Select
w3wp.exe (IIS worker process)
- Click Attach
Load modules:
- Debug → Break All
- Debug → Windows → Modules
- Click any module → Open All Modules
- Right-click in Assembly Explorer → Sort Assemblies
Adding Logging in dnSpy
To make dnSpy log information to a file, insert this code:
using System.IO;
path = "C:\\inetpub\\temp\\MyTest2.txt";
File.AppendAllText(path, "Password: " + password + "\n");
Shellcode Analysis & Debugging
Tool Selection
| Task |
Tool |
| Allocate & debug |
Blobrunner, jmp2it |
| Analyze functions |
scdbg |
| Emulate & inspect |
Cutter |
| Deobfuscate |
scdbg, demovfuscator |
| Disassemble |
CyberChef |
Debugging with Blobrunner
- Run Blobrunner with your shellcode
- It will allocate the shellcode in memory and stop execution
- Note the memory address where shellcode was allocated
- Attach debugger (IDA or x64dbg) to the process
- Set breakpoint at the indicated address
- Resume execution to debug the shellcode
Debugging with jmp2it
- Run jmp2it with your shellcode
- It allocates shellcode and starts an eternal loop
- Attach debugger to the process
- Play start, wait 2-5 seconds, press stop
- You'll be in the eternal loop
- Jump to next instruction (call to shellcode)
- Now executing the shellcode
Using scdbg
# Get basic info
scdbg.exe -f shellcode
# Show analysis report at end
scdbg.exe -f shellcode -r
# Enable interactive hooks (file/network) + report
scdbg.exe -f shellcode -i -r
# Dump decoded shellcode
scdbg.exe -f shellcode -d
# Find where shellcode starts
scdbg.exe -f shellcode /findsc
# Start execution at specific offset
scdbg.exe -f shellcode /foff 0x0000004D
Key features:
- Tells you which functions the shellcode uses
- Detects if shellcode is self-decoding in memory
- Create Dump option saves decoded shellcode if modified dynamically
- Start offset to begin at specific location
Using Cutter
- Open Cutter (GUI for radare2)
- Open File or Open Shellcode
- Set a breakpoint where you want to start emulation
- Cutter will automatically start emulation from there
- View stack in hex dump
Disassembling with CyberChef
Upload shellcode file and use this recipe:
- To Hex (Space separator)
- Disassemble x86 (32-bit, Full x86 architecture)
DLL Debugging
Using x64dbg/x32dbg
Load rundll32.exe:
- 64-bit:
C:\Windows\System32\rundll32.exe
- 32-bit:
C:\Windows\SysWOW64\rundll32.exe
Change Command Line (File → Change Command Line):
"C:\Windows\SysWOW64\rundll32.exe" "path\to\your.dll",FunctionName
Configure settings:
- Options → Settings
- Select "DLL Entry"
Start execution - debugger will stop at each DLL entry point
When stopped in your DLL's entry, search for breakpoints
Tip: When execution stops, check the top of x64dbg window to see which code you're in.
Using IDA
- Load rundll32.exe
- Select Windbg debugger
- Select "Suspend on library load/unload"
- Configure execution parameters with DLL path and function name
- Start debugging - execution stops when each DLL loads
Wasm Decompilation
Online Tools
Software Tools
Platform-Specific Tools
Rust Binaries
- Search for functions containing
::main
- Identify the main function (often obvious from binary name)
- Search function names online to learn about inputs/outputs
Delphi Binaries
- Use IDR: https://github.com/crypto2020/IDR
- Use IDA-For-Delphi plugin: https://github.com/Coldzer0/IDA-For-Delphi
- In IDA, press ALT+F7 to import Python plugin
- Select the plugin and start debugging
- Press Start button (green or F9) - breakpoint hits at real code start
- Pressing buttons in GUI will stop debugger in executed function
Golang Binaries
- Use IDAGolangHelper plugin: https://github.com/sibears/IDAGolangHelper
- In IDA, press ALT+F7 to import Python plugin
- Select the plugin to resolve function names
GBA Games
Tools:
- no$gba (debug version): GUI debugger with interface
- mgba: CLI debugger
- gba-ghidra-loader: Ghidra plugin
- GhidraGBA: Ghidra plugin
Key Input Values:
A = 1
B = 2
SELECT = 4
START = 8
RIGHT = 16
LEFT = 32
UP = 64
DOWN = 128
R = 256
L = 512
Common Pattern:
- Address
0x4000130 contains KEYINPUT function
- Look for how program treats user input
- Check for button value comparisons in decompiled code
Game Boy
Reference: https://www.youtube.com/watch?v=VVbRe7wr3G4
Obfuscation Handling
Movfuscator
What it does: Modifies all instructions to mov and uses interrupts to change execution flow.
Deobfuscation:
Try demovfuscator: https://github.com/kirschju/demovfuscator
Install dependencies:
apt-get install libcapstone-dev
apt-get install libz3-dev
Install Keystone:
apt-get install cmake
mkdir build && cd build
../make-share.sh
make install
CTF workaround: https://dustri.org/b/defeating-the-recons-movfuscator-crackme.html
GUI Apps & Games
- Cheat Engine: Find and modify values in running game memory
- PiNCE: GDB front-end focused on games, works for any reverse engineering
- Decompiler Explorer (dogbolt.org): Compare decompiler outputs on small executables
Compiled Python
To extract Python code from ELF/EXE compiled binaries, use standard .pyc extraction methods.
Learning Resources
Workflow Recommendations
Before Starting
- Identify the target type (language, platform, format)
- Select appropriate tools from the tables above
- Check for obfuscation (movfuscator, custom packers)
- Set up debugging environment (disable optimizations if needed)
During Analysis
- Start with static analysis (decompile, disassemble)
- Move to dynamic analysis (debug, trace execution)
- Document findings (function names, key addresses, logic flow)
- Test hypotheses (modify code, recompile, verify)
Common Pitfalls
- Optimizations prevent breakpoints: Modify assembly attributes for .NET
- Shellcode self-decoding: Use scdbg to dump decoded version
- Missing function names: Use language-specific IDA plugins
- Wrong architecture: Verify 32-bit vs 64-bit before loading
Quick Commands Reference
# .NET IIS restart
iisreset /noforce
# scdbg analysis
scdbg.exe -f shellcode -r
scdbg.exe -f shellcode -d
# Install demovfuscator deps
apt-get install libcapstone-dev libz3-dev cmake
When to Use This Skill
Use this skill when you need to:
- Decompile or analyze compiled binaries
- Debug shellcode or malicious payloads
- Reverse engineer .NET, Java, Golang, Delphi, or Rust applications
- Work with Wasm, GBA games, or other specialized formats
- Handle obfuscated binaries
- Select appropriate tools for a reverse engineering task
- Understand debugging workflows for different platforms
1---2name: reversing-tools-basic-methods3description: Use this skill for reverse engineering tasks including decompiling binaries, debugging shellcode, analyzing .NET/Java/Golang/Delphi/Rust applications, working with Wasm, GBA games, and using tools like IDA, x64dbg, dnSpy, Cutter, and scdbg. Trigger this skill whenever the user mentions reverse engineering, decompiling, debugging binaries, analyzing shellcode, or working with compiled code from any language or platform.4---56# Reversing Tools & Basic Methods78This skill provides guidance on reverse engineering tools and methodologies for various platforms, languages, and binary formats.910## Quick Reference by Target Type1112| Target | Primary Tools |13|--------|---------------|14| .NET assemblies | dnSpy, ILSpy, dotPeek |15| Java | JADX, JD-GUI |16| Shellcode | Blobrunner, jmp2it, scdbg, Cutter |17| Wasm | wabt, wasmdec, Jeb |18| GBA games | no$gba, mgba, GhidraGBA |19| Delphi | IDR, IDA-For-Delphi |20| Golang | IDAGolangHelper |21| Obfuscated (movfuscator) | demovfuscator |2223## .NET Decompilation & Debugging2425### Tool Selection2627- **dotPeek** (JetBrains): Best for examining .dll, .winmd, .exe files. Can save as Visual Studio project.28- **ILSpy**: Cross-platform, has VSCode extension. Good for quick decompilation.29- **dnSpy/dnSpyEx**: Use when you need to **decompile, modify, and recompile**. Right-click → "Modify Method" to edit functions.3031### Debugging .NET Applications3233To debug a .NET application with dnSpy:34351. **Modify assembly attributes** to enable debugging:36 ```csharp37 // Change from:38 [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]39 40 // To:41 [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default |42 DebuggableAttribute.DebuggingModes.DisableOptimizations |43 DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints |44 DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]45 ```46472. **Compile and save** the modified module via File → Save module...48493. **If running under IIS**, restart with:50 ```bash51 iisreset /noforce52 ```53544. **Attach debugger**:55 - Close all opened files in dnSpy56 - Debug Tab → Attach to Process...57 - Select `w3wp.exe` (IIS worker process)58 - Click Attach59605. **Load modules**:61 - Debug → Break All62 - Debug → Windows → Modules63 - Click any module → Open All Modules64 - Right-click in Assembly Explorer → Sort Assemblies6566### Adding Logging in dnSpy6768To make dnSpy log information to a file, insert this code:6970```csharp71using System.IO;72path = "C:\\inetpub\\temp\\MyTest2.txt";73File.AppendAllText(path, "Password: " + password + "\n");74```7576## Shellcode Analysis & Debugging7778### Tool Selection7980| Task | Tool |81|------|------|82| Allocate & debug | Blobrunner, jmp2it |83| Analyze functions | scdbg |84| Emulate & inspect | Cutter |85| Deobfuscate | scdbg, demovfuscator |86| Disassemble | CyberChef |8788### Debugging with Blobrunner89901. Run Blobrunner with your shellcode912. It will **allocate** the shellcode in memory and **stop** execution923. Note the **memory address** where shellcode was allocated934. **Attach debugger** (IDA or x64dbg) to the process945. Set **breakpoint** at the indicated address956. **Resume** execution to debug the shellcode9697### Debugging with jmp2it98991. Run jmp2it with your shellcode1002. It allocates shellcode and starts an **eternal loop**1013. **Attach debugger** to the process1024. **Play start, wait 2-5 seconds, press stop**1035. You'll be in the eternal loop1046. **Jump to next instruction** (call to shellcode)1057. Now executing the shellcode106107### Using scdbg108109```bash110# Get basic info111scdbg.exe -f shellcode112113# Show analysis report at end114scdbg.exe -f shellcode -r115116# Enable interactive hooks (file/network) + report117scdbg.exe -f shellcode -i -r118119# Dump decoded shellcode120scdbg.exe -f shellcode -d121122# Find where shellcode starts123scdbg.exe -f shellcode /findsc124125# Start execution at specific offset126scdbg.exe -f shellcode /foff 0x0000004D127```128129**Key features:**130- Tells you which functions the shellcode uses131- Detects if shellcode is self-decoding in memory132- **Create Dump** option saves decoded shellcode if modified dynamically133- **Start offset** to begin at specific location134135### Using Cutter1361371. Open Cutter (GUI for radare2)1382. **Open File** or **Open Shellcode**1393. Set a **breakpoint** where you want to start emulation1404. Cutter will automatically start emulation from there1415. View stack in hex dump142143### Disassembling with CyberChef144145Upload shellcode file and use this recipe:146- To Hex (Space separator)147- Disassemble x86 (32-bit, Full x86 architecture)148149## DLL Debugging150151### Using x64dbg/x32dbg1521531. **Load rundll32.exe**:154 - 64-bit: `C:\Windows\System32\rundll32.exe`155 - 32-bit: `C:\Windows\SysWOW64\rundll32.exe`1561572. **Change Command Line** (File → Change Command Line):158 ```159 "C:\Windows\SysWOW64\rundll32.exe" "path\to\your.dll",FunctionName160 ```1611623. **Configure settings**:163 - Options → Settings164 - Select "DLL Entry"1651664. **Start execution** - debugger will stop at each DLL entry point1675. When stopped in your DLL's entry, search for breakpoints168169**Tip:** When execution stops, check the top of x64dbg window to see which code you're in.170171### Using IDA1721731. Load rundll32.exe1742. Select **Windbg** debugger1753. Select "**Suspend on library load/unload**"1764. Configure execution parameters with DLL path and function name1775. Start debugging - execution stops when each DLL loads178179## Wasm Decompilation180181### Online Tools182183- **wasm2wat**: https://webassembly.github.io/wabt/demo/wasm2wat/index.html184 - Decompiles from wasm (binary) to wat (text)185- **wat2wasm**: https://webassembly.github.io/wabt/demo/wat2wasm/186 - Compiles from wat to wasm187- **web-wasmdec**: https://wwwg.github.io/web-wasmdec/188 - Alternative decompiler189190### Software Tools191192- **Jeb**: https://www.pnfsoftware.com/jeb/demo193- **wasmdec**: https://github.com/wwwg/wasmdec194195## Platform-Specific Tools196197### Rust Binaries1981991. Search for functions containing `::main`2002. Identify the main function (often obvious from binary name)2013. Search function names online to learn about inputs/outputs202203### Delphi Binaries2042051. Use **IDR**: https://github.com/crypto2020/IDR2062. Use **IDA-For-Delphi** plugin: https://github.com/Coldzer0/IDA-For-Delphi2073. In IDA, press **ALT+F7** to import Python plugin2084. Select the plugin and start debugging2095. Press Start button (green or F9) - breakpoint hits at real code start2106. Pressing buttons in GUI will stop debugger in executed function211212### Golang Binaries2132141. Use **IDAGolangHelper** plugin: https://github.com/sibears/IDAGolangHelper2152. In IDA, press **ALT+F7** to import Python plugin2163. Select the plugin to resolve function names217218### GBA Games219220**Tools:**221- **no$gba** (debug version): GUI debugger with interface222- **mgba**: CLI debugger223- **gba-ghidra-loader**: Ghidra plugin224- **GhidraGBA**: Ghidra plugin225226**Key Input Values:**227```228A = 1229B = 2230SELECT = 4231START = 8232RIGHT = 16233LEFT = 32234UP = 64235DOWN = 128236R = 256237L = 512238```239240**Common Pattern:**241- Address `0x4000130` contains `KEYINPUT` function242- Look for how program treats user input243- Check for button value comparisons in decompiled code244245### Game Boy246247Reference: https://www.youtube.com/watch?v=VVbRe7wr3G4248249## Obfuscation Handling250251### Movfuscator252253**What it does:** Modifies all instructions to `mov` and uses interrupts to change execution flow.254255**Deobfuscation:**2562571. Try **demovfuscator**: https://github.com/kirschju/demovfuscator2582592. **Install dependencies:**260 ```bash261 apt-get install libcapstone-dev262 apt-get install libz3-dev263 ```2642653. **Install Keystone:**266 ```bash267 apt-get install cmake268 mkdir build && cd build269 ../make-share.sh270 make install271 ```2722734. **CTF workaround:** https://dustri.org/b/defeating-the-recons-movfuscator-crackme.html274275## GUI Apps & Games276277- **Cheat Engine**: Find and modify values in running game memory278- **PiNCE**: GDB front-end focused on games, works for any reverse engineering279- **Decompiler Explorer** (dogbolt.org): Compare decompiler outputs on small executables280281## Compiled Python282283To extract Python code from ELF/EXE compiled binaries, use standard .pyc extraction methods.284285## Learning Resources286287- **Z0F Course**: https://github.com/0xZ0F/Z0FCourse_ReverseEngineering288- **ABD (Binary Deobfuscation)**: https://github.com/malrev/ABD289290## Workflow Recommendations291292### Before Starting2932941. **Identify the target type** (language, platform, format)2952. **Select appropriate tools** from the tables above2963. **Check for obfuscation** (movfuscator, custom packers)2974. **Set up debugging environment** (disable optimizations if needed)298299### During Analysis3003011. **Start with static analysis** (decompile, disassemble)3022. **Move to dynamic analysis** (debug, trace execution)3033. **Document findings** (function names, key addresses, logic flow)3044. **Test hypotheses** (modify code, recompile, verify)305306### Common Pitfalls307308- **Optimizations prevent breakpoints**: Modify assembly attributes for .NET309- **Shellcode self-decoding**: Use scdbg to dump decoded version310- **Missing function names**: Use language-specific IDA plugins311- **Wrong architecture**: Verify 32-bit vs 64-bit before loading312313## Quick Commands Reference314315```bash316# .NET IIS restart317iisreset /noforce318319# scdbg analysis320scdbg.exe -f shellcode -r321scdbg.exe -f shellcode -d322323# Install demovfuscator deps324apt-get install libcapstone-dev libz3-dev cmake325```326327## When to Use This Skill328329Use this skill when you need to:330- Decompile or analyze compiled binaries331- Debug shellcode or malicious payloads332- Reverse engineer .NET, Java, Golang, Delphi, or Rust applications333- Work with Wasm, GBA games, or other specialized formats334- Handle obfuscated binaries335- Select appropriate tools for a reverse engineering task336- Understand debugging workflows for different platforms