| View previous topic :: View next topic |
| Author |
Message |
Frouk Grandmaster Cheater
Reputation: 6
Joined: 22 Jun 2021 Posts: 527
|
Posted: Wed Feb 23, 2022 12:31 pm Post subject: C Code call |
|
|
| Code: | alloc(CameraFade,128)
createThread(CameraFade)
CameraFade:
{$ccode}
((void(*)(float,short))0x50AC20)(1,0)
{$asm}
dealloc(CameraFade) |
I wanted to call function without definition,but game crashed
|
|
| Back to top |
|
 |
Frouk Grandmaster Cheater
Reputation: 6
Joined: 22 Jun 2021 Posts: 527
|
Posted: Thu Feb 24, 2022 1:36 am Post subject: |
|
|
| someone?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25989 Location: The netherlands
|
Posted: Thu Feb 24, 2022 3:01 am Post subject: |
|
|
That is with a definition (float, short), try replacing (float, short) with (void)
anyhow, if it's really without parameters you can just do a
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Frouk Grandmaster Cheater
Reputation: 6
Joined: 22 Jun 2021 Posts: 527
|
Posted: Thu Feb 24, 2022 4:24 am Post subject: |
|
|
definition look like this:
| Code: | | typedef int(__cdecl *_Function)(float,short,void); //Thats definition |
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25989 Location: The netherlands
|
Posted: Thu Feb 24, 2022 4:47 am Post subject: |
|
|
no
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Frouk Grandmaster Cheater
Reputation: 6
Joined: 22 Jun 2021 Posts: 527
|
Posted: Thu Feb 24, 2022 9:23 am Post subject: |
|
|
| i want to call function with parameters and without typing typedef
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25989 Location: The netherlands
|
Posted: Thu Feb 24, 2022 12:20 pm Post subject: |
|
|
why without typedef ?
anyhow:
((int(__cdecl *)(float,short))0x50AC20)(1,0);
also, void is a stupid type so I won't add it
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
|