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 


[Feature Request] Add new option "Call function"

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
rain-13
Expert Cheater
Reputation: 0

Joined: 18 Mar 2009
Posts: 110

PostPosted: Fri Jan 14, 2011 3:48 pm    Post subject: [Feature Request] Add new option "Call function" Reply with quote

Add new option "Call function" in Memory viewer's tools menu, that would have inputs fox func address, return value type , param1 type, param1, param2 type, param2 ... paramN type, paramN.

This function could auto generate asm code that would do the call with given parameters.

You could use createremotethread to execute asm code. This could save my time, because then I wouldn't have to write C program every time I want to test some funcs.

Also CE made trainers could use function calls which means they can do more cheats with less work.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Jan 14, 2011 5:05 pm    Post subject: Reply with quote

Not sure, but I think this is already possible:

Code:

fullaccess(00400500,4)
alloc(mycode,2048)
CreateThread(mycode)

mycode:
push param4
push (float)param3asfloat
push param2
push param1
call functionname
//eax contains a return value you can use for whatever thing you like

mov [00400500],eax //save result

ret //exit thread


_________________
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
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Sat Jan 15, 2011 3:41 am    Post subject: Reply with quote

Yeah, calling functions is working fine in both CE 5.6.1 and CE 6.0.
It doesn't fill in the parameters automatically of course, You have to do it manually, but it is working.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
rain-13
Expert Cheater
Reputation: 0

Joined: 18 Mar 2009
Posts: 110

PostPosted: Sat Jan 15, 2011 1:47 pm    Post subject: Reply with quote

Dark Byte wrote:
Not sure, but I think this is already possible:

Code:

fullaccess(00400500,4)
alloc(mycode,2048)
CreateThread(mycode)

mycode:
push param4
push (float)param3asfloat
push param2
push param1
call functionname
//eax contains a return value you can use for whatever thing you like

mov [00400500],eax //save result

ret //exit thread



where do i put that code?


Last edited by rain-13 on Sat Jan 15, 2011 2:04 pm; edited 3 times in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Jan 15, 2011 1:58 pm    Post subject: Reply with quote

auto assembler window
memory view->tools->auto assemble (or just ctrl+a in mem view)

_________________
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
rain-13
Expert Cheater
Reputation: 0

Joined: 18 Mar 2009
Posts: 110

PostPosted: Sat Jan 15, 2011 2:04 pm    Post subject: Reply with quote

Great thanks.


I injected this following code, but it makes VLC crash. Any ideas about this How to fix that?

6A5A4200 is address that mutes sound ant is void.

if I want to use 1234 as arg, do I just push 1234, or do i have to convert that number into hex or something?

Code:
fullaccess(00400500,4)
alloc(mycode,2048)
CreateThread(mycode)

mycode:
call 6A5A4200
//eax contains a return value you can use for whatever thing you like

mov [00400500],eax //save result

ret //exit thread
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Jan 15, 2011 4:00 pm    Post subject: Reply with quote

I looked at VLC after reading your post and I don't see a function that mutes the volume that returns a void and takes no params.

libvlccore.dll holds the main handler code which I found the mute code is:

aout_SetMute - libvlccore.dll + 6BF30
aout_ToggleMute - libvlccore.dll + 6BF60

Both of these functions expect params and return values.

aout_SetMute seems to be the one called when you click the mute button, which is:
int __cdecl aout_SetMute(int a1, int a2, char a3)

a1 = vlc_object_t object pointer.
a2 = audio_volume_t object pointer.
a3 = boolean

The source shows Mute being called like this:
Code:

void SoundWidget::setMuted( bool mute )
{
    b_is_muted = mute;
    playlist_t *p_playlist = pl_Get( p_intf );
    aout_SetMute( VLC_OBJECT(p_playlist), NULL, mute );
}


So you need to pass at least the vlc object and the boolean.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
rain-13
Expert Cheater
Reputation: 0

Joined: 18 Mar 2009
Posts: 110

PostPosted: Sat Jan 15, 2011 5:13 pm    Post subject: Reply with quote

Is there any tutorial about how to find part that is often called? and how can i inject my code there? Do i need to overwrite original code or what?

Edit: from which cpp file did you find that function call?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Jan 15, 2011 9:42 pm    Post subject: Reply with quote

rain-13 wrote:
Is there any tutorial about how to find part that is often called? and how can i inject my code there? Do i need to overwrite original code or what?

Edit: from which cpp file did you find that function call?


It's inside of:
vlc-1.1.5\vlc-1.1.5\modules\gui\qt4\components\controller_widget.cpp

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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