MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / run_decompile_script

Function run_decompile_script

src/Chain/libraries/glua/single_glua_src/main.cpp:487–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487static int run_decompile_script(lua_State *L, char **argv, int script)
488{
489 const char *fname = argv[script];
490 bool is_bytecode_file = luaL_is_bytecode_file(L, fname);
491 if (!is_bytecode_file)
492 {
493 printf("decompile error, the input is not bytecode file\n");
494 return LUA_ERRRUN;
495 }
496 boost::filesystem::path filepath(fname);
497 char error[LUA_VM_EXCEPTION_STRNG_MAX_LENGTH] = "\0";
498 auto result = thinkyoung::lua::lib::decompile_bytecode_file_to_source_code(L, fname, filepath.stem().string(), error);
499 printf("decompiled result:\n%s", result.c_str());
500 return LUA_OK;
501}
502
503static int run_compile_script(lua_State *L, char **argv, int script)
504{

Callers 1

pmainFunction · 0.85

Calls 4

luaL_is_bytecode_fileFunction · 0.85
printfClass · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected