Proxmark3 developers 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.

#1 2013-04-25 12:17:25

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

.net (c#/vb) Client

Hi,

So is there any progress with bringing a .net client for the proxmark3?  I looked around the forum, and at code.google  but I still don't see a pure .net client yet.
I might ask instead if there is any need for it?  I found Asger to have a certain interest of it.

I tought of offering my assistance to bring forth a .net client. If there is any work in progress otherwize I might have to do it by myself.

Don't hesitate to contact me.


If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#2 2013-04-25 15:50:08

rule
Moderator
Registered: 2008-05-21
Posts: 416

Re: .net (c#/vb) Client

I don't think this exist so far. It was hard to realize before we changed to the new CDC interface. Dotnet and libusb don't go hand in hand (and stay platform independent).
There will always people that prefer a GUI over a console interface, so I think you would make these people very happy with such a contribution!

Offline

#3 2013-04-25 15:59:13

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

Re: .net (c#/vb) Client

There are different approaches to this I suppose.  Either build a gui-wrapper around the proxmark3.exe binary,  like the zen-gui for nmap.  Or one might convert it all, which is a much longer path to follow given all the bit-operations in the source.   I will take a look at the Crapto1gui source, and see which way they did there.  I might find it inspirational, who knows.    Pleasing people however, is a different matter and not so easy to accomplish in my experience.  I will do my best.  Do you have a prefered way of handling sourcecode, like code.google?


If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#4 2013-04-25 16:01:15

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

Re: .net (c#/vb) Client

And by the way, there seem to be different versions of crapto1 laying around, like  the crapto1-v3.2  project.  Which is the "latest" and most updated one?


If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#5 2013-04-25 20:38:28

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Hi guys,
my new "forum friend" Asper sent me a package with windows executable that allows to use the proxmark on command prompt.
I know that up to now that is the only available tool available for windows. 
He said that he and another guy tried in the past to do what you want to do with this discussion, but they end up it was too much complicated due to the fact that the protocol between pc and the fpga it's  too much "custom".

Someone thinks the command prompt is not the best GUI cause it's not so easy to copy text from the command prompt and you have to type commands instead of press buttons...

I partially agree with it (only partially),
for this reason i created a tool: I run the proxmark exe inside my tool, creating an asyncronous thread and redirecting the standard input and standard output to my thread.
By this way i'm able to interact with the proxmark.

In my sample, made in more or less 1 hour, you can:
-open the connection on the choosed serial line
-send the HELP command by pressing the HELP button
-send manual command typing inside the text field the command to send
-read the result of the requested command and copy the result with easy CTRL+C.

parsing the result you can create a custom graphic interface to show the result in the best way.
parsing the string result it's not complicated. just some patience.

I still don't have proxmark (too much expensive) but you can use my code, and add buttons associating them to proxmark commands (or sequences of commands)

This is the distribution license: you must  always mention in the INFO window, the credits to Gaucho for the Startup engine (or find another better word) and Asper for the idea (and the moral support). big_smile

Work on it and beautify it.
Enjoy!
http://www.sendspace.com/file/9hiltu

Here it is a screenshot ( i didn't work on the visual aspect, but on the asyncronous thred creation)
tooli.jpg
p.s.:inside the bin/debug folder you can find the compiled tool and the executable (with dependencies) received by Asper.


Imagination is more important than knowledge.

Offline

#6 2013-04-25 20:58:06

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

Re: .net (c#/vb) Client

Thanks Gaucho.

The idea that you present is similar to how I choosed to go forward with.  Wrap the compiled programs with a GUI,  grap the standardoutput and present the relativ parts.
I, with you, really don't like the cut & paste function from cmd-windows.  It is simply plain tedious.  So today I got this together.

IceCrapto1.Net

Cut the intressting line with uid, nt, par, ks  in the bigger box and it processes the rest.


If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#7 2013-04-25 22:02:46

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Go Iceman!
now you have everything you need. take a look at my code. I don't know if crapto is implemented in the same way.
What i've seen is that if you don't use asyncronous thread to launch the proxmark process, your GUI will freeze untill the proxmark process will dead.
So, syncronous thread is ok if your "command prompt exe" executes a specific command then exits. But if, like in this case, your exe runs and stays opened waiting for user inputs, you need an asyncronous thread to start the proxmark process.


Imagination is more important than knowledge.

Offline

#8 2013-04-27 11:07:04

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

Re: .net (c#/vb) Client

Well iceman you can use my PM3 command manual and make for example an XML file that can be easily added to any software !

Offline

#9 2013-04-27 11:52:21

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

I suggest 2 ways:
1)If you will use c.net you can try to include the .c files linked here https://code.google.com/p/proxmark3/sou … k%2Fclient
(I'm faster on vb.net, so i would not choose that solution, even if by that way updates will be easily managed )

2)Creating a custom xml file.
The xml file could be structured like this :

<?xml version="1.0"?>
<pm3>
   <section>
		<title>HELP</title>
		<description>This help</description>
		<command>
			<item>
				<type>button</type>
				<label>HELP</label>
				<tooltip>Press to obtain the Help info</tooltip>
				<action>HELP</action>
			</item>
		</command>
   </section>
   <section>
		<title>HELP</title>      
   </section>
   
</pm3>

where you can have more than one section in cascade or at the same level, more than one command at the same level and more than one item at the same level.

sections can be displayed in a tree view on the left side of the window.
commands can be displayed on the right side of the window.
each command as you can see can be composed of many items like buttons, labels, texboxex..etc..etc..
the action can be a string formatted according to the string command you want to send.

In the xml file you can even add a way to decode the result of the command.
Or you can mix: the most part of the tool can be configurable on xml and some custom parts like bruteforce, or dump decoding can be hardcoded in the software.

Last edited by gaucho (2013-04-27 11:58:52)


Imagination is more important than knowledge.

Offline

#10 2013-04-28 22:41:24

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Hey Iceman, are you working on it?
today I had a moment to work on it.
I changed the structure of the xml:

<?xml version="1.0"?>
<pm3>
   <section title="HELP" tooltip="Help command shows available commands" uniqueId="1" >
		
			<item type="button" text="HELP" tooltip="Press to obtain the Help info" action="HELP">
			</item>
			<item type="label" text="sample text" >
			</item>
			<item type="textbox" tooltip="sample tooltip" uniqueId="textbox1" >
			</item>
   </section>
   <section title="command1" tooltip="description1" uniqueId="2" >
		     
   </section>
   
</pm3>

this is the appereance. do you like it?

picturehe.png

If someone completes the xml file, i will complete the exe.
It is missing only the action for commands with parameters.
the commands can be structured like this sample:
if a texbox contains the texty "HI" and the action field of a button contains "HELP $textbox1 SEND", that button will send to proxmark the string HELP HI SEND
Hope it is clear.
Here annexed source code with the exe and settings.xml file in debug folder.
http://dfiles.eu/files/kfu6pa6qr


Imagination is more important than knowledge.

Offline

#11 2013-04-29 05:51:11

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

Re: .net (c#/vb) Client

Nice remake, Gaucho!

I'm in the process of trying to get a better flow of actions. Like for instance, you issue the "hf mf mifare" command,  then you wait,  then if you get a response from the output that you may use to the nonce2key.  So you cut 'n paste (from the command window is not the same as in windows) and wait again..  Then you cut 'n paste the key (if found)  to issue the  "hf mf nested"  and so on... 
I like instead this process. Put the card on the pm3, software identifiy the card direct (or via buttonpress)  Then a button "get keys", runs the aformented process with "hf mf mifare -> nonce2key -> hf mf nested" and so on.

And this doesn't exclude a gui you made, but it is an complement to it.

So to better understand the existing codebase, I started to convert the nonce2key code into managed c#.  A lot of bit-wise operations smile but I needed to refresh my knowledge of it anyway smile


If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#12 2013-04-29 07:37:01

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

I suggest you the following:
1) on xml let's complete the PM3 commands tree.
2) on xml let's add a section named "MACRO" with tooltip "complex functions using PM3 commands"
3) inside MACRO section, add many sections, one for each "complex command to send"
4) inside each complex command there will be textboxes,labels and buttons.
5)on button's action there will be an ACTION string where we will implement a stadard syntax.

For example if the textbox1 contains HI and textbox2 contains BYE, and  the action string is "MF $textbox1 #wait keyword#LF $textbox2"
the tool will  send the commands to PM3: MF HI, then waits for a response from the proxmark containing "keyword", then sends to proxmark the command LF BYE.

What we need is just to write a global rule to compose the command.
This way you will write one time the exe. Next time someone will update the xml, even if he is not a programmer.
Have you tried the exe? controls are drawn on the window dinamically upon xml content.

Last edited by gaucho (2013-04-29 07:39:26)


Imagination is more important than knowledge.

Offline

#13 2013-04-29 17:06:44

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

Re: .net (c#/vb) Client

Gaucho,  Is it like this you are thinking? 

settings.xml:

   <section title="HF" tooltip="High frequence commands" uniqueId="2" >
		<item type="button" text="list" tooltip="List ISO14443 history" action="hf 14a list" />
		<item type="button" text="reader" tooltip="Act like an ISO14443 Type A reader" action="hf 14a reader" />
		<item type="button" text="cuids" tooltip="<n> Collect n>0 ISO14443 Type A UID:s in one go" action="hf 14a cuids" />
		<item type="button" text="sim" tooltip="<UID> Fake ISO14443 Type A tag" action="hf 14a sim {0} {1}" />
		<item type="button" text="snoop" tooltip="Eavsdrop ISO14443 Type A" action="hf 14a snoop" />
   </section>

If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#14 2013-04-29 17:24:34

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Yes you are right ! Test it downloading the tool! Or you can post it here and I will check it.

I still don't have proxmark3, so it is better that this xml is filled and tested by someone who can test it.
Up to now you can test each command that it doesn't need parameters, but you can write them all.
If someone will do it I will continue the tool.
Note: up to now all buttons,textboxes, labels inside a section are drawn in the same window, so, if commands are not related to the same matter (or just if it is better to watch them in different windows),  i suggest you to place buttons in different sections.
Teorically you can have one section (then one leaf) for each button.

now you can have many sections in cascade and many sections at the same level.
Items, instead, are objects (windows form's controls) and therefore they can not be nested.

If I well remember, a section with items can not have a section at the same level of the items.. but I'm not sure of that.. Anyway i think we need items only on the final leafs, so we don't have this problem.

p.s: What are these "{0} {1}" . are they parameters? if yes, you can create textboxes where the user can insert parameters calling them (uniqueId), for example,  {0} and {1}. The important thing is that the uniqueId must be unique inside the section. Before to test these commands with parametrs I have to write some code. Let me know if you are interested to contribute on the xml.

Last edited by gaucho (2013-04-29 17:28:47)


Imagination is more important than knowledge.

Offline

#15 2013-04-29 17:46:18

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

Re: .net (c#/vb) Client

Great job guys ! I was waiting for something like that for years !!! I can test it ! And If someone can make a detailed example of the "hardest" pm3 command,hf 15 cmd + all parameters, (hardest = the one with the maximum "nesting" items), I will try to fill all the rest !

Here are all hf 15 cmd params:

hf 15 cmd	help             This Help          	
	inquiry          Search for tags in range          	
	read             Read a block          	Usage:  hf 15 cmd read    [options] <uid|s|u|*> <page#>          
           options:          
               -2        use slower '1 out of 256' mode          
           uid (either):           
               <8B hex>  full UID eg E011223344556677          
               s         selected tag          
               u         unaddressed mode          
               *         scan for tag          
           page#:        page number 0-255          
	write            Write a block          	Usage:  hf 15 cmd write    [options] <uid|s|u|*> <page#> <hexdata>          
           options:          
               -2        use slower '1 out of 256' mode          
               -o        set OPTION Flag (needed for TI)          
           uid (either):           
               <8B hex>  full UID eg E011223344556677          
               s         selected tag          
               u         unaddressed mode          
               *         scan for tag          
           page#:        page number 0-255          
           hexdata:      data to be written eg AA BB CC DD          
	readmulti        Reads multiple Blocks          	Usage:  hf 15 cmd readmulti  [options] <uid|s|u|*> <start#> <count#>          
           options:          
               -2        use slower '1 out of 256' mode          
           uid (either):           
               <8B hex>  full UID eg E011223344556677          
               s         selected tag          
               u         unaddressed mode          
               *         scan for tag          
           start#:       page number to start 0-255          
           count#:       number of pages          
	sysinfo          Get Card Information          	Usage:  hf 15 cmd sysinfo    [options] <uid|s|u|*>          
           options:          
               -2        use slower '1 out of 256' mode          
           uid (either):           
               <8B hex>  full UID eg E011223344556677          
               s         selected tag          
               u         unaddressed mode          
               *         scan for tag          
           start#:       page number to start 0-255          
           count#:       number of pages          
	raw              Send raw hex data to tag          	Usage: hf 15 cmd raw  [-r] [-2] [-c] <0A 0B 0C ... hex>          
       -r    do not read response          
       -2    use slower '1 out of 256' mode          
       -c	  calculate and append CRC          
 Tip: turn on debugging for verbose output          
	debug            Turn debugging on/off          	Usage: hf 15 cmd debug  <0/1>          
	0..no debugging output  1..turn debugging on          

Last edited by asper (2013-04-29 17:50:57)

Offline

#16 2013-04-29 20:16:32

iceman
Administrator
Registered: 2013-04-25
Posts: 6,704
Website

Re: .net (c#/vb) Client

"{0} {1}"

is just idea to use the vb.net string.format() method for getting the textbox inputs to the command.

I played with your codebase. ( I'm not allowed to post links here. )

http://depositfiles.com/files/fmszi5ymx

 


So, there may be a need for one more level in the proposed xml-format.

And I tried it against my PM3 and it works but not flawless. However, running a command like "hf tune"  has no way of cancel the process yet. But it is fun to see it work.

smile


If you feel the love,  https://www.patreon.com/iceman1001

modhex(hkhehghthbhudcfcdchkigiehgduiehg)

Offline

#17 2013-04-29 20:18:08

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

I still didn't watch your code. I'll to it.

The xml formatting needs to be better structured..

Last edited by gaucho (2013-05-01 21:19:26)


Imagination is more important than knowledge.

Offline

#18 2013-04-29 20:46:28

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

iceman...are you working on vb6? your annex has only few files. you removed try-catch structures that ensure to avoid crashes. I can't find important differences. now I don't have a tool to do the merge.
Let's work on .net in order to share the same project.

the action string has to be parsed to convert $variableName to " & variableName.text & " inside the code. I will do it.. May be it is better to validate the syntax before to proceed.

Last edited by gaucho (2013-04-29 20:51:27)


Imagination is more important than knowledge.

Offline

#19 2013-04-30 16:47:53

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

I did my job.
Now complex commands are parsed as wrote in my previous message.
I also solved some bugs.
Someone should complete the xml.
If something can be done better you should verify and ask.

Last edited by gaucho (2013-05-01 21:18:27)


Imagination is more important than knowledge.

Offline

#20 2013-05-01 21:15:10

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

I updated the tool cause Asper while filling the xml found some things to complete.
Now you only need to complete the xml as you prefer.
Here what i did:
-corrected bugs
-defined a syntax to draw items in the treeview and in the window (you can find the syntax to use in the info window)
-defined syntax for items parameters and action, with complex action definition (you can find the syntax to use in the info window)
-may other things that now i can't remember.

the tool is here http://dfiles.eu/files/lsmjzxl9z in /bin/debug you can find the exe and the "Proxmark Tool.exe" and the settings.xml file started by Asper and corrected by me. Now the xml file should be completed by you.

here some screenshots:

picturei.png

infoo.png


Imagination is more important than knowledge.

Offline

#21 2013-05-02 10:53:37

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

Re: .net (c#/vb) Client

Thanks to new gaucho implementations I managed to build a full ISO15693+Hardware PM3 Client xml command file that you can find here.

I have some questions to ask to pm3 devs:

PROBLEMS:
hf 15 cmd sysinfo: in the help information the parameter "pages" must be removed
hf 15 cmd readmulti: check if startpage is lower than endpage; from pm3 behaviour I think there is no check for that

QUESTIONS:
how hw setmux command woks ? <loraw|hiraw|lopkd|hipkd> are them specific parameters or must we provide hex values for them ? Any example please ?
sri512read and srix4k have the <int> option: what is that <int> parameter ?

Here is a "collage" screenshot of my work-in-progress XML (that you can download in the link above):
sshotq.png

ISO14443 and other commands will come shortly.

Last edited by asper (2013-05-02 11:49:03)

Offline

#22 2013-05-02 15:24:57

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

when you will finish with xml and (may be) i will update the exe, we will issue a new revision with the latest exe and the latest xml.
At the end, if someone managing the google code account wants it, you can upload the sources on google code.

bye.

p.s.:I hope that PM developers will answer Asper's questions. (I even asked on another thread an important document: a document with the protocol used on the usb port).

EDIT: Asper found few bugs and i corrected it. Here the sources, the exe and the last xml update by Asper.

http://dfiles.eu/files/apkimka0j

Last edited by gaucho (2013-05-03 10:02:46)


Imagination is more important than knowledge.

Offline

#23 2013-05-02 17:38:27

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

Re: .net (c#/vb) Client

This is the latest .xml file (still not complete).

Screenshot:
sshotc.png

Offline

#24 2013-05-03 10:08:15

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Hey. I read again the discussion. When you finish the xml, we can add MACROS to perform complex operations like "get a parameter from the tag" and then "use that parameter on another command" and then "convert the result in a readable way".

Start thinking on it. If you have some ideas..

as i said, i still don't have the proxmark, so YOU have to think about a situation where the MACROS could be usefull.


Imagination is more important than knowledge.

Offline

#25 2013-05-04 15:12:51

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

Re: .net (c#/vb) Client

XML is complete; I am only waiting for some gaucho add-ons to the tool to make it really easy to use !
saven.png
After releasing the tool+xml please test it to verify that all is good and working !

Offline

#26 2013-05-06 14:54:45

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

Re: .net (c#/vb) Client

Another settings.xml release here.

Last edited by asper (2013-05-06 14:54:53)

Offline

#27 2013-05-07 17:33:40

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

So,
finally the release 1.5 here annexed contains last exe revision by Gaucho and last xml file by Asper. In the zip file there is also the command line client. Many errors and features added.
http://www.sendspace.com/file/qj2c7i
In this zip file there is no sources.

NOW WE NEED SOMEONE TO TEST AND CHECK THE EXE and the treeview commands.

If someone wants sources just ask for them.
If someone of the crew is interested to upload the sources and the compiled exe on google code, just ask for the sources.

Regards.

P.S.:asper i found a little error in a tooltip for the "slow down speed" field. Let's even wait some more substantial error reported by the community.

Last edited by gaucho (2013-05-07 17:36:15)


Imagination is more important than knowledge.

Offline

#28 2013-05-07 17:55:28

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

Re: .net (c#/vb) Client

Well, the amount of hand-written data is huge so I think there will be more than 1 single error wink
Feel free to correct them and to post an updated settings.xml !!

Offline

#29 2013-05-08 21:02:01

JM@BIDT
Member
Registered: 2013-05-08
Posts: 3

Re: .net (c#/vb) Client

not a big issue, but for Mifare-classic tags-hacks-nested attack the default window size right the right upper pane is too short to see all the boxes and does not have a scroll bar so you have to increase the window size to see the rest of the fields and command button.  (i assume this will also be the case with other large paramater commands.)

Great Job Guys!!!  Love it.

Offline

#30 2013-05-08 23:31:52

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

Re: .net (c#/vb) Client

We know that and to solve this we make sub-boxes resizable as you already noticed; this is the easiest solution for the program structure, easier than scroll bars. Gaucho will provide the change. Thank you for testing!

Last edited by asper (2013-05-09 09:46:11)

Offline

#31 2013-05-09 07:25:23

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Dear JM@BIDT you were right.
I corrected the tool. The new rev. 1.6 is here annexed.
Proxmark Tool V.1.6
I added you to the info window on the credits for testing the tool.
So, now you have the moral obligation big_smile to test the tool and correct each mistake in the xml file.
Anyway if you will disappear without contribute, like Iceman, I will remove you from the credits. tongue


Imagination is more important than knowledge.

Offline

#32 2013-05-09 09:36:46

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

Re: .net (c#/vb) Client

Thank you Gaucho ! I updated the download thread with a link to the latest exe+xml files. I will keep it updated with new .xml changes and with your .exe when you will provide an updated one !

Last edited by asper (2013-05-09 09:44:03)

Offline

#33 2013-05-09 21:05:45

cupido
Member
Registered: 2013-03-16
Posts: 8

Re: .net (c#/vb) Client

Great tool!

One proposal for the next update: Isn't it a good idea to select a fixed com port which is still selected after a new start? As I connect the pm3 always to the same port that would be a nice feature.

Offline

#34 2013-05-10 15:15:43

kra
Contributor
Registered: 2011-01-19
Posts: 59

Re: .net (c#/vb) Client

I want to add more functions but really piss me off C# and I have some script from other programs in C# to complementary to the program and I also got another script very good but is in a language not included in any version of google code proxmark3.  who could help me?

Offline

#35 2013-05-10 15:50:02

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

@cupido. I'll do it when the xml file will be corrected.

@kra: I can't understand if you want to add macros (or features) to my tool or if you want just help to convert some c code in some other language. can you "speak" vb.net language?


Imagination is more important than knowledge.

Offline

#36 2013-05-10 22:18:32

kra
Contributor
Registered: 2011-01-19
Posts: 59

Re: .net (c#/vb) Client

@gaucho I don't speak vb.net laguague and yes help me, how I pass you the scripts, by email ?
craptoss1@gmail.com

Offline

#37 2013-05-10 22:52:21

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

kra, explain what you need, cause it's not clear. if you just have a script but you can't explain what it did, how could i use it? you can use the contact on my profile


Imagination is more important than knowledge.

Offline

#38 2013-05-11 01:20:19

kra
Contributor
Registered: 2011-01-19
Posts: 59

Re: .net (c#/vb) Client

check your e-mail

Offline

#39 2013-05-14 18:10:29

urkis
Contributor
Registered: 2012-02-12
Posts: 30

Re: .net (c#/vb) Client

Im currently working on a GUI program in VB.NET to get an great user-friendly GUI (sorry not in english).

Main menu:
3144ar5.jpg

Here is some of the tools that are already integrated, I'm also developing new functions continiously.

Indala card reading menu:
dfekjn.jpg

Writing EM data to T55x7, also with a smart DEC to HEX-converter
ape8ue.jpg

Advanced LF-reading mode, its easy to load/save .trc-files, capture data and try different demodulation types
2zi3g53.jpg

Of course we have the Mifare tool where you can read/write cards, load/save project files and key files and more, there is also a r/w-mode for the magic chinese cards
5n251e.jpg

Also when you read tags you can choose to log them in a reading log like this
335az9e.jpg

Last edited by urkis (2013-05-14 20:27:20)

Offline

#40 2013-05-14 20:49:09

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

Re: .net (c#/vb) Client

Very good tool man! Are sources available?

Offline

#41 2013-05-15 13:16:22

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

Compliments!
I can't speak your language but it seems nice.
Do you write directly on the serial port or do you use the Roel client like i did?
Could you share your sources?


Imagination is more important than knowledge.

Offline

#42 2013-05-15 14:10:27

urkis
Contributor
Registered: 2012-02-12
Posts: 30

Re: .net (c#/vb) Client

Thank you! I might release the source in a soon future.
Im using the proxmark client proxmark3.exe.
It works great under WinXP, but with Win7 I've got some errors when I exit the program, the proxmark3 process doesnt always exit like intended..

Anyway here is a sample of the source code:

        myProcess.StartInfo.FileName = "proxmark3.exe"
        'myProcess.StartInfo.Arguments = "com16" '//Uncomment if using the new usb interface
        myProcess.StartInfo.UseShellExecute = False
        myProcess.StartInfo.CreateNoWindow = True
        myProcess.StartInfo.RedirectStandardOutput = True
        myProcess.StartInfo.RedirectStandardInput = True
        myProcess.StartInfo.RedirectStandardError = True
        myProcess.Start()
        myProcess.BeginOutputReadLine()
        myProcess.BeginOutputReadLine()
        Dim sIn As System.IO.StreamWriter = myProcess.StandardInput
        Dim sErr As System.IO.StreamReader = myProcess.StandardError
        AddHandler myProcess.OutputDataReceived, AddressOf HelloMum

The handler then detects the response text depending of which mode the program is in like this

         If StatusMode = "READHIDFSK" Then
                If e.Data.Contains("TAG ID: ") Then
                    ReadedString = e.Data.Substring(24, 10).ToUpper
                    FastReadHIDFSKValue.Text = ReadedString


                End If
  End If

Send commands to proxmark3.exe

            sIn.Write(cmdtosend & System.Environment.NewLine)

Last edited by urkis (2013-05-15 14:15:00)

Offline

#43 2013-05-15 18:55:17

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

ok, then each time roel changes the client, you have to update your tool in the code.
i tried to solve this problem with the xml file. This way any change affects the xml and not the exe.

About your problem, here it is how i close the app without problems.

Public p As Process
Dim t As System.Threading.Thread
Dim comPortNumberVar As Integer
Delegate Sub SetTextCallback(ByVal [text] As String)


 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Try
            p.Kill()

        Catch ex As Exception

        End Try
        Try
            t.Abort()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub SetText(ByVal [text] As String)

        ' InvokeRequired required compares the thread ID of the
        ' calling thread to the thread ID of the creating thread.
        ' If these threads are different, it returns true.
        If Me.prompt.InvokeRequired Then
            Dim d As New SetTextCallback(AddressOf SetText)
            Me.Invoke(d, New Object() {[text]})
        Else
            Me.prompt.Text = Me.prompt.Text & vbCrLf & [text]
            Me.prompt.SelectionStart = Me.prompt.Text.Length
            Me.prompt.SelectionLength = 0
            Me.prompt.ScrollToCaret()
        End If
    End Sub


    Public Sub ProxmarkProcess()


        p = New Process



        Dim pi As ProcessStartInfo = New ProcessStartInfo()
        pi.Arguments = "COM" & comPortNumberVar
        pi.FileName = Application.StartupPath & "\proxmark3.exe"
        'pi.FileName = "cmd.exe"
        pi.UseShellExecute = False
        pi.CreateNoWindow = True
        pi.RedirectStandardInput = True
        pi.RedirectStandardOutput = True

        p.StartInfo = pi
        p.Start()



        While True
            Try
                If p.StandardOutput.EndOfStream Then Continue While
                Dim tmpStr As String = p.StandardOutput.ReadLine
                If Trim(tmpStr) <> "" Then SetText(tmpStr)


            Catch ex As Exception

            End Try

        End While
        p.WaitForExit()
        p.Close()

    End Sub

    Private Sub comPortNumber_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comPortNumber.SelectedIndexChanged
        prompt.Text = ""
        comPortNumberVar = comPortNumber.SelectedIndex() + 1
        Try
            p.CloseMainWindow()
        Catch ex As Exception
        End Try


        Try
            p.Kill()
        Catch ex As Exception
        End Try
        Try
            t.Abort()
        Catch ex As Exception
        End Try

        t = New System.Threading.Thread(AddressOf ProxmarkProcess)
        t.Start()

    End Sub

if you want my complete code, just ask for it.


Imagination is more important than knowledge.

Offline

#44 2013-06-19 20:04:09

marshmellow
Moderator
From: US
Registered: 2013-06-10
Posts: 2,301

Re: .net (c#/vb) Client

It appears the lf indalaclone command is missing from the proxmark .net client.  sad  ..  i don't know how to add it to the xml..

Offline

#45 2013-06-20 18:04:00

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

you should first read the infobox in the client.
This is the content:

Use the following syntax to fill Settings.xml file:

XML file "settings.xml" can have many <section> in cascade and at the same level.
<section> can use the following parameters: title, tooltip, uniqueId.
The sections that contains <item> should have the uniqueId parameter setted.
The <item> object always has the following parameter: type .
According to the type, the item can use differents additional parameters:

Parameters for <item type="label" >:
    label=    the text contained in the label. Note: "\r" will be converted
              to carriage return  

Parameters for <item type="button" >:
    text=    the text contained in the button
    tooltip= string that will be shown when the user moves the mouse on this item 
    action=  the action is the string to send to the Proxmark. if in the string there 
             is a name of an item preceded by the symbol $, it will be replaced by the 
             actual value of that item (example: if in a textbox with uniqueId "itemName" 
             the user types the word "Mary", and the button action is "HI $itemName is my 
             name", the command sent to the Proxmark it will be "HI Mary is my name"
    width=   (Optional) The width of the item in pixels.

Parameters for <item type="textbox" >:
    defaultValue= default text value contained in the textbox
    tooltip=      string that will be shown when the user moves the mouse on this item
    uniqueId=     unique identifier for this item
    label=        label placed on top of the Item
    width=       (Optional) The width of the item in pixels.

Parameters for <item type="dropdown" >:
    defaultValue= default text value contained in the drop-down box
    tooltip=      string that will be shown when the user moves the mouse on this item
    uniqueId=     unique identifier for this item
    values=       It could be expressed in 2 formats: as a list of values separed by comma 
                  (example: "a,b,c,d") or as a range (example: "1:10" will output values in
                  the range between 1 and 10)
    label=        label placed on top of the Item
    width=       (Optional) The width of the item in pixels.

Parameters for <item type="checkbox" >:
    defaultValue=   it can be "checked" or "unchecked"
    text=           it is the label of the checkbox 
    tooltip=        string that will be shown when the user moves the mouse on this item
    uniqueId=       unique identifier for this item
    valueChecked=   value to use in the action, if the item is checked
    valueUnchecked= value to use in the action, if the item is unchecked

Parameters for <item type="browse-load" >:
    defaultValue=   default path of this texbox with browse button
    text=           it is the label of the path textbox 
    tooltip=        string that will be shown when the user moves the mouse on this
                    item (on the textbox)
    uniqueId=       unique identifier for this item
    width=          (optional) width of this item (the textbox)
	
Parameters for <item type="browse-save" >:
    defaultValue=   default path of this texbox with browse button
    text=           it is the label of the path textbox 
    tooltip=        string that will be shown when the user moves the mouse on this
                    item (on the textbox)
    uniqueId=       unique identifier for this item
    width=          (optional) width of this item (the textbox)

then you have to know how this command should be used on the command prompt client.
then, looking at a similar command inside the settings.xml, you can copy paste it, and modify according to your needs.
Isn't it easy?

this is a sample of a window with a button that sends a static command help to the proxmark:

<section title="HELP" tooltip="Help command shows PM3 available commands" uniqueId="1">
        <item tooltip="Press button to obtain the Help info" action="help" text="HELP" type="button"/>
</section>

Note1: section creates the window and the treenode HELP.
Note2: item with type="button" creates and draws a button in the window, using given parameters.
Note3: tooltip are not needed, but it's always good to add them in order for the tool to be easy to understand.


take care of the BUTTON item, cause the core is here (the action field). Read again:

Parameters for <item type="button" >:
    text=    the text contained in the button
    tooltip= string that will be shown when the user moves the mouse on this item 
    action=  the action is the string to send to the Proxmark. if in the string there 
             is a name of an item preceded by the symbol $, it will be replaced by the 
             actual value of that item (example: if in a textbox with uniqueId "itemName" 
             the user types the word "Mary", and the button action is "HI $itemName is my 
             name", the command sent to the Proxmark it will be "HI Mary is my name"
    width=   (Optional) The width of the item in pixels.

Asper updates the download section on the thread http://proxmark.org/forum/viewtopic.php?id=1562 but i've seen this command is not available on the last version of the xml. I don't know if there is a reason or if he forgot  to add it. Ask him, or add it by yourself as i shown you. After you update it, upload the changes you made in order to share it.

Last edited by gaucho (2013-06-20 18:24:35)


Imagination is more important than knowledge.

Offline

#46 2013-06-20 19:42:05

marshmellow
Moderator
From: US
Registered: 2013-06-10
Posts: 2,301

Re: .net (c#/vb) Client

Thanks gaucho.  I am not good at xml but your post prompted me to give it a go.
added:

<section title="INDALA CLONE" tooltip="Clone Indala to T55x7" uniqueId="indalaclone">
		<item type="checkbox" valueChecked="l" valueUnchecked="" defaultValue="unchecked" tooltip="If checked, 224 bit ID will be used" uniqueId="224Clone" text="Check to use 224bit ID (not checked = 64bit ID)" />				
                <item type="textbox" defaultValue="" tooltip="Indala UID Value" uniqueId="IndalaUID" label="Indala UID (up to 224 bits):" width="140" />		
		<item type="button" text="Clone" tooltip="Press button to Clone Indala ID to T55x7 TAG" action="lf indalaclone $IndalaUID $224Clone" />	
	</section>	

and it seems to work.

sorry for not taking the inititive before!

Thanks!

Offline

#47 2013-06-20 20:05:16

marshmellow
Moderator
From: US
Registered: 2013-06-10
Posts: 2,301

Re: .net (c#/vb) Client

... hehe I love you gaucho...

prompted me to get creative...

just added buttons to the lf read screen for
data samples 16000
lf indalademod
data askdemod
data fskdemod
data mandemod
+ others...

so for most of my uses i can hit one screen!
and 3 clicks.

Offline

#48 2013-06-20 20:23:08

gaucho
Contributor
From: France
Registered: 2010-06-15
Posts: 444
Website

Re: .net (c#/vb) Client

compliments!
if you think your settings.xml now is better than the most updated one (the one found on the download thread by Asper), post here the link to allow Asper to download your settings file in order to check it and upload on the download thread.


Imagination is more important than knowledge.

Offline

#49 2013-06-20 22:03:53

marshmellow
Moderator
From: US
Registered: 2013-06-10
Posts: 2,301

Re: .net (c#/vb) Client

I added a Common Processes tree,
added indalaclone,
and fixed a few typo's in descriptions.

where can I upload the settings.xml?

EDIT: never mind - here is the link

http://www.sendspace.com/file/uyyr49

I don't know if it will be helpful for all, but it certainly is for me!

Last edited by marshmellow (2013-06-20 22:10:42)

Offline

#50 2013-06-21 06:09:32

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

Re: .net (c#/vb) Client

From which revision is indalaclone command available? Maybe I miss that command in the help ? If so I will add it as soon as I get back to  my pc !

Last edited by asper (2013-06-21 06:49:54)

Offline

Board footer

Powered by FluxBB