gfetgkh Newbie cheater
Reputation: 0
Joined: 06 Apr 2018 Posts: 22
|
Posted: Thu Jan 02, 2020 1:10 am Post subject: CE7.0 source lua_pcall function has a bug |
|
|
My operating system is 64 bit. When CE7.0 trying to require a 32-bit DLL, the error is garbled if the error contains utf8 characters.I can't read the error message from the garbled code.
for example:
| Quote: | Error:error loading module 'mydll' from file 'D:\Program Files\Cheat Engine 7.0\mydll.dll':
%1 ?????Ч?? Win32 Ӧ?ó??? |
Lua_pcall function of luahandler.pas should be updated to support utf8 characters.
| Quote: | Error:error loading module 'mydll' from file 'D:\CheatEngine\CheatEngine70src\Cheat Engine\bin\mydll.dll':
%1 不是有效的 Win32 应用程序。 |
| Code: | function lua_pcall(L: Plua_State; nargs, nresults, errf: Integer): Integer; cdecl;
var
error: string;
usesluaengineform: boolean;
begin
try
if lua_isfunction(L, (-nargs)-1)=false then
begin
lua_pop(L,nargs+1);
outputdebugstring(pchar('lua_pcall with invalid parameter'));
//MessageBoxA(0, pchar('lua_pcall with invalid parameter'), pchar('Lua: Not a function'), MB_OK);
exit(LUA_ERRRUN);
end;
result:=lua.lua_pcall(L, nargs, nresults, errf);
except
on e: exception do
begin
lua_pop(L, lua_gettop(L));
result:=LUA_ERRRUN;
lua_pushstring(l, e.Message);
if (GetCurrentThreadId=MainThreadID) and (e.Message='Access Violation') and mainform.miEnableLCLDebug.checked then
begin
DebugLn('Lua Exception: '+e.Message);
lazlogger.DumpExceptionBackTrace;
end;
end;
end;
if (result=LUA_ERRRUN) and (errf=0) then //an error occured and no error handler was specified
begin
if GetCurrentThreadId=MainThreadID then
begin
//lua_Debug
error:=Lua_ToString(l, -1);
if (error<>'') then
begin
usesluaengineform:=false;
if printoutput=nil then
begin
if frmLuaEngine=nil then
frmLuaEngine:=TfrmLuaEngine.Create(application);
printoutput:=frmLuaEngine.mOutput.Lines;
usesluaengineform:=true;
end;
printoutput.add(rsError+WinCPToUTF8(error));
if (frmLuaEngine<>nil) and usesluaengineform and (frmLuaEngine.cbShowOnPrint.checked) then
frmLuaEngine.show;
if usesluaengineform then
printoutput:=nil;
lua_pop(L, lua_gettop(L));
end;
end
else
begin
//MessageBoxA(0, pchar(Lua_ToString(l, -1)), pchar(rsNonMainthreadLuaError), MB_OK);
end;
end;
end; |
|
|