summaryrefslogtreecommitdiffstats
path: root/public/sdk/inc/disasm.h
blob: c13e7f8cb703a74eba2350486a4695c5c0071c3d (plain) (blame)
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
/***********************************************************************
* Microsoft Lego
*
* Microsoft Confidential.  Copyright 1994 Microsoft Corporation.
*
* Component:
*
* File: dis.h
*
* File Comments:
*
*
***********************************************************************/

#include <stddef.h>

// ------------------------------------------------------------
// Architecture types
// ------------------------------------------------------------

enum ARCHT
{
   archtX8616,                         // Intel x86 (16 bit mode)
   archtX86,                           // Intel x86 (32 bit mode)
   archtMips,                          // MIPS R4x00
   archtAlphaAxp,                      // DEC Alpha AXP
   archtPowerPc,                       // Motorola PowerPC
   archtPowerMac,                      // Motorola PowerPC in big endian mode
   archtPaRisc,                        // HP PA-RISC
};

struct DIS;

#ifdef __cplusplus
extern "C" {
#endif

typedef  size_t (*PFNCCHADDR)(struct DIS *, ULONG, char *, size_t, DWORD *);
typedef  size_t (*PFNCCHFIXUP)(struct DIS *, ULONG, size_t, char *, size_t, DWORD *);

struct DIS *DisNew(enum ARCHT);

size_t Disassemble(struct DIS *pdis, ULONG addr, const BYTE *pb, size_t cbMax, char *pad, char *buf, size_t cbBuf);
void   SetSymbolCallback(struct DIS *pdis,PFNCCHADDR,PFNCCHFIXUP);

void FreePdis(struct DIS *);

#ifdef __cplusplus
}
#endif