XPL File Format?

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

theqmann
Posts: 23
Joined: Fri, 21. Jan 11, 21:47
x4

XPL File Format?

Post by theqmann »

Has anyone figured out the format of the XPL files? Are they compiled scripts?
Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Post by Tyrant597 »

Yes, from what I understand they are compiled LUA.
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

discussion is going on on this, seems to be compiled lua files but no standard version of it. at least that is the current consens on that.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
MutantDwarf
Posts: 716
Joined: Tue, 20. Jun 06, 02:29
x4

Post by MutantDwarf »

UniTrader wrote:discussion is going on on this, seems to be compiled lua files but no standard version of it. at least that is the current consens on that.
As far as I can tell it's just standard compiled LuaJIT bytecode, but there are no decent LuaJIT decompilers so we can't mess around with it:(
Deleted User

Post by Deleted User »

I feel they'll release the sources, or a decompiler, along with other stuff for modding.
User avatar
Swallen
Posts: 280
Joined: Tue, 11. Oct 11, 19:13
x4

Post by Swallen »

This seems to be were most of the UI happens. I was looking forward to making some decent job queue management until my search led me to an XPL file. Seems my modding won't be starting anytime soon :(
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Did a little digging with this and came up smelling good ;) The xpl files are lua compiled with luajt http://luajit.org/luajit.html.

A working decompiler can be found here : https://github.com/bobsayshilol/luajit-decomp

with instructions in the Wiki for use.

*EDIT* looking at the output... Good luck!
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Post by nonnex »

YorrickVander wrote:Did a little digging with this and came up smelling good ;) The xpl files are lua compiled with luajt http://luajit.org/luajit.html.

A working decompiler can be found here : https://github.com/bobsayshilol/luajit-decomp

with instructions in the Wiki for use.

*EDIT* looking at the output... Good luck!
As far as I know, a reverseengineering to source it's not possible even with -decomp. The best results what we can get by now are bytecode or assemblies.

For a full source reverse engineering are also the header files needed.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

It is possible, but not for the feint hearted :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Post by nonnex »

YorrickVander wrote:It is possible, but not for the feint hearted :)
I use the method described here: https://github.com/bobsayshilol/luajit- ... i/Tutorial

If You use another less painful method let us know please :)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

that's the same link i posted. so no :P
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Post by nonnex »

So I have played around a bit with the jit files. It is possible to refactor the bytecode 2.0 into source back. but it is really pita to do so.

here just an example of the first lines of /UI/menu_controlentities.xpl:

asm from menu_controlentities.xpl via luajit -b

Code: Select all

-- BYTECODE -- menu_controlentities.lua:11-17
0001    GGET     0   0      ; "Menus"
0002    IST          0
0003    JMP      1 => 0005
0004    TNEW     0   0
0005 => GSET     0   0      ; "Menus"
0006    GGET     0   1      ; "table"
0007    TGETS    0   0   2  ; "insert"
.
.
.
Now if we take a look into it and can read some bytecode the Lua SourceCode expression of the asm above would look like similar to this then:

Code: Select all

if not Menus then 
	local Menus = {}
end

Menus = Menus
table.insert(Menus, menu)
.
.
.
It's easy to use the compare method here by compiling our source "guess" and compare it against original. With this it should be possible to refactor the .xpl into 100% sources. But why should we do that?

How I've sayed, it is pita to transform bytecode to source manually. Whats about patches? So, no it is not the right way. Btw, I was able to inject Luacode by runtime, this could be an alternative, but thats really nasty stuff. Feels like hacking around. Especially if it could be so easy by getting some sources from ES (if they would be so kind).

Someone - or we together - should ask for it.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

I popped in a request for samples and/or docs as an xmas pressie from egosoft, but no sign of it yet :(

A combo of the byte code, along with results of decompiled source might get there sooner rather than later of course.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Return to “X Rebirth - Scripts and Modding”