PE-sieve
Scans all running processes. Recognizes and dumps a variety of potentially malicious implants (replaced/implanted PEs, shellcodes, hooks, in-memory patches).
|
A postprocessor of the detected code patches. Detects if the patch is a hook, and if so, tries to indentify the address where it leads to. More...
#include <patch_analyzer.h>
Public Types | |
enum | t_hook_opcode { OP_SHORTJMP = 0xEB , OP_JMP = 0xE9 , OP_CALL_DWORD = 0xE8 , OP_PUSH_DWORD = 0x68 , OP_JMP_VIA_ADDR_B1 = 0xFF , OP_JMP_VIA_ADDR_B2 = 0x25 } |
Public Member Functions | |
PatchAnalyzer (ModuleData &_moduleData, DWORD _sectionRVA, PBYTE patched_code, size_t code_size) | |
size_t | analyzeHook (PatchList::Patch &patch) |
size_t | analyzeOther (PatchList::Patch &patch) |
Protected Member Functions | |
size_t | _analyzeHook (PatchList::Patch &patch, PBYTE patch_ptr, ULONGLONG patch_va) |
size_t | _analyzeRelocated (PatchList::Patch &patch, BYTE *patch_ptr) |
size_t | parseJmpViaAddr (PatchList::Patch &patch, PBYTE patch_ptr, ULONGLONG patch_va) |
size_t | parseShortJmp (PatchList::Patch &patch, PBYTE patch_ptr, ULONGLONG patch_va) |
size_t | parseJmp (PatchList::Patch &patch, PBYTE patch_ptr, ULONGLONG patch_va) |
size_t | parseMovJmp (PatchList::Patch &patch, PBYTE patch_ptr, bool is_long) |
size_t | parsePushRet (PatchList::Patch &patch, PBYTE patch_ptr) |
template<typename DELTA_T > | |
ULONGLONG | getJmpDestAddr (ULONGLONG currVA, int instrLen, DELTA_T lVal) |
bool | is64Modifier (BYTE op) |
bool | isLongModifier (BYTE op) |
Protected Attributes | |
bool | isModule64bit |
ModuleData & | moduleData |
DWORD | sectionRVA |
PBYTE | patchedCode |
size_t | codeSize |
std::set< DWORD > | relocs |
A postprocessor of the detected code patches. Detects if the patch is a hook, and if so, tries to indentify the address where it leads to.
Definition at line 9 of file patch_analyzer.h.
Enumerator | |
---|---|
OP_SHORTJMP | |
OP_JMP | |
OP_CALL_DWORD | |
OP_PUSH_DWORD | |
OP_JMP_VIA_ADDR_B1 | |
OP_JMP_VIA_ADDR_B2 |
Definition at line 12 of file patch_analyzer.h.
|
inline |
|
protected |
Definition at line 150 of file patch_analyzer.cpp.
|
protected |
size_t pesieve::PatchAnalyzer::analyzeHook | ( | PatchList::Patch & | patch | ) |
Definition at line 222 of file patch_analyzer.cpp.
size_t pesieve::PatchAnalyzer::analyzeOther | ( | PatchList::Patch & | patch | ) |
Definition at line 195 of file patch_analyzer.cpp.
|
protected |
Definition at line 6 of file patch_analyzer.cpp.
|
protected |
Definition at line 132 of file patch_analyzer.cpp.
|
protected |
Definition at line 141 of file patch_analyzer.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 53 of file patch_analyzer.h.
|
protected |
Definition at line 48 of file patch_analyzer.h.
|
protected |
Definition at line 50 of file patch_analyzer.h.
|
protected |
Definition at line 52 of file patch_analyzer.h.
|
protected |
Definition at line 55 of file patch_analyzer.h.
|
protected |
Definition at line 51 of file patch_analyzer.h.