PDA

View Full Version : AI.obj decompiler


Xellos
04.03.2006, 14:00
ok, here is another project...

I tried to get Valakas Lair working but the server does not liked the map and someone told me to lok into ai scripts from Antaras Lair.

But this ai.obj is not really human readable...
so I tried to fully decompile this thing.

Here is the plan how the decompiler will work:
1.0 decompile bytecode into high language function calls
1.1 transform stackvalues that are pointers to variable-/struct-names
1.2 transform call parameter constants into human readable (items, skills etc.)
1.3 transform comparisms into names when possible (npc_class_id == @keltir)
2. regroup branches to make if-then-elseif-else and/or select-case structures

the engine is fully working for pass1,
only some data for the transformations is missing (pass1_v0)

pass1_v0 decompiled pp-release ai.obj (http://l2.t-u-x.org/ai_decompiled_pass1_v0.zip)
(this archive contains one file per ai-class to get a better overview)

Please PM me when someone got an idea how to improve pass2 decompilation.

kvoxi
04.03.2006, 14:21
May i ask you, why u share archive with 2402 files.
Every file have same structrure.
Why i need download 1 MB to see 2402 non-difference files?
If u try make a decompiler, post only 2-3 files for test, please

Xellos
04.03.2006, 14:29
open your eyes! look at the size of the files...
and open the larger files...
it's the complete project folder...
it's like in ai.obj... some classes are empty :angryfire:

kvoxi
04.03.2006, 14:46
ok, ok :)
i open the largest file. this is tor.txt (filesize is 115263 bytes)
and what?
what something interesting in this file? nothing special...
like as other 2401 files...
i don`t undestand, really

toolpunk
04.03.2006, 15:16
uhm...
though i like the idea of an ai.obj decompiler i gotta tell you that this file is readable...
enough info has been shared and many people CODED new stuff in that compiled "language" ;)

Digital
04.03.2006, 15:17
chill... it's in it's infant stage.
and i believe there's some value in doing this...
(i prefer high level programming rather then doing low level programming... ((sry to them asm freaks :X))

wish u luck in this project Xellos!

Xellos
04.03.2006, 15:22
thx Digital,

my main goal is to get better AIs for raid bosses

and antaras is a good example of what's possible
but i don't want to code such a thing in ai.obj style ^^

and it's easier to rebuild the whole ai.obj from one script than adding new code where we have to substitute all jump lables

Sauron
04.03.2006, 20:16
uhm...
though i like the idea of an ai.obj decompiler i gotta tell you that this file is readable...
enough info has been shared and many people CODED new stuff in that compiled "language" ;)

yes is readable but i can take the hole week to code a quest.

toolpunk
04.03.2006, 20:19
hey, i didnt say its comfortable... ;)