View previous topic :: View next topic |
Author |
Message |
Genbu How do I cheat?
Reputation: 0
Joined: 07 Jul 2014 Posts: 6
|
Posted: Mon Jul 07, 2014 10:14 pm Post subject: Automating change of memory value |
|
|
I would like to automate the steps of (1) selecting the second instance of FlashPlayerPlugin, (2) searching the memory for a value (Array of byte), (3) changing the value.
When using Mozilla Firefox, Flash opens two instances of FlashPlayerPlugin. The second instance is always the relevant one. When Flash crashes CheatEngine shifts focus to the first process (which typically persists). When Flash is reloaded, CheatEngine stays focused on the first instance of FlashPlayerPlugin. Is there a way to automatically nudge CheatEngine to the second instance after reloading flash?
Upon reloading a webpage, relevant memory addresses change. Is there a way to (after Flash has been reloaded, and the second instance of Flash has been selected) automatically search for a value, and then change it?
I am using AutoHotKey to interact with and reload Firefox.
Original Value
25 96 01 d0 66 ?? ?? a3
New Value
25 14 02 d0 66 ?? ?? a3
I get the feeling this is probably a much simpler task than I perceive it to be. I have tried looking at Assembler scripting and LUA scripting hoping that that would do what I want, but it is all Greek to me. Any assistance is greatly appreciated. Thanks.
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Tue Jul 08, 2014 12:33 am Post subject: |
|
|
Execute this in Lua script window.
Code: | openProcess("FlashPlayerPlugin"); -- always opens the second FlashPlayerPlugin as it's the newer one, alternative solution is getting both processes PID and attaching to both of the processes and trying to activate hacks in both processes...
autoAssemble([[aobscan(hack, 25 96 01 d0 66 ?? ?? a3) // assuming there's only 1 result
hack:
db 25 14 02]]); |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Genbu How do I cheat?
Reputation: 0
Joined: 07 Jul 2014 Posts: 6
|
Posted: Tue Jul 08, 2014 5:58 am Post subject: |
|
|
DaSpamer wrote: | Execute this in Lua script window. |
Execute how?
I installed LuaForWindows 5.1. Then I saved the code to a text file and renamed it Flash.lua. Double clicking Flash.lua results in a window appearing then disappearing. Upon using CheatEngine to check, I find the value has not been changed.
I tried asking for help in a Lua IRC channel, which resulted in the response "[the code] is not written in standard Lua".
How do I run the code? I am using Windows 7.
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Tue Jul 08, 2014 6:17 am Post subject: |
|
|
Open Cheat Engine, press Ctrl + Alt + L ..
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Genbu How do I cheat?
Reputation: 0
Joined: 07 Jul 2014 Posts: 6
|
Posted: Tue Jul 08, 2014 7:32 am Post subject: |
|
|
The value change works. Thanks. Would it be possible to change a second value in addition to the first? I have tried duplicating the code you posted and changed in the secondary values, but it does not work; the value remains unchanged.
Original
29 60 ?? ?? 46 ?? ?? ?? 60 ?? ?? ae 12
New
29 60 ?? ?? 46 ?? ?? ?? 24 00 02 ae 12
Using this method is much simpler than the normal steps involved in using CheatEngine; selecting the process and then searching for and changing two values would involve around 18 mouse clicks/key presses; using this lua scripting seems like it will only require one mouse click.
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Tue Jul 08, 2014 8:23 am Post subject: |
|
|
Code: | openProcess("FlashPlayerPlugin"); -- always opens the second FlashPlayerPlugin as it's the newer one, alternative solution is getting both processes PID and attaching to both of the processes and trying to activate hacks in both processes...
autoAssemble([[aobscan(hack, 25 96 01 d0 66 ?? ?? a3) // assuming there's only 1 result
hack:
db 25 14 02
hack+8:
24 00 02]]); |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Genbu How do I cheat?
Reputation: 0
Joined: 07 Jul 2014 Posts: 6
|
Posted: Tue Jul 08, 2014 10:24 am Post subject: |
|
|
The code you posted does not change either of the two values.
I took a blind guess and added 'db' to the second value, which results in the first value change working correctly, but the second still does not work.
Code: |
openProcess("FlashPlayerPlugin"); --[[ always opens the second FlashPlayerPlugin as it's the newer one
How does it do that (open the second FlashPlayerPlugin)?? I mean the one line of code does not provide
any differentiation between FlashPlayerPlugin's? Unless openProcess by default searches for the newest
instance? Or openProcess searches through the list of processes working upward through the list?]]
autoAssemble([[aobscan(hack, 25 96 01 d0 66 ?? ?? a3) // assuming there's only 1 result
hack:
db 25 14 02
hack+8:
db 24 00 02]]); --[[This one does not work correctly
How is this supposed to work??? You do not search for the original value
(29 60 ?? ?? 46 ?? ?? ?? 24 00 02 ae 12) so how is this supposed to change it??]] |
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Wed Jul 09, 2014 12:25 am Post subject: |
|
|
My bad didnt notice it's 2 different codes.
Code: | openProcess("FlashPlayerPlugin"); --opens the newest instance
autoAssemble([[aobscan(hack1, 25 96 01 d0 66 ?? ?? a3) // assuming there's only 1 result
aobscan(hack2, 29 60 ?? ?? 46 ?? ?? ?? 60 ?? ?? ae 12 )
hack1:
db 25 14 02
hack2+8:
db 24 00 02]]); |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Genbu How do I cheat?
Reputation: 0
Joined: 07 Jul 2014 Posts: 6
|
Posted: Wed Jul 09, 2014 3:28 am Post subject: |
|
|
The new code works exactly how I want it to. Thank you. And thank you for the continued responses to all my comments.
P.S. I am still curious HOW openProcess accesses the correct FlashPlayerPlugin
P.P.S. I see this forum uses some kind of Reputation system, but I do not see any option to +1 your reputation for all your effort to help me.
|
|
Back to top |
|
 |
|