Jump to content

eressea

Legendary Member
  • Posts

    534
  • Credits

  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by eressea

  1. Thanks, now it works fine. As for utf-16le problem, this should be sufficient (I'm not PHP programmer, I've copied it from https://stackoverflow.com/questions/27551099/how-to-read-from-files-in-utf-16le-encoding-in-php):

    ...
    $tokenizer = new Tokenizer();
    $parser = new Parser($data);
    $generator = new NASCGenerator();
    
    class readutf16le_filter extends php_user_filter {
        function filter($in, $out, &$consumed, $closing) {
            while ($bucket = stream_bucket_make_writeable($in)) {
                $bucket->data = iconv('UTF-16LE', 'UTF-8',
                    strlen($bucket->data) && substr($bucket->data, 0, 2) == "\xff\xfe"
                        ? substr($bucket->data, 2)
                        : $bucket->data);
                $consumed += $bucket->datalen;
                stream_bucket_append($out, $bucket);
            }
            return PSFS_PASS_ON;
        }
    }
    
    stream_filter_register('readutf16le', 'readutf16le_filter');
    
    $file = fopen('ai.obj', 'r');
    stream_filter_append($file, 'readutf16le');
    $line = 0;
    
    // write BOM
    file_put_contents('ai.nasc', pack('S', 0xFEFF));
    ...

    and just remove

        $string = preg_replace('/[^\s\x20-\x7E]/', '', $string); // remove non-ASCII characters

     

  2. Hi, nice work,  but when I try decompile my ai.obj, I get  this:

    C:\ep\git\nasc-decompiler>run.bat
    Decompile ai_adiantum_skilluse
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    PHP Notice:  Undefined offset: 1 in C:\ep\git\nasc-decompiler\core\tokenizer.php on line 26
    Decompile ai_agit02_dietrichPHP Notice:  Undefined index: S1 in C:\ep\git\nasc-decompiler\core\parser.php on line 442
    PHP Fatal error:  Uncaught TypeError: Argument 1 passed to StringExpression::__construct() must be of the type string, null given, called in C:\ep\git\nasc-decompiler\core\parser.php on line 442 and defined in C:\ep\git\nasc-decompiler\core\ast.php:195
    Stack trace:
    #0 C:\ep\git\nasc-decompiler\core\parser.php(442): StringExpression->__construct(NULL)
    #1 C:\ep\git\nasc-decompiler\core\parser.php(116): Parser->parsePushString(Object(Token))
    #2 C:\ep\git\nasc-decompiler\core\main.php(73): Parser->parseClass(Object(Token))
    #3 {main}
      thrown in C:\ep\git\nasc-decompiler\core\ast.php on line 195
    
    Press any key to continue . . .

    Am I doing anything wrong? The AI part where it's failing is here http://download.l2shrine.com/ai.obj

     

  3. 7 hours ago, etherian said:

    uhmm  i must dwnload GD client and try

    It's just a compiler with definitions for l2npc.exe from GD and H5 - for the few people who have those binaries (I was only asked if I can do it and got definitions that were needed)

     

    1 hour ago, Jamba said:

    Eressea is master, code c++ beautiful , I'll learn seeing your code . Thank you

    Thanks :) But this code isn't so beautiful, it's just a bunch of definitions

  4. As title suggests, I've tried to adapt MyExt64 compiler for Glory Days AI (classes, variable offsets, functions) but it's just an experiment. If there's anyone who can test how it really works, I'd be glad :) It's just a first draft and proof-of-concept, if there's any bug, I'll try to fix it. Stay tuned ;)

     

    Compiled DLL: https://bitbucket.org/l2shrine/extender-public/src/compiler-gd/server/MyExt64.dll

    Sources: https://bitbucket.org/l2shrine/extender-public/branch/compiler-gd

     

    EDIT: Fixed few bugs (missing handlers and wrong 'myself' type in NPC maker event), now it compiles default NPC and default maker

    • Like 1
    • Thanks 1
    • Upvote 2
  5. 6 hours ago, DimensionalGames said:

    i know about the first, but how do i edit the l2.exe? btw thx for answering. This way i can add more too? also are there any dependencies for the dll (other dlls?)

     

    There are tools like CFF Explorer etc, you just open l2.exe there and add an import to import table.

    If you write your DLL, it's up to you what it will depend on. If it depends on other DLLs, it will automatically load them so you still need just to add your DLL to import table of l2.exe and system will do the rest for you.

  6. 7 hours ago, sepultribe said:

    Bumping this topic since I haven't heard anything from the big gurus of the forum. Please share some personal stories of how you started reversing, what knowledge you believe is good as a foundation for newbies, any good books, online courses or whatever you recommend. Anything to give me and anyone else looking for a way to get his feet wet some courage and hope. Or if there is no hope at all for someone who didn't go to Computer Science University, tell me the reasons for that too, I want to hear it.

     

    Till now I've been told you either know how to do it or you don't. Or other really vague things that haven't helped me at all to be honest. Advise people, advise, I don't ask you to hold my hand or give me skype 1:1 lessons for free. We need to get this place alive again, like 8-10 years ago, and for this more people need to learn to code in l2off. I am willing to share and document all my steps to help others like me as I go deeper but without anyone's help I don't know how long it's going to take me, or if I even make it to the end without giving up, struggling with depression at the same time. Please consider contributing and thanks for reading this post.

     

     

     

    I'll throw some tags here so people get to see this hopefully

    @Anarchy@mcbigmac@eressea@Phantasmo@tk422@CriticalError@Sighed

     

    Well, my start wasn't so hard because I actually work as C++ developer and I have some experience with few different assemblers (notably x86 asm from MS-DOS era and Intel 8051 asm, both around 18-25 years ago). Around two years ago, I've decided I want to run l2off server but there was only AdvExt stuff (which is great and I wouldn't even care it costs some money, but it would also mean I wouldn't be able to customize it for my needs) so I've started to google for some extender sources and found OSIE project. It's really small extender that aimed to downgrade GF to Interlude and doesn't fix half of bugs present in GF binaries, but it was a good start. So I've installed IDA Pro and started to try to find how all that works. When I was sure I know how everything in OSIE works, I've started to add some new stuff there (offline trade, global shout). When that worked I started to write brand new extender...

    • Thanks 1
  7. On 6/15/2018 at 9:55 PM, Yoshidajr said:

    does it work in interlude? or you would have an interlude to make it available, thank you.

     

    There are different decompilers for C4-based AIs - unfortunately I don't know anything about them. On the other side, C4 stuff is wide spread on the Internet so I think you can find some working decompiler (or maybe decompiled AI).

  8. 3 minutes ago, melron said:

    maybe i cant understand properly the image but, where did you guys see that the problem is on mysql? I can clearly see class cast exception from big integer to long which is normally lol.

     

    About your errors in mysql tables check the rows if they are really big (lol?)

     

    Because it's thrown when MySQL connection is created - and because first few Google results seem so - just search this:

    "java.math.BigInteger cannot be cast to java.lang.Long" mysql

     

  9. 33 minutes ago, Nightw0lf said:

    I am not C expert to remove completely the serial and the problem is that the OS dont accept later than visual studio 2008 this is why I ask for serial for HWID or any help since I cant do it

     

    You should get VirtualBox, some 64bit Windows 2008 Server and Visual Studio 2005 Pro to be able to do changes/fix stuff etc...

     

    If you're in a hurry, zip the sources together and send me a link, I'll try to remove the licensing and compile it for you...

     

     

  10. On 5/19/2018 at 9:25 PM, verbrannt said:

    Thank you! Can you please explain how did you get the CNPC.h & CMaker.h files with signatures of NASC methods and their addresses (in comments)?

    UPD: I think I found some signatures in the OSIE project, but only methods, not variables.

     

    Yes, something is from OSIE, Vanganth etc and something is reverse engineered in IDA (NPCd stuff mostly reverse engineered)... Get IDA Pro and start exploring stuff :) It's fun if you have time for it

    • Like 1
  11. 11 hours ago, bit said:

    eressea trying to replicate your exact setup. im banging my head here. sure you did not forget anything about proxy setup? you set DNAT to IP of l2server, however here on my end proxy does not know where to route such packet because l2server is on different subnet than openvpn proxies. any ideas?

     

    Hi, the machine "Linux Router" must be in all networks and route packets between them

×
×
  • Create New...