lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all,

ChunkSpy 0.9.1 -- a Lua 5 binary chunk disassembler
URL: http://luaforge.net/projects/chunkspy/
(initial release, beta)

ChunkSpy is a Lua 5 binary chunk disassembler with no external
dependencies (it's a single self-contained Lua script). A
detailed assembler-style listing is generated. It's a useful
tool for inspecting the internals of binary chunks.

* includes instruction disassembly with comments
* should work even with non-generic x86 binary chunks
* merge in source code listing

This is a beta release, but most of the features I wanted are
complete, and many bugs have been squashed. Part of the usage
information is as follows:

usage: lua ChunkSpy.lua [options] [filenames]

options:
  -h, --help    prints usage information
  --test        perform internal tests only
  --sample      generate sample listing only
  --stats       prints some statistical information
  --auto        auto detects binary chunk profile

Sample output:
  ...
  ; (0212)      sum = sum * 256 + string.byte(x, i)
  1425  CEBF0005           [08] mul        5   1   255  ; 256
  1429  85010006           [09] getglobal  6   6        ; string
  142D  46400306           [10] gettable   6   6   257  ; "byte"
  1431  00000007           [11] move       7   0
  1435  00000108           [12] move       8   2
  1439  99800106           [13] call       6   3   2
  143D  8C810201           [14] add        1   5   6
  ...

I wrote it as a kind of learning tool. Enjoy,
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia