Closed Vigeant closed 8 years ago
The lua source code you used was not official lua-5.1.x code . Maybe you used lua-5.2 or 5.3 code , or a modified 5.1 code.
I think you use 5.2/5.3 header files mixed with 5.1 lib
// lua-5.2
LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, const char *mode);
#define luaL_loadfile(L,f) luaL_loadfilex(L,f,NULL)
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
// lua-5.1
LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
Did you make a 5.2 version before make 5.1 without make clean ?
make LUAVER=5.2
make clean
make LUAVER=5.1
followinfg the installation instructions for luadec 5.1 on a kali rolling box:
make LUAVER=5.1
gcc -o luadec guess.o luadec.o decompile.o disassemble.o proto.o StringBuffer.o structs.o statement.o macro-array.o expression.o ../lua-5.1/src/liblua.a -lm guess.o: In function
luaU_guess_locals': guess.c:(.text+0x8eb): undefined reference to
luaS_new' luadec.o: In functionstrip': luadec.c:(.text+0x87): undefined reference to
luaS_new' luadec.c:(.text+0x9c): undefined reference toluaS_new' luadec.o: In function
Inject': luadec.c:(.text+0x30c): undefined reference toluaS_new' luadec.o: In function
main': luadec.c:(.text.startup+0xe6): undefined reference toluaL_loadfilex' decompile.o: In function
FixLocalNames': decompile.c:(.text+0x2637): undefined reference toluaS_new' decompile.c:(.text+0x26c9): undefined reference to
luaS_new' decompile.o: In functionProcessSubFunction': decompile.c:(.text+0x3f21): undefined reference to
luaS_new' decompile.c:(.text+0x4042): undefined reference toluaS_new' decompile.o: In function
ProcessCode': decompile.c:(.text+0x5e37): undefined reference toluaS_new' /usr/bin/ld: luadec: hidden symbol
luaS_new' isn't defined /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status Makefile:52: recipe for target 'luadec' failed make: *\ [luadec] Error 1