BinHandle Type
Represents the main data structure for accessing a chunk of binary code. It provides ways to read raw data from the binary through addresses and to access binary file metadata through the IBinFile interface. It also provides ways to parse/lift instructions from the binary through LiftingUnit.
Constructors
| Constructor |
Description
|
|
|
|
|
|
|
|
Construct a BinHandle from a given file path. ISA is set to `ISA.DefaultISA`.
|
|
|
|
Instance members
| Instance member |
Description
|
File handle.
|
|
|
|
Full Usage:
this.MakeNew
Parameters:
byte[]
-
The byte array.
Returns: BinHandle
Return a new BinHandle.
|
Create a new BinHandle from the given byte array while keeping the other properties of the original BinHandle.
|
|
Get a new instance of lifting unit.
|
Full Usage:
this.ReadASCII
Parameters:
BinFilePointer
-
BinFilePointer.
Returns: string
Return the corresponding ASCII string.
|
Return the ASCII string pointed to by the binary file pointer from the given BinHandle.
|
Full Usage:
this.ReadASCII
Parameters:
Addr
-
The address.
Returns: string
Return the corresponding ASCII string.
|
Return the ASCII string at the addr from the given BinHandle.
|
Full Usage:
this.ReadBytes
Parameters:
Addr
-
The address.
nBytes : int
-
The size of the byte array (in bytes).
Returns: byte[]
Return the byte array if succeed. Otherwise, raise an exception.
|
Return the byte array of size (nBytes) at the addr from the current binary.
|
Full Usage:
this.ReadBytes
Parameters:
BinFilePointer
-
BInaryPointer.
nBytes : int
-
The size of the byte array (in bytes).
Returns: byte[]
Return the byte array if succeed. Otherwise, raise an exception.
|
Return the byte array of size (nBytes) pointed to by the binary file pointer (ptr).
|
Full Usage:
this.ReadInt
Parameters:
Addr
-
The address.
size : int
-
The size of the integer in bytes. Maximum 8 bytes is
possible.
Returns: int64
Return the corresponding integer (int64).
|
Return the corresponding integer value at the addr of the size from the current binary.
|
Full Usage:
this.ReadInt
Parameters:
BinFilePointer
-
The binary pointer.
size : int
-
The size of the integer in bytes. Maximum 8 bytes is
possible.
Returns: int64
Return the corresponding integer (int64).
|
Return the corresponding integer value of the size from the current binary, which is pointed to by the binary file pointer (ptr).
|
Full Usage:
this.ReadUInt
Parameters:
BinFilePointer
-
BinFilePointer.
size : int
-
The size of the integer in bytes. Maximum 8 bytes is
possible.
Returns: uint64
Return the corresponding unsigned integer (uint64).
|
Return the corresponding unsigned integer value of the size from the binary, which is pointed to by the binary file pointer (ptr).
|
Full Usage:
this.ReadUInt
Parameters:
Addr
-
The address.
size : int
-
The size of the integer in bytes. Maximum 8 bytes is
possible.
Returns: uint64
Return the corresponding unsigned integer (uint64).
|
Return the corresponding unsigned integer value at the addr of the size from the binary.
|
|
Register factory.
|
|
|
Full Usage:
this.TryReadBytes
Parameters:
BinFilePointer
-
The binary pointer.
nBytes : int
-
The size of the byte array (in bytes).
Returns: Result<byte[], ErrorCase>
Return (byte[]) if succeeded, (ErrorCase) otherwise.
|
Return the byte array of size (nBytes) pointed to by the pointer (ptr).
|
Full Usage:
this.TryReadInt
Parameters:
BinFilePointer
-
BinFilePointer.
size : int
-
The size of the integer in bytes. Maximum 8 bytes is
possible.
Returns: Result<int64, ErrorCase>
Return the corresponding value (int64) if the address and the size is
valid. Otherwise ErrorCase.
|
Return the corresponding integer of the size from the given address pointed to by the binary pointer (ptr).
|
|
|
Full Usage:
this.TryReadUInt
Parameters:
BinFilePointer
-
BinFilePointer.
size : int
-
The size of the integer in bytes. Maximum 8 bytes is
possible.
Returns: Result<uint64, ErrorCase>
Return the corresponding unsigned integer (uint64) if the address and
the size is valid. Otherwise, ErrorCase.
|
Return the corresponding unsigned integer of the size from the address pointed to by the binary file pointer (ptr).
|
|
Return the corresponding unsigned integer of the size from the given address.
|
B2R2