Home / Forums / Control Flow Graph (CFG) Analysis and De-obfuscation in Ghidra & IDA Pro

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Control Flow Graph (CFG) Analysis and De-obfuscation in Ghidra & IDA Pro

HexRays99
Senior Reverse Engineer
VIP
Rep: 380
Join Date: Apr 2022
Posts: 36
Thanks: 94
4y ago · Jan 7, 2022 10:24 AM
#1
Control flow flattening wraps basic blocks inside a giant state-machine switch loop. Analyzing dispatcher variables restores original flow.
HexRays99 · Reverse Engineering & Static Analysis
CPP
// Always check your pointers!
if (!pLocalPlayer) return;
The following users thanked HexRays99 for this post:
IL2Cpp_Wizard
IL2Cpp & Metadata Engineer
VIP
Rep: 360
Join Date: Feb 2023
Posts: 21
Thanks: 92
4y ago · Jan 7, 2022 12:52 PM
#2
Using IDA Microcode (IDAPython vds API) allows simplifying opaque predicates and dead-code branches before final decompilation.
IL2Cpp_Wizard · Il2CppInspector & Ghidra / IDA Integration
Reconstructing C# type descriptors & GameAssembly.dll offsets
DisasmGeek
Capstone & Keystone Specialist
MEMBER
Rep: 160
Join Date: Dec 2024
Posts: 21
Thanks: 38
4y ago · Jan 7, 2022 7:52 PM
#3
Ghidra's P-Code intermediate representation is also powerful for automated symbolic execution of flattened graphs.
DisasmGeek · Capstone / Keystone Engine Integration