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.4metadata:5 source: https://skillmd.com/skills/abelrguezr/reversing-tools-basic-methods6---78# Reversing Tools & Basic Methods910This skill provides guidance on reverse engineering tools and methodologies for various platforms, languages, and binary formats.1112## Quick Reference by Target Type1314| Target | Primary Tools |15|--------|---------------|16| .NET assemblies | dnSpy, ILSpy, dotPeek |17| Java | JADX, JD-GUI |18| Shellcode | Blobrunner, jmp2it, scdbg, Cutter |19| Wasm | wabt, wasmdec, Jeb |20| GBA games | no$gba, mgba, GhidraGBA |21| Delphi | IDR, IDA-For-Delphi |22| Golang | IDAGolangHelper |23| Obfuscated (movfuscator) | demovfuscator |2425## .NET Decompilation & Debugging2627### Tool Selection2829- **dotPeek** (JetBrains): Best for examining .dll, .winmd, .exe files. Can save as Visual Studio project.30- **ILSpy**: Cross-platform, has VSCode extension. Good for quick decompilation.31- **dnSpy/dnSpyEx**: Use when you need to **decompile, modify, and recompile**. Right-click → "Modify Method" to edit functions.3233### Debugging .NET Applications3435To debug a .NET application with dnSpy:36371. **Modify assembly attributes** to enable debugging:38 ```csharp39 // Change from:40 [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]41 42 // To:43 [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default |44 DebuggableAttribute.DebuggingModes.DisableOptimizations |45 DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints |46 DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]47 ```48492. **Compile and save** the modified module via File → Save module...50513. **If running under IIS**, restart with:52 ```bash53 iisreset /noforce54 ```55564. **Attach debugger**:57 - Close all opened files in dnSpy58 - Debug Tab → Attach to Process...59 - Select `w3wp.exe` (IIS worker process)60 - Click Attach61625. **Load modules**:63 - Debug → Break All64 - Debug → Windows → Modules65 - Click any module → Open All Modules66 - Right-click in Assembly Explorer → Sort Assemblies6768### Adding Logging in dnSpy6970To make dnSpy log information to a file, insert this code:7172```csharp73using System.IO;74path = "C:\\inetpub\\temp\\MyTest2.txt";75File.AppendAllText(path, "Password: " + password + "\n");76```7778## Shellcode Analysis & Debugging7980### Tool Selection8182| Task | Tool |83|------|------|84| Allocate & debug | Blobrunner, jmp2it |85| Analyze functions | scdbg |86| Emulate & inspect | Cutter |87| Deobfuscate | scdbg, demovfuscator |88| Disassemble | CyberChef |8990### Debugging with Blobrunner91921. Run Blobrunner with your shellcode932. It will **allocate** the shellcode in memory and **stop** execution943. Note the **memory address** where shellcode was allocated954. **Attach debugger** (IDA or x64dbg) to the process965. Set **breakpoint** at the indicated address976. **Resume** execution to debug the shellcode9899### Debugging with jmp2it1001011. Run jmp2it with your shellcode1022. It allocates shellcode and starts an **eternal loop**1033. **Attach debugger** to the process1044. **Play start, wait 2-5 seconds, press stop**1055. You'll be in the eternal loop1066. **Jump to next instruction** (call to shellcode)1077. Now executing the shellcode108109### Using scdbg110111```bash112# Get basic info113scdbg.exe -f shellcode114115# Show analysis report at end116scdbg.exe -f shellcode -r117118# Enable interactive hooks (file/network) + report119scdbg.exe -f shellcode -i -r120121# Dump decoded shellcode122scdbg.exe -f shellcode -d123124# Find where shellcode starts125scdbg.exe -f shellcode /findsc126127# Start execution at specific offset128scdbg.exe -f shellcode /foff 0x0000004D129```130131**Key features:**132- Tells you which functions the shellcode uses133- Detects if shellcode is self-decoding in memory134- **Create Dump** option saves decoded shellcode if modified dynamically135- **Start offset** to begin at specific location136137### Using Cutter1381391. Open Cutter (GUI for radare2)1402. **Open File** or **Open Shellcode**1413. Set a **breakpoint** where you want to start emulation1424. Cutter will automatically start emulation from there1435. View stack in hex dump144145### Disassembling with CyberChef146147Upload shellcode file and use this recipe:148- To Hex (Space separator)149- Disassemble x86 (32-bit, Full x86 architecture)150151## DLL Debugging152153### Using x64dbg/x32dbg1541551. **Load rundll32.exe**:156 - 64-bit: `C:\Windows\System32\rundll32.exe`157 - 32-bit: `C:\Windows\SysWOW64\rundll32.exe`1581592. **Change Command Line** (File → Change Command Line):160 ```161 "C:\Windows\SysWOW64\rundll32.exe" "path\to\your.dll",FunctionName162 ```1631643. **Configure settings**:165 - Options → Settings166 - Select "DLL Entry"1671684. **Start execution** - debugger will stop at each DLL entry point1695. When stopped in your DLL's entry, search for breakpoints170171**Tip:** When execution stops, check the top of x64dbg window to see which code you're in.172173### Using IDA1741751. Load rundll32.exe1762. Select **Windbg** debugger1773. Select "**Suspend on library load/unload**"1784. Configure execution parameters with DLL path and function name1795. Start debugging - execution stops when each DLL loads180181## Wasm Decompilation182183### Online Tools184185- **wasm2wat**: https://webassembly.github.io/wabt/demo/wasm2wat/index.html186 - Decompiles from wasm (binary) to wat (text)187- **wat2wasm**: https://webassembly.github.io/wabt/demo/wat2wasm/188 - Compiles from wat to wasm189- **web-wasmdec**: https://wwwg.github.io/web-wasmdec/190 - Alternative decompiler191192### Software Tools193194- **Jeb**: https://www.pnfsoftware.com/jeb/demo195- **wasmdec**: https://github.com/wwwg/wasmdec196197## Platform-Specific Tools198199### Rust Binaries2002011. Search for functions containing `::main`2022. Identify the main function (often obvious from binary name)2033. Search function names online to learn about inputs/outputs204205### Delphi Binaries2062071. Use **IDR**: https://github.com/crypto2020/IDR2082. Use **IDA-For-Delphi** plugin: https://github.com/Coldzer0/IDA-For-Delphi2093. In IDA, press **ALT+F7** to import Python plugin2104. Select the plugin and start debugging2115. Press Start button (green or F9) - breakpoint hits at real code start2126. Pressing buttons in GUI will stop debugger in executed function213214### Golang Binaries2152161. Use **IDAGolangHelper** plugin: https://github.com/sibears/IDAGolangHelper2172. In IDA, press **ALT+F7** to import Python plugin2183. Select the plugin to resolve function names219220### GBA Games221222**Tools:**223- **no$gba** (debug version): GUI debugger with interface224- **mgba**: CLI debugger225- **gba-ghidra-loader**: Ghidra plugin226- **GhidraGBA**: Ghidra plugin227228**Key Input Values:**229```230A = 1231B = 2232SELECT = 4233START = 8234RIGHT = 16235LEFT = 32236UP = 64237DOWN = 128238R = 256239L = 512240```241242**Common Pattern:**243- Address `0x4000130` contains `KEYINPUT` function244- Look for how program treats user input245- Check for button value comparisons in decompiled code246247### Game Boy248249Reference: https://www.youtube.com/watch?v=VVbRe7wr3G4250251## Obfuscation Handling252253### Movfuscator254255**What it does:** Modifies all instructions to `mov` and uses interrupts to change execution flow.256257**Deobfuscation:**2582591. Try **demovfuscator**: https://github.com/kirschju/demovfuscator2602612. **Install dependencies:**262 ```bash263 apt-get install libcapstone-dev264 apt-get install libz3-dev265 ```2662673. **Install Keystone:**268 ```bash269 apt-get install cmake270 mkdir build && cd build271 ../make-share.sh272 make install273 ```2742754. **CTF workaround:** https://dustri.org/b/defeating-the-recons-movfuscator-crackme.html276277## GUI Apps & Games278279- **Cheat Engine**: Find and modify values in running game memory280- **PiNCE**: GDB front-end focused on games, works for any reverse engineering281- **Decompiler Explorer** (dogbolt.org): Compare decompiler outputs on small executables282283## Compiled Python284285To extract Python code from ELF/EXE compiled binaries, use standard .pyc extraction methods.286287## Learning Resources288289- **Z0F Course**: https://github.com/0xZ0F/Z0FCourse_ReverseEngineering290- **ABD (Binary Deobfuscation)**: https://github.com/malrev/ABD291292## Workflow Recommendations293294### Before Starting2952961. **Identify the target type** (language, platform, format)2972. **Select appropriate tools** from the tables above2983. **Check for obfuscation** (movfuscator, custom packers)2994. **Set up debugging environment** (disable optimizations if needed)300301### During Analysis3023031. **Start with static analysis** (decompile, disassemble)3042. **Move to dynamic analysis** (debug, trace execution)3053. **Document findings** (function names, key addresses, logic flow)3064. **Test hypotheses** (modify code, recompile, verify)307308### Common Pitfalls309310- **Optimizations prevent breakpoints**: Modify assembly attributes for .NET311- **Shellcode self-decoding**: Use scdbg to dump decoded version312- **Missing function names**: Use language-specific IDA plugins313- **Wrong architecture**: Verify 32-bit vs 64-bit before loading314315## Quick Commands Reference316317```bash318# .NET IIS restart319iisreset /noforce320321# scdbg analysis322scdbg.exe -f shellcode -r323scdbg.exe -f shellcode -d324325# Install demovfuscator deps326apt-get install libcapstone-dev libz3-dev cmake327```328329## When to Use This Skill330331Use this skill when you need to:332- Decompile or analyze compiled binaries333- Debug shellcode or malicious payloads334- Reverse engineer .NET, Java, Golang, Delphi, or Rust applications335- Work with Wasm, GBA games, or other specialized formats336- Handle obfuscated binaries337- Select appropriate tools for a reverse engineering task338- Understand debugging workflows for different platforms