-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathidaldr.h
67 lines (58 loc) · 1.51 KB
/
idaldr.h
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __IDALDR_H__
#define __IDALDR_H__
#include <ida.hpp>
//#include <fpro.h>
#include <idp.hpp>
#include <loader.hpp>
//#include <name.hpp>
//#include <bytes.hpp>
//#include <offset.hpp>
//#include <segment.hpp>
//#include <segregs.hpp>
//#include <fixup.hpp>
//#include <entry.hpp>
//#include <auto.hpp>
#include <diskio.hpp>
//#include <kernwin.hpp>
//----------------------------------
#define CLASS_CODE "CODE"
#define NAME_CODE ".text"
#define CLASS_DATA "DATA"
#define CLASS_CONST "CONST"
#define NAME_DATA ".data"
#define CLASS_BSS "BSS"
#define NAME_BSS ".bss"
#define NAME_EXTERN "extern"
#define NAME_COMMON "common"
#define NAME_ABS "abs"
#define NAME_UNDEF "UNDEF"
#define CLASS_STACK "STACK"
#define CLASS_RES16 "RESOURCE"
#define LDR_NODE "$ IDALDR node for ids loading $"
#define LDR_INFO_NODE "$ IDALDR node for unload $"
//----------------------------------
inline uchar readchar(linput_t *li)
{
uchar x;
lread(li, &x, sizeof(x));
return x;
}
//----------------------------------
inline uint16 readshort(linput_t *li)
{
uint16 x;
lread(li, &x, sizeof(x));
return x;
}
//----------------------------------
inline uint32 readlong(linput_t *li)
{
uint32 x;
lread(li, &x, sizeof(x));
return x;
}
inline uint32 mf_readlong(linput_t *li) { return swap32(readlong(li)); }
inline uint16 mf_readshort(linput_t *li) { return swap16(readshort(li)); }
// each loader must declare and export this symbol:
idaman loader_t ida_module_data LDSC;
#endif // __IDALDR_H__