-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathClearBackdoorCodeProvider.cpp
More file actions
executable file
·35 lines (34 loc) · 1.04 KB
/
Copy pathClearBackdoorCodeProvider.cpp
File metadata and controls
executable file
·35 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "ClearBackdoorCodeProvider.h"
#include "BinaryEditor.h"
#include "KSEngine.h"
void ClearBackdoorCodeProvider::getCode(uint64_t virtualAddress, std::vector<uint8_t> & allcode)
{
if (BinaryEditor::instance()->getPlatform() == ELF_CLASS::ELFCLASS64)
{
std::vector<uint8_t> codeX64;
std::string asmtext =
"xor rax,rax;\
mov al,0x3e;\
mov rdi, 0xffffffffffffffff;\
push 9;\
pop rsi;\
syscall;\
";
KSEngine::instance()->assemble(asmtext.c_str(), 0, codeX64);
allcode.insert(allcode.end(), codeX64.begin(), codeX64.end());
}
else
{
std::string x32asm =
"xor eax,eax;\
mov al,0x25;\
mov ebx,0xffffffff;\
push 9;\
pop ecx;\
int 0x80;\
";
std::vector<uint8_t> codeX32;
KSEngine::instance()->assemble(x32asm.c_str(), 0, codeX32);
allcode.insert(allcode.end(), codeX32.begin(), codeX32.end());
}
}