内存补丁

FeiXue_AL FeiXue_AL 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
以下是VC代码。我转换成DELPHI 出了错误,请大家分析下。VC代码运行正确。DELPHI编译是正确的,但运行出错。
struct delphi_string
{
DWORD len;
char text[256];
};

void AddChatString(LPCTSTR string, COLORREF b=0xffffff, COLORREF f=0)
{
DWORD p=0x00479AE0;
delphi_string d;
ZeroMemory(&d,sizeof(d));
d.len=strlen(string);
strcpy(d.text,string);
DWORD t=(DWORD)d.text;
__asm
{
push eax
push edx
push ecx

push f
mov ecx, b
mov edx, [t]
mov eax, 004F7D8Ch
mov eax, [eax]
call p

pop ecx
pop edx
pop eax
}
}
////////////DELPHI
Tdelphi_string = packed record
len : DWORD;
text : string[255];
end;
procedure AddChatString(sstring:PAnsiChar; b:DWORD;f:DWORD);
const
p=$00479AE0;
var
d:Tdelphi_string;
t:DWORD;
begin
ZeroMemory(@d,sizeof(d));
d.len:=strlen(sstring);
d.text:=sstring;
t:=dword(@d.text);
asm

push eax
push edx
push ecx

push f
mov ecx, b
mov edx, t
mov eax, [$004F7D8C]
mov eax, [eax]
call [p]

pop ecx
pop edx
pop eax
end;
end;
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部