]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/scripts/tnp3sim.lua
FIX: "abort trap 6" error when runing the tnp3sim.lua script was because the CMD_MIF...
[proxmark3-svn] / client / scripts / tnp3sim.lua
index fa9d1c22d998db91d36065d07849001cad899ab5..11b268dd04ba94497e850c1aa9321575b49f37d6 100644 (file)
@@ -197,8 +197,9 @@ local function ValidateCheckSums(blocks)
        calc = CalcCheckSum(blocks,2,3)
        if crc == calc then isOk='Ok' else isOk = 'Error' end   
        io.write( ('TYPE 3 area 2: %04x = %04x -- %s\n'):format(crc,calc,isOk))
-end
 
+end
+local function LoadEmulator(blocks)
        local cmd
        local blockdata
        for _,b in pairs(blocks) do 
@@ -219,11 +220,9 @@ end
                        end
                end
 
-               cmd = Command:new{cmd = cmds.CMD_MIFARE_EML_MEMSET, arg1 = _ ,arg2 = 1,arg3 = 0, data = blockdata}
+               cmd = Command:new{cmd = cmds.CMD_MIFARE_EML_MEMSET, arg1 = _ ,arg2 = 1,arg3 = 16, data = blockdata}
                local err = core.SendCommand(cmd:getBytes())
-               if err then 
-                       return err
-               end
+               if err then return err end
        end
        io.write('\n')
 end
Impressum, Datenschutz