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
Non tibia programming
Results 1 to 4 of 4

Thread: Non tibia programming

  1. #1

    Non tibia programming

    Hi everyone, its been a while since i dont post here cause im not playing/programming tibia at the moment...

    A few days ago i found a source code but as im not familiarized with c++ some of the code beats my cnowdlege maybe someone could explain / translate some of it.

    Code:
    cout << "Getting debug privileges..." << endl;
            EnableDebugPriv();
            cout << "Opening Process..." << endl;
            HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, GetPIDForProcess("PROCESS.EXE"));
            if(hProc)
            {
                cout << "Process opened... Patching" << endl;
                DWORD gameBase = GetDLLBase("Game.dll",GetPIDForProcess("Process.EXE"));
    			DWORD dSize = 0;
    
    NPATCH(0x4559EC,"\x60\x0B\xC0\x75\x2F\x8A\x8E\xD0\x02\x00\x00\x80\xF9\x01\x74\x51\xC6\x86\xD0\x02\x00\x00\x01\xC6\x86\xD1\x02\x00\x00\x01\xC6\x86\xD2\x02\x00\x00\xFF\x8B\xCE\xB8\xFF\x01\x01\xFF\xFF\x15\x60\x5A\x45\x00\xEB\x2D\x8A\x8E\xD0\x02\x00\x00\x80\xF9\xFF\x74\x22\xC6\x86\xD0\x02\x00\x00\xFF\xC6\x86\xD1\x02\x00\x00\xFF\xC6\x86\xD2\x02\x00\x00\xFF\x8B\xCE\xB8\xFF\xFF\xFF\xFF\xFF\x15\x60\x5A\x45\x00\x61\xB8\x01\x00\x00\x00\x23\xD8\x89\x44\x24\xE4\xFF\x35\x65\x5A\x45\x00\xC3",116);
                DWORD addr[3];
                addr[0] = gameBase + 0x29E270; //References to the Game.dll
                addr[1] = gameBase + 0x39A3BF; //
                addr[2] = 0x4559EC;            //Detour
                NPATCH(0x455A60,&addr[0],sizeof(DWORD));
                NPATCH(0x455A65,&addr[1],sizeof(DWORD));
                NPATCH(0x455A6A,&addr[2],sizeof(DWORD));
                PATCH(0x39A3B9,"\xFF\x25\x6A\x5A\x45\x00",6); //Plant detour
                if(dSize == 0)
                {
                    cout << "Failed to enable colored invisibles" << endl;
                }
    }
    My main problem would be the game.dll part and the NPATCH

    Im programming in VB.net

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Oct 2007
    Posts
    1,045

    Non tibia programming

    I have no idea what the "NPATCH" is.. But it looks like it wants to send a packet or something ;o

  3. #3
    Senior Member
    Join Date
    May 2007
    Posts
    287

    Non tibia programming

    Code:
    GetDLLBase("Game.dll",GetPIDForProcess("Process.EXE"));
    it returns the address where the DLL has been loaded in the memory, it's nice somebody takes care of it, because most of the people quite often assume the reallocation won't happen

    as for the NPATCH
    Code:
    NPATCH(0x455A6A,&addr[2],sizeof(DWORD));
    Generally it looks like a macro for memcpy, it prolly just convert the parameters
    Code:
    inline void NPATCH(unsigned int addr, void* buf, unsigned int bufSize)
    {
      memcpy((void*)addr, buf, bufSize);
    }
    The PATCH is similiar and even can be declared in the same way as NPATCH above. PATCH is supposed to take a string literal as 2nd parameter but in fact it's passed as a pointer behind the scene, so the above will work for it too.

  4. #4

    Non tibia programming

    I know patch, just writes in memory, i can do taht by basic memory writing. I guess the NPATCH is something like that, but i cant get how could it be dont in vb.net.

    About the gamedlll, any idea how it can be done in vb.net?

Posting Permissions

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