Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant archive_postsperpage - assumed 'archive_postsperpage' (this will throw an Error in a future version of PHP) in ..../archive/index.php on line 456
Hooking a tibiaFunction. [Archive] - Forums

PDA

View Full Version : Hooking a tibiaFunction.



klusbert
02-04-2013, 10:29 PM
Hiho I started with some babysteps with c++ hooking, I managed to do a winsock hook with c++.(thanks to tibiaAPI) Now I want to hook tibias tileadd function.
How would I know how the function looks like I mean how do the arguments look like?

The function address is(0x419320)(9.81)
I can guess that the arguments look like this(int id,int x,int y,int z,byte stack)

klusbert
02-11-2013, 02:41 AM
Okay I still playing around with this, I do progress everyday :)( with that said I mean everyday I try :P)
Today I manage do call the say function.

I can explain how I did it.
First of I am still no expert in this. So blame me if I am wrong.

The say function is on address 0x40f120(9.81) and if you are checking the arguments to that function you will only see the speach type.

So in c++ We create our void.


typedef void _Say(byte type);


Declare our say function


static _Say *sayfunction =0;

and set the address to that function:


sayfunction=(_Say*)0x0040f120;


Checkout my picture bellow, you will see that EAX is 0 and ECX holds our message.(check it out in olly)

So to call this I did like this.


__asm
{


push 1 // type
mov ecx, message
call sayfunction
add esp,4
}


1 = general chat
4 = npc

So far so good :)

klusbert
02-16-2013, 12:53 PM
Hiho, I am using Stepler parsing method, with Darkstars "Tugbot" code. The parser works great, but sometimes and pretty often I misses Deadcreatures.

I also parse green messages and never misses it nor creaturespeech packet. So My wonder is if dead creatures are passed in another packet than TileAdd 0x6A?

I would appreciate help.
http://pastebin.com/J783RmvY

If Someone wonders why I am blocking creatures Spell, is because when I hunting my mages I really hate that all spells stacking up over my health bar, so therefor I move the location of every spell I cast.

beziak
02-25-2013, 04:01 AM
it misses deadcreatures because probably you check only for the first command of whole packet without parsing each commands:)

klusbert
02-25-2013, 09:40 PM
it misses deadcreatures because probably you check only for the first command of whole packet without parsing each commands:)

I got it working now :)