X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/3510cdff4b1abbd224e731a871c5a7c8687d0c93..f057bddb70733c45eb6110b48df944d01a4be864:/client/scripts/mifare.lua diff --git a/client/scripts/mifare.lua b/client/scripts/mifare.lua index 174c760e..93837d03 100644 --- a/client/scripts/mifare.lua +++ b/client/scripts/mifare.lua @@ -8,7 +8,30 @@ print("core.SendCommand", core.SendCommand) print("core.WaitForResponseTimeout", core.WaitForResponseTimeout) print("core.nonce2key", core.nonce2key) -- To actually send something meaningful, we need to include the 'Binlib' or 'lpack' library. -local x = core.SendCommand("aaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000ggggaaaabbbb2222111100000gggg12345678901234567890123456789012345678901234") -local result = core.WaitForResponseTimeout(0x0611,1000) +local cmd = 0x0611 -- CMD_READER_MIFARE - uint_64 +local arg1, arg2, arg3 = "0","0","0" -- 3 x uint_64 +local d = string.rep("00",512)-- 512 bytes +local usbcommand = bin.pack("LLLLH",cmd, arg1, arg2, arg3,d); +print("len(usbcommand): ", string.len(usbcommand)); +local x = core.SendCommand(usbcommand); +local result +repeat + result = core.WaitForResponseTimeout(cmd,1000) + print(".") +until result + +local r_cmd, r_arg1, r_arg2, r_arg3,r_data; +--[[ +response = bin.unpack() +isOK = resp.arg[0] & 0xff; + +uid = (uint32_t)bytes_to_num(resp.d.asBytes + 0, 4); +nt = (uint32_t)bytes_to_num(resp.d.asBytes + 4, 4); +par_list = bytes_to_num(resp.d.asBytes + 8, 8); +ks_list = bytes_to_num(resp.d.asBytes + 16, 8); + + +end +--]] --- Oh, and nonce2Key is not 'glued' yet. print("err", result) \ No newline at end of file