[UTILITY] Lua 5.1 tools: compiler, decompiler, snippets & extendable lua.dll with SDK

Search This thread

B4PJS

Senior Member
May 29, 2007
856
8
London
Yes it does but it relies on luadec 1.0 which is not as good at decompiling as the newer luadec 2.0. I use the m9editor to separate lua from the other files and do the proper decompiling in my kitchen. Sztupy decompiled the files used for the rhodium port and you can find them at his site, 12

Cheers Bro, will check it out :)
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
okay, needing some help with this file. no idea what is messed up with it. I am getting different results on different things I do.

comparing it to the decompile rhodium files, it seems to be almost an exact match, for layout anyways, the locals are different, but aside from that everything is the same, and I am still getting a bunch of messed up stuff.

So if somone has time, and let me know what I did wrong it would be great.

The log file, my attempt to decompile it, and the manila file are all attached. so take a look

The main block is different??? I don't really know what that means, never saw that before....
 
C

conflipper

Guest
Where there is something like this. the 1.699999... is that the correct number, or is it becuase HTC uses a different standard, and these numbers need to be cahnged to the correct conversion has well?

HTML:
  else
    if l_2_0._application.Orientation == ScreenOrientation_Landscape then
      l_2_2.Scale = Vector3Property(Vector3(1.6999969482421875, 1, 1))
    end
 
C

conflipper

Guest
and if this is all I have in my Log file for errors, do I need to worry about fixing this?

HTML:
Function 2:
  1>175 [-]: EQ        0 R2 K66     ; if R2 ~= true then PC := 196
  2>175 [-]: EQ        0 R2 K66     ; if R2 ~= true then PC := 204
  1>176 [-]: JMP       196          ; PC := 196
  2>176 [-]: JMP       204          ; PC := 204
  1>189 [-]: EQ        0 R2 K66     ; if R2 ~= true then PC := 204
  2>189 [-]: EQ        0 R2 K66     ; if R2 ~= true then PC := 196
  1>190 [-]: JMP       204          ; PC := 204
  2>190 [-]: JMP       196          ; PC := 196
Opcodes in original: 220
Same lines in both files: 216 98%


The way I read this, is that I have condionals, but that not to care about them, if I do not have anything else in the file to fix. or am i wrong on this has well.

HTML:
CONDITIONALS!


99 out of 100 cases you will HATE them!


Usually if the only difference between the original and the decompiled script is the location
 where they jump (the PC:=xxx part)then don’t care about them, unless you have fixed
 the rest of the script (I mean the locals). If there are only conditional statements left,
 then you will have a hard time guessing how this have to be done. Usually this means
 the structure of the conditionals are not right. For example instead of



What is the proper way to handle the Repeat log?

HTML:
LvMessages.ClearCollection = function(l_17_0)
  local l_17_1 = l_17_0.collection:GetCount()
  repeat
    if l_17_1 > 0 then
      l_17_0.collection:pop_back()
      l_17_1 = l_17_1 - 1
    end
end

convert this to?

HTML:
LvMessages.ClearCollection = function(l_17_0)
  local l_17_1 = l_17_0.collection:GetCount()
  
    while l_17_1 > 0 do
      l_17_0.collection:pop_back()
      l_17_1 = l_17_1 - 1

    end
 
Last edited:
C

conflipper

Guest
Well I have 155 of the Tachi Scripts decompiled. I am still getting confused on some of the bootlean error codes. and a few others.

its not an easy concept to get understand, so I am doing my best, 82 to go, and then I start on the embedded ones. this is going to be fun.
 

colonel00

Senior Member
Jan 21, 2007
166
0
Does anyone happen to know where the control is for the page length in the "people" tabs? For example, in peoplemessaging on a vga device, the last two lines/messages fall down behind the input box and menubar. I would like to move this up but cannot find where this is handled.
 

epapas

Senior Member
May 1, 2009
129
3
Athens
Menu Left Soft KEy

Hi

I am running a ROM with the TF3D2 V1E. There in the call history when I press menu I get a dim screen and everything is stuck.
I used m9 editor to find possible solution. So I found in the 771fb99e_manila the following snippet
RSKFunction_Callback = function()
dialogThing = _application.DialogManager:GetDialog(URL("Manila://PeopleCallLog.dialog"))
dialogThing.OnExit:connect(DialogMenu_Callback)
dialogThing:Show()
end

So what is Manila://PeopleCallLog.dialog? Is it in another file? Is it XML?
Any hint would be aprreciated. Thanks!!!
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
Latest kitchen

I've been prepping a fully automated decompiling (and anything else realated to lua) kitchen. It decompiled as many lua files as you'd like at once. Also it's based on to keeping the original files names know at any times so it won't ever be confusing which files you work with. It automatically creates a scripts library from the successfully decompiled files (sztupy's tools of course) and it makes it real easy to get the embedded lua files from the mode9 in there as well. The only thing that you'll need to do is work on the scripts which luadec didn't fully decompile. Anyway check out this lean mean decompiling machine over here
 

tkiela

New member
Nov 19, 2009
1
0
Hey there.

Is there any way to decompile a *.lub-File?

Everytime I try decompiling it with LuaTool or luadec.exe, the executeable crashes.
Why?

I uploaded an example file.

Thanks for help.
 

Attachments

  • file.zip
    468 bytes · Views: 59

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
Hey there.

Is there any way to decompile a *.lub-File?

Everytime I try decompiling it with LuaTool or luadec.exe, the executeable crashes.
Why?

I uploaded an example file.

Thanks for help.

Wrong thread, Sztupy hasn't been around for a while you should ask Co0kiemonster instead,

12
 

guenthar

Member
Feb 5, 2010
5
0
I downloaded luadec today so that I can decompile a script from a game. I disassembled the script successfully but when I go to decompile it I get "unexpected symbol near ';'" and it doesn't do anything. I tried the debugging feature and it comes up with the same error.

Thank you
 

sentinel80

Senior Member
Sep 11, 2009
76
0
Problem with decompile 53cc1e4f_manila

Hi!

I have problem with decompile 53cc1e4f_manila this files is from Manila_2_1_19201317_0.

If i want decompile, i get three files:

53cc1e4f_manila.lua
53cc1e4f_manila.dis.lua
53cc1e4f_manila.error.txt

In error i see this message: LuaDec: 53cc1e4f_manila.lua:215: function arguments expected near 'l_15_8'

Anybody pls help me.
 

Attachments

  • 53cc1e4f_manila.ZIP
    40.1 KB · Views: 118

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
Hi!

I have problem with decompile 53cc1e4f_manila this files is from Manila_2_1_19201317_0.

If i want decompile, i get three files:

53cc1e4f_manila.lua
53cc1e4f_manila.dis.lua
53cc1e4f_manila.error.txt

In error i see this message: LuaDec: 53cc1e4f_manila.lua:215: function arguments expected near 'l_15_8'

Anybody pls help me.

Take a look inside this thread:

http://xdaforums.com/showthread.php?t=528548

This is an older version of the manila kitchen by Sztupy which relies upon an earlier version of the decompiler.

What those files mean is described in the thread above but I'll give you a quick answer. Do keep in mind that what you are trying to do most likely is a lot harder than you might think it is.

53cc1e4f_manila.lua -> this is a .lua file which handles some of the operations inside Sense\TF3D (right now it's not useble since there are still errors in this script)
53cc1e4f_manila.dis.lua -> This is the output from the dissembler, you can use this to see the order in which the script is processed
53cc1e4f_manila.error.txt -> This file tells you where to look for the error inside the .lua script

After you have fixed the error run the kitchen again with the "-CMP" switch to see if you have fixed that part of the lua script. Keep repeating this until there is no more error.txt,

12
 

Akademik

New member
Jul 17, 2010
1
0
Hi!

I have problem with decompile strings_db.lua:(

If i want to decompile, i get error:
luadec: strings.lua: bad header in precompiled chunk
or
Input is not a valid LUAC file.

Can you help me please.
 

Attachments

  • strings_db.rar
    84.2 KB · Views: 76

Gee Force

New member
Dec 31, 2011
1
0
I'm sorry to bump such an old thread, But I really need to decompile a lua script but the executable crashes on me, this seems to happen to anything big. Does anyone want to spare a few minutes and give a crack at trying to decompile this script for me? I'd really appreciate it.
 

hilaireg

Moderator Emeritus
Jan 20, 2009
2,948
237
I'm sorry to bump such an old thread, But I really need to decompile a lua script but the executable crashes on me, this seems to happen to anything big. Does anyone want to spare a few minutes and give a crack at trying to decompile this script for me? I'd really appreciate it.

Have a look at this thread:

http://xdaforums.com/showthread.php?t=528548


You will find newer tools, additional reference web links, and some XDA social groups which focus on modding Manila.

Cheers,
 

umare4388

New member
Jul 5, 2020
1
0
I wand to get open source from dll file which made in C++.
Can any one help me to disassembly and de compile and decode. Interested can mail me to umaresuresh@gmail.com
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I still haven't been able to figure out where this is actually referring too. I see similar situation in other lua files. But in each case, I've been unable to locate where or what it's actually trying to do. :confused:

    They are dialogs (as their name suggests). They are defined in manila.xml (26948339_manila). They seem to be like some kind of "embedded mode9" files

    Example:
    Code:
    <PageGroup Name="settings">
    (...)
      <PageGroup Name="updatesanddata">
        <Page Order="0" Name="updatesanddata.page" PackageName="HTC" Title="[[IDS_UPDATESANDDATA]]" Default="true" >
          <ComponentReference Name="page"  Mode9Path="HTC\settings.mode9" Component="UpdatesAndDataPageComponent" SmartComponent="true"  />
        </Page>
      </PageGroup>
    (...)
    </PageGroup>