foxdec-0.1.0.0: Formally Verified x86-64 Decompilation
Safe HaskellNone
LanguageHaskell2010

Analysis.FunctionNames

Description

Contains function relating to control flow, including functions for resolving the targets of jumps and calls.

Synopsis

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 #

Arguments

:: 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.

function_name_of_entry Source #

Arguments

:: Context

The context

-> Int

The entry address

-> String 

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 #

Arguments

:: 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.