Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Changing addresses in mass with code.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sun Oct 09, 2016 9:25 am    Post subject: Changing addresses in mass with code. Reply with quote

I'm working on a table within the forum FF8_EN.ct

All of the addresses are in the form of
FF8_EN.exe+18FE0EC

I used a text program to change those address to the form
psxfin.exe+18FE0EC

Now all the addresses in the psxfin seem to be + 0x4EF9740 from the FF8_EN addresses.
What programming steps would be required to bulk change all the addresses?
I am stumped to the point of not knowing where to start.
Back to top
View user's profile Send private message Yahoo Messenger
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Sun Oct 09, 2016 11:00 am    Post subject: Reply with quote

I use autohotkey to automate changing addresses by a set amount. This is the script I use for it.

Code:
SetFormat, Integerfast, H
!x::   
send {alt up}

/* ^!(enter) opens table entry for editing, tabbing changes item
Sendinput ^!{enter}
Sendinput {tab 3}
sleep 100   
*/
;sendinput {home}           ;places cursor at start
;Sendinput +{end}          ;highlights to end
clipboard :=
 sendinput ^c               ;places on clipboard
clipwait
StringReplace, clipboard, clipboard,%clipboard%,0x%clipboard%   ;adds '0x' context to beginning
var := clipboard          ;sends to variable
var += 0x4                 ;adds 0x04, use any hex number
StringReplace,newvar,var,0x ;puts 0x on beginning
Sendinput %newvar%          ;prints to output
;Sendinput {home}          ;jumps to front
;Sendinput {Del}{Del}      ;removes 0x context
return

Autohotkey must be run as administrator to have access to cheat engine.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Oct 09, 2016 11:00 am    Post subject: Reply with quote

Not entirely sure what you're trying to do, but it's not likely to work (assuming you're trying to port PC cheats over to an emulator by simply changing out the module base).
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sun Oct 09, 2016 11:27 am    Post subject: Reply with quote

++METHOS wrote:
Not entirely sure what you're trying to do, but it's not likely to work (assuming you're trying to port PC cheats over to an emulator by simply changing out the module base).


Yes attempting to take a pc game address and converting them to emulator
addresses. You may be correct that it won't work, but I won't know until I change all the addresses.
Currently I have manually adjusted the first two table addresses:

FF8_EN.exe+18FE0EC
FF8_EN.exe+18FE0E8

psxfin.exe+67F782C
psxfin.exe+67F7828

The values seem to be correct after the change.
Back to top
View user's profile Send private message Yahoo Messenger
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Sun Oct 09, 2016 11:51 am    Post subject: Reply with quote

It may work if FF8_En.exe is actually an emulator which work similar with psxfin.exe that they reference the emulated ram base as a FIXED offset from its respective *.exe base.

May try add a memory record in the ORIGINAL FF8_EN.ct:
Code:

unregistersymbol(FF8_EN.exe)

[ENABLE]

define(FF8_EN.exe,psxfin.exe+4EF9740)
registersymbol(FF8_EN.exe)
 
 
[DISABLE]


and activate it after attached to psxfin.exe

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Sun Oct 09, 2016 12:24 pm    Post subject: Reply with quote

Another solution is to use notepad++ replace feature. That should be pretty simple if you are always replacing the same text.
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sun Oct 09, 2016 1:41 pm    Post subject: Reply with quote

Toying with ideas
Code:
al = getAddressList()
for x = 0, 2 do
print((addresslist_getMemoryRecordByID(al,x)).Description)
end

received the following;
Current HP
Slot 2 Current HP
Error:[string "al = getAddressList()..."]:3: attempt to index a nil value
Script Error

I remember trying to use Index a while back and one of the members indicated ID was the way to go because Index values could be nil, if a record was deleted for example.
Why does the code above have a nil value to a ID number? Further is there a better way to write that little procedure to skip over the nils if any?
Back to top
View user's profile Send private message Yahoo Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Thu Oct 13, 2016 2:03 pm    Post subject: Reply with quote

++METHOS wrote:
Not entirely sure what you're trying to do, but it's not likely to work (assuming you're trying to port PC cheats over to an emulator by simply changing out the module base).


You were right and wrong, but since I don't know what you exactly meant by "not likely to work", I'll give you the befit of doubt.

A. Some associates working with excel built language to do what I was attempting, not a problem.
B. After that procedure nearly all the addresses are correct(from the table I built), after applying a psxfin.exe = constant 0x400000 and whatever additional 0x0xxxxx was necessary to locate the first address.
C. The problem occurs every time psxfin opens, it allocates the game to different locations (all in the same relative addresses locations). So the procedure fails in that light.
Back to top
View user's profile Send private message Yahoo Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Oct 13, 2016 2:57 pm    Post subject: Reply with quote

I was not wrong. This is typical for memory that occurs inside of an emulated environment.
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Thu Oct 13, 2016 3:04 pm    Post subject: Reply with quote

Typical in fceu and znes emulators.
Back to top
View user's profile Send private message Yahoo Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Oct 13, 2016 3:17 pm    Post subject: Reply with quote

And others, obviously. Mr. Green
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Thu Oct 13, 2016 3:23 pm    Post subject: Reply with quote

I don't know as I have not tried anything but those three(fceu, znes and psxfin) plus an attempt at espxe, emulator for one game, found set-ups for add-ins too difficult, so not much work there.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites