LuaDec

This application is using luadec (http://luadec.luaforge.net/) as a base, but it's compiled with 5.1. Of course 5.0 and 5.1 are a bit different, so it has a lot of erros atm, but at least it prints some output. It will also supress any errors, so instead of quitting, it will continue decompiling (and might crash). If you want to know how many errors it got use the "-d" option to get the debug information.

Luadec will output a "-- Lua5.1" or "-- Warning" or "-- DECOMPILER ERROR" comment to lines, where you should check the output.

Simpler scripts decompiled with luadec are semantically identical to their original counterparts (usually only the line numberings are changed)

Installation

Simply download and extract to a directory. You'll need to have the MS VC++ 2008 redistributables for the application to work. The input lua files must be ANSI encoded too.

The binaries that are provided here are meant for TouchFlo3D, because they use Q16 numeric formats. If you need a generic lua 5.1 decompiler, then get the source code, and copy over the lua directory with the files from a generic lua before compilation

Known bugs

  1. Luadec sometimes can't determine block endings
  2. Unassigned local variables might hide useful assignment blocks

ExtLua

ExtLua is a DLL Proxy for lua.dll, that will load user made lua functions into the interpreter that can be used for M3D programming

Unfortunately my attempts to implement this DLL proxy as "lua.dll" failed, so mode9.dll and manila2.exe must be patched to use this dll

To use LuaExt one have to create a loadable dll using the LuaExt SDK

LuaExt will load up the DLL files stored in "HKLM\Software\SztupY\LuaExt" and will run their "lua_addawesomestuff" function whenever M3D tries to create a new lua context using luaL_newstate

Installation

  1. If you have an M3D version 1.8.5c (for example from xboxmod) then download the cab and install that
  2. If you have an other version of M3D, you have to patch it. The manual way is the following:
    1. Copy manila.exe (Raphael), manila2.exe (Patched HD manila) and mode9.dll from your device to your computer
    2. Open a HEX editor (like HxD)
    3. Search for the string "lua.dll" and replace it to "aul.dll"
    4. Re-sign both files with signtool (for example to sign mode9.dll run: signtool sign /f SamplePrivDeveloper.pfx mode9.dll)
    5. Copy these files back to your device (M3D should be disabled)
    I also added an automatic ManilaPatcher. Just unzip, and copy manila.exe, manila2.exe and mode9.dll to the directory and run HTCPatcher. (if you don't have all of the files, have no fear, HTCPatcher will only patch files that are provided in the directory)
  3. Copy aul.dll and lua.dll to your device's \Windows directory
  4. Soft reset

Changelog

LuaDec 2.0

LuaDec 1.9

LuaDec 1.0

LuaDec beta 6

LuaDec beta 5

LuaDec beta 4

LuaDec beta 3

ExtLua 0.1

LuaDec beta 2

LuaDec beta 1

alpha 2

alpha 1