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 


How can I force a function of a program to execute?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
False Prophet
Expert Cheater
Reputation: -1

Joined: 28 May 2006
Posts: 121

PostPosted: Wed Jan 05, 2011 10:47 pm    Post subject: How can I force a function of a program to execute? Reply with quote

How can I make a program call one of it's own functions? For example, if I know the name and how many arguments a function has how can I force it to execute? Example of the function:
Code:
tServerCommand( -1, varargs("cp \"String of text\n\""))


I do not have the source code of the program. I'd like to just call this function whenever I want while the program itself is running.

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Jan 05, 2011 11:29 pm    Post subject: Reply with quote

pretty sure wiccaan did a thing on this 9000 years ago that used the quake console, maybe he still has it.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jan 06, 2011 9:05 am    Post subject: Reply with quote

I think you would need a mapping from function name >> function address. Otherwise you must look it up at runtime. Then some conditionals on the function name to determine what function to call based on the mapping described. All arguments then must be parsed according to the function signature and exceptions parsing must be caught and handled gracefully.
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: Thu Jan 06, 2011 8:54 pm    Post subject: Reply with quote

If you are doing it in C++ you need to figure out the calling convention of the function as well as its prototype to recreate a valid calling method to it. Then you need to figure out what the params are when calling the function.

slovach wrote:
pretty sure wiccaan did a thing on this 9000 years ago that used the quake console, maybe he still has it.


Not sure, the post I made for it is gone as the site it was on is gone. Don't even remember what game it was for. Don't think it was quake though, but it was a game that used the quake engine. All I remember was helping someone with it and did that small tut showing how to use the console via dll injection and print colored text etc.

_________________
- 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 -> General programming 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