]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Fix two errors in writeraw (14a)-script that were found by jonor
authormartin.holst@gmail.com <martin.holst@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Fri, 20 Sep 2013 07:32:37 +0000 (07:32 +0000)
committermartin.holst@gmail.com <martin.holst@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Fri, 20 Sep 2013 07:32:37 +0000 (07:32 +0000)
client/scripts/writeraw.lua

index c53b639695600e1657d4e61f260000ebdc3344b0..1dc8c0df047deaf9602daf24ac94da4987f4c106 100644 (file)
@@ -28,12 +28,18 @@ end
 print(string.len(rawdata))
 local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a, 
                                                                        arg1 = 3, -- Connect (1) and don't disconnect (2)
-                                                                       arg2 = 0-- string.len(rawdata), 
-                                                                       --data = rawdata
+                                                                       arg2 = 0
                   }
 local mf_auth = Command:new{cmd = cmds.CMD_READER_ISO_14443a, 
-                                                                       arg1 = 6, -- Send raw 
-                                                                       arg2 = string.len(rawdata), 
+                                                                       arg1 = 10, -- Send raw 
+                                                                       -- arg2 contains the length. 
+                                                                       -- Remember; rawdata is an ascii string containing
+                                                                       -- ASCII characters. Thus; rawdata= "FF" are two bytes in length
+                                                                       -- but when converted to true hexvalues internally inside the Command 
+                                                                       -- constructor, 0xFF is only one byte. So, the bytelength is the 
+                                                                       -- length of the ASCII-string divided by two. Thanks jonor!
+
+                                                                       arg2 = string.len(rawdata)/2, 
                                                                        data = rawdata}
 local quit = Command:new{cmd = cmds.CMD_READER_ISO_14443a, 
                                                                        arg1 = 0, -- Nothing 
Impressum, Datenschutz