]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/lualibs/read14b.lua
CHG: has the order of varibles some impact? I re-arranged them to match.
[proxmark3-svn] / client / lualibs / read14b.lua
index dd720fea57a59095108838f074d6624f8ae29578..49e3d0e7fe92c222c9c6f72b1dd45c0ded0415a8 100644 (file)
@@ -96,7 +96,7 @@ local function select1443b()
        local result, infoReqb, infoAttrib, infoPong, err, resp, len, data
        local goodReqbResponse = false
        --REQB
        local result, infoReqb, infoAttrib, infoPong, err, resp, len, data
        local goodReqbResponse = false
        --REQB
-       local p = 5
+       local p = 20
        while p > 0 do
                -- 05 00 08
                -- 05
        while p > 0 do
                -- 05 00 08
                -- 05
@@ -107,7 +107,7 @@ local function select1443b()
                --   bit 0-1-2   | N slots  ( 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 == 16)
                --   bit 3               | (1== WUPB, 0 == REQB)  
                --   bit 4-5-6-7 | AFI application family identifier
                --   bit 0-1-2   | N slots  ( 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 == 16)
                --   bit 3               | (1== WUPB, 0 == REQB)  
                --   bit 4-5-6-7 | AFI application family identifier
-               local result, err = sendRaw('050000', 1, 1)
+               local result, err = sendRaw('050008', 1, 1)
                if result then
                        resp = Command.parse( result )
                        len = tonumber(resp.arg1) * 2
                if result then
                        resp = Command.parse( result )
                        len = tonumber(resp.arg1) * 2
@@ -122,10 +122,10 @@ local function select1443b()
                end
                
                -- send some strange 0A/0C
                end
                
                -- send some strange 0A/0C
-               if ( p < 3) then
-                       sendRaw('0A', 0, 0)
-                       sendRaw('0C', 0, 0)
-               end
+               -- if ( p < 3) then
+                       -- sendRaw('0A', 0, 0)
+                       -- sendRaw('0C', 0, 0)
+               -- end
                
                p = p - 1
                print('retrying')
                
                p = p - 1
                print('retrying')
@@ -200,6 +200,7 @@ local function waitFor14443b()
        while not core.ukbhit() do
                res, err = select1443b()
                if res then return res end
        while not core.ukbhit() do
                res, err = select1443b()
                if res then return res end
+               if res == nil then return nil, err end
                -- err means that there was no response from card
        end
        return nil, "Aborted by user"
                -- err means that there was no response from card
        end
        return nil, "Aborted by user"
Impressum, Datenschutz