 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
CookiesHax How do I cheat?
Reputation: 0
Joined: 25 Jul 2024 Posts: 1
|
Posted: Thu Jul 25, 2024 5:41 am Post subject: Unable to call the C function. |
|
|
Hello everyone.
I am trying to use the C function in AA, but it doesnt work. This is my script
| Code: | [ENABLE]
registersymbol(newmem)
alloc(newmem,$100)
createthread(newmem)
registersymbol(math)
alloc(math,$10)
math+0:
dd (float)3
math+4:
dd (float)7
newmem:
pushad
movss xmm0,[math+0]
movss xmm1,[math+4]
{$c}
float addf(float x, float y)
{
return x + y;
}
{$ccode xmmReg0=xmm0 xmmReg1=xmm1}
xmmReg0.f0 = addf(xmmReg0.f0, xmmReg1.f0);
{$asm}
//movss xmm0,[math+0]
//addss xmm0,[math+4]
movss [math+8],xmm0
popad
jmp newmem
[DISABLE]
newmem:
ret
unregistersymbol(*)
dealloc(*) |
This is the error message:
| Code: | Not all code is injectable.
(C Error Error at line 25: error: declaration
expected
)
Are you sure you want to edit it to this? |
However, when I do not use the function and perform the calculation directly, it executes correctly.
| Code: | [ENABLE]
registersymbol(newmem)
alloc(newmem,$100)
createthread(newmem)
registersymbol(math)
alloc(math,$10)
math+0:
dd (float)3
math+4:
dd (float)7
newmem:
pushad
movss xmm0,[math+0]
movss xmm1,[math+4]
{$ccode xmmReg0=xmm0 xmmReg1=xmm1}
xmmReg0.f0 = xmmReg0.f0 + xmmReg1.f0;
{$asm}
//movss xmm0,[math+0]
//addss xmm0,[math+4]
movss [math+8],xmm0
popad
jmp newmem
[DISABLE]
newmem:
ret
unregistersymbol(*)
dealloc(*) |
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 153
Joined: 06 Jul 2014 Posts: 4731
|
Posted: Thu Jul 25, 2024 9:27 am Post subject: |
|
|
{$c} blocks need a terminating {$asm}; you can't just go directly into a {$ccode} block
Move the {$c} block above newmem
| Code: | {$c}
...
{$asm}
...
newmem:
...
{$ccode ...}
...
{$asm}
|
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Jul 25, 2024 2:45 pm Post subject: |
|
|
Moved from Auto Assembler Tutorials as this is not a tutorial. _________________
- Retired. |
|
| Back to top |
|
 |
|
|
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
|
'][0]['L_POST_REPLY_TOPIC'] : '') , '" align="middle" />
';
$_switch_quick_reply_count = (isset($this->_tpldata['switch_quick_reply'])) ? sizeof($this->_tpldata['switch_quick_reply']) : 0;for ($_switch_quick_reply_i = 0; $_switch_quick_reply_i < $_switch_quick_reply_count; $_switch_quick_reply_i++){
echo '
';
} // END switch_quick_reply
echo ' |
';
echo '
';
echo ' ' , ((isset($this->_tpldata['.'][0]['L_INDEX'])) ? $this->_tpldata['.'][0]['L_INDEX'] : '') , '
';
$_switch_parent_link_count = (isset($this->_tpldata['switch_parent_link'])) ? sizeof($this->_tpldata['switch_parent_link']) : 0;for ($_switch_parent_link_i = 0; $_switch_parent_link_i < $_switch_parent_link_count; $_switch_parent_link_i++){
echo ' -> ' , ((isset($this->_tpldata['.'][0]['PARENT_NAME'])) ? $this->_tpldata['.'][0]['PARENT_NAME'] : '') , '
';
} // END switch_parent_link
echo ' -> ' , ((isset($this->_tpldata['.'][0]['FORUM_NAME'])) ? $this->_tpldata['.'][0]['FORUM_NAME'] : '') , ' |
';
echo '
';
echo ' ' , ((isset($this->_tpldata['.'][0]['S_TIMEZONE'])) ? $this->_tpldata['.'][0]['S_TIMEZONE'] : '') , ' ' , ((isset($this->_tpldata['.'][0]['PAGINATION'])) ? $this->_tpldata['.'][0]['PAGINATION'] : '') , '
';
echo ' |
';
echo '
';
echo '