foxdec-0.1.0.0: Formally Verified x86-64 Decompilation
Safe HaskellSafe-Inferred
LanguageHaskell2010

OutputGeneration.NASM.NASM

Description

 
Synopsis

Documentation

data NASM Source #

NASM contains external symbols, sections, and a footer

Instances

Instances details
Generic NASM Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM :: Type -> Type #

Methods

from :: NASM -> Rep NASM x #

to :: Rep NASM x -> NASM #

Serialize NASM Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Methods

put :: Putter NASM #

get :: Get NASM #

type Rep NASM Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM = D1 ('MetaData "NASM" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nasm_externals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set String)) :*: S1 ('MetaSel ('Just "nasm_globals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set String))) :*: (S1 ('MetaSel ('Just "nasm_sections") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NASM_Section]) :*: S1 ('MetaSel ('Just "nasm_footer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [String]))))

data NASM_Label Source #

A NASM label is either a string, or a macro. The latter is used when referring to addresses within data sections. For example:

Macro "" ".data" 0x4000 0x23

refers to segment "", and the section ".data" that starts at immediate address 0x4000. So the real adress was 0x4023.

Constructors

Label Word64 String

Normal label

Macro String String Word64 Word64

Macro into data section (segment, section, a0, offset)

Instances

Instances details
Generic NASM_Label Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_Label :: Type -> Type #

Show NASM_Label Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_Label Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Eq NASM_Label Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Ord NASM_Label Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Label Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

data NASM_Section Source #

A NASM section is either a NASM text section or NASM data section

Instances

Instances details
Generic NASM_Section Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_Section :: Type -> Type #

Serialize NASM_Section Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Section Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Section = D1 ('MetaData "NASM_Section" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_Section_Text" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NASM_TextSection)) :+: C1 ('MetaCons "NASM_Section_Data" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NASM_DataSection])))

type Annot = [(Word64, NASM_Label, Word64)] Source #

An annotation consists of an address that is being symbolized to a label and an offset. The offset will often be 0. For example: 0x1016 --> L1000_2 0x4028 --> L_.bss_0x4020 + 0x8 Annotations translate to NASM comments, and have no effect on the actual NASM itself.

data NASM_TextSection Source #

A NASM text section contains a name and an **ordered** list of basic blocks. Each basic block has an ID and a list of lines.

Constructors

NASM_TextSection 

Fields

Instances

Instances details
Generic NASM_TextSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_TextSection :: Type -> Type #

Show NASM_TextSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_TextSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_TextSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_TextSection = D1 ('MetaData "NASM_TextSection" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_TextSection" 'PrefixI 'True) (S1 ('MetaSel ('Just "nasm_function_name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Just "nasm_blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Int, [NASM_Line])]) :*: S1 ('MetaSel ('Just "nasm_cfg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (IntMap IntSet)))))

data NASM_Line Source #

A NASM line is either a comment, an instruction or a label

Constructors

NASM_Comment Int String

A comment with an indentation level (number of spaces)

NASM_Line NASM_Instruction

An instruction with an annotation

NASM_Label NASM_Label

A label

Instances

Instances details
Generic NASM_Line Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_Line :: Type -> Type #

Show NASM_Line Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_Line Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Eq NASM_Line Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Line Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

data NASM_Instruction Source #

An instruction consists of a prefix, an opcode, a list of operands, a comment (possibly empty) and an annotation (possibly empty).

Instances

Instances details
Generic NASM_Instruction Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_Instruction :: Type -> Type #

Show NASM_Instruction Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_Instruction Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Eq NASM_Instruction Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Instruction Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Instruction = D1 ('MetaData "NASM_Instruction" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_Instruction" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nasm_prefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Prefix)) :*: S1 ('MetaSel ('Just "nasm_mnemonic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Opcode))) :*: (S1 ('MetaSel ('Just "nasm_operands") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NASM_Operand]) :*: (S1 ('MetaSel ('Just "nasm_comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "nasm_annot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Annot)))))

type NASM_SizeDir = (Int, Bool) Source #

A size directive for a memory operand in bytes. For example (4,True) is the size directive for a 4-byte memory operand. It can be False to indicate that the operand should not be rendered (e.g, in case of an LEA instruction).

data NASM_Address Source #

An address can either be a computation or some symbol.

Instances

Instances details
Generic NASM_Address Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_Address :: Type -> Type #

Show NASM_Address Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_Address Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Eq NASM_Address Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Address Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

data NASM_Address_Computation Source #

An address computation within an operand. The computation is: segment + [base + index*scale + disp]

Instances

Instances details
Generic NASM_Address_Computation Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_Address_Computation :: Type -> Type #

Show NASM_Address_Computation Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_Address_Computation Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Eq NASM_Address_Computation Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Address_Computation Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_Address_Computation = D1 ('MetaData "NASM_Address_Computation" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_Address_Computation" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nasm_segment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Register)) :*: S1 ('MetaSel ('Just "nasm_index") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Register))) :*: (S1 ('MetaSel ('Just "nasm_scale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "nasm_base") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Register)) :*: S1 ('MetaSel ('Just "nasm_displace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Word64))))))

data NASM_DataEntry Source #

A data section consists of a list of data section entries. Each DataEntry stores its address and a value.

Constructors

DataEntry_Byte Word64 Word8

A single byte

DataEntry_String Word64 [Word8]

A string of characters (Word8)

DataEntry_Pointer Word64 (NASM_Address, Annot)

A pointer (a label or external symbol)

DataEntry_BSS Int

A BSS section with a given size in bytes

Instances

Instances details
Generic NASM_DataEntry Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_DataEntry :: Type -> Type #

Serialize NASM_DataEntry Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_DataEntry Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

data NASM_DataSection Source #

A data section then consists of:

Constructors

NASM_DataSection 

Fields

Instances

Instances details
Generic NASM_DataSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Associated Types

type Rep NASM_DataSection :: Type -> Type #

Show NASM_DataSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

Serialize NASM_DataSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_DataSection Source # 
Instance details

Defined in OutputGeneration.NASM.NASM

type Rep NASM_DataSection = D1 ('MetaData "NASM_DataSection" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_DataSection" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nasm_data_section") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (String, String, Word64)) :*: S1 ('MetaSel ('Just "nasm_data_section_align") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "nasm_data_section_labels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (IntMap (Set NASM_Label))) :*: S1 ('MetaSel ('Just "nasm_data_section_data") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NASM_DataEntry]))))