mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
chg: remark available in lua
This commit is contained in:
parent
2c4e660605
commit
ed565d04f5
3 changed files with 20 additions and 1 deletions
|
@ -38,7 +38,7 @@
|
|||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
static int CmdRem(const char *Cmd) {
|
||||
int CmdRem(const char *Cmd) {
|
||||
char buf[22] = {0};
|
||||
struct tm *ct, tm_buf;
|
||||
time_t now = time(NULL);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "cmdparser.h" // command_t
|
||||
|
||||
int CommandReceived(char *Cmd);
|
||||
int CmdRem(const char *Cmd);
|
||||
command_t *getTopLevelCommandTable(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "crc16.h"
|
||||
#include "protocols.h"
|
||||
#include "fileutils.h" // searchfile
|
||||
#include "cmdlf.h" // lf_config
|
||||
|
||||
static int returnToLuaWithError(lua_State *L, const char *fmt, ...) {
|
||||
char buffer[200];
|
||||
|
@ -1056,6 +1057,22 @@ static int l_ndefparse(lua_State *L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int l_remark(lua_State *L) {
|
||||
//Check number of arguments
|
||||
int n = lua_gettop(L);
|
||||
if (n != 1) {
|
||||
return returnToLuaWithError(L, "Only one string allowed");
|
||||
}
|
||||
|
||||
size_t size;
|
||||
// data
|
||||
const char *s = luaL_checklstring(L, 1, &size);
|
||||
|
||||
int res = CmdRem(s);
|
||||
lua_pushinteger(L, res);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int l_searchfile(lua_State *L) {
|
||||
//Check number of arguments
|
||||
int n = lua_gettop(L);
|
||||
|
@ -1141,6 +1158,7 @@ int set_pm3_libraries(lua_State *L) {
|
|||
{"ndefparse", l_ndefparse},
|
||||
{"fast_push_mode", l_fast_push_mode},
|
||||
{"search_file", l_searchfile},
|
||||
{"rem", l_remark},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue