mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Correct typos and spacing in decompiler documentation
This commit is contained in:
parent
c905c203f0
commit
b940cdcc4f
2 changed files with 37 additions and 37 deletions
|
@ -27,7 +27,7 @@
|
||||||
implement these models provides the quickest inroad into
|
implement these models provides the quickest inroad into
|
||||||
obtaining an overall understanding of the code.
|
obtaining an overall understanding of the code.
|
||||||
|
|
||||||
We list all these fundemental classes here, loosely grouped
|
We list all these fundamental classes here, loosely grouped
|
||||||
as follows. There is one set of classes that describe the
|
as follows. There is one set of classes that describe the
|
||||||
\e Syntax \e Trees, which are built up from the original p-code,
|
\e Syntax \e Trees, which are built up from the original p-code,
|
||||||
and transformed during the decompiler's simplification process.
|
and transformed during the decompiler's simplification process.
|
||||||
|
@ -43,18 +43,18 @@
|
||||||
- AddrSpace
|
- AddrSpace
|
||||||
- A place within the reverse engineering model where data
|
- A place within the reverse engineering model where data
|
||||||
can be stored. The typical address spaces are \b ram,
|
can be stored. The typical address spaces are \b ram,
|
||||||
modeling the main databus of a processor, and \b register,
|
modeling the main databus of a processor, and \b register,
|
||||||
modeling a processors on board registers. Data is stored a
|
modeling a processor's on board registers. Data is stored a
|
||||||
byte at a time at \b offsets within the AddrSpace.
|
byte at a time at \b offsets within the AddrSpace.
|
||||||
.
|
.
|
||||||
- Address
|
- Address
|
||||||
- An AddrSpace and an offset within the space forms the
|
- An AddrSpace and an offset within the space forms the
|
||||||
Address of the byte at that offset.
|
Address of the byte at that offset.
|
||||||
.
|
.
|
||||||
- Varnode
|
- Varnode
|
||||||
- A contiguous set of bytes, given by an Address and a size,
|
- A contiguous set of bytes, given by an Address and a size,
|
||||||
encoding a single value in the model. In terms of SSA
|
encoding a single value in the model. In terms of SSA
|
||||||
syntax tree, a Varnode is also a node in the tree.
|
syntax tree, a Varnode is also a node in the tree.
|
||||||
.
|
.
|
||||||
- SeqNum
|
- SeqNum
|
||||||
- A \e sequence \e number that extends Address for distinguishing PcodeOps
|
- A \e sequence \e number that extends Address for distinguishing PcodeOps
|
||||||
|
@ -161,14 +161,14 @@
|
||||||
and local scope.
|
and local scope.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
string & getName(); // get name of function
|
string & getName(); // get name of function
|
||||||
Address & getAddress(); // get Address of function's entry point
|
Address & getAddress(); // get Address of function's entry point
|
||||||
int4 numCalls(); // number of subfunctions called by this function
|
int4 numCalls(); // number of subfunctions called by this function
|
||||||
FuncCallSpecs *getCallSpecs(int4 i); // get specs for one of the subfunctions
|
FuncCallSpecs *getCallSpecs(int4 i); // get specs for one of the subfunctions
|
||||||
BlockGraph & getBasicBlocks(); // get the collection of basic blocks
|
BlockGraph & getBasicBlocks(); // get the collection of basic blocks
|
||||||
|
|
||||||
iterator beginLoc(Address &); // Search for Varnodes in tree
|
iterator beginLoc(Address &); // Search for Varnodes in tree
|
||||||
iterator beginLoc(int4,Address &); // based on the Varnode's address
|
iterator beginLoc(int4,Address &); // based on the Varnode's address
|
||||||
iterator beginLoc(int4,Address &,Address &,uintm);
|
iterator beginLoc(int4,Address &,Address &,uintm);
|
||||||
iterator beginDef(uint4,Address &); // Search for Varnode based on the
|
iterator beginDef(uint4,Address &); // Search for Varnode based on the
|
||||||
// address of its defining operation
|
// address of its defining operation
|
||||||
|
@ -221,14 +221,14 @@
|
||||||
array, and structure qualifiers.
|
array, and structure qualifiers.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
class TypePointer : public Datatype { // pointer to (some other type)
|
class TypePointer : public Datatype { // pointer to (some other type)
|
||||||
Datatype *getBase(); // get Datatype being pointed to
|
Datatype *getBase(); // get Datatype being pointed to
|
||||||
};
|
};
|
||||||
class TypeArray : public Datatype { // array of (some other type)
|
class TypeArray : public Datatype { // array of (some other type)
|
||||||
Datatype *getBase(); // get Datatype of array element
|
Datatype *getBase(); // get Datatype of array element
|
||||||
};
|
};
|
||||||
class TypeStruct : public Datatype { // structure with fields of (some other types)
|
class TypeStruct : public Datatype { // structure with fields of (some other types)
|
||||||
TypeField *getField(int4,int4,int4 *); // get Datatype of a field
|
TypeField *getField(int4,int4,int4 *); // get Datatype of a field
|
||||||
};
|
};
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
|
@ -237,12 +237,12 @@
|
||||||
This is a container for Datatypes.
|
This is a container for Datatypes.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
Datatype *findByName(string &); // find a Datatype by name
|
Datatype *findByName(string &); // find a Datatype by name
|
||||||
Datatype *getTypeVoid(); // retrieve common types
|
Datatype *getTypeVoid(); // retrieve common types
|
||||||
Datatype *getTypeChar();
|
Datatype *getTypeChar();
|
||||||
Datatype *getBase(int4 size,type_metatype);
|
Datatype *getBase(int4 size,type_metatype);
|
||||||
Datatype *getTypePointer(int4,Datatype *,uint4); // get a pointer to another type
|
Datatype *getTypePointer(int4,Datatype *,uint4); // get a pointer to another type
|
||||||
Datatype *getTypeArray(int4,Datatype *); // get an array of another type
|
Datatype *getTypeArray(int4,Datatype *); // get an array of another type
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\section classhighvariable HighVariable
|
\section classhighvariable HighVariable
|
||||||
|
@ -257,7 +257,7 @@
|
||||||
\code
|
\code
|
||||||
int4 numInstances(); // get number of different Varnodes associated
|
int4 numInstances(); // get number of different Varnodes associated
|
||||||
// with this variable.
|
// with this variable.
|
||||||
Varnode * getInstance(int4); // get (one of the) Varnodes associated with
|
Varnode * getInstance(int4); // get (one of the) Varnodes associated with
|
||||||
// this variable.
|
// this variable.
|
||||||
Datatype * getType(); // get Datatype of this variable
|
Datatype * getType(); // get Datatype of this variable
|
||||||
Symbol * getSymbol(); // get Symbol associated with this variable
|
Symbol * getSymbol(); // get Symbol associated with this variable
|
||||||
|
@ -274,11 +274,11 @@
|
||||||
lives in a scope, has a name, and has a Datatype.
|
lives in a scope, has a name, and has a Datatype.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
string & getName(); // get the name of the symbol
|
string & getName(); // get the name of the symbol
|
||||||
Datatype * getType(); // get the Datatype of the symbol
|
Datatype * getType(); // get the Datatype of the symbol
|
||||||
Scope * getScope(); // get the scope containing the symbol
|
Scope * getScope(); // get the scope containing the symbol
|
||||||
SymbolEntry * getFirstWholeMap(); // get the (first) SymbolEntry associated
|
SymbolEntry * getFirstWholeMap(); // get the (first) SymbolEntry associated
|
||||||
// with this symbol
|
// with this symbol
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\section classsymbolentry SymbolEntry
|
\section classsymbolentry SymbolEntry
|
||||||
|
@ -300,16 +300,16 @@
|
||||||
This is a container for symbols.
|
This is a container for symbols.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
SymbolEntry *findAddr(Address &,Address &); // find a Symbol by address
|
SymbolEntry *findAddr(Address &,Address &); // find a Symbol by address
|
||||||
SymbolEntry *findContainer(Address &,int4,Address &); // find containing symbol
|
SymbolEntry *findContainer(Address &,int4,Address &); // find containing symbol
|
||||||
Funcdata * findFunction(Address &); // find a function by entry address
|
Funcdata * findFunction(Address &); // find a function by entry address
|
||||||
Symbol * findByName(string &); // find a Symbol by name
|
Symbol * findByName(string &); // find a Symbol by name
|
||||||
SymbolEntry *queryByAddr(Address &,Address &); // search for symbols across multiple scopes
|
SymbolEntry *queryByAddr(Address &,Address &); // search for symbols across multiple scopes
|
||||||
SymbolEntry *queryContainer(Address &,int4,Address &);
|
SymbolEntry *queryContainer(Address &,int4,Address &);
|
||||||
Funcdata * queryFunction(Address &);
|
Funcdata * queryFunction(Address &);
|
||||||
Scope * discoverScope(Address &,int4,Address &); // discover scope of an address
|
Scope * discoverScope(Address &,int4,Address &); // discover scope of an address
|
||||||
string & getName(); // get name of scope
|
string & getName(); // get name of scope
|
||||||
Scope * getParent(); // get parent scope
|
Scope * getParent(); // get parent scope
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\section classdatabase Database
|
\section classdatabase Database
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
the main code workflow.
|
the main code workflow.
|
||||||
|
|
||||||
The library provides its own Register
|
The library provides its own Register
|
||||||
Transfer Languate (RTL), referred to internally as \b p-code,
|
Transfer Language (RTL), referred to internally as \b p-code,
|
||||||
which is designed specifically for reverse engineering
|
which is designed specifically for reverse engineering
|
||||||
applications. The disassembly of processor specific machine-code
|
applications. The disassembly of processor specific machine-code
|
||||||
languages, and subsequent translation into \b p-code, forms
|
languages, and subsequent translation into \b p-code, forms
|
||||||
|
@ -275,7 +275,7 @@
|
||||||
about the variables it analyzes, as this kind of
|
about the variables it analyzes, as this kind of
|
||||||
information is generally not present in the input
|
information is generally not present in the input
|
||||||
binary. Some information can be gathered about a
|
binary. Some information can be gathered about a
|
||||||
variable, based on the instructions it is used in (.i.e
|
variable, based on the instructions it is used in (i.e.
|
||||||
if it is used in a floating point instruction). Other
|
if it is used in a floating point instruction). Other
|
||||||
information about type might be available from header
|
information about type might be available from header
|
||||||
files or from the user. Once this is gathered, the
|
files or from the user. Once this is gathered, the
|
||||||
|
@ -301,7 +301,7 @@
|
||||||
compiler would, but to simplify and normalize for
|
compiler would, but to simplify and normalize for
|
||||||
easier understanding and recognition by human analysts
|
easier understanding and recognition by human analysts
|
||||||
(and follow on machine processing). Typical examples
|
(and follow on machine processing). Typical examples
|
||||||
of transforms include, copy propagation, constant
|
of transforms include: copy propagation, constant
|
||||||
propagation, collecting terms, cancellation of
|
propagation, collecting terms, cancellation of
|
||||||
operators and other algebraic simplifications, undoing
|
operators and other algebraic simplifications, undoing
|
||||||
multiplication and division optimizations, commuting
|
multiplication and division optimizations, commuting
|
||||||
|
@ -373,7 +373,7 @@
|
||||||
|
|
||||||
Even after the initial merging of variables in phase 1,
|
Even after the initial merging of variables in phase 1,
|
||||||
there are generally still too many for normal C code. So
|
there are generally still too many for normal C code. So
|
||||||
the decompiler, does additional, more speculative merging.
|
the decompiler does additional, more speculative merging.
|
||||||
It first tries to merge the inputs and outputs of copy
|
It first tries to merge the inputs and outputs of copy
|
||||||
operations, and then the inputs and outputs of more
|
operations, and then the inputs and outputs of more
|
||||||
general operations. And finally, merging is attempted on
|
general operations. And finally, merging is attempted on
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue