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 


[help] script crashes game when run from table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
jim2point0
Master Cheater
Reputation: 4

Joined: 05 Oct 2012
Posts: 336

PostPosted: Mon Oct 28, 2013 7:00 pm    Post subject: [help] script crashes game when run from table Reply with quote

Hello,

So this is for Battlefield 4 single player. So I have a snippet of code that works fine when I "replace with code that does nothing" \ "restore original code" but crashes the game when I try it in a [enable] [disable] script.

The piece of code is in the "advanced options."
The script is in the table.

The script hides your weapon model. It's for screenshotters =)

If anyone can take a look and see what's wrong, I'd appreciate it.

The script itself is pretty simple so I'll post that here:
Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
jmp exit

originalcode:
movss [rbx],xmm13

exit:
jmp returnhere

"bf4.exe"+684AA3:
jmp newmem
returnhere:

[DISABLE]
dealloc(newmem)
"bf4.exe"+684AA3:
movss [rbx],xmm13



bf4.CT
 Description:

Download
 Filename:  bf4.CT
 Filesize:  1.45 KB
 Downloaded:  758 Time(s)

Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Oct 29, 2013 3:34 am    Post subject: Reply with quote

Try alloc(newmem,2048,bf4.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 Tue Oct 29, 2013 1:55 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
jim2point0
Master Cheater
Reputation: 4

Joined: 05 Oct 2012
Posts: 336

PostPosted: Tue Oct 29, 2013 1:52 pm    Post subject: Reply with quote

I can give that a try.

It occurred to me that my problem might be due to running the 64bit version of the game. This is the first time I've tried a native 64bit EXE. Not sure if they're any different as far as coding tables\scripts is concerned.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Oct 29, 2013 1:54 pm    Post subject: Reply with quote

in 64-bit a jump can be 14 bytes long if the jump distance is bigger than 7fffffff

the 3th alloc parameter tells ce to allocate memory in the memory nearby the given address

_________________
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
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