parent
3e73d359b8
commit
9b2a12bd12
@ -0,0 +1 @@
|
||||
#include "DataLog.h"
|
@ -0,0 +1,7 @@
|
||||
#ifndef __DATALOG_H
|
||||
#define __DATALOG_H
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,47 @@
|
||||
#include "Flags.h"
|
||||
|
||||
|
||||
|
||||
PNATIVE_CODE_LINK FlgEmitPushfqInst()
|
||||
{
|
||||
UCHAR RawData[] = { 0x9C };
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST, RawData, 1);
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, 1);
|
||||
return Link;
|
||||
}
|
||||
|
||||
PNATIVE_CODE_LINK FlgEmitPopfqInst()
|
||||
{
|
||||
UCHAR RawData[] = { 0x9D };
|
||||
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST, RawData, 1);
|
||||
XedDecode(&Link->XedInstruction, Link->RawData, 1);
|
||||
return Link;
|
||||
}
|
||||
|
||||
|
||||
BOOL FlgAreFlagsClobbered(PNATIVE_CODE_LINK Inst, PNATIVE_CODE_LINK Stop)
|
||||
{
|
||||
XED_FLAG_SET Ledger;
|
||||
CONST XED_SIMPLE_FLAG* SimpleFlags = XedDecodedInstGetRflagsInfo(&Inst->XedInstruction);
|
||||
CONST XED_FLAG_SET* _Ledger1 = XedSimpleFlagGetWrittenFlagSet(SimpleFlags);
|
||||
CONST XED_FLAG_SET* _Ledger2 = XedSimpleFlagGetUndefinedFlagSet(SimpleFlags);
|
||||
Ledger.flat = (_Ledger1->flat | _Ledger2->flat);
|
||||
|
||||
for (PNATIVE_CODE_LINK T = Inst->Next; T && T != Stop; T = T->Next)
|
||||
{
|
||||
if (T->Flags & CODE_FLAG_IS_LABEL)
|
||||
continue;
|
||||
|
||||
CONST XED_SIMPLE_FLAG* InstFlags = XedDecodedInstGetRflagsInfo(&T->XedInstruction);
|
||||
CONST XED_FLAG_SET* FlagsRead = XedSimpleFlagGetReadFlagSet(InstFlags);
|
||||
|
||||
if (FlagsRead->flat & Ledger.flat)
|
||||
return FALSE;
|
||||
|
||||
CONST XED_FLAG_SET* FlagsWritten = XedSimpleFlagGetWrittenFlagSet(InstFlags);
|
||||
CONST XED_FLAG_SET* FlagsUndefined = XedSimpleFlagGetUndefinedFlagSet(InstFlags);
|
||||
|
||||
Ledger.flat &= ~(Ledger.flat & (FlagsWritten->flat | FlagsUndefined->flat));
|
||||
}
|
||||
return TRUE;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
#ifndef __FLAGS_H
|
||||
#define __FLAGS_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
PNATIVE_CODE_LINK FlgEmitPushfqInst();
|
||||
PNATIVE_CODE_LINK FlgEmitPopfqInst();
|
||||
|
||||
BOOL FlgAreFlagsClobbered(PNATIVE_CODE_LINK Inst, PNATIVE_CODE_LINK Stop);
|
||||
|
||||
#endif
|
@ -1,11 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<ProjectOutputs>
|
||||
<ProjectOutput>
|
||||
<FullPath>C:\@\Work\code-virtualizer\x64\Debug\CodeVirtualizer.exe</FullPath>
|
||||
</ProjectOutput>
|
||||
</ProjectOutputs>
|
||||
<ContentFiles />
|
||||
<SatelliteDlls />
|
||||
<NonRecipeFileRefs />
|
||||
<ProjectOutputs>C:\$Fanta\code-virtualizer\x64\Debug\CodeVirtualizer.exe</ProjectOutputs>
|
||||
<ContentFiles></ContentFiles>
|
||||
<SatelliteDlls></SatelliteDlls>
|
||||
<NonRecipeFileRefs></NonRecipeFileRefs>
|
||||
</Project>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue