|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
slancer91 How do I cheat? Reputation: 0
Joined: 29 Sep 2011 Posts: 2
|
Posted: Thu Sep 29, 2011 6:36 pm Post subject: [Solved] Preferred method to delay until process attached |
|
|
The below code fails to patch, without the "Hit OK to patch!" line. I added it as a simple delay. What is the preferred method to ensure that a LUA script has attached to the container process, before it executes?
(I used the "create form" menu item, and left it blank, to be able to use showMessage calls.)
Thanks
Sample.CT file:
Code: | -- Set process to Flash in Firefox...
--hideAllCEWindows()
strings_add(getAutoAttachList(), "plugin-container.exe");
showMessage( "Hit OK to patch!\n" );
-- Attempt AS3 code patching...
local count = 0;
local scan = AOBScan( "24 76 02 02 02 48" );
if ( scan ~= nil ) then count = strings_getCount( scan ) end
if ( count > 0 ) then
for n = 0, ( count - 1 ) do writeBytes( strings_getString( scan, n ), 0x24, 0x75, 0x02, 0x02, 0x02, 0x48) end
showMessage( string.format( "Applied patch(es) to %s locations...\nEnjoy your game!\n", count ) );
else
showMessage( "Could not locate code(s) to patch!\n" );
end
object_destroy( scan );
object_destroy( count ); |
Last edited by slancer91 on Thu Sep 29, 2011 6:57 pm; edited 1 time in total |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Thu Sep 29, 2011 6:50 pm Post subject: |
|
|
use "function onOpenProcess(processid)"
e.g:
Code: |
function onOpenProcess(processid)
-- Attempt AS3 code patching...
local count = 0;
local scan = AOBScan( "24 76 02 02 02 48" );
if ( scan ~= nil ) then count = strings_getCount( scan ) end
if ( count > 0 ) then
for n = 0, ( count - 1 ) do writeBytes( strings_getString( scan, n ), 0x24, 0x75, 0x02, 0x02, 0x02, 0x48) end
showMessage( string.format( "Applied patch(es) to %s locations...\nEnjoy your game!\n", count ) );
else
showMessage( "Could not locate code(s) to patch!\n" );
end
object_destroy( scan );
end
strings_add(getAutoAttachList(), "plugin-container.exe");
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
Last edited by Dark Byte on Thu Sep 29, 2011 6:59 pm; edited 1 time in total |
|
Back to top |
|
|
slancer91 How do I cheat? Reputation: 0
Joined: 29 Sep 2011 Posts: 2
|
Posted: Thu Sep 29, 2011 6:57 pm Post subject: |
|
|
Thank you & again for the below
Last edited by slancer91 on Thu Sep 29, 2011 7:19 pm; edited 1 time in total |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Thu Sep 29, 2011 6:59 pm Post subject: |
|
|
oh yes, don't free count, it's a normal integer, not a class object
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|