forked from rdbo/libmem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added documentation for LM_Disassemble(Ex)
- Loading branch information
Showing
6 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# LM_Disassemble | ||
|
||
```c | ||
LM_API lm_bool_t | ||
LM_Disassemble(lm_address_t code, | ||
lm_inst_t *inst); | ||
``` | ||
# Description | ||
Disassembles a single instruction into an `lm_inst_t`. | ||
# Parameters | ||
- code: virtual address of the instruction to be disassembled. | ||
- inst: a pointer to a variable of type `lm_inst_t` that will receive the disassembled instruction. | ||
# Return Value | ||
On success, it returns `LM_TRUE`. On failure, it returns `LM_FALSE`. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# LM_DisassembleEx | ||
|
||
```c | ||
LM_API lm_size_t | ||
LM_DisassembleEx(lm_address_t code, | ||
lm_size_t bits, | ||
lm_size_t size, | ||
lm_size_t count, | ||
lm_address_t runtime_addr, | ||
lm_inst_t **pinsts); | ||
``` | ||
# Description | ||
Disassembles one or more instructions into `lm_inst_t`'s (must be deallocated with `LM_FreeInstructions`). | ||
# Parameters | ||
- code: virtual address of the instructions to be disassembled. | ||
- bits: the bits of the architecture to be disassembled. It can be `32` or `64`. | ||
- size: the maximum size in bytes for the disassembly. | ||
- count: the amount of instructions to be disassembled (0 for as many as possible) | ||
- runtime_addr: the runtime address to resolve the functions (for example, relative jumps will be resolved using this address). | ||
- pinsts: a pointer to a variable of type `lm_inst_t *` that will receive the disassembled instructions (deallocate after use with `LM_FreeInstructions`). | ||
# Return Value | ||
On success, it returns the count of the instructions disassembled. On failure, it returns `0`. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# LM_Disassemble | ||
|
||
```python | ||
def LM_Disassemble(code : int) | ||
``` | ||
|
||
# Description | ||
|
||
Disassembles a single instruction into an `lm_inst_t`. | ||
|
||
# Parameters | ||
|
||
- code: virtual address of the instruction to be disassembled. | ||
|
||
# Return Value | ||
|
||
On success, it returns a valid `lm_inst_t` containing the disassembled instruction. On failure, it returns `None`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# LM_DisassembleEx | ||
|
||
```python | ||
def LM_DisassembleEx(code : int, bits : int, size : int, count : int, runtime_addr : int) | ||
``` | ||
|
||
# Description | ||
|
||
Disassembles one or more instructions into `lm_inst_t`'s. | ||
|
||
# Parameters | ||
|
||
- code: virtual address of the instructions to be disassembled. | ||
- bits: the bits of the architecture to be disassembled. It can be `32` or `64`. | ||
- size: the maximum size in bytes for the disassembly. | ||
- count: the amount of instructions to be disassembled (0 for as many as possible) | ||
- runtime_addr: the runtime address to resolve the functions (for example, relative jumps will be resolved using this address). | ||
|
||
# Return Value | ||
|
||
On success, it returns a list of `lm_inst_t`'s containing the disassembled instructions. On failure, it returns `None`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# LM_Disassemble | ||
|
||
```rust | ||
pub fn LM_Disassemble(code : lm_address_t) -> Option<lm_inst_t> | ||
``` | ||
|
||
# Description | ||
|
||
Disassembles a single instruction into an `lm_inst_t`. | ||
|
||
# Parameters | ||
|
||
- code: virtual address of the instruction to be disassembled. | ||
|
||
# Return Value | ||
|
||
On success, it returns `Some(instruction)`, where `instruction` is a valid `lm_inst_t` containing the disassembled instruction. On failure, it returns `None`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# LM_DisassembleEx | ||
|
||
```rust | ||
pub fn LM_DisassembleEx(code : lm_address_t, bits : lm_size_t, size : lm_size_t, count : lm_size_t, runtime_addr : lm_address_t) -> Option<Vec<lm_inst_t>> | ||
``` | ||
|
||
# Description | ||
|
||
Disassembles one or more instructions into `lm_inst_t`'s. | ||
|
||
# Parameters | ||
|
||
- code: virtual address of the instructions to be disassembled. | ||
- bits: the bits of the architecture to be disassembled. It can be `32` or `64`. | ||
- size: the maximum size in bytes for the disassembly. | ||
- count: the amount of instructions to be disassembled (0 for as many as possible) | ||
- runtime_addr: the runtime address to resolve the functions (for example, relative jumps will be resolved using this address). | ||
|
||
# Return Value | ||
|
||
On success, it returns `Some(instructions)`, where `instructions` is a vector of `lm_inst_t`'s containing the disassembled instructions. On failure, it returns `None`. | ||
|