You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.1 KiB
61 lines
1.1 KiB
|
|
#include <Windows.h>
|
|
#include <stdio.h>
|
|
|
|
|
|
#include "NativeCode.h"
|
|
#include "RipXorInst.h"
|
|
#include "RipMovInst.h"
|
|
#include "OpaqueBranching.h"
|
|
#include "Jit.h"
|
|
|
|
UCHAR TestBuffer[] = {
|
|
0x48, 0x33, 0xC0,
|
|
0x48, 0x33, 0xC0,
|
|
0xEB, 0x0E,
|
|
0x48, 0x33, 0xC0,
|
|
0x48, 0x33, 0xC0,
|
|
0x7E, 0x06,
|
|
0x48, 0x33, 0xC0,
|
|
0x48, 0x33, 0xC0,
|
|
0x48, 0x33, 0xC0,
|
|
0x48, 0x33, 0xC0,
|
|
0xEB, 0xF8,
|
|
0x50,
|
|
0x48, 0xB8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
|
|
0x48, 0x87, 0x04, 0x24,
|
|
0xC3,
|
|
};
|
|
ULONG TestBufferSize = sizeof(TestBuffer);
|
|
|
|
int main()
|
|
{
|
|
XedTablesInit();
|
|
/*srand(time(NULL));
|
|
|
|
NATIVE_CODE_BLOCK Block;
|
|
NcDisassemble(&Block, TestBuffer, TestBufferSize);
|
|
PNATIVE_CODE_BLOCK OpaqueBranch = ObfGenOpaqueBranch(Block.Start, Block.End);
|
|
NcDebugPrint(OpaqueBranch);
|
|
system("pause");*/
|
|
|
|
|
|
|
|
|
|
NATIVE_CODE_LINK T;
|
|
T.RawDataSize = 10;
|
|
T.RawData = new UCHAR[10];
|
|
memset(T.RawData, 0xAA, 10);
|
|
JIT_BITWISE_DATA Data;
|
|
RtlSecureZeroMemory(&Data, sizeof(JIT_BITWISE_DATA));
|
|
PNATIVE_CODE_BLOCK NewBlock = JitEmitPreRipMov(&T);
|
|
if (NewBlock)
|
|
{
|
|
printf("\n");
|
|
NcDebugPrint(NewBlock);
|
|
printf("\n");
|
|
NcPrintBlockCode(NewBlock);
|
|
}
|
|
system("pause");
|
|
|
|
} |