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 


Script for writing and freezing an address if conditional???

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
gid2525
Expert Cheater
Reputation: 2

Joined: 21 Oct 2013
Posts: 103

PostPosted: Mon Mar 14, 2016 10:19 pm    Post subject: Script for writing and freezing an address if conditional??? Reply with quote

Ok so, I have this here

Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
[fs2_open_3_7_2.exe+00933DE4]+3a9:
db 6B 46 43 01
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
[fs2_open_3_7_2.exe+00933DE4]+3a9:
db 6B 46 43 00




the pointer is the address 00D34655 right above blue highlighted one.

What I need the script to do:

When [fs2_open_3_7_2.exe+00933DE4]+3a9 is ONLY :
6B 46 43 00

then write

db 6B 46 43 01
and FREEZE THAT until script is deactivated.

I can't really write scripts, i just plug in info into the auto assembler. So how would you add it to the code I posted above? Thanks!
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Mar 14, 2016 10:36 pm    Post subject: Reply with quote

Add Address Manually: [fs2_open_3_7_2.exe+00933DE4]+3a9
Assign a hotkey to set the value and freeze it.
Don't push the hotkey when you don't want to.
Back to top
View user's profile Send private message
gid2525
Expert Cheater
Reputation: 2

Joined: 21 Oct 2013
Posts: 103

PostPosted: Mon Mar 14, 2016 11:29 pm    Post subject: Reply with quote

Zanzer wrote:
Add Address Manually: [fs2_open_3_7_2.exe+00933DE4]+3a9
Assign a hotkey to set the value and freeze it.
Don't push the hotkey when you don't want to.


Already have that. I want it in a script though to add in an AOB for upgrading to a different version if needed.
Back to top
View user's profile Send private message
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Tue Mar 15, 2016 5:30 am    Post subject: Reply with quote

do you mean this?

Code:

[ENABLE]
aobscanmodule(INJECT,fs2_open_3_7_2.exe,6B 46 43 00)
registersymbol(INJECT)
INJECT+3:
  db 01

[DISABLE]

INJECT+3:
  db 00
unregistersymbol(INJECT)


This should work fine but if you mean something else then do tell me. Confused
Back to top
View user's profile Send private message
gid2525
Expert Cheater
Reputation: 2

Joined: 21 Oct 2013
Posts: 103

PostPosted: Tue Mar 15, 2016 7:41 am    Post subject: Reply with quote

No, that does not freeze the value like I wanted. The value changes when I do certain things. So just changing it won't do any good, as it will just change back again. I need it like I said in the first post. Thanks!
Back to top
View user's profile Send private message
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Tue Mar 15, 2016 7:59 am    Post subject: Reply with quote

If you give me the game download and tell me what you are trying to change/freeze then I will try and make it myself and then I will give you the script I make.
Back to top
View user's profile Send private message
Cake-san
Grandmaster Cheater
Reputation: 8

Joined: 18 Dec 2014
Posts: 541
Location: Semenanjung

PostPosted: Tue Mar 15, 2016 10:42 am    Post subject: Reply with quote

Can you try this :
Code:

[ENABLE]
aobscanmodule(INJECT,fs2_open_3_7_2.exe,6B 46 43 00)
registersymbol(INJECT)
alloc(_B,6)
label(_G1)
label(_G2)
label(_C1)
label(_C2)
registersymbol(_C1)
registersymbol(_C2)
[INJECT-6]:
_G1:
[INJECT-2]:
_G2:
_B:
dd _G1
_B+4:
dw _G2
[_B]:
_C1:
[_B+4]:
_C2:

alloc(newmem,48)
label(exit)
label(returnhere)
label(_value)
INJECT+3:
_value:

newmem:
dd _C1
newmem+4:
dw _C2
newmem+6:
cmp byte ptr [_value],01
jne exit
mov byte ptr [_value],01
exit:
jmp returnhere

INJECT-6:
jmp newmem
nop
returnhere:

[DISABLE]
INJECT-6:
dd _C1
INJECT-2:
dw _C2
dealloc(newmem)
unregistersymbol(_C1)
unregistersymbol(_C2)
dealloc(_B)
unregistersymbol(INJECT)

Sorry, the script looked a little messy Embarassed

_________________
...
Back to top
View user's profile Send private message
gid2525
Expert Cheater
Reputation: 2

Joined: 21 Oct 2013
Posts: 103

PostPosted: Tue Mar 15, 2016 12:12 pm    Post subject: Reply with quote

Well, that part of the code thats AOB actually changes. So I guess can you try it as a simple injection with no AOB? Thanks!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4725

PostPosted: Wed Mar 16, 2016 6:19 pm    Post subject: Reply with quote

An AoB scan is intended to be used to search for ASM instructions. If you want to use that, find an instruction that accesses that address and hook it.

If you don't want to use that, then the next best thing would be to create your own thread that does what you want.

Code:
[ENABLE]
alloc(newmem,2048)
label(loop)
label(exit)
label(myFreezeExit)
registersymbol(myFreezeExit)

createthread(newmem)

newmem:
  mov eax,[fs2_open_3_7_2.exe+00933DE4]
  lea esi,[eax+3a9]
  mov eax,[esi]
  cmp eax,0043466B
  jne exit
loop:
  mov [esi],0143466B
  push 50
  call Sleep
  mov eax,[myFreezeExit]
  test eax,eax
  je loop
exit:
  pop eax
  push 8000
  push 0
  push newmem
  push eax
  jmp VirtualFree
db CC CC CC CC
myFreezeExit:
  dd 0

[DISABLE]
{$lua}
errorOnLookupFailure(false)
if getAddress("myFreezeExit") ~= 0 then
  writeInteger("myFreezeExit",1)
end
errorOnLookupFailure(true)
unregisterSymbol("myFreezeExit")

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Mar 16, 2016 6:36 pm    Post subject: Reply with quote

If the AOB changes, use wildcard entries. You can use read memory for bytes that are dynamic, for your disable section.
Back to top
View user's profile Send private message
gid2525
Expert Cheater
Reputation: 2

Joined: 21 Oct 2013
Posts: 103

PostPosted: Thu Mar 17, 2016 3:58 pm    Post subject: Reply with quote

++METHOS wrote:
If the AOB changes, use wildcard entries. You can use read memory for bytes that are dynamic, for your disable section.


Yea, I started getting into using wildcards. I hate that this game shifts huge sections of code around and duplicates so much of it for the ai/npc. Having to sift thru multiple AOBs to get signature with 200+ bytes, sometimes a LOT more just to find a unique and to have to use that many wild cards blows. But its just that way with some of the things in this game. With some of the entries that have such huge duplicate AOB sections I decided it would be easier just to get another pointer in the updated game Razz I have a Desktop and a laptop with game both on them so its not too hard getting the pointers.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Mar 17, 2016 4:56 pm    Post subject: Reply with quote

You can save a lot of time with AOB signatures and wildcards by using GH*master's AAmaker plugin. It can generate large signatures and incorporate wildcards automatically. Very Happy
Back to top
View user's profile Send private message
gid2525
Expert Cheater
Reputation: 2

Joined: 21 Oct 2013
Posts: 103

PostPosted: Thu Mar 17, 2016 5:49 pm    Post subject: Reply with quote

++METHOS wrote:
You can save a lot of time with AOB signatures and wildcards by using GH*master's AAmaker plugin. It can generate large signatures and incorporate wildcards automatically. Very Happy


Great Ill check it out.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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