DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Wed Jul 27, 2016 8:57 am Post subject: Cheat Engine Custom Font loader |
|
|
This script allows you to load a font for you to use in the cheat engine 6.5.1 and newer (only).
By calling AddFontResourceExA
Put this script in your auto run folder
Code: | function TableAddFont(path)
if (type(path)=='string') then
local font,filename
font = findTableFile(path);
if (not font) then
local file = io.open(path,"r")
if (not file) then
error("ERROR loading font");
else
file:close();
filename = path:match(".+\\(.-)$")
font = findTableFile(filename)
if (not font) then
font = createTableFile(filename,path)
end
end
end
local frmt = (cheatEngineIs64Bit() and "mov edx,#%%d\nmov rcx,#%%d\nxor r8d,r8d\nlea r9d,[count]\ncall AddFontMemResourceEx\nmov [handle],rax" or "lea eax,[count]\npush eax\npush 0\npush #%%d\npush #%%d\ncall AddFontMemResourceEx\nmov [handle],eax")
local pFont,length = font.stream.memory,font.stream.size
local sAdd = "alloc(script,128)\nalloc(data,32)\nlabel(count)\nlabel(handle)\nregistersymbol(count)\nregistersymbol(handle)\nregistersymbol(script)\nscript:\n_FORMAT\nret\ndata:\ncount:\ndd -1\nhandle:\ndd -1\ncreatethread(script)"
sAdd = sAdd:gsub("_FORMAT",frmt):format(length,pFont)
local status = autoAssemble(sAdd,true);
if (status) then
local handle = readIntegerLocal("handle") or 0;
return handle ~= 0
end
return false;
end
end |
Usage:
Code: | -- Path to the font file in your computer
local path = 'c:\\The_Juke_Box-FFP.ttf';
TableAddFont(path)
-- File name inside cheat engine table
local name = 'Funkrocker.otf'
TableAddFont(name) |
Preview:
Edit
Added CE 6.5.1 64 bit support _________________
|
|