![]() Shoutbox (View Full Shoutbox)
|
||||
Click Refresh to load shouts. |
||||
|
Tibia GUI structure
|
|
05-30-2009, 08:20 AM
(This post was last modified: 07-02-2009 10:33 AM by Snowak. Edit Reason: )
Post: #1
|
|||
|
|||
|
Tibia GUI structure
[SIZE="4"][FONT="Georgia"]
Hello! [/FONT][/SIZE]Long time ago, somewhere around 8.21 I've managed to work out whole GUI structure in Tibia client. I've just found below notes on my computer and though that someone maybe will find it useful. Luckily they're written like tutorial, as I've shared it with few people. When connected with hooking, this knowledge makes it possible to modify absolutely everything related to GUI and even to add own items! After writing simple API you will be able to make things such as world view which correctly accept mouse clicks, world view with margins to keep the correct width/height ratio and also eq panel on the left (which looks quite funny ). Here you go. Quote:I. Window structure [SIZE="4"][FONT="Georgia"] Finding the pointer [/FONT][/SIZE]Okay, the above notes explains the structure, but our main goal is to find the pointer The simpliest aproach is to use Cheat Engine to look for increased/decreased variables while resizing world window to find where it's stored, and then according to above notes just move using parentChild to reach the main window structure. Then just start a scan for this address to get the pointer.As I'm quite lazy I've noticed that the pointer's address is very close to the player XYZ position. If you substract 0x3C from the Z position address, in 8.21 you would get the pointer too. I don't know whether it changed since that time, but even if it did the pointer is still somewhere nearby. To save you some time I've made a quick scan and our most wanted pointer is stored at address 0x640B00. So compared to above, it's currently 0x38 before Z coordinate ![]() [SIZE="4"][FONT="Georgia"] Bonus pointer [/FONT][/SIZE]As some of you probably have guessed, dialogs in Tibia are stored using the same structure, however they're not connected with the GUI structure. They have their own pointer in Tibia memory which directly points to opened dialog. Another quick scan, and you will be able to play with it ![]() Added: Thanks to Cameri, the pointer's address is 0x640AFC [SIZE="4"][FONT="Georgia"] Preventing and forcing data restore [/FONT][/SIZE]There's a little but important thing we need to remember about. When Tibia window is resized/minimized all of our changes will be removed. There are also some values which won't affect the window instantly but after next redraw, however we already know that original values will be restored, thus modyfying them is quite tricky (but of course possible and not that hard with a bit of hooking).The easiest thing to do is forcing Tibia to redraw GUI. It is necessary for example when we are resizing containers. Here's the WinAPI trick: Quote:procedure forceGUIResraw; For those of you who are not familiar with Delphi, the C variable is an unsigned integer where younger bytes (first two) contain tibia window width and older bytes (last two) contain tibia window height. Of course this data can be retrieved using another WinAPI calls, but as we have pointer to Tibia main window's structure which already contain the size, why would we waste time ;> Now about making the changes constant. The only reliable way to do it, is to hook onGUIResize callback of main window structure. You can safely set up your own settings from there without having to worry that they will be changed. Unfortunetely, it's not that simple. You have to insert your hook AFTER original function. My aproach was to use disassembler and insert a code cave in runtime somewhere before retn op-code. Luckily there's also other method which also requires some ASM coding. We can create a plain helper function which we will put in callback structure. It should call the original function and then our. I haven't tested it, but it would look like: Quote:call onGUIResize [SIZE="4"][FONT="Georgia"] Good luck! [/FONT][/SIZE]I haven't programmed anything for tibia client since 8.21 so there could be some little changes in the structure, however I didn't noticed any while looking for the pointer. All I currently can do is wish you good luck and hope you'll make good use of it ![]() [SIZE="1"]btw. Please do not re-post it on other forums.[/SIZE] /edit There's a better way to force Tibia to redraw itself. Simply use: Quote:InvalidateRect(TibiaHandle, 0, true);If the screen flickers, use false instead of true - it won't erase the window. |
|||
|
05-30-2009, 10:16 AM
Post: #2
|
|||
|
|||
|
Tibia GUI structure
I love you :o!!
|
|||
|
05-30-2009, 11:21 AM
Post: #3
|
|||
|
|||
|
Tibia GUI structure
Excellent! Now I'll try to digest everything you did here!
Cameri TibiaTek+TibiaAPI Development Team Taking programming into a whole new level.
|
|||
|
05-30-2009, 12:20 PM
Post: #4
|
|||
|
|||
|
Tibia GUI structure
1 word:
Awesome! |
|||
|
07-04-2009, 08:26 AM
Post: #5
|
|||
|
|||
|
Tibia GUI structure
Hey. It's a great spot to start working with Tibia GUI. Very helpful.
Thank you. .:: Tibia 2 ::. |
|||
|
02-05-2010, 06:37 AM
Post: #6
|
|||
|
|||
|
RE: Tibia GUI structure
Thank you for this!
I have a question, for the 8.54 the player Z is 0x645530, so I can find the GUI pointer 0x6454f8. Now I would like to use the containers pointer, which I must add 0x38 to the value found in the GUI pointer, lets suppose the result is 0x1C552c8, now I need just to add those values to mix things ![]() It worked here! But, is there any way to know the position of the containers? Size? Thank you again! |
|||
|
02-08-2010, 01:24 PM
Post: #7
|
|||
|
|||
|
RE: Tibia GUI structure
It'd be cool to find a way to make a bot that interacts only through Tibia. Such as using the quest window as a listbox, etc
|
|||
|
02-08-2010, 07:50 PM
Post: #8
|
|||
|
|||
|
RE: Tibia GUI structure
I've tried this, its harder then it sounds but entirely possible.
|
|||
|
« Next Oldest | Next Newest »
|

![[-]](images/mint/collapse.gif)


). Here you go.
The simpliest aproach is to use Cheat Engine to look for increased/decreased variables while resizing world window to find where it's stored, and then according to above notes just move using parentChild to reach the main window structure. Then just start a scan for this address to get the pointer.


![[Image: 514832412.329.1164300914.png]](http://badge.facebook.com/badge/514832412.329.1164300914.png)
