-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvxworks_symtable.idc
69 lines (47 loc) · 1.11 KB
/
vxworks_symtable.idc
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
68
69
/* Ruben Santamarta - IOActive */
/* Rebuild VxWorks Symbol Table */
#include <idc.idc>
static main()
{
auto ea;
auto offset;
auto sName;
auto eaStart;
auto eaEnd;
// You'll need to adjust these values
eaStart = 0x80AEC1A0;
eaEnd = 0x80B4A200;
SetStatus(IDA_STATUS_WORK);
ea = eaStart;
while( ea < eaEnd) {
MakeDword( ea );
offset = 0;
if ( Dword( ea ) == 0x900 || Dword( ea ) == 0x500)
{
offset = 8;
}
else if( Dword( ea ) == 0x90000 || Dword( ea ) == 0x50000 )
{
offset = 0xc;
}
if( offset )
{
MakeStr( Dword( ea - offset ), BADADDR);
sName = GetString( Dword( ea - offset ), -1, ASCSTR_C ) ;
if ( sName )
{
if( Dword( ea ) == 0x500 || Dword( ea ) == 0x50000)
{
if ( GetFunctionName( Dword( ea - offset + 4) ) == "" )
{
MakeCode( Dword( ea - offset + 4) );
MakeFunction( Dword( ea - offset + 4), BADADDR );
}
}
MakeName( Dword( ea - offset + 4 ), sName );
}
}
ea = ea + 4;
}
SetStatus(IDA_STATUS_READY);
}