| View previous topic :: View next topic |
| Author |
Message |
False Prophet Expert Cheater
Reputation: -1
Joined: 28 May 2006 Posts: 121
|
Posted: Wed Jan 05, 2011 10:47 pm Post subject: How can I force a function of a program to execute? |
|
|
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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Jan 05, 2011 11:29 pm Post subject: |
|
|
| pretty sure wiccaan did a thing on this 9000 years ago that used the quake console, maybe he still has it. |
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Thu Jan 06, 2011 9:05 am Post subject: |
|
|
| 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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Jan 06, 2011 8:54 pm Post subject: |
|
|
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 |
|
 |
|