[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(JmpHer)
label(IfFile)
label(exit)
label(AddBase)
label(GetEditcByInx)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
call eax
add esp,08
push 1
call [GetEditcByInx]
add esp,04
mov [newmem+100],eax
push esi
xor esi,esi
mov esi,1
JmpHer:
push esi
call [GetEditcByInx]// 69 C1 68 03 00 00 03 05
add esp,04
test eax,eax
je IfFile
cmp [eax+80],0
je IfFile
cmp [eax],0
jne IfFile
cmp eax,[newmem+100]
je IfFile
cmp [newmem+100],0
je IfFile
mov edx,[newmem+100]
movss xmm0,[edx+8C]
movss xmm1,[AddBase]
addss xmm0,xmm1
movss [eax+8C],xmm0
movss xmm0,[edx+90]
movss xmm1,[AddBase]
addss xmm0,xmm1
movss [eax+90],xmm0
movss xmm0,[edx+94]
movss xmm1,[AddBase]
addss xmm0,xmm1
movss [eax+94],xmm0
IfFile:
inc esi
cmp esi,20
jne JmpHer
exit:
pop esi
jmp returnhere
Dim newmem As Long Dim GetEditcByInx As Long Dim AddBase As Single Dim hw_dll_base As Long Dim hw_dll_560002 As Long Dim hw_dll_5FA080 As Long ' 获取 hw.dll 的基地址 hw_dll_base = 取模块jz(“hw.dll”) hw_dll_560002 = hw_dll_base + &H560002 hw_dll_5FA080 = hw_dll_base + &H5FA080 ' 分配内存 newmem = VirtualAlloc(0, 2048, MEM_COMMIT, PAGE_EXECUTE_READWRITE) If newmem = 0 Then 信息框(“内存分配失败!”, 0, “错误”, 0) Return End If ' 定义常量 AddBase = 1.0 ' 42480000 对应的浮点数 ' 原始代码部分 ' 这里的代码逻辑需要根据实际情况进行调整,因为易语言不能直接执行汇编代码 ' 例如 call eax 和 call [GetEditcByInx] 等操作需要使用易语言的内存读写函数模拟 ' 释放内存 VirtualFree(newmem, 0, MEM_RELEASE) End Sub ' 模拟 VirtualAlloc 函数
子程序名
返回值类型
公开
备 注
VirtualAlloc
整数型
分配内存
参数名
类 型
参考
可空
数组
备 注
lpAddress
整数型
内存地址
dwSize
整数型
内存大小
flAllocationType
整数型
分配类型
flProtect
整数型
保护类型
Return 0 ' 这里需要调用 Windows API 实现真正的内存分配 End Sub ' 模拟 VirtualFree 函数
子程序名
返回值类型
公开
备 注
VirtualFree
逻辑型
释放内存
参数名
类 型
参考
可空
数组
备 注
lpAddress
整数型
内存地址
dwSize
整数型
内存大小
dwFreeType
整数型
释放类型
Return True ' 这里需要调用 Windows API 实现真正的内存释放 End Sub
i支持库列表
支持库注释
eAPI
应用接口支持库
注意:
代码中的 VirtualAlloc 和 VirtualFree 函数只是模拟实现,你需要调用 Windows API 来实现真正的内存分配和释放。