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 


Restore structure after disable script (readmem)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
FENIX_145
How do I cheat?
Reputation: 0

Joined: 05 Apr 2015
Posts: 5

PostPosted: Fri Aug 21, 2020 2:37 pm    Post subject: Restore structure after disable script (readmem) Reply with quote

Hello guys!
Sry I rly very tired. I fought all day with the script and can't inject =( I would be grateful for any help.

It's my script:
Code:

[ENABLE]

aobscanregion(SUPER_WPN, BoardHUD:Invalidate+615, BoardHUD:Invalidate+666, 48 8B 41 78 48 63 89 10 01 00 00)
alloc(newmem,$1000,SUPER_WPN) // 64 bit game
alloc(storedValue,4096)

label(code)
label(return)
registersymbol(SUPER_WPN)
registersymbol(STORED_ADDR)
registersymbol(storedValue)

newmem:
  push rdi
  mov rdi,[rcx+78]
  mov rdi,[rbx+20]
  test rdi,rdi
  jz @F
  mov [STORED_ADDR],rdi // it's big weapon structure
  mov [rdi+50],#1
  mov [rdi+78],#1
  mov [rdi+a0],#1
  mov [rdi+13c],#9999
  mov [rdi+140],#9999
@@:
  pop rdi
code:
  mov rax,[rcx+78]
  movsxd rcx,dword ptr [rcx+00000110]
  jmp return

STORED_ADDR:
  dq 0
storedValue:
  readmem(STORED_ADDR,4096)  // Invalid address for ReadMem

SUPER_WPN:
  jmp newmem
  nop 6
return:

[DISABLE]

STORED_ADDR:
   readmem(storedValue,4096) // Tryed to restore
unregistersymbol(STORED_ADDR)

SUPER_WPN:
  db 48 8B 41 78 48 63 89 10 01 00 00
unregistersymbol(SUPER_WPN)

dealloc(storedValue)
dealloc(newmem)


I can't activate my script and got error: Invalid address for ReadMem. But why?? And how can I change my script to make it work?

I just need restore structure in RDI. Any help guys, mb I can change it with lua...but I don't know lua and and newbie in assembler. But I rly need help.

Thank you in advance and sry for my English


Last edited by FENIX_145 on Fri Aug 21, 2020 4:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Fri Aug 21, 2020 2:55 pm    Post subject: Reply with quote

are all 4096 bytes starting from the address of STORED_ADDR readable ?
_________________
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
View user's profile Send private message MSN Messenger
FENIX_145
How do I cheat?
Reputation: 0

Joined: 05 Apr 2015
Posts: 5

PostPosted: Fri Aug 21, 2020 3:20 pm    Post subject: Reply with quote

Dark Byte wrote:
are all 4096 bytes starting from the address of STORED_ADDR readable ?

Oooh hello mr. Dark Byte first of all I want to thank you for the best software!
About your question: I don't know (how can I check it?) =( I just set the this value because game 64bit....I changed to other values but result - Invalid address for ReadMem Sad I think the problem is not the amount of allocated memory
----
UPD: I changed 4096 on 8 and nothing changed.
----
UPD2: I guess first called
Code:

storedValue:
  readmem(STORED_ADDR,4096)  // Invalid address for ReadMem

and then
Code:

mov [STORED_ADDR],rdi

and that's why I got error because STORED_ADDR is empty 8 byte... but how can I check it? I can't inject Sad
If I'm right how can I change the order of calls?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Sat Aug 22, 2020 2:53 am    Post subject: Reply with quote

readmem only executes at the time the script is injected, and it reads the bytes stored at STORED_ADDR, not where STORED_ADDR points to
_________________
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
View user's profile Send private message MSN Messenger
FENIX_145
How do I cheat?
Reputation: 0

Joined: 05 Apr 2015
Posts: 5

PostPosted: Sat Aug 22, 2020 3:54 am    Post subject: Reply with quote

Dark Byte wrote:
readmem only executes at the time the script is injected, and it reads the bytes stored at STORED_ADDR, not where STORED_ADDR points to


Ah.. I understand now. tyvm sir
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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