]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: just made the autopwn script main loop a bit more verbal
authoriceman1001 <iceman@iuse.se>
Tue, 10 May 2016 05:40:27 +0000 (07:40 +0200)
committericeman1001 <iceman@iuse.se>
Tue, 10 May 2016 05:40:27 +0000 (07:40 +0200)
client/scripts/dumptoemul.lua
client/scripts/htmldump.lua
client/scripts/mifare_autopwn.lua

index f8cc11d455da2fa0bbea72fab9bb0c389b680d0d..87c4e645855bbf72208dc87320baa571e74d305e 100644 (file)
@@ -33,8 +33,6 @@ end
 function oops(err)
        print("ERROR: ",err)
 end
-
-
 --- 
 -- Usage help
 function help()
index d14f88195e2e92177dfe469afe71b4bb65634dc1..0299e13c5302c3391b1cc85a0251498b278eaa0f 100644 (file)
@@ -34,8 +34,6 @@ end
 function oops(err)
        print("ERROR: ",err)
 end
-
-
 --- 
 -- Usage help
 function help()
index ce6db3c00767091c2ab5cd3a61e7d643bcea8d5a..12fd270a354b7575e2531bc04b7477be15ee4ecc 100644 (file)
@@ -66,7 +66,7 @@ end
 function mfcrack()
        core.clearCommandBuffer()
        -- Build the mifare-command
-       local cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 1}
+       local cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 1, arg2 = 0}
        
        local retry = true
        while retry do
@@ -78,12 +78,11 @@ function mfcrack()
                if errormessage then return nil, errormessage end
                -- Try again..set arg1 to 0 this time. 
 
-               cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 0}
+               cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 0, arg2 = 0}
        end     
        return nil, "Aborted by user"
 end
 
-
 function mfcrack_inner()
        while not core.ukbhit() do              
                local result = core.WaitForResponseTimeout(cmds.CMD_ACK,1000)
@@ -133,7 +132,7 @@ function mfcrack_inner()
                        local uid,nt,pl = get(4),get(4),get(8)
                        local ks,nr = get(8),get(4)
 
-                       local status, key = core.nonce2key(uid,nt, nr, pl,ks)
+                       local status, key = core.nonce2key(uid, nt, nr, pl, ks)
                        if not status then return status,key end
 
                        if status > 0 then 
@@ -187,10 +186,9 @@ end
 -- The main entry point
 function main(args)
 
-
        local verbose, exit,res,uid,err,_,sak
        local seen_uids = {}
-
+       local print_message = true
        -- Read the parameters
        for o, a in getopt.getopt(args, 'hd') do
                if o == "h" then help() return end
@@ -198,6 +196,10 @@ function main(args)
        end
 
        while not exit do
+               if print_message then
+                       print("Waiting for card or press any key to stop")
+                       print_message = false
+               end
                res, err = wait_for_mifare()
                if err then return oops(err) end
                -- Seen already?
@@ -206,7 +208,7 @@ function main(args)
                if not seen_uids[uid] then
                        -- Store it
                        seen_uids[uid] = uid
-                       print("Card found, commencing crack", uid)
+                       print("Card found, commencing crack on UID", uid)
                        -- Crack it
                        local key, cnt
                        res,err = mfcrack()
@@ -223,6 +225,7 @@ function main(args)
                        nested(key,sak)
                        -- Dump info
                        dump(uid)
+                       print_message = true
                end
        end
 end
Impressum, Datenschutz