Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luadec-5.1 fails to compile undefined luaS_new #46

Closed
Vigeant opened this issue Sep 17, 2016 · 2 comments
Closed

luadec-5.1 fails to compile undefined luaS_new #46

Vigeant opened this issue Sep 17, 2016 · 2 comments

Comments

@Vigeant
Copy link

Vigeant commented Sep 17, 2016

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 toluaS_new'
luadec.o: In function strip': luadec.c:(.text+0x87): undefined reference toluaS_new'
luadec.c:(.text+0x9c): undefined reference to luaS_new' luadec.o: In functionInject':
luadec.c:(.text+0x30c): undefined reference to luaS_new' luadec.o: In functionmain':
luadec.c:(.text.startup+0xe6): undefined reference to luaL_loadfilex' decompile.o: In functionFixLocalNames':
decompile.c:(.text+0x2637): undefined reference to luaS_new' decompile.c:(.text+0x26c9): undefined reference toluaS_new'
decompile.o: In function ProcessSubFunction': decompile.c:(.text+0x3f21): undefined reference toluaS_new'
decompile.c:(.text+0x4042): undefined reference to luaS_new' decompile.o: In functionProcessCode':
decompile.c:(.text+0x5e37): undefined reference to luaS_new' /usr/bin/ld: luadec: hidden symbolluaS_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

@viruscamp
Copy link
Owner

viruscamp commented Sep 19, 2016

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);

@viruscamp
Copy link
Owner

Did you make a 5.2 version before make 5.1 without make clean ?

make LUAVER=5.2
make clean
make LUAVER=5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants