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 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 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
noname proxy
Page 1 of 6 123 ... LastLast
Results 1 to 10 of 51

Thread: noname proxy

  1. #1
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    hello all, today i have finished a major milestone in my proxy, and id like to start trying to get some other developers onboard, as well as publicize what im doing.

    noname proxy aims to be a complete stand alone client for tibia that is easily extensible through plugins. It takes a drastically different approach to parsing the data that passes through it, which is what i hope will give it its power.

    When ever a packet is recved, the binary packet is converted into typed data. What this means is ive written a class for every Tibia Message type (well only the recved msgs so far) which provides easy manipulation of the data they contain.

    A message list is the next level up. It is basically just a list of message classes which have been put into a list. The client then iterates over this list, calling message hooks. Message hooks are simply functions which are set up to be called whenever a particular message is recved. For example, you could easily make an auto healer by hooking the player stats packet (which contains your health) and then cast exura if you have less than whatever ammount of health.

    At the top level is the client, each hook has, for better or for worse, complete access to the client, allowing hooks to do all sorts of fancy things, making an msn plugin is one idea i want to do.

    Eventually most hooks will reside inside of plugins that can be dynamically loaded, but im not that far yet.

    As of right now, i have just hooked the message parsing system up to the actual client, until now ive only been running it in a testing environment. Im finding lots of problems. For example, talk to a npc and it will crash. Also, for now stay above ground and dont change any levels. But the point is that ive got it to a stage where you can walk around, which turned out to really be quite a feat. Most proxies dont parse data, they read the information from the client and then send packets. My proxy is completely independent, you could even run it on a remote machine.

    Anyway if anyones interested, you can find all the code here
    http://code.google.com/p/nonameproxy

    Currently it only runs on a POSIX compatible operating system (ie not windows). Im looking for someone to add windows support if your interested . its written in oldskool c++, none of this .NET bullshit.

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    for all those who are interested, ive now got it stable enough to walk around up ground. If you can crash it let me know.

  3. #3
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    proxy is now working with 8.30
    now with 8.31
    should also point out you can now go below ground because ive started to implement the protocol. Right now gamestate only tracks your position, but thats enough.

  4. #4
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    nonameproxy has plugins

    check this out, this simple plugin changes all public "speaks" into squarks. Admittedly theres still not much you can do with the proxy yet because the send protocol isnt implemented yet, but this is cool ;p.

    dummy.h
    Code:
    #ifndef __DUMMY_H
    #define __DUMMY_H
    
    #include <string>
    #include <stdint.h>
    
    #include "client.h"
    #include "tibiamessage.h"
    #include "hook.h"
    
    class ChickenHook : public WriteHook
    {
            virtual TibiaMessage* func (TibiaMessage* tm, Client* client);
    };
    
    extern "C"
    {
            void load (uint32_t id, Client* client);
            void unload ();
            const std::string& name ();
    }
    
    #endif
    dummy.c
    Code:
    #include <stdio.h>
    #include "dummy.h"
    #include "enums.h"
    
    uint32_t pluginId;
    uint32_t chickenHookId;
    
    Client* clientPtr;
    std::string pluginName;
    
    TibiaMessage* ChickenHook::func (TibiaMessage* tm, Client* client)
    {
            GRMSpeak* speak = (GRMSpeak*)tm;
    
            const TSpeak& orig = speak->getSpeak ();
            if (orig.getSpeakType () != TSpeak::pub) {
                    /* if the speak isnt a public one dont do anything */
                    return tm;
            }
    
            /* because speak has a derived class structure this will be a bit
             * more complicated than usual */
    
            const TPublicSpeak& oldPublic = (TPublicSpeak&)orig;
            /* look at the header files for the definitions */
            TPublicSpeak squark (oldPublic.getU1 (),
                                 oldPublic.getName (),
                                 oldPublic.getLevel (),
                                 oldPublic.getType (),
                                 oldPublic.getPos (),
                                 "Squark");
            
            /* delete the old message and return a new one, this is how a 
             * write hook works. The new proxy will replace the old message
             * with the new one */
            delete tm;
            GRMSpeak* newSpeak = new GRMSpeak (squark);
            return newSpeak;
    }
    
    void load (uint32_t id, Client* client)
    {
            pluginId = id;
            printf ("loading id = %d\n", pluginId);
            pluginName = "dummy";
            clientPtr = client;
    
            /* new we have to load the plugin
             * The pluginId is required for resource management.
             * Something which i think is pretty cool is that when a plugin
             * is unloaded it will automatically free any resources
             * ie. hooks, connections, and the messaging hooks, even if the
             * plugin doesnt do it by itself, which its meant to */
    
            chickenHookId = clientPtr->addRecvWriteHook (pluginId, GRM_SPEAK_ID,
                                                            new ChickenHook);
    }
    
    void unload ()
    {
            clientPtr->deleteRecvWriteHook (pluginId, chickenHookId);
    }
    
    const std::string& name ()
    {
            return pluginName;
    }
    and the result

  5. #5
    Administrator
    Join Date
    Mar 2007
    Posts
    1,723

    noname proxy

    Haha that's funny, I run XP so I can't test your proxy, .

    Jo3

  6. #6
    Senior Member
    Join Date
    Mar 2007
    Posts
    367

    noname proxy

    That's quite similar to the idea I had.
    I wanted to make a prog that would raise events depending on packets received.
    So if you for instance received a lvl up message then there would be raised eLevelUp event.
    And then, if registered, a script would be run.
    Scripts and registering them would be the user-part.

    Guess you could think about something like that

    And looking at the screeny - that's quite funny

    And the prog sounds to be awesome (once it's completed ).

    Good luck

  7. #7
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    there should be a windows port some time soon, i hope.

  8. #8
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    also, as for event based programming i decided long ago that was a bad idea. I much prefer qts way of handling "events" and my hook mechanism more closely models their approach.

  9. #9
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    Ok time for another little update, the send protocol has now been implemented, which means its fun time.

    Now it is possible to make simple plugins such as an auto healer which hooks the player stats message, and if hp < limit send a say "exura" packet.

    The next task is to implement the game state which will record, well, the game state. After that is done more complex plugins can be written.

    The big advantage of parsing the protocol is that the gamestate will be concurrent with the bot itself. This means that if you ask the game state do i have a UH, it will be able to tell you right away. Memory based bots run into a slight problem because there is often a response delay between the time an action is performed and when reading the memory will tell you that the action has been performed.

  10. #10
    Senior Member
    Join Date
    Jun 2007
    Posts
    247

    noname proxy

    Ive made another two plugins, channelmanager and console. These two will be considered core plugins, as channelmanager is required for console, and console is just awesome.

    its finally let me play around with some of the features i wrote when designing the plugin system. I can dynamically load and unload the chicken plugin, which is not only fun, but will make development on plugins much easier, as you will be able to recompile and reload plugins, rather than having to restart the proxy each time you want to change something.

    heres a screenshot


Posting Permissions

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