View previous topic :: View next topic |
Author |
Message |
oyyzj Cheater
Reputation: 0
Joined: 21 May 2011 Posts: 46
|
Posted: Fri Jul 01, 2016 10:39 am Post subject: need help for a script |
|
|
Hi as the topic says I need help for a script.
I have this OP-Code
sub [ecx+eax*2],dx // contains sub ammo and everything else
now I normally go to Memory Viewer manually and change edx to 01 or 00
Now I want to ask is how to write a correct script so that I don't have to open Memory Viewer and change it manually everytime.
Thank you in advance.
|
|
Back to top |
|
 |
oyyzj Cheater
Reputation: 0
Joined: 21 May 2011 Posts: 46
|
Posted: Sun Jul 03, 2016 10:47 am Post subject: |
|
|
*bump*
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Jul 03, 2016 11:07 am Post subject: |
|
|
Memory Viewer > Tools > Auto Assemble > Template > AOB Injection
|
|
Back to top |
|
 |
oyyzj Cheater
Reputation: 0
Joined: 21 May 2011 Posts: 46
|
Posted: Wed Jul 06, 2016 11:01 am Post subject: |
|
|
Zanzer wrote: | Memory Viewer > Tools > Auto Assemble > Template > AOB Injection |
It seems you didn't even understand what I want.
I need help to write few working line of additional OP-codes that do what I manually input everytime. I tried for example like following
aobscan(INJECT,66 29 54 41) // should be unique
alloc(newmem,$1000)
label(code)
label(return)
newmem:
code:
sub [ecx+eax*2],dx
mov edx,01
jmp return
INJECT:
jmp code
return:
registersymbol(INJECT)
but it doesn't do anything.
|
|
Back to top |
|
 |
Cake-san Grandmaster Cheater
Reputation: 8
Joined: 18 Dec 2014 Posts: 541 Location: Semenanjung
|
Posted: Wed Jul 06, 2016 11:54 am Post subject: |
|
|
if all's well, File -> Assign to current cheat table -> activate your script.
_________________
... |
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Wed Jul 06, 2016 2:16 pm Post subject: |
|
|
oyyzj wrote: | Zanzer wrote: | Memory Viewer > Tools > Auto Assemble > Template > AOB Injection | It seems you didn't even understand what I want. | -Zanzer understands...you do not.
|
|
Back to top |
|
 |
oyyzj Cheater
Reputation: 0
Joined: 21 May 2011 Posts: 46
|
Posted: Wed Jul 06, 2016 4:41 pm Post subject: |
|
|
Cake-san wrote: | if all's well, File -> Assign to current cheat table -> activate your script. |
nah the game crashes.
|
|
Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Wed Jul 06, 2016 6:43 pm Post subject: |
|
|
bad code, post it and we may help
|
|
Back to top |
|
 |
oyyzj Cheater
Reputation: 0
Joined: 21 May 2011 Posts: 46
|
Posted: Thu Jul 07, 2016 10:02 am Post subject: |
|
|
cooleko wrote: | bad code, post it and we may help |
This is what I get when I use Aobinjection from template
[ENABLE]
aobscan(INJECT,66 29 54 41) // should be unique
alloc(newmem,$1000)
label(code)
label(return)
newmem:
code:
sub [ecx+eax*2],dx
jmp return
INJECT:
jmp code
return:
registersymbol(INJECT)
[DISABLE]
INJECT:
db 66 29 54 41
unregistersymbol(INJECT)
dealloc(newmem)
Now.. how do I write additional correct OP-code to change dx to 01 ?? that is what I want to know.
I tried to add a simple line mov dx,01 but game crashed.
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Jul 07, 2016 10:57 am Post subject: |
|
|
You didn't seem to post the whole thing... there should've been two instructions it copied over.
Not just "sub [ecx+eax*2],dx"
If that literally was the whole script CE gave you, then select the whole chunk of code around that instruction within memory viewer and press CTRL-C to copy it. Paste that here so Dark Byte can see if there is some bug within CE.
But, this should work for you...
Code: | [ENABLE]
aobscan(INJECT,66 29 54 41)
INJECT:
dec word ptr [ecx+eax*2]
registersymbol(INJECT)
[DISABLE]
INJECT:
db 66 29 54 41
unregistersymbol(INJECT) |
|
|
Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Thu Jul 07, 2016 2:38 pm Post subject: |
|
|
The reason we believe an error occured is because a jmp code requires 5 bytes, the code you showed us acted on 4 bytes, something is wrong. If you write 5 byte of code onto 4 byte of memory, memory will be off by 1 byte and will crash on the next jump, branch, or return that is in any memory higher than the injected code.
|
|
Back to top |
|
 |
oyyzj Cheater
Reputation: 0
Joined: 21 May 2011 Posts: 46
|
Posted: Fri Jul 08, 2016 8:54 am Post subject: |
|
|
Zanzer wrote: | You didn't seem to post the whole thing... there should've been two instructions it copied over.
Not just "sub [ecx+eax*2],dx"
If that literally was the whole script CE gave you, then select the whole chunk of code around that instruction within memory viewer and press CTRL-C to copy it. Paste that here so Dark Byte can see if there is some bug within CE.
But, this should work for you...
Code: | [ENABLE]
aobscan(INJECT,66 29 54 41)
INJECT:
dec word ptr [ecx+eax*2]
registersymbol(INJECT)
[DISABLE]
INJECT:
db 66 29 54 41
unregistersymbol(INJECT) |
|
dec word ptr [ecx+eax*2],01 // didn't work, compiler doesn't understand this instruction
I changed sub word ptr [ecx+eax*2],01 // Works fine. Thanks for this idea.
|
|
Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Fri Jul 08, 2016 9:08 am Post subject: |
|
|
dec, or decrement, subtracts 1 automatically.
You dont need to provide the ,1 to dec because it is built into the instruction.
|
|
Back to top |
|
 |
|