【发布时间】:2011-08-05 06:32:20
【问题描述】:
我有一个检查游戏内存值的项目的源代码。我不明白的是:作者如何如此精确地确定这些值的类型和位置?例如,这是他定义的一个结构:
typedef struct {
UInt16 times_used; // 0x0
UInt16 token; // 0x2
SInt16 previous_id; // 0x4
SInt16 next_id; // 0x6
SInt32 model; // 0x8
char unknown00[0x1B]; // 0xC
UInt8 player_owner; // 0x27
char unknown01[0x18]; // 0x28
UInt32 position_x; // 0x40
UInt32 position_y; // 0x44
char unknown02[0x1F]; // 0x48
UInt32 death_type; // 0x69
char unknown03[0x7]; // 0x6D
UInt32 destination_x; // 0x74
UInt32 destination_y; // 0x78
char unknown04[0x84]; // 0x7C
UInt32 health_damage; // 0x100
UInt32 shield_damage; // 0x104
UInt32 energy_damage; // 0x108
char unknown05[0x74]; // 0x10C
} Unit;
他在0x3BC2060这个地址寻找它,它的大小是0x8B8。我运行程序并在这个位置观察内存,当然,我可以识别一些像 name 属性这样的东西,但他是如何如此精确地发现的呢?
谢谢。
【问题讨论】: