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 misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 85

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
Containers?????? - Page 2
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Containers??????

  1. #11
    Junior Member
    Join Date
    Mar 2016
    Posts
    9
    I wrote a proof of concept to show you how to traverse the containers tree. I coded it in C#, since it's not my prefered language, I may not be quite familiar with it. I hope that's what you are looking for.
    Code:
    using System;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    
    namespace Containers
    {
        class Program
        {
            [DllImport("kernel32.dll")]
            static extern int ReadProcessMemory(
                IntPtr pHandle,
                UInt32 address,
                IntPtr buffer,
                int size,
                out int readedBytes
            );
    
            struct TTreeNode {
                public UInt32 left, parent, right;
                public byte color;
                public byte isNil;
                public UInt32 key, containerAddress;
            }
    
            struct TTreeEntry {
                public UInt32 proxy, head; //Head is not the tree root, instead, Head.Parent is.
                public int count;
            }
    
            static TTreeNode ReadTreeNode(IntPtr pHandle, UInt32 nodeAddress)
            {
                int readedBytes;
                Type nodeType = typeof(TTreeNode);
                int typeSize = Marshal.SizeOf(nodeType);
                IntPtr buffer = Marshal.AllocHGlobal(typeSize);
    
                ReadProcessMemory(pHandle, nodeAddress, buffer, typeSize, out readedBytes);
    
                TTreeNode node = (TTreeNode)Marshal.PtrToStructure(buffer, nodeType);
    
                if (node.isNil == 0)
                {
                    Console.WriteLine("Index: {0} Container address: 0x{1:X}", node.key, node.containerAddress);
                    ReadTreeNode(pHandle, node.left);
                    ReadTreeNode(pHandle, node.right);
                }
    
                return node;
            }
    
            static void ReadTree(IntPtr pHandle, UInt32 entryAddress)
            {
                int readedBytes;
                Type entryType = typeof(TTreeEntry);
                int typeSize = Marshal.SizeOf(entryType);
                IntPtr buffer = Marshal.AllocHGlobal(typeSize);
    
                ReadProcessMemory(pHandle, entryAddress, buffer, typeSize, out readedBytes);
    
                TTreeEntry entry = (TTreeEntry) Marshal.PtrToStructure(buffer, entryType);
    
                Marshal.FreeHGlobal(buffer);
    
                TTreeNode node = ReadTreeNode(pHandle, entry.head);
                ReadTreeNode(pHandle, node.parent);
            }
    
            static UInt32 ReadContainerAddress(IntPtr pHandle, UInt32 pointertAddress)
            {
                int readedBytes;
                int intSize = sizeof(UInt32);
                IntPtr buffer = Marshal.AllocHGlobal(intSize);
    
                ReadProcessMemory(pHandle, pointertAddress, buffer, intSize, out readedBytes);
    
                UInt32 result = (UInt32)Marshal.PtrToStructure(buffer, typeof(UInt32));
    
                Marshal.FreeHGlobal(buffer);
    
                return result;
            }
    
            static void Main(string[] args)
            {
                Process process = Process.GetProcessesByName("tibia")[0];
                UInt32 containers_PointerAddress = 0xB7A2A4;
                ReadTree(process.Handle, ReadContainerAddress(process.Handle, ((UInt32) process.MainModule.BaseAddress.ToInt32()) + containers_PointerAddress - 0x400000));
                Console.ReadLine();
            }
        }
    }

  2. #12
    Junior Member
    Join Date
    Feb 2016
    Posts
    9
    I would like to say only one thing - you are my master.

    THANK YOU!

    Also I have one more question - how to use internal functions? Easiest way? Injecting into tibia?
    Because without packets or internal function it's not possible to move item from containers?


    [offtop] Do you also see forum "unlayouted" ?
    Last edited by crackgm; 03-09-2016 at 12:40 AM.

  3. #13
    Junior Member
    Join Date
    Mar 2016
    Posts
    9
    Also I have one more question - how to use internal functions? Easiest way? Injecting into tibia?
    Because without packets or internal function it's not possible to move item from containers?


    [offtop] Do you also see forum "unlayouted" ?
    In order to execute an internal function you need to be inside the target process context, the easiest way IMO is the old fashioned dll injection. Also you can move items by sending mouse clicks to the client window, but that`s a hell of work, since u`ll have to be aware of every container position and scrolling state.

    No, I don`t follow unlayouted forum.

  4. #14
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201
    You can do alot with codecaves. Take a look at https://github.com/klusbert/MemoryScanner.

    I call walk function and say function with codecaves. I even setup a packetlistner with a codecave.

    Even tho I only used codecaves for learning purpose, I supose you can have Great succses with them if you set them up corectly
    Last edited by klusbert; 03-09-2016 at 11:32 PM.
    How to find battlelist address --> http://tpforums.org/forum/thread-8146.html
    Updating addresses --> http://tpforums.org/forum/thread-8625.html
    DataReader --> http://tpforums.org/forum/thread-10387.html

  5. #15
    Junior Member
    Join Date
    Jan 2015
    Posts
    27

    Nice TOOL!

    Quote Originally Posted by klusbert View Post
    you can do alot with codecaves. Take a look at https://github.com/klusbert/memoryscanner.

    I call walk function and say function with codecaves. I even setup a packetlistner with a codecave.

    Even tho i only used codecaves for learning purpose, i supose you can have great succses with them if you set them up corectly
    very nice tool bro!

  6. #16
    Junior Member
    Join Date
    Feb 2016
    Posts
    9
    Quote Originally Posted by klusbert View Post
    You can do alot with codecaves. Take a look at https://github.com/klusbert/MemoryScanner.

    I call walk function and say function with codecaves. I even setup a packetlistner with a codecave.

    Even tho I only used codecaves for learning purpose, I supose you can have Great succses with them if you set them up corectly
    Thank you very much! Now I just need to study a bit codecave and have a nice hours spent finding function addresses, I've never succeded looking for them...It's pain in my a... But still thanks!

  7. #17
    Junior Member
    Join Date
    Jan 2015
    Posts
    27

    =D

    Quote Originally Posted by crackgm View Post
    Thank you very much! Now I just need to study a bit codecave and have a nice hours spent finding function addresses, I've never succeded looking for them...It's pain in my a... But still thanks!
    add in skype bro!

  8. #18
    Senior Member
    Join Date
    Jan 2012
    Posts
    417
    using C++ templates, you guys could code the most important STL data structures used by Tibia at the moment. Then, just declaring types correctly, we have a lot of structures out-of-the-box, avoiding to rewrite code.

    ex: Character List is a std::vector<Character>, Vip List is a std::list<Vip>, Presets is a std::map<std::string, std::vector<Hotkey>> (indexed by Preset), Containers is
    Code:
    struct Containers
    {
       int unknown;
       std::map<int, Container*> map;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •