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 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
[HOWTO] Pokemon Online SPR/DAT/PIC reading
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: [HOWTO] Pokemon Online SPR/DAT/PIC reading

  1. #1
    Senior Member
    Join Date
    Aug 2007
    Posts
    232

    [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Hiho!
    Now i will try to explain you how the MoleBox packer works in Pokemon Online client.
    Only what you need is Tibia 8.10 (for comparisions), PO client and OllyDbg.
    Let's take a look how Tibia and PO are getting handle to a file:



    Now you can see that Tibia is using original CreateFileA API to get a handle instead of PO's unknown function. If you put breakpoint on PO's function, you will notice that it's requesting Tibia.spr same as original Tibia client.
    Ok! Now go to 0x597100 address. There are pointers to API's what Tibia uses.



    At the first look you can notice that packer changed pointers to some API's like:
    CreateFileA, ReadFile
    What's our goal? Write a simple program that will use changed API's and write original file.

    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <process.h>
    
    #define DEFAULT_BUF_LEN 40000000
    // 40mb~
    
    typedef HANDLE (__stdcall *_CREATEFILE) (LPCTSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile);
    _CREATEFILE MBCreateFile = (_CREATEFILE)(*(DWORD*)0x597100);
    
    typedef BOOL (__stdcall *_READFILE)(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped);
    _READFILE MBReadFile = (_READFILE)(*(DWORD*)0x5970E8);
    
    void ThreadProc(void *param)
    {
         DWORD bytesRead;
         DWORD bytesWritten;
         char *buffer = new char[DEFAULT_BUF_LEN]; //40mb~
         HANDLE h = MBCreateFile("Tibia.spr", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
         MBReadFile(h, buffer, DEFAULT_BUF_LEN, &bytesRead, NULL);
         //
         HANDLE p = CreateFile("Tibia2.spr", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
         WriteFile(p, buffer, bytesRead, &bytesWritten, NULL);
         CloseHandle(p);
         delete[] buffer;
    }
    
    extern "C" BOOL APIENTRY DllMain (HINSTANCE hInst,
                           DWORD reason,
                           LPVOID reserved)
    {
        switch (reason)
        {
          case DLL_PROCESS_ATTACH:
               {         
                   _beginthread(ThreadProc, 0, NULL);   
               }
            break;
        }
     
        return TRUE;
    }
    Next step is inject DLL to tibia and wait some seconds for Tibia2.spr in PO's directory.
    In this tutorial i missed checking for compressed file size (buffer allocation).
    If you want to get PIC for example.. You need to change "Tibia.spr" and "Tibia2.spr" strings (it won't work with exe).

    Src&Bin attached.

  2. #2
    Junior Member
    Join Date
    Jan 2010
    Posts
    6

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Woah nice. Now I know how not to pack my spr and dat.

  3. #3
    Senior Member
    Join Date
    Jan 2010
    Location
    Venezuela
    Posts
    366

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    This sucks :/ i have a more easy way

  4. #4
    Junior Member
    Join Date
    Apr 2010
    Posts
    14

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Don't work for me.
    I put the P.O exe and record.exe in the same folder and i executed the record and nothing....
    Can you help me?

  5. #5
    Senior Member
    Join Date
    Aug 2007
    Posts
    232

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Quote Originally Posted by Pro-grammer
    This sucks :/ i have a more easy way
    Yeah I know why this sucks.. because I can destroy your bussiness? Am I right?

    Quote Originally Posted by conde2
    Don't work for me.
    I put the P.O exe and record.exe in the same folder and i executed the record and nothing....
    Can you help me?
    You should have 3 files in the same folder.
    record.exe
    po.dll
    pokemon client

    Run pokemon client, next record.exe and then wait for files in your folder.
    (Faster than copy-paste someone's script )

  6. #6
    Senior Member
    Join Date
    Oct 2008
    Posts
    208

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    yeah (: works good thanks

  7. #7

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Quote Originally Posted by Pro-grammer
    This sucks :/ i have a more easy way
    Dumb thing to say. There is a million easy ways.

    I didnt read this thouroughly, but I can tell you i can just read the Spr pointer, find the SPR address, read that and write to a file. Simple code and something slow like VB can do it in 5 seconds or less, bet me.

    Don't be a dick and brag, show proof or fuckoff.

    Good work, Beziak. You always have helpful input where it is needed. I wish I had the time to help as much as you, like I used to.

  8. #8
    Junior Member
    Join Date
    Apr 2010
    Posts
    14

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Thank you so much xD
    Work very nice now =)
    I'm so glad =D

  9. #9
    Junior Member
    Join Date
    Dec 2009
    Posts
    4

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    Molebox 2.x Unpacker

    ~

  10. #10
    Junior Member
    Join Date
    May 2010
    Posts
    2

    RE: [HOWTO] Pokemon Online SPR/DAT/PIC reading

    how can I do the opposite? (encrypt my own custom client to avoid custom sprites steal?)

Posting Permissions

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