]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/scripts/14araw.lua
Adjust LUA scripts to new ISO14A_NO_RATS option
[proxmark3-svn] / client / scripts / 14araw.lua
index 0ce986565f33fe05f81b0216190d261f2aad574d..82f30fa870f51ebbef8b39b6a80b09e568e6d73e 100644 (file)
@@ -17,6 +17,8 @@ Arguments:
        -p                              stay connected - dont inactivate the field
        -x <payload>    Data to send (NO SPACES!)
        -d                              Debug flag
        -p                              stay connected - dont inactivate the field
        -x <payload>    Data to send (NO SPACES!)
        -d                              Debug flag
+       -t                              Topaz mode
+       -3                              Skip ISO14443-4 select
 
 Examples : 
 
 
 Examples : 
 
@@ -70,6 +72,7 @@ function help()
        print(example)
 end
 
        print(example)
 end
 
+
 --- 
 -- The main entry point
 function main(args)
 --- 
 -- The main entry point
 function main(args)
@@ -83,15 +86,19 @@ function main(args)
        local stayconnected = false
        local payload = nil
        local doconnect = true
        local stayconnected = false
        local payload = nil
        local doconnect = true
+       local topaz_mode = false
+       local no_rats = false
 
        -- Read the parameters
 
        -- Read the parameters
-       for o, a in getopt.getopt(args, 'corcpx:') do
+       for o, a in getopt.getopt(args, 'corcpxt3:') do
                if o == "o" then doconnect = false end          
                if o == "r" then ignore_response = true end
                if o == "c" then appendcrc = true end
                if o == "p" then stayconnected = true end
                if o == "x" then payload = a end
                if o == "d" then DEBUG = true end
                if o == "o" then doconnect = false end          
                if o == "r" then ignore_response = true end
                if o == "c" then appendcrc = true end
                if o == "p" then stayconnected = true end
                if o == "x" then payload = a end
                if o == "d" then DEBUG = true end
+               if o == "t" then topaz_mode = true end
+               if o == "3" then no_rats = true end
        end
 
        -- First of all, connect
        end
 
        -- First of all, connect
@@ -99,7 +106,7 @@ function main(args)
                dbg("doconnect")
                -- We reuse the connect functionality from a 
                -- common library
                dbg("doconnect")
                -- We reuse the connect functionality from a 
                -- common library
-               info, err = lib14a.read1443a(true)
+               info, err = lib14a.read1443a(true, no_rats)
 
                if err then return oops(err) end
                print(("Connected to card, uid = %s"):format(info.uid))
 
                if err then return oops(err) end
                print(("Connected to card, uid = %s"):format(info.uid))
@@ -137,11 +144,11 @@ function showdata(usbpacket)
 end
 
 
 end
 
 
-
 function sendRaw(rawdata, options)
        print(">> ", rawdata)
        
        local flags = lib14a.ISO14A_COMMAND.ISO14A_NO_DISCONNECT + lib14a.ISO14A_COMMAND.ISO14A_RAW
 function sendRaw(rawdata, options)
        print(">> ", rawdata)
        
        local flags = lib14a.ISO14A_COMMAND.ISO14A_NO_DISCONNECT + lib14a.ISO14A_COMMAND.ISO14A_RAW
+       if topaz_mode == true then flags = flags + lib14a.ISO14A_COMMAND.ISO14A_TOPAZMODE end
 
        local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a, 
                                                                        arg1 = flags, -- Send raw 
 
        local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a, 
                                                                        arg1 = flags, -- Send raw 
Impressum, Datenschutz