ADD: @pivipw 's changes "making lua paths".

ref:: 4197a3f6ff

This contains a ugly hardcoded hack to solve the issue: https://github.com/Proxmark/proxmark3/issues/217
where GetModuleHandleEx doesn't exist in mingw (old proxspace 2013 environment).

Use the docker container or linux...
This commit is contained in:
iceman1001 2017-02-24 14:59:38 +01:00
parent 01f082a60f
commit b804b9cdb8
7 changed files with 762 additions and 13 deletions

View file

@ -221,10 +221,10 @@ static int l_iso14443b_crc(lua_State *L)
unsigned char *TransmitFirst,
unsigned char *TransmitSecond)
*/
unsigned char buf[USB_CMD_DATA_SIZE] = {0x00};
size_t size = 0;
const char *data = luaL_checklstring(L, 1, &size);
unsigned char buf[USB_CMD_DATA_SIZE] = {0x00};
for (int i = 0; i < size; i += 2)
sscanf(&data[i], "%02x", (unsigned int *)&buf[i / 2]);
@ -605,7 +605,11 @@ int set_pm3_libraries(lua_State *L)
//-- Last but not least, add to the LUA_PATH (package.path in lua)
// so we can load libraries from the ./lualib/ - directory
setLuaPath(L,"./lualibs/?.lua");
char libraries_path[strlen(get_my_executable_directory()) + strlen(LUA_LIBRARIES_DIRECTORY) + strlen(LUA_LIBRARIES_WILDCARD) + 1];
strcpy(libraries_path, get_my_executable_directory());
strcat(libraries_path, LUA_LIBRARIES_DIRECTORY);
strcat(libraries_path, LUA_LIBRARIES_WILDCARD);
setLuaPath(L, libraries_path);
return 1;
}