• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

DrNewbie/luajit-decompiler: https://gitlab.com/znixian/luajit-decompiler

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

DrNewbie/luajit-decompiler

开源软件地址(OpenSource Url):

https://github.com/DrNewbie/luajit-decompiler

开源编程语言(OpenSource Language):

Python 86.0%

开源软件介绍(OpenSource Introduction):

LuaJIT Raw-Bytecode Decompiler (LJD)

The original name was ljwthgnd, as in LuaJIT 'What The Hell is Going On' Decompiler; named under the LuaJIT C sources variable-naming convention.

WARNING! This code is not finished or tested! There is not even the slightest warranty that the resulting code is even close to the original. Use the decompiled code at your own risk.

SECOND WARNING! This is all a huge prototype. The "release" version should be written in Lua itself, because it's cool to decompile the decompiler — a great test too!

Requirements:

Python 3.0+ from Python.org

How To Use:

Typical usage (no version configuration list, all files in a directory):

python ./ljd/main.py --recursive ./<input directory> --dir_out ./<output directory> --catch_asserts

Arguments:

"-f", "--file" : Single file input target. Not to be used with "-r"

"-o", "--output" : Single file output destination. Not to be used with "-r"

"-r", "--recursive" : Directory in which to recurse and process all files. Not to be used with "-f"

"-d", "--dir_out" : Directory to output processed files during recursion. Not to be used with "-f"

"-j", "--jit_version" : Global override of LuaJIT version, ignores -j, currently supports 2.1b3, 2.0

"-v", "--version_config_list" : 'Profiles' that hardcode LuaJIT versions per file, ljd.config.version_config.py

"-c", "--catch_asserts" : Prevent most integrity asserts from canceling decompilation

"-l", "--enable_logging" : Output a log of exceptions and information during decompilation

IRC:

#ljd at freenode

TODO:

There is a lot of work to do. In order of priority:

  1. Logical subexpressions in while statements:

    	while x < (xi and 2 or 3) do
    		print ("Hello crazy world!")
    	end

    Logical subexpressions (the subexpressions used as operands in ariphmetic or comparison operations inside other expressions) are currently supported only for ifs. To support them for whiles and repeat-untils, the expression unwarping logic should be moved to the very beginning. This won't work without all the fixes in the loop unwarping logic, so we need to split that and move the fixes before expressions, before loops, before ifs. That's not that easy...

  2. AST Mutations:

    1. Use the line information (or common sense if there is no line information) to squash similar expressions into single expressions.
  3. Formatting improvements (partially-implemented):

    1. Use the line information (or common sense) to preserve empty lines and break long statements like in the original code.

      This is mostly done, but only in the "common sense" part.

  4. Features not supported:

    1. GOTO statement (from Lua 5.2). All the required functionality is now in place, but that's a rather low-priority task right now.

    2. Local sub-blocks:

    do
    	...
    end
    These subblocks are not directly reflected in the bytecode.
    The only way to guess their presence is to watch local variable scopes.
    Simple enough in case of non-stripped bytecode, but a bit
    harder otherwise.
    



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Campbell Suter (ZNix) / luajit-decompiler · GitLab发布时间:2022-08-17
下一篇:
luadch/luadch: ADC Hub Server发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap