ASM Addresses [message #245977] |
Mon, 19 February 2007 21:51 |
QoQn00b
Messages: 18 Registered: January 2007
Karma: 0
|
Recruit |
|
|
I've been modding C++ and CS for about 4 weeks now and I want to move on to editing the ASM... and I understand how for the most part, enough to get going, but I need to know how to get the Address (i.e. 0x0040F0D0) of the function I'm trying to make. Is there a list or something somewhere? oO
|
|
|
|
Re: ASM Addresses [message #246059 is a reply to message #245977] |
Tue, 20 February 2007 09:54 |
|
jnz
Messages: 3396 Registered: July 2006 Location: 30th century
Karma: 0
|
General (3 Stars) |
|
|
#include <iostream>
using namespace std;
int myfunct(int myparam)
{
return myparam+10;
}
int main()
{
cout << "Call the function: " << myfunct(2) << endl << "Function address: " << &myfunct << endl;
system("pause");
return 0;
}
for my own interest, how do you get the function in bhs.dll and how would you make such an application IE: stop the message from showing? the only way i know how to hack is to:
#include <iostream>
using namespace std;
typedef int (*_myfunctptr)(int param);
int main()
{
_myfunctptr myfunctptr = (_myfunctptr)12423574; //some funct address
cout << myfunctptr(2) << endl;
system("pause");
return 0;
}
how do i get the addresses of the functions i want to hack?
[Updated on: Tue, 20 February 2007 09:58] Report message to a moderator
|
|
|
Re: ASM Addresses [message #246120 is a reply to message #246059] |
Tue, 20 February 2007 16:03 |
QoQn00b
Messages: 18 Registered: January 2007
Karma: 0
|
Recruit |
|
|
Quote: | use the adress operator: &
|
Nein, I mean how to find the names of the ASM commands. Like, 0x0040F0D0 is the SetScore or SetMoney (I cant remember which) address in the ASM release. How can I get a key to the list of these address names?
|
|
|
|
Re: ASM Addresses [message #246133 is a reply to message #246120] |
Tue, 20 February 2007 18:11 |
0x90
Messages: 142 Registered: September 2006 Location: Germany
Karma: 0
|
Recruit |
|
|
QoQn00b wrote on Wed, 21 February 2007 00:03 |
Nein, I mean how to find the names of the ASM commands. Like, 0x0040F0D0 is the SetScore or SetMoney (I cant remember which) address in the ASM release. How can I get a key to the list of these address names?
|
gamemodding wrote | how do i get the addresses of the functions i want to hack?
|
im pretty sure youre talking about the same: getting the function pointer of an (engine) function. so the address of the first instruction of any function not available in source (so only in asm).
im afraid you would have to debug/trace them yourself if not already done like by jonwil@scriptsdll.
so i think funcptr of renegade engine is pretty good covered.
regards
0x90
|
|
|
Re: ASM Addresses [message #246153 is a reply to message #246133] |
Tue, 20 February 2007 22:41 |
QoQn00b
Messages: 18 Registered: January 2007
Karma: 0
|
Recruit |
|
|
Thanks for the replies.
Yes, gamemodding, that is EXACTLY what I'm looking for. Where'd you get that list? Is there more?
|
|
|
|
Re: ASM Addresses [message #246179 is a reply to message #246163] |
Wed, 21 February 2007 03:14 |
0x90
Messages: 142 Registered: September 2006 Location: Germany
Karma: 0
|
Recruit |
|
|
but that are just the exported functions of a dll (in this case the bhs.dll i guess?!)
this is useless if youre looking for engine pointers in a closed-source "exe" file like you will find them in jonwils scripts.dll source. dont have the sources here right now but i think it was InitEngine()@Engine.c
oh and btw, just to do some smalltalk, instead of using typedefs for all those funcptr calls i wrote myself a small function:
pCall(ptraddress,argcount,arguments...)
for example: if there was a function in the renegade engine to set some players money at 0x12345678 and it needs two arguments (playerid and moneyamount) you would call it that way:
pCall(0x12345678,2,playerid,moneyamount);
of course a typedef is more failsafe/nicer but if you have to call many funcptr's randomly, this is a quick'n'dirty, asm-based solution to do it. the contra: it has of course some (code)overhead.
regards
0x90
|
|
|
Re: ASM Addresses [message #246206 is a reply to message #245977] |
Wed, 21 February 2007 09:40 |
|
jnz
Messages: 3396 Registered: July 2006 Location: 30th century
Karma: 0
|
General (3 Stars) |
|
|
i never thought it was possible to call a non-exported function in a dll. so, how do i get the address of the non-exported funcion? if you try to call a invalid address, it will throw a generic error.
|
|
|