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 2012-06-06 16:02:24

PM
Contributor
Registered: 2011-08-15
Posts: 13

[Need HELP please] Proxmark USB protocols (libusb / Android app)

Hello.

I have a problem for Host to Proxmark USB communication.

One week ago, I made a Java for my Proxmark device, using libusb (native lib).
I can easily communicate with my Proxmark, with "bulkTransfer" function (0x01 and 0x82 endpoints) and 64 bytes packets.


Now, I want to try to communicate with an Android Smartphone device. I'm using an USB OTG cable, which allow me to connect the PM3 to my Xperia Pro (updated to ICS last week). The proxmark seems to be correctly powered (standalone mode works with Smartphone power, and LEDs switches on correctly).
I'm also able to read serial number and productId, and detect the Proxmark from my Android application.

Now, the problem is " Which USB interface is used to communicate with the PM3 ? ". When I worked on my Java PC app, with libusb, it seems it use xfer bulk endpoints. (64 bytes packets)
However, when I scan interfaces from the Smartphone application, it found only 2 IN/OUT INTERRUPT endpoints (not bulk ?) limited to 8 bytes per packet (instead of 64).

Any bulkTransfer from Android app fails, and returns "-1". (errCode)

Moreover, the phone seems to not correctly claims the interface.
EDIT : The problem seems to be here --> The device is not claimed correctly. I tried to change "HID" (0x03) type to "generic" (0xff) in the device source, without success hmm

I was hoping that the USB host functionality of android would work, because the tool used (libusb) by google API seems to be the same as my PC application.
But the operation may be more complicated, and I don't know if I missed something, or if "hardware" constraints make operation impossible.


Thanks for help wink (and sorry for my egnlsih)

Last edited by PM (2012-06-06 21:20:45)

Offline

#2 2012-06-12 11:55:47

asper
Contributor
Registered: 2008-08-24
Posts: 1,409

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

Hi, can you please show me how to use the "bulkTransfer" function or write down some piece of source code ? I would like to communicate with PM3 using Visual Basic but I had no luck until now...

Offline

#3 2012-06-12 23:26:37

PM
Contributor
Registered: 2011-08-15
Posts: 13

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

Hello.

Try this sample : http://zone.ni.com/devzone/cda/epd/p/id/3624

Offline

#4 2012-06-13 07:07:13

asper
Contributor
Registered: 2008-08-24
Posts: 1,409

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

PM wrote:

Hello.

Try this sample : http://zone.ni.com/devzone/cda/epd/p/id/3624

Many thanks for the link ! Can you please show some raw command to send to the PM3 in order to get info and, for example, read/write data ? I am now able to send commands through USB but I need exact command syntax because I try to find it in PM3 manual and source but with no examples is too difficult !

Last edited by asper (2012-06-13 07:14:25)

Offline

#5 2012-06-13 09:20:37

PM
Contributor
Registered: 2011-08-15
Posts: 13

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

In usb_cmd.h, you have the list of command codes ( http://pastebin.com/26tR5nym ).

So, normally, you just send raw bytes begining with one of these codes, and Proxmark3 will interpret it, and send you responses.

In order to receive responses, it seems we need to create a dedicated thread which always listen for incoming data. (ie, when you send "0x0000" - device info - you will receive 4 commands containing String response.)


Some commands needs arguments ( a not only the 0x---- code ). Normally, you just have to add raw bytes after the command code. Look at C source code of Proxmark3, and you will see argument format for each command.
(but, before, you can easily try to send "0x0000" or "0x0400" - antenna tunning - which don't need args)

Offline

#6 2012-06-13 10:19:20

asper
Contributor
Registered: 2008-08-24
Posts: 1,409

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

So probably my problem is in libusb under Visual Basic... it seems not to answer to my commands... I really don't know why... can you give me some suggestions/other libs to use with Visual Basic and PM3 ? You can also try to send me a piece of your java code in order for me to understand how it works...

Last edited by asper (2012-06-13 10:49:43)

Offline

#7 2012-07-30 00:48:53

mickarea
Member
Registered: 2012-07-29
Posts: 6

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

PM, I wanted to know if you had continue your work ? If yes, have you been able to communicate with the proxmark via android phone ?

thx

Offline

#8 2012-11-13 11:59:31

asper
Contributor
Registered: 2008-08-24
Posts: 1,409

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

PM wrote:

Hello.

Try this sample : http://zone.ni.com/devzone/cda/epd/p/id/3624


I tryed also this way (dunno why I was missing the full instruction inside that link) but PM3 cannot be recognized by the Devices and Interfaces ov National Instruments software bundle so I am not able to use it at all... I desperately need an example (source code) for the libusb0.dll and libusb0.sys, can PLEASE someone provide few line of VB code in order for me to work with PM3 under Windows environment ? PLEASE !

Edit: should I try to use latest libusb-win32 ?

Last edited by asper (2012-11-13 12:08:16)

Offline

#9 2012-11-30 22:23:27

jonor
Contributor
Registered: 2009-09-17
Posts: 97

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

asper wrote:

So probably my problem is in libusb under Visual Basic... it seems not to answer to my commands... I really don't know why... can you give me some suggestions/other libs to use with Visual Basic and PM3 ? You can also try to send me a piece of your java code in order for me to understand how it works...

Have you tried to install a filter with utility in libusbwin32 for PM3 in windows? UsbOpen return a correct handle?

Offline

#10 2012-12-05 10:45:17

asper
Contributor
Registered: 2008-08-24
Posts: 1,409

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

The problem probably is under libusb that is NOT a windows library and must be "redirected" through libusbvb0 library (custom lubrary built by a developer); the custom library will then "talk" with the original libusb library sendin correct commands; I will try to test this redirections in the near future (I hope).

Offline

#11 2012-12-05 11:03:41

rule
Member
Registered: 2008-05-21
Posts: 417

Re: [Need HELP please] Proxmark USB protocols (libusb / Android app)

The new branch I just created uses a different USB interface and should solve such issues. Please check out this post.

Offline

Board footer

Powered by FluxBB