-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_selling_price.idc
More file actions
46 lines (39 loc) · 1.24 KB
/
debug_selling_price.idc
File metadata and controls
46 lines (39 loc) · 1.24 KB
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
#include <idc.idc>
#include "lib/lib.idc"
extern break_get_sell_price;
static handle_get_sell_price() {
auto esp = GetRegValue("esp");
auto ware_id = Dword(esp + 0x00 + 0x04);
auto town_index = Dword(esp + 0x00 + 0x08);
auto sell_amount = Dword(esp + 0x00 + 0x0C);
if (ware_id == 0x10 && town_index == 0x09) {
break_get_sell_price = 1;
auto ecx = GetRegValue("ecx");
auto f = get_float(ecx + 0x64);
Message("handle_get_sell_price Luebeck PigIron difficulty=%f\n", f);
return 0;
} else {
break_get_sell_price = 0;
}
}
static handle_get_sell_price_prefinal() {
if (break_get_sell_price) {
auto value = GetRegValue("ST0");
Message("computed %f\n", value);
}
}
static handle_get_sell_price_factor() {
if (break_get_sell_price) {
auto value = GetRegValue("ST0");
Message("factor %f\n", value);
}
}
static main() {
break_get_sell_price = 0;
AddBpt(0x0052E1D0);
SetBptCnd(0x0052E1D0, "handle_get_sell_price()");
AddBpt(0x0052E415);
SetBptCnd(0x0052E415, "handle_get_sell_price_prefinal()");
AddBpt(0x0052E3E4);
SetBptCnd(0x0052E3E4, "handle_get_sell_price_factor()");
}