parent
51b61d400b
commit
5d46bc31dd
@ -0,0 +1,5 @@
|
||||
#include "Obfuscator.h"
|
||||
|
||||
//Requires either being in the process address space, or relocations
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
#ifndef __CODE_VIRTUALIZER_H
|
||||
#define __CODE_VIRTUALIZER_H
|
||||
|
||||
#include <Windows.h>
|
||||
#include "Obfuscator.h"
|
||||
|
||||
__declspec(dllexport) VOID CvInit();
|
||||
|
||||
__declspec(dllexport) PVOID CvDriverFunctionObfuscate(PVOID Code, ULONG CodeSize, PULONG OutSize, ULONG BranchCount, FLOAT MaxBranchSizePercentage);
|
||||
|
||||
__declspec(dllexport) VOID CvDeleteCode(PVOID Code);
|
||||
|
||||
#endif
|
@ -1 +0,0 @@
|
||||
#include "DataLog.h"
|
@ -1,7 +0,0 @@
|
||||
#ifndef __DATALOG_H
|
||||
#define __DATALOG_H
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,358 +0,0 @@
|
||||
#include "Jit.h"
|
||||
#include "Flags.h"
|
||||
#include "RipXorInst.h"
|
||||
#include "RipAndInst.h"
|
||||
#include "RipOrInst.h"
|
||||
#include "RipMovInst.h"
|
||||
|
||||
|
||||
BOOL JitMutateInstForXor(PNATIVE_CODE_LINK Link, PUCHAR ToMutate, PJIT_BITWISE_DATA JitData)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
while (FourByte)
|
||||
{
|
||||
*(PULONG)ToMutate ^= JitData->Data[2 - FourByte];
|
||||
ToMutate += 4;
|
||||
FourByte--;
|
||||
}
|
||||
|
||||
if (TwoByte)
|
||||
{
|
||||
*(PUSHORT)ToMutate ^= (USHORT)JitData->Data[3];
|
||||
ToMutate += 2;
|
||||
}
|
||||
|
||||
if (OneByte)
|
||||
*(PUCHAR)ToMutate ^= (UCHAR)JitData->Data[3];
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID JitMutateInstForOr(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID JitMutateInstForAnd(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreRipMov(PNATIVE_CODE_LINK Link, INT32 Delta)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
PNATIVE_CODE_BLOCK Block = new NATIVE_CODE_BLOCK;
|
||||
|
||||
Block->Start = Block->End = new NATIVE_CODE_LINK;
|
||||
PUCHAR DataOffset = Link->RawData;
|
||||
ULONG Count = FourByte;
|
||||
while (Count)
|
||||
{
|
||||
//Account for remaining MOVs
|
||||
INT32 RipDelta = (((Count - 1) * DWORD_MOV_INST_LENGTH) + (TwoByte * WORD_MOV_INST_LENGTH) + (OneByte * BYTE_MOV_INST_LENGTH));
|
||||
//Account for already MOVd instructions
|
||||
RipDelta += ((FourByte - Count) * 4);
|
||||
RipDelta += Delta;
|
||||
//Add the actual instruction
|
||||
if (!JitEmitRipRelativeMovD(Block, RipDelta, DataOffset))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
DataOffset += 4;
|
||||
--Count;
|
||||
}
|
||||
|
||||
if (TwoByte)
|
||||
{
|
||||
INT32 RipDelta = (OneByte * BYTE_MOV_INST_LENGTH);
|
||||
RipDelta += (FourByte * 4);
|
||||
RipDelta += Delta;
|
||||
if (!JitEmitRipRelativeMovW(Block, RipDelta, DataOffset))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
DataOffset += 2;
|
||||
}
|
||||
|
||||
if (OneByte)
|
||||
{
|
||||
INT32 RipDelta = 0;
|
||||
RipDelta += (FourByte * 4) + (TwoByte * 2);
|
||||
RipDelta += Delta;
|
||||
if (!JitEmitRipRelativeMovB(Block, RipDelta, DataOffset))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PNATIVE_CODE_LINK StartLink = Block->Start;
|
||||
Block->Start = Block->Start->Next;
|
||||
if (Block->Start)
|
||||
Block->Start->Prev = NULL;
|
||||
delete StartLink;
|
||||
|
||||
return Block;
|
||||
}
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostRipMov(PNATIVE_CODE_LINK Link, INT32 Delta)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
PNATIVE_CODE_BLOCK Block = new NATIVE_CODE_BLOCK;
|
||||
|
||||
Block->Start = Block->End = new NATIVE_CODE_LINK;
|
||||
ULONG ZeroValue = 0;
|
||||
ULONG Count = FourByte;
|
||||
while (Count)
|
||||
{
|
||||
INT32 RipDelta = Link->RawDataSize - ((FourByte - Count) * 4);
|
||||
RipDelta += (FourByte - (Count - 1)) * DWORD_MOV_INST_LENGTH;
|
||||
RipDelta *= (-1);
|
||||
RipDelta += Delta;
|
||||
ZeroValue = rand();
|
||||
if (!JitEmitRipRelativeMovD(Block, RipDelta, (PUCHAR)&ZeroValue))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
--Count;
|
||||
}
|
||||
|
||||
if (TwoByte)
|
||||
{
|
||||
INT32 RipDelta = Link->RawDataSize - (FourByte * 4);
|
||||
RipDelta += (FourByte * DWORD_MOV_INST_LENGTH);
|
||||
RipDelta += WORD_MOV_INST_LENGTH;
|
||||
RipDelta *= (-1);
|
||||
RipDelta += Delta;
|
||||
ZeroValue = rand();
|
||||
if (!JitEmitRipRelativeMovW(Block, RipDelta, (PUCHAR)&ZeroValue))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (OneByte)
|
||||
{
|
||||
INT32 RipDelta = Link->RawDataSize - (FourByte * 4) - (TwoByte * 2);
|
||||
RipDelta += (FourByte * DWORD_MOV_INST_LENGTH);
|
||||
RipDelta += (TwoByte * WORD_MOV_INST_LENGTH);
|
||||
RipDelta += BYTE_MOV_INST_LENGTH;
|
||||
RipDelta *= (-1);
|
||||
RipDelta += Delta;
|
||||
ZeroValue = rand();
|
||||
if (!JitEmitRipRelativeMovB(Block, RipDelta, (PUCHAR)&ZeroValue))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PNATIVE_CODE_LINK StartLink = Block->Start;
|
||||
Block->Start = Block->Start->Next;
|
||||
if (Block->Start)
|
||||
Block->Start->Prev = NULL;
|
||||
delete StartLink;
|
||||
|
||||
return Block;
|
||||
}
|
||||
|
||||
INLINE BOOL JitiEmitWrapperD(ULONG OpType, PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
switch (OpType)
|
||||
{
|
||||
case JIT_BITWISE_XOR: return JitEmitRipRelativeXorD(Block, RipDelta, Value);
|
||||
case JIT_BITWISE_AND: return JitEmitRipRelativeAndD(Block, RipDelta, Value);
|
||||
case JIT_BITWISE_OR: return JitEmitRipRelativeOrD(Block, RipDelta, Value);
|
||||
}
|
||||
}
|
||||
INLINE BOOL JitiEmitWrapperW(ULONG OpType, PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
switch (OpType)
|
||||
{
|
||||
case JIT_BITWISE_XOR: return JitEmitRipRelativeXorW(Block, RipDelta, Value);
|
||||
case JIT_BITWISE_AND: return JitEmitRipRelativeAndW(Block, RipDelta, Value);
|
||||
case JIT_BITWISE_OR: return JitEmitRipRelativeOrW(Block, RipDelta, Value);
|
||||
}
|
||||
}
|
||||
INLINE BOOL JitiEmitWrapperB(ULONG OpType, PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
switch (OpType)
|
||||
{
|
||||
case JIT_BITWISE_XOR: return JitEmitRipRelativeXorB(Block, RipDelta, Value);
|
||||
case JIT_BITWISE_AND: return JitEmitRipRelativeAndB(Block, RipDelta, Value);
|
||||
case JIT_BITWISE_OR: return JitEmitRipRelativeOrB(Block, RipDelta, Value);
|
||||
}
|
||||
}
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreRipBitwiseOp(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData, ULONG OpType, BOOL SaveFlags, INT32 Delta)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
PNATIVE_CODE_BLOCK Block = new NATIVE_CODE_BLOCK;
|
||||
if (!Block)
|
||||
return NULL;
|
||||
|
||||
if (SaveFlags)
|
||||
{
|
||||
PNATIVE_CODE_LINK PushF = FlgEmitPushfqInst();
|
||||
PushF->Flags |= CODE_FLAG_DO_NOT_DIVIDE;
|
||||
NcAppendToBlock(Block, PushF);
|
||||
}
|
||||
|
||||
ULONG Count = FourByte;
|
||||
while (Count)
|
||||
{
|
||||
INT32 RipDelta = (((Count - 1) * DWORD_RIP_INST_LENGTH) + (TwoByte * WORD_RIP_INST_LENGTH) + (OneByte * BYTE_RIP_INST_LENGTH));
|
||||
if (SaveFlags)
|
||||
RipDelta += 1;
|
||||
RipDelta += ((FourByte - Count) * 4);
|
||||
RipDelta += Delta;
|
||||
if (!JitiEmitWrapperD(OpType, Block, RipDelta, JitData->Data[FourByte - Count]))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
--Count;
|
||||
}
|
||||
|
||||
if (TwoByte)
|
||||
{
|
||||
INT32 RipDelta = (OneByte * BYTE_RIP_INST_LENGTH);
|
||||
if (SaveFlags)
|
||||
RipDelta += 1;
|
||||
RipDelta += (FourByte * 4);
|
||||
RipDelta += Delta;
|
||||
if (!JitiEmitWrapperW(OpType, Block, RipDelta, JitData->Data[3]))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (OneByte)
|
||||
{
|
||||
INT32 RipDelta = 0;
|
||||
if (SaveFlags)
|
||||
RipDelta += 1;
|
||||
RipDelta += (FourByte * 4) + (TwoByte * 2);
|
||||
RipDelta += Delta;
|
||||
if (!JitiEmitWrapperB(OpType, Block, RipDelta, JitData->Data[4]))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (SaveFlags)
|
||||
{
|
||||
PNATIVE_CODE_LINK PopF = FlgEmitPopfqInst();
|
||||
PopF->Flags |= CODE_FLAG_DO_NOT_DIVIDE;
|
||||
NcAppendToBlock(Block, PopF);
|
||||
}
|
||||
|
||||
return Block;
|
||||
}
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostRipBitwiseOp(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData, ULONG OpType, BOOL SaveFlags, INT32 Delta)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
PNATIVE_CODE_BLOCK Block = new NATIVE_CODE_BLOCK;
|
||||
if (!Block)
|
||||
return NULL;
|
||||
|
||||
if (SaveFlags)
|
||||
{
|
||||
PNATIVE_CODE_LINK PushF = FlgEmitPushfqInst();
|
||||
PushF->Flags |= CODE_FLAG_DO_NOT_DIVIDE;
|
||||
NcAppendToBlock(Block, PushF);
|
||||
}
|
||||
|
||||
ULONG Count = FourByte;
|
||||
while (Count)
|
||||
{
|
||||
INT32 RipDelta = Link->RawDataSize - ((FourByte - Count) * 4);
|
||||
if (SaveFlags)
|
||||
RipDelta += 1;
|
||||
RipDelta += (FourByte - (Count - 1)) * DWORD_RIP_INST_LENGTH;
|
||||
RipDelta *= (-1);
|
||||
RipDelta += Delta;
|
||||
if (!JitiEmitWrapperD(OpType, Block, RipDelta, JitData->Data[FourByte - Count]))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
--Count;
|
||||
}
|
||||
|
||||
if (TwoByte)
|
||||
{
|
||||
INT32 RipDelta = Link->RawDataSize - (FourByte * 4);
|
||||
if (SaveFlags)
|
||||
RipDelta += 1;
|
||||
RipDelta += (FourByte * DWORD_RIP_INST_LENGTH);
|
||||
RipDelta += WORD_RIP_INST_LENGTH;
|
||||
RipDelta *= (-1);
|
||||
RipDelta += Delta;
|
||||
if (!JitiEmitWrapperW(OpType, Block, RipDelta, JitData->Data[3]))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (OneByte)
|
||||
{
|
||||
INT32 RipDelta = Link->RawDataSize - (FourByte * 4) - (TwoByte * 2);
|
||||
if (SaveFlags)
|
||||
RipDelta += 1;
|
||||
RipDelta += (FourByte * DWORD_RIP_INST_LENGTH);
|
||||
RipDelta += WORD_RIP_INST_LENGTH;
|
||||
RipDelta += BYTE_RIP_INST_LENGTH;
|
||||
RipDelta *= (-1);
|
||||
RipDelta += Delta;
|
||||
if (!JitiEmitWrapperB(OpType, Block, RipDelta, JitData->Data[4]))
|
||||
{
|
||||
NcDeleteBlock(Block);
|
||||
delete Block;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (SaveFlags)
|
||||
{
|
||||
PNATIVE_CODE_LINK PopF = FlgEmitPopfqInst();
|
||||
PopF->Flags |= CODE_FLAG_DO_NOT_DIVIDE;
|
||||
NcAppendToBlock(Block, PopF);
|
||||
}
|
||||
|
||||
return Block;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
#ifndef __JIT_H
|
||||
#define __JIT_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
#define DWORD_RIP_INST_LENGTH 10
|
||||
#define WORD_RIP_INST_LENGTH 9
|
||||
#define BYTE_RIP_INST_LENGTH 7
|
||||
|
||||
#define DWORD_MOV_INST_LENGTH 10
|
||||
#define WORD_MOV_INST_LENGTH 9
|
||||
#define BYTE_MOV_INST_LENGTH 7
|
||||
|
||||
#define JIT_BITWISE_XOR 0
|
||||
#define JIT_BITWISE_AND 1
|
||||
#define JIT_BITWISE_OR 2
|
||||
|
||||
typedef struct _JIT_BITWISE_DATA
|
||||
{
|
||||
ULONG Data[5];
|
||||
}JIT_BITWISE_DATA, *PJIT_BITWISE_DATA;
|
||||
|
||||
BOOL JitMutateInstForXor(PNATIVE_CODE_LINK Link, PUCHAR ToMutate, PJIT_BITWISE_DATA JitData);
|
||||
|
||||
VOID JitMutateInstForOr(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData);
|
||||
|
||||
VOID JitMutateInstForAnd(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreRipMov(PNATIVE_CODE_LINK Link, INT32 Delta = 0);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostRipMov(PNATIVE_CODE_LINK Link, INT32 Delta = 0);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreRipBitwiseOp(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData, ULONG OpType, BOOL SaveFlags = TRUE, INT32 Delta = 0);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostRipBitwiseOp(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData, ULONG OpType, BOOL SaveFlags = TRUE, INT32 Delta = 0);
|
||||
|
||||
#endif
|
@ -1,50 +0,0 @@
|
||||
#include "Jit2.h"
|
||||
|
||||
|
||||
PNATIVE_CODE_LINK JitEmitDwordOp();
|
||||
|
||||
BOOL JitMutateInstruction(PNATIVE_CODE_LINK Link, PUCHAR ToMutate, PJIT_MUTATE_DATA JitData)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
switch (JitData->Operation)
|
||||
{
|
||||
case JIT_XOR:
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
case JIT_OR:
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
case JIT_AND:
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
case JIT_MOV:
|
||||
{
|
||||
for (ULONG i = 0; i < Link->RawDataSize; i++)
|
||||
ToMutate[i] = (rand() % 255);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags, INT32 Delta)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags, INT32 Delta)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
#ifndef __JIT2_H
|
||||
#define __JIT2_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
#define JIT_XOR 0
|
||||
#define JIT_OR 1
|
||||
#define JIT_AND 2
|
||||
#define JIT_MOV 3
|
||||
|
||||
typedef struct _JIT_MUTATE_DATA
|
||||
{
|
||||
ULONG Part1[3];
|
||||
USHORT Part2;
|
||||
UCHAR Part3;
|
||||
UCHAR Operation;
|
||||
}JIT_MUTATE_DATA, *PJIT_MUTATE_DATA;
|
||||
|
||||
|
||||
BOOL JitMutateInstruction(PNATIVE_CODE_LINK Link, PUCHAR ToMutate, PJIT_MUTATE_DATA JitData);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags = FALSE, INT32 Delta = 0);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags = FALSE, INT32 Delta = 0);
|
||||
|
||||
#endif
|
@ -1 +0,0 @@
|
||||
#include "Junk.h"
|
@ -1,9 +0,0 @@
|
||||
#ifndef __JUNK_CODE_H
|
||||
#define __JUNK_CODE_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
|
||||
#endif
|
@ -1,21 +0,0 @@
|
||||
#include "Nop.h"
|
||||
|
||||
PNATIVE_CODE_LINK NcEmitNop()
|
||||
{
|
||||
UCHAR RawData[] = { 0x90 };
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST, RawData, 1, TRUE);
|
||||
//XedDecode(&Link->XedInstruction, Link->RawData, 1);
|
||||
return Link;
|
||||
}
|
||||
|
||||
BOOL NcEmitNopGroup(ULONG Count, PNATIVE_CODE_BLOCK Block)
|
||||
{
|
||||
if (Count < 1)
|
||||
return FALSE;
|
||||
while (Count)
|
||||
{
|
||||
NcAppendToBlock(Block, NcEmitNop());
|
||||
Count--;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
#ifndef __NOP_H
|
||||
#define __NOP_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
PNATIVE_CODE_LINK NcEmitNop();
|
||||
|
||||
BOOL NcEmitNopGroup(ULONG Count, PNATIVE_CODE_BLOCK Block);
|
||||
|
||||
#endif
|
@ -0,0 +1 @@
|
||||
#include "Obfuscator.h"
|
@ -0,0 +1,40 @@
|
||||
#include "PEFile.h"
|
||||
|
||||
|
||||
VOID FiLoadFile(PPE_FILE File, PVOID RawData, ULONG RawDataSize)
|
||||
{
|
||||
File->RawData = RawData;
|
||||
File->RawDataSize = RawDataSize;
|
||||
File->Flags = NULL;
|
||||
|
||||
File->DosHeader = (PIMAGE_DOS_HEADER)File->RawData;
|
||||
if (File->DosHeader->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return;
|
||||
|
||||
File->NtHeaders = (PIMAGE_NT_HEADERS)((PUCHAR)File + File->DosHeader->e_lfanew);
|
||||
if (File->NtHeaders->Signature != IMAGE_NT_SIGNATURE)
|
||||
return;
|
||||
|
||||
File->FileHeader = &(File->NtHeaders->FileHeader);
|
||||
File->SectionHeaders = (PIMAGE_SECTION_HEADER)((PUCHAR)File->FileHeader + sizeof(IMAGE_FILE_HEADER) + File->FileHeader->SizeOfOptionalHeader);
|
||||
|
||||
File->Flags |= PEFI_IS_LOADED;
|
||||
}
|
||||
VOID FiWriteFile(PPE_FILE File, STDSTRING CONST& Path)
|
||||
{
|
||||
//xD
|
||||
}
|
||||
VOID FILoadSymbols(PPE_FILE File, PVOID PdbFileData)
|
||||
{
|
||||
|
||||
}
|
||||
VOID FiDestroy(PPE_FILE File)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL FiGood(PPE_FILE File)
|
||||
{
|
||||
return (File->Flags & PEFI_IS_LOADED);
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
#ifndef __PEFILE_H
|
||||
#define __PEFILE_H
|
||||
|
||||
#include "Windas.h"
|
||||
|
||||
#define PEFI_IS_LOADED (1<<0)
|
||||
#define PEFI_SYMBOLS_LOADED (1<<1)
|
||||
|
||||
|
||||
typedef struct _PEFI_SECTION
|
||||
{
|
||||
PVOID RawData;
|
||||
ULONG RawDataSize;
|
||||
}PEFI_SECTION, *PPEFI_SECTION;
|
||||
|
||||
typedef struct _PE_FILE
|
||||
{
|
||||
PVOID RawData;
|
||||
ULONG RawDataSize;
|
||||
ULONG Flags;
|
||||
PIMAGE_DOS_HEADER DosHeader;
|
||||
PIMAGE_NT_HEADERS NtHeaders;
|
||||
PIMAGE_FILE_HEADER FileHeader;
|
||||
PIMAGE_SECTION_HEADER SectionHeaders;
|
||||
STDVECTOR<UCHAR> SymbolData;
|
||||
}PE_FILE, *PPE_FILE;
|
||||
|
||||
VOID FiLoadFile(PPE_FILE File, PVOID RawData, ULONG RawDataSize);
|
||||
VOID FiWriteFile(PPE_FILE File, STDSTRING CONST& Path);
|
||||
VOID FILoadSymbols(PPE_FILE File, PVOID PdbFileData);
|
||||
VOID FiDestroy(PPE_FILE File);
|
||||
|
||||
BOOL FiGood(PPE_FILE File);
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,18 @@
|
||||
#include "Random.h"
|
||||
|
||||
|
||||
INT RndGetRandomInt(INT min, INT max)
|
||||
{
|
||||
std::random_device rd;
|
||||
std::default_random_engine generator(rd());
|
||||
std::uniform_int_distribution<ULONG> distribution(min, max);
|
||||
return distribution(generator);
|
||||
}
|
||||
|
||||
FLOAT RndGetRandomFloat(FLOAT min, FLOAT max)
|
||||
{
|
||||
std::random_device Random;
|
||||
std::mt19937 RandomGenerator(Random());
|
||||
std::uniform_real<FLOAT> RandomDistribute(min, max);
|
||||
return RandomDistribute(RandomGenerator);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
#ifndef __RANDOM_H
|
||||
#define __RANDOM_H
|
||||
|
||||
|
||||
#include "Windas.h"
|
||||
|
||||
INT RndGetRandomInt(INT min, INT max);
|
||||
|
||||
FLOAT RndGetRandomFloat(FLOAT min, FLOAT max);
|
||||
|
||||
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
#include "RipAndInst.h"
|
||||
|
||||
BOOL JitEmitRipRelativeAndD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x81, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[2] = RipDelta;
|
||||
*(PULONG)&Link->RawData[6] = Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JitEmitRipRelativeAndW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x66, 0x83, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[3] = RipDelta;
|
||||
*(PUSHORT)&Link->RawData[7] = (USHORT)Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JitEmitRipRelativeAndB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x80, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[2] = RipDelta;
|
||||
*(PUCHAR)&Link->RawData[6] = (UCHAR)Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
#ifndef __RIP_AND_INST_H
|
||||
#define __RIP_AND_INST_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
BOOL JitEmitRipRelativeAndD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
BOOL JitEmitRipRelativeAndW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
BOOL JitEmitRipRelativeAndB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,15 +0,0 @@
|
||||
#ifndef __RIP_MOV_INST_H
|
||||
#define __RIP_MOV_INST_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
BOOL JitEmitRipRelativeMovD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, PUCHAR Data);
|
||||
|
||||
BOOL JitEmitRipRelativeMovW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, PUCHAR Data);
|
||||
|
||||
BOOL JitEmitRipRelativeMovB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, PUCHAR Data);
|
||||
|
||||
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
#include "RipOrInst.h"
|
||||
|
||||
BOOL JitEmitRipRelativeOrD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x81, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[2] = RipDelta;
|
||||
*(PULONG)&Link->RawData[6] = Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JitEmitRipRelativeOrW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x66, 0x83, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[3] = RipDelta;
|
||||
*(PUSHORT)&Link->RawData[7] = (USHORT)Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JitEmitRipRelativeOrB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x80, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[2] = RipDelta;
|
||||
*(PUCHAR)&Link->RawData[6] = (UCHAR)Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
#ifndef __RIP_OR_INST_H
|
||||
#define __RIP_OR_INST_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
BOOL JitEmitRipRelativeOrD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
BOOL JitEmitRipRelativeOrW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
BOOL JitEmitRipRelativeOrB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
#include "RipXorInst.h"
|
||||
|
||||
BOOL JitEmitRipRelativeXorD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x81, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[2] = RipDelta;
|
||||
*(PULONG)&Link->RawData[6] = Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JitEmitRipRelativeXorW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x66, 0x81, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[3] = RipDelta;
|
||||
*(PUSHORT)&Link->RawData[7] = (USHORT)Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JitEmitRipRelativeXorB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
||||
{
|
||||
UCHAR RawData[] = { 0x80, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
||||
*(PINT32)&Link->RawData[2] = RipDelta;
|
||||
*(PUCHAR)&Link->RawData[6] = (UCHAR)Value;
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
||||
NcAppendToBlock(Block, Link);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
#ifndef __RIP_XOR_INST_H
|
||||
#define __RIP_XOR_INST_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
BOOL JitEmitRipRelativeXorD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
BOOL JitEmitRipRelativeXorW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
BOOL JitEmitRipRelativeXorB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value);
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,7 @@
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{0949e81d-fac5-471e-b533-cb0d9b53b346}</ProjectGuid>
|
||||
<RootNamespace>TestProject</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<SpectreMitigation>false</SpectreMitigation>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
Loading…
Reference in new issue