Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/RolfRolles/HexRaysDeob
/ functions
Functions
106 in github.com/RolfRolles/HexRaysDeob
⨍
Functions
106
◇
Types & classes
21
↓ 187 callers
Function
mopt_t_to_string
Produce a string for an operand type
HexRaysUtil.cpp:5
↓ 21 callers
Function
equal_mops_ignore_size
-------------------------------------------------------------------------- compare operands but ignore the sizes
HexRaysUtil.cpp:134
↓ 13 callers
Function
debugmsg
Unflattener.cpp:16
↓ 9 callers
Function
debugmsg
CFFlattenInfo.cpp:12
↓ 8 callers
Function
ExtractNumAndNonNum
For microinstructions with two or more operands (in l and r), check to see if one of them is numeric and the other one isn't. If this is the case, ret
PatternDeobfuscateUtil.cpp:12
↓ 7 callers
Function
TunnelThroughAnd1
The obfuscation techniques upon conditional operations have "&1" miscellaneously present or not present within them. Writing pattern-matching rules fo
PatternDeobfuscateUtil.cpp:85
↓ 7 callers
Function
mcode_t_to_string
Produce a brief representation of a microinstruction, including the types of its operands.
HexRaysUtil.cpp:31
↓ 6 callers
Function
MicroMaturityToString
Produce a string describing the microcode maturity level.
HexRaysUtil.cpp:112
↓ 5 callers
Function
ExtractLogicallyNegatedTerm
The obfuscator implements boolean inversion via "x ^ 1". Hex-Rays, or one of our other deobfuscation rules, could also convert these to m_lnot instruc
PatternDeobfuscateUtil.cpp:127
↓ 4 callers
Function
debugmsg
DefUtil.cpp:7
↓ 3 callers
Function
ExtractByOpcodeType
For microinstructions with two or more operands (in l and r), check to see if one of them is a mop_d (result of another microinstruction), where the p
PatternDeobfuscateUtil.cpp:51
↓ 3 callers
Function
InsertOp
Put an mop_t into an mlist_t. The op must be either a register or a stack variable.
DefUtil.cpp:19
↓ 3 callers
Function
debugmsg
TargetUtil.cpp:5
↓ 2 callers
Function
AppendGotoOntoNonEmptyBlock
Append a goto onto a non-empty block, which is assumed not to already have a goto at the end of it.
TargetUtil.cpp:17
↓ 2 callers
Method
Display
MicrocodeExplorer.cpp:271
↓ 2 callers
Function
DumpMBAToFile
Unflattener.cpp:26
↓ 2 callers
Function
ExtractJccParts
For a block that ends in a conditional jump, extract the integer block numbers for the "taken" and "not taken" cases.
TargetUtil.cpp:192
↓ 2 callers
Method
Insert
Insert a micro-operand into one of the two sets above. Remove duplicates -- meaning, if the operand we're trying to insert is already in the set, remo
PatternDeobfuscateUtil.cpp:250
↓ 2 callers
Method
Replace
Plan to replace an edge from src->oldDest to src->newDest
TargetUtil.cpp:257
↓ 1 callers
Method
Apply
Apply the planned changes to the graph
TargetUtil.cpp:264
↓ 1 callers
Function
AreConditionsOpposite
This function checks whether two conditional terms are logically opposite. For example, "eax <s 1" and "eax >=s 1" would be considered logically oppos
PatternDeobfuscateUtil.cpp:198
↓ 1 callers
Function
AskDesiredMaturity
MicrocodeExplorer.cpp:467
↓ 1 callers
Method
Build
MicrocodeExplorer.cpp:85
↓ 1 callers
Method
ChangeGoto
Either change the destination of an existing goto, or add a new goto onto the end of the block to the destination. Also, plan to modify the graph stru
TargetUtil.cpp:305
↓ 1 callers
Function
ChangeSingleTarget
For a block with a single successor, change its target from some old block to a new block. This is only on the graph level, not in terms of gotos.
TargetUtil.cpp:38
↓ 1 callers
Method
Clear
Unflattener.hpp:13
↓ 1 callers
Function
ComputeDominators
Compute dominator information for the function.
CFFlattenInfo.cpp:302
↓ 1 callers
Function
DeleteBlock
Delete all instructions on a block, and remove its outgoing edges. Blocks will be deleted if we have removed edges in the graph such that the block is
TargetUtil.cpp:338
↓ 1 callers
Method
FindBlockByKey
Convenience function to look up a block number by its key. This way, we can write the iterator-end check once, so clients don't have to do it.
CFFlattenInfo.cpp:382
↓ 1 callers
Function
FindForwardNumericDef
This function finds a numeric definition by searching in the forward direction.
DefUtil.cpp:185
↓ 1 callers
Function
FindForwardStackVarDef
This function is just a thin wrapper around FindForwardNumericDef, which also inserts the mov into the "chain" argument.
DefUtil.cpp:215
↓ 1 callers
Function
FindNumericDefBackwards
This function has way too many arguments. Basically, it's a wrapper around my_find_def_backwards from above. It is extended in the following ways: If
DefUtil.cpp:84
↓ 1 callers
Function
FixCallsToAllocaProbe
Find all calls to __alloca_probe, extract the parameters, and update the stack pointer differentials.
AllocaFixer.cpp:82
↓ 1 callers
Method
GetAssignedAndComparisonVariables
This function computes all of the preliminary information needed for unflattening.
CFFlattenInfo.cpp:391
↓ 1 callers
Function
GetFirstBlock
This function finds the "first" block immediately before the control flow flattening dispatcher begins. The logic is simple; start at the beginning of
CFFlattenInfo.cpp:141
↓ 1 callers
Method
Optimize
This function just inspects the instruction and calls the pattern-replacement functions above to perform deobfuscation.
PatternDeobfuscate.cpp:562
↓ 1 callers
Function
PruneUnreachable
The goto-to-goto elimination and unflattening phases remove edges in the control flow graph represented in the mbl_array_t *. As a result, certain blo
TargetUtil.cpp:379
↓ 1 callers
Function
RemoveSingleGotos
This function eliminates transfers to blocks with a single goto on them. Either if a given block has a goto at the end of it, where the destination is
TargetUtil.cpp:71
↓ 1 callers
Method
ShouldBlacklist
This method determines whether a given function is likely obfuscated. It does this by ensuring that: 1) Some minimum number of comparisons are made ag
CFFlattenInfo.cpp:27
↓ 1 callers
Function
ShowMicrocodeExplorer
MicrocodeExplorer.cpp:485
↓ 1 callers
Method
Simplify
Top-level functionality to simplify an XOR microinstruction. Insert the instruction, then see if any simplifications could be performed. If so, remove
PatternDeobfuscateUtil.cpp:342
↓ 1 callers
Function
SplitMblocksByJccEnding
For a block with two predecessors, figure out if one of them ends in a jcc instruction. Return pointers to the block that ends in a jcc and the one th
TargetUtil.cpp:217
↓ 1 callers
Function
is_call_block
Reverse engineered from hexrays.dll (though it's obvious). Basically: does this block end in a call instruction?
TargetUtil.cpp:55
↓ 1 callers
Function
my_find_def_backwards
Ilfak sent me this function in response to a similar support request. It walks backwards through a block, instruction-by-instruction, looking at what
DefUtil.cpp:44
↓ 1 callers
Function
my_find_def_forwards
This is a nearly identical version of the function above, except it works in the forward direction rather than backwards.
DefUtil.cpp:58
Method
Add
Plan to add an edge from src->dest
TargetUtil.cpp:251
Method
AddEdge
MicrocodeExplorer.cpp:92
Method
AddLine
MicrocodeExplorer.cpp:39
Method
AddLine
MicrocodeExplorer.cpp:49
Method
Blah
PatternDeobfuscate.cpp:634
Method
CFFlattenInfo
CFFlattenInfo.hpp:52
Method
CFUnflattener
Unflattener.hpp:20
Method
Clear
TargetUtil.hpp:21
Method
Clear
MicrocodeExplorer.cpp:76
Method
Clear
CFFlattenInfo.hpp:27
Method
DidSimplify
Were any cancellations performed?
PatternDeobfuscateUtil.cpp:333
Method
Display
MicrocodeExplorer.cpp:182
Method
FindBlockTargetOrLastCopy
This function attempts to locate the numeric assignment to a given variable "what" starting from the end of the block "mb". It follows definitions bac
Unflattener.cpp:82
Method
FindNonCommonConstant
Compare two sets of mop_t * (number values) element-by-element. There should be one value in the larger set that's not in the smaller set. Find and re
PatternDeobfuscate.cpp:399
Method
GetDominatedClusterHead
Find the block that dominates iDispPred, and which is one of the targets of the control flow flattening switch.
Unflattener.cpp:40
Method
GetIncrBlockNum
MicrocodeExplorer.cpp:101
Method
HandleTwoPreds
This function is used for unflattening constructs that have two successors, such as if statements. Given a block that assigns to the assignment variab
Unflattener.cpp:151
Method
HandoffVarFinder
CFFlattenInfo.cpp:215
Method
Insert
MicrocodeExplorer.cpp:106
Method
InsertConst
PatternDeobfuscateUtil.cpp:287
Method
InsertNonConst
Wrapper to insert constant and non-constant terms
PatternDeobfuscateUtil.cpp:281
Method
JZCollector
CFFlattenInfo.cpp:85
Method
JZInfo
CFFlattenInfo.hpp:6
Method
JZMapper
CFFlattenInfo.cpp:263
Method
MicrocodeGraphContainer
MicrocodeExplorer.cpp:270
Method
MicrocodeInstructionGraphContainer
MicrocodeExplorer.cpp:180
Method
NonConstSetsMatch
Compare two sets of mop_t * element-by-element. Return true if they match.
PatternDeobfuscate.cpp:371
Method
ProcessErasures
Erase the now-superfluous chain of instructions that were used to copy a numeric value into the assignment variable.
Unflattener.cpp:216
Method
Remove
Plan to remove an edge from src->dest
TargetUtil.cpp:245
Method
XorSimplifier
PatternDeobfuscateUtil.hpp:15
Function
ct_keyboard
MicrocodeExplorer.cpp:349
Method
func
This is the top-level un-flattening function for an entire graph. Hex-Rays calls this function since we register our CFUnflattener class as a block op
Unflattener.cpp:250
Method
func
Callback function. Do pattern-deobfuscation.
PatternDeobfuscate.cpp:606
Function
init
--------------------------------------------------------------------------
main.cpp:29
Method
mblock_dumper_t
MicrocodeExplorer.cpp:48
Method
mblock_qstring_dumper_t
MicrocodeExplorer.cpp:38
Method
mblock_virtual_dumper_t
MicrocodeExplorer.cpp:12
Function
mgr_callback
MicrocodeExplorer.cpp:296
Function
migr_callback
MicrocodeExplorer.cpp:207
Method
pat_AndXor
Matches patterns of the form: (a^b^c^d) & (a^b^c^d^e) => (a^b^c^d) & ~e, where e is numeric The terms don't necessarily have to be in the same order;
PatternDeobfuscate.cpp:437
Method
pat_BnotOrBnotConst
Replaces terms of the form ~(~x | n), where n is a number, with x & ~n.
PatternDeobfuscate.cpp:529
Method
pat_IsSubBy1
One of the obfuscation patterns involves a subtraction by 1. In the assembly code, this is implemented by something like: add eax, 2 add eax, ecx ; o
PatternDeobfuscate.cpp:72
Method
pat_LnotOrLnotLnot
Replaces conditionals of the form !(!c1 || !c2) with (c1 && c2).
PatternDeobfuscate.cpp:502
Method
pat_LogicAnd1
This function simplifies microinstruction patterns that look like either: (x & 1) | (y & 1) ==> (x | y) & 1 or: (x & 1) ^ (y & 1) ==> (x ^ y) & 1
PatternDeobfuscate.cpp:17
Method
pat_MulSub
This function performs the following pattern-substitution: (x * (x-1)) & 1 ==> 0
PatternDeobfuscate.cpp:103
Method
pat_OrAndNot
Replace patterns of the form (x&c)|(~x&d) (when c and d are numbers such that c == ~d) with x^d.
PatternDeobfuscate.cpp:262
Method
pat_OrNegatedSameCondition
This pattern replaces microcode of the form (x|!x), where x is a conditional, and !x is its syntactically-negated version, with 1.
PatternDeobfuscate.cpp:226
Method
pat_OrViaXorAnd
This function looks tries to replace patterns of the form either: (x&y)|(x^y) ==> x|y or: (x&y)|(y^x) ==> x|y
PatternDeobfuscate.cpp:182
Method
pat_XorChain
Remove XOR chains with common terms. E.g. x^5^y^6^5^x ==> y^6. This uses the XorSimplifier class from PatternDeobfuscateUtil.
PatternDeobfuscate.cpp:346
Function
run
--------------------------------------------------------------------------
main.cpp:66
Method
sample_info_t
MicrocodeExplorer.cpp:61
Function
term
--------------------------------------------------------------------------
main.cpp:45
Function
ui_callback
MicrocodeExplorer.cpp:436
Method
visit_minsn
CFFlattenInfo.cpp:87
Method
visit_minsn
CFFlattenInfo.cpp:184
next →
1–100 of 106, ranked by callers