| 28 | | int32_t emu_memory_read_byte (struct emu_memory *m, uint32_t addr, uint8_t *byte) |
|---|
| 29 | | int32_t emu_memory_read_word (struct emu_memory *m, uint32_t addr, uint16_t *word) |
|---|
| 30 | | int32_t emu_memory_read_dword (struct emu_memory *m, uint32_t addr, uint32_t *dword) |
|---|
| 31 | | int32_t emu_memory_read_block (struct emu_memory *m, uint32_t addr, void *dest, size_t len) |
|---|
| 32 | | int32_t emu_memory_read_string (struct emu_memory *m, uint32_t addr, struct emu_string *s, uint32_t maxsize) |
|---|
| 33 | | int32_t emu_memory_write_byte (struct emu_memory *m, uint32_t addr, uint8_t byte) |
|---|
| 34 | | int32_t emu_memory_write_word (struct emu_memory *m, uint32_t addr, uint16_t word) |
|---|
| 35 | | int32_t emu_memory_write_dword (struct emu_memory *m, uint32_t addr, uint32_t dword) |
|---|
| 36 | | int32_t emu_memory_write_block (struct emu_memory *m, uint32_t addr, void *src, size_t len) |
|---|
| 37 | | void emu_memory_segment_select (struct emu_memory *m, enum emu_segment s) |
|---|
| | 30 | int32_t emu_memory_read_byte (struct emu_memory *m, |
|---|
| | 31 | .ti +8 |
|---|
| | 32 | uint32_t addr, uint8_t *byte) |
|---|
| | 33 | int32_t emu_memory_read_word (struct emu_memory *m, |
|---|
| | 34 | .ti +8 |
|---|
| | 35 | uint32_t addr, uint16_t *word) |
|---|
| | 36 | int32_t emu_memory_read_dword (struct emu_memory *m, |
|---|
| | 37 | .ti +8 |
|---|
| | 38 | uint32_t addr, uint32_t *dword) |
|---|
| | 39 | int32_t emu_memory_read_block (struct emu_memory *m, |
|---|
| | 40 | .ti +8 |
|---|
| | 41 | uint32_t addr, void *dest, size_t len) |
|---|
| | 42 | int32_t emu_memory_read_string (struct emu_memory *m, |
|---|
| | 43 | .ti +8 |
|---|
| | 44 | uint32_t addr, struct emu_string *s, uint32_t maxsize) |
|---|
| | 45 | int32_t emu_memory_write_byte (struct emu_memory *m, |
|---|
| | 46 | .ti +8 |
|---|
| | 47 | uint32_t addr, uint8_t byte) |
|---|
| | 48 | int32_t emu_memory_write_word (struct emu_memory *m, |
|---|
| | 49 | .ti +8 |
|---|
| | 50 | uint32_t addr, uint16_t word) |
|---|
| | 51 | int32_t emu_memory_write_dword (struct emu_memory *m, |
|---|
| | 52 | .ti +8 |
|---|
| | 53 | uint32_t addr, uint32_t dword) |
|---|
| | 54 | int32_t emu_memory_write_block (struct emu_memory *m, |
|---|
| | 55 | .ti +8 |
|---|
| | 56 | uint32_t addr, void *src, size_t len) |
|---|
| | 57 | void emu_memory_segment_select (struct emu_memory *m, |
|---|
| | 58 | .ti +8 |
|---|
| | 59 | enum emu_segment s) |
|---|
| 146 | | .B emu_cpu_step() |
|---|
| 147 | | . |
|---|
| 148 | | |
|---|
| | 191 | .BR emu_cpu_step() . |
|---|
| | 192 | .PP |
|---|
| | 193 | If you want to detect shellcodes in buffers, use |
|---|
| | 194 | .B emu_shellcode_test() |
|---|
| | 195 | , the emu will copy the buffer to it's pages and try to detect a shellcode. |
|---|
| | 196 | If a possible shellcode gets detected, the guessed starting offset is returned, else -1. |
|---|
| | 197 | .PP |
|---|
| | 198 | To be able to run shellcodes using windows api, one has to provide parts of the |
|---|
| | 199 | windows process environment to the emulation, as well as some kind of emulation for the used api calls. |
|---|
| | 200 | .B emu_env_w32_new() |
|---|
| | 201 | will created a minimalistic process environment in |
|---|
| | 202 | .I e |
|---|
| | 203 | and using |
|---|
| | 204 | .B emu_env_w32_eip_check() |
|---|
| | 205 | after step allows you intercepting calls to exported api. |
|---|
| | 206 | If the return value of |
|---|
| | 207 | .B emu_env_w32_eip_check() |
|---|
| | 208 | is not NULL, the dll exports information is returned, including the calls name and hook. |
|---|
| | 209 | If you want to hook calls to api exports, use |
|---|
| | 210 | .BR emu_env_w32_export_hook() . |
|---|
| | 211 | |
|---|
| | 212 | .SH AUTHOR |
|---|
| | 213 | Markus Koetter <nepenthesdev@gmail.com> |
|---|