Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains function relating to control flow, including functions for resolving the targets of jumps and calls.
Synopsis
- address_has_external_symbol :: Integral a => Context -> a -> Bool
- operand_static_resolve :: Context -> Instruction -> Operand -> ResolvedJumpTarget
- static_resolve_rip_expr :: Context -> Instruction -> (Word64 -> Word64) -> Int -> ResolvedJumpTarget
- function_name_of_entry :: Context -> Int -> String
- function_name_of_instruction :: Context -> Instruction -> String
Documentation
address_has_external_symbol :: Integral a => Context -> a -> Bool Source #
Returns true iff a symbol is associated with the address.
operand_static_resolve Source #
:: Context | The context |
-> Instruction | The instruction |
-> Operand | The operand of the instruction to be resolved |
-> ResolvedJumpTarget |
many operands can statically be resolved, even though technically they are indirect (relative to RIP). Examples:
10005464e: call RIP + 1751660
resolves to an immediate jump target by resolving the RIP-relative addressing.
10005464e: call qword ptr [RIP + 1751660]
read from address 1002000c0, but address has a symbol associated to it. This function call will resolve to an external function.
static_resolve_rip_expr :: Context -> Instruction -> (Word64 -> Word64) -> Int -> ResolvedJumpTarget Source #
function_name_of_entry Source #
Tries to retrieve a function name with an entry address.
If the entry matches a known symbol, return that.
Otherwise, simply return the entry address itself in hexadecimal notation.
However, there is one exception:
if the first instruction at the entry address immediately jumps to an external function,
return the name of that external function instead. This happens in a .got
section.
function_name_of_instruction Source #
:: Context | The context |
-> Instruction | The instruction |
-> String |
Tries to retrieve a function name for a call
-instruction (see
).function_name_of_entry
Returns the empty string if the given instruction is not a call or a jump.