1
0
Fork 0

DBG: Try fixing git filesystem bug

This commit is contained in:
Nukem 2015-07-11 16:15:11 -04:00
parent 76a9d6232b
commit 9fa4c9dece
5 changed files with 1 additions and 89 deletions

View File

@ -1,29 +0,0 @@
#include "Analysis.h"
#include "console.h"
#include "module.h"
void Derp(uint _base)
{
dputs("Starting analysis...");
DWORD ticks = GetTickCount();
uint modBase = ModBaseFromAddr(_base);
uint modSize = ModSizeFromAddr(_base);
BBlockArray array;
LinearPass* pass = new LinearPass(modBase, modBase + modSize, array);
pass->Analyse();
FunctionPass* pass3 = new FunctionPass(modBase, modBase + modSize, array);
pass3->Analyse();
//Int3CoagulatorPass *pass2 = new Int3CoagulatorPass(modBase, modBase + modSize, array);
//pass2->Analyse();
/*
PopulateReferences();
dprintf("%u called functions populated\n", _functions.size());
AnalyseFunctions();
*/
dprintf("Analysis finished in %ums!\n", GetTickCount() - ticks);
}

View File

@ -1,8 +0,0 @@
#pragma once
#include "_global.h"
#include "LinearPass.h"
#include "CodeFollowPass.h"
#include "FunctionPass.h"
#include "Int3CoagulatorPass.h"
// TODO: CallConvPass? Or keep it inside FunctionPass?

View File

@ -208,7 +208,7 @@ void LinearPass::AnalysisWorker(uint Start, uint End, BBlockArray* Blocks)
// Branch target immediate
block->Target = operand.imm;
// Check if abs jump
// Check if absolute jump
if(disasm.GetId() == X86_INS_JMP)
block->SetFlag(BASIC_BLOCK_FLAG_ABSJMP);
}

View File

@ -1,25 +0,0 @@
#include "analysis.h"
#include "memory.h"
Analysis::Analysis(uint base, uint size)
{
_base = base;
_size = size;
_data = new unsigned char[_size + MAX_DISASM_BUFFER];
MemRead((void*)_base, _data, _size, 0);
}
Analysis::~Analysis()
{
delete[] _data;
}
bool Analysis::IsValidAddress(uint addr)
{
return addr >= _base && addr < _base + _size;
}
const unsigned char* Analysis::TranslateAddress(uint addr)
{
return IsValidAddress(addr) ? _data + (addr - _base) : nullptr;
}

View File

@ -1,26 +0,0 @@
#ifndef _ANALYSIS_H
#define _ANALYSIS_H
#include "_global.h"
#include "capstone_wrapper.h"
class Analysis
{
public:
explicit Analysis(uint base, uint size);
Analysis(const Analysis & that) = delete;
~Analysis();
virtual void Analyse() = 0;
virtual void SetMarkers() = 0;
protected:
uint _base;
uint _size;
unsigned char* _data;
Capstone _cp;
bool IsValidAddress(uint addr);
const unsigned char* TranslateAddress(uint addr);
};
#endif //_ANALYSIS_H