forked from farbrausch/fr_public
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdis.hpp
51 lines (37 loc) · 1002 Bytes
/
dis.hpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Written by Fabian "ryg" Giesen.
// I hereby place this code in the public domain.
#ifndef __DIS_HPP__
#define __DIS_HPP__
#include "_types.hpp"
/****************************************************************************/
#define NBUFFERS 20
struct DataBuffer
{
sInt Size,Max;
sU8 *Data;
DataBuffer();
~DataBuffer();
void Clear();
void Append(sU8 *data,sInt size);
void PutValue(sU32 value,sInt size);
};
class DisFilter
{
DataBuffer Buffer[NBUFFERS];
sInt FuncTablePos;
sU32 FuncTable[255];
sBool NextFunc;
sU32 LastJump;
sU32 JumpTable;
class DebugInfo *Info;
sU32 CodeSize;
sInt CountInstr(sU8 *instr);
sInt ProcessInstr(sU8 *instr,sU32 memory,sU32 VA);
public:
DataBuffer Output;
sU8 Table[256];
void Filter(sU8 *code,sInt size,sU32 VA,DebugInfo *info=0);
};
void DisUnFilter(sU8 *packed,sU8 *dest,sU32 oldAddr,sU32 newAddr,class ReorderBuffer &reord);
/****************************************************************************/
#endif