Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2009-08-05 17:07:02

ryan
Contributor
Registered: 2009-06-17
Posts: 36

Linux Client in OSX - Some Success

So after changing the pm3's USB descriptor to not be a HID device I was able to successfully prevent OSX from grabbing it so that libusb can talk to the pm3 without having to run the detach command.  I know doing this creates other issues, so I'm only doing it temporarily until a solution is decided upon.

The proxmark3 client can see the pm3, but it hangs when a command is entered because usb_bulk_read in the reader pthread does not appear to honor the timeout value and hangs indefinitely.  If you then do something to get the device to transmit data (like unplug it and plug it back in, or enter standalone mode) it does receive the data.

Can anybody else try to replicate this?  Any ideas for a workaround?

Offline

#2 2009-08-07 03:19:57

ryan
Contributor
Registered: 2009-06-17
Posts: 36

Re: Linux Client in OSX - Some Success

After playing with it a bit more, I ended up compiling libusb myself rather than installing the one from darwinports, and it works.  So if anyone runs into this problem and is using darwinports, try compiling libusb from scratch.

Next step will be to test qtgui support.

Offline

#3 2009-11-05 22:24:13

bushing
Contributor
Registered: 2008-10-14
Posts: 42

Re: Linux Client in OSX - Some Success

It should be possible to create a "codeless kext" that prevents com.apple.iokit.IOUSBHIDDriver from grabbing the Proxmark3 ... but I tried, and couldn't get it to work.   I'll try to modify the USB descriptor like you describe...

Offline

#4 2009-11-05 23:37:36

bushing
Contributor
Registered: 2008-10-14
Posts: 42

Re: Linux Client in OSX - Some Success

Okay, I made some more progress.  Something is really wrong with the event handling -- I can't really figure out how this code can work under Linux.  This patch made it start running:

Index: proxmark3.c
===================================================================
--- proxmark3.c  (revision 252)
+++ proxmark3.c  (working copy)
@@ -46,21 +46,24 @@
 {
   struct main_loop_arg *arg = (struct main_loop_arg*)targ;
   char *cmd = NULL;
+  pthread_t reader_thread;
 
-  while(1) {
+  if (arg->usb_present == 1) {
     struct usb_receiver_arg rarg;
-    pthread_t reader_thread;
+    rarg.run=1;
+    printf("******* spawning reader thread\n");
+    pthread_create(&reader_thread, NULL, &usb_receiver, &rarg);
+  }
 
-    rarg.run=1;
-    if (arg->usb_present == 1) {
-      pthread_create(&reader_thread, NULL, &usb_receiver, &rarg);
-    }
+  while(1) {
+
     cmd = readline(PROXPROMPT);
-    rarg.run=0;
-    if (arg->usb_present == 1) {
-      pthread_join(reader_thread, NULL);
-    }
-
+    printf("cmd = %s\n", cmd);
+//    rarg.run=0;
+//    if (arg->usb_present == 1) {
+//      printf("******* joining reader thread\n");
+//      pthread_join(reader_thread, NULL);
+//    }
     if (cmd) {
       if (cmd[0] != 0x00) {
         CommandReceived(cmd);

Why was the reader thread constantly being created and torn down?

Offline

#5 2017-08-01 02:56:13

Navster
Contributor
Registered: 2017-07-09
Posts: 50

Re: Linux Client in OSX - Some Success

ryan wrote:

So after changing the pm3's USB descriptor to not be a HID device I was able to successfully prevent OSX from grabbing it so that libusb can talk to the pm3 without having to run the detach command.  I know doing this creates other issues, so I'm only doing it temporarily until a solution is decided upon.

The proxmark3 client can see the pm3, but it hangs when a command is entered because usb_bulk_read in the reader pthread does not appear to honor the timeout value and hangs indefinitely.  If you then do something to get the device to transmit data (like unplug it and plug it back in, or enter standalone mode) it does receive the data.

Can anybody else try to replicate this?  Any ideas for a workaround?


How do you change pm3's USB descriptor?

Offline

Board footer

Powered by FluxBB