-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstrings.idc
75 lines (61 loc) · 1.31 KB
/
strings.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
70
71
72
73
74
75
#include <idc.idc>
static loco_strlen(i, offset)
{
auto size, chr;
if (i == 337)
return 513;
if (i == 338)
return 513;
if (i == 649)
return 64;
if (i == 1250)
return 513;
if (i == 1506)
return 129;
if (i == 1719)
return 512;
if (i == 2039)
return 513;
if (i == 2040)
return 513;
if (i == 2042)
return 73;
if (i == 2045)
return 77;
size = 0;
while (1) {
chr = Byte(offset + size);
size++;
if (chr == 17) {
size = size + 2;
}
if (chr == 23) {
size = size + 4;
}
if (chr == 0x00) {
break;
}
}
return size;
}
static initStrings(void)
{
auto i, addr, size, offset, len;
addr = 0x5183FC;
size = 0x2000;
OpOff(addr, 0, 0);
MakeArray(addr, size);
SetColor(addr, CIC_ITEM, 0xFFFFFF);
for (i = 0; i < size; i++) {
offset = Dword(addr + i * 4);
if (offset == 0) {
break;
}
len = loco_strlen(i, offset);
Message("0x%X => %d,\n", offset, len);
MakeUnknown(offset, len, 1 | 2);
MakeName(offset, form("_str%04d", i));
MakeStr(offset, offset + len);
SetColor(offset, CIC_ITEM, 0xFFFFFF);
}
}