Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SectionsInfo = SectionsInfo {
- si_sections :: [(String, String, Word64, Word64)]
- si_min_address :: Word64
- si_max_address :: Word64
- data Symbol
- data SymbolTable = SymbolTable (IntMap Symbol)
- is_internal_symbol :: Symbol -> Bool
- is_external_symbol :: Symbol -> Bool
- symbol_to_name :: Symbol -> Maybe String
- data Relocation = Relocation Word64 Word64
- class BinaryClass a where
- binary_read_ro_data :: a -> Word64 -> Int -> Maybe [Word8]
- binary_read_data :: a -> Word64 -> Int -> Maybe [Word8]
- binary_get_sections_info :: a -> SectionsInfo
- binary_get_symbols :: a -> SymbolTable
- binary_get_relocations :: a -> Set Relocation
- binary_pp :: a -> String
- binary_entry :: a -> Word64
- binary_text_section_size :: a -> Int
- data Binary = forall b.BinaryClass b => Binary b
Documentation
data SectionsInfo Source #
Information on the sections in the binary
SectionsInfo | |
|
Instances
An address a0 can have a symbol.
Relocated_Function: E.g: 0xcfe0 --> malloc Means that reading 8 bytes from address 0xcfe0 procudes a pointer to malloc. Thus an instruction: "CALL qword ptr [0xcfe0]" can be seen as "CALL malloc".
Relocated_Object: E.g.: 0xd0a8 --> stdout Means that "mov rdi,QWORD PTR [0xd0a8]" can be seen as "mov rdi, QWORD PTR [stdout]"
Relocated_Address: E.g.: 0xaaa -> 0xbbbb Means that reading 8 bytes from address 0xaaaa produces the value 0xbbbb
Relocated_Function String | Address a0 is a pointer to memory storing the entry of an external function |
Relocated_Label String | Address a0 can be replaced by the string, e.g., "stdout" or "optind" |
Internal_Label String | Address a0 can be replaced by the string. |
Instances
Eq Symbol Source # | |
Show Symbol Source # | |
Generic Symbol Source # | |
Serialize Symbol Source # | |
NFData Symbol Source # | |
Defined in Analysis.Context | |
type Rep Symbol Source # | |
Defined in Generic.Binary type Rep Symbol = D1 ('MetaData "Symbol" "Generic.Binary" "foxdec-0.1.0.0-F8J4QQ8bsQELJyhc4kJb0m" 'False) (C1 ('MetaCons "Relocated_Function" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Relocated_Label" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Internal_Label" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))) |
data SymbolTable Source #
Instances
is_internal_symbol :: Symbol -> Bool Source #
Is the symbol an internal label?
is_external_symbol :: Symbol -> Bool Source #
Is the symbol an external label?
data Relocation Source #
Relocation Word64 Word64 | 8: At address a0, address a1 has been written, i.e., qword ptr[a0] == a1 |
Instances
class BinaryClass a where Source #
binary_read_ro_data :: a -> Word64 -> Int -> Maybe [Word8] Source #
binary_read_data :: a -> Word64 -> Int -> Maybe [Word8] Source #
binary_get_sections_info :: a -> SectionsInfo Source #
binary_get_symbols :: a -> SymbolTable Source #
binary_get_relocations :: a -> Set Relocation Source #
binary_pp :: a -> String Source #
binary_entry :: a -> Word64 Source #
binary_text_section_size :: a -> Int Source #
Instances
BinaryClass Elf Source # | |
Defined in Instantiation.BinaryElf binary_read_ro_data :: Elf -> Word64 -> Int -> Maybe [Word8] Source # binary_read_data :: Elf -> Word64 -> Int -> Maybe [Word8] Source # binary_get_sections_info :: Elf -> SectionsInfo Source # binary_get_symbols :: Elf -> SymbolTable Source # binary_get_relocations :: Elf -> Set Relocation Source # binary_pp :: Elf -> String Source # binary_entry :: Elf -> Word64 Source # binary_text_section_size :: Elf -> Int Source # | |
BinaryClass Binary Source # | |
Defined in Generic.Binary binary_read_ro_data :: Binary -> Word64 -> Int -> Maybe [Word8] Source # binary_read_data :: Binary -> Word64 -> Int -> Maybe [Word8] Source # binary_get_sections_info :: Binary -> SectionsInfo Source # binary_get_symbols :: Binary -> SymbolTable Source # binary_get_relocations :: Binary -> Set Relocation Source # binary_pp :: Binary -> String Source # binary_entry :: Binary -> Word64 Source # binary_text_section_size :: Binary -> Int Source # |
forall b.BinaryClass b => Binary b |
Instances
BinaryClass Binary Source # | |
Defined in Generic.Binary binary_read_ro_data :: Binary -> Word64 -> Int -> Maybe [Word8] Source # binary_read_data :: Binary -> Word64 -> Int -> Maybe [Word8] Source # binary_get_sections_info :: Binary -> SectionsInfo Source # binary_get_symbols :: Binary -> SymbolTable Source # binary_get_relocations :: Binary -> Set Relocation Source # binary_pp :: Binary -> String Source # binary_entry :: Binary -> Word64 Source # binary_text_section_size :: Binary -> Int Source # |