CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    7

    Exclamation getting binary output from a magnetic writer

    I have a msr505c magnetic reader/writer, and
    I am trying to read a non standard format magnetic card.
    I would need to see the data in binary form to analyze.

    there is a crappy demo program for windows, but it would output in hex for raw read

    i have found some source files here for linux: http://code.google.com/p/libmsr/
    for the msr505c
    and here i found the interesting part
    i used this snippet code below to get a string in 0 and 1 from track data
    but the binary output is wrong, i know how the data format should look like, i also know the start sentinel. etc...

    looking at the dumpbits function i see there is a loop that was commented out, so i tried that loop, but still it did not work

    int
    dumpbits (uint8_t * buf, int len)
    {
    int bytes, i;
    for (bytes = 0; bytes < len; bytes++) {
    /* for (i = 0; i < 8; i++) { */
    for (i = 7; i > -1; i--) {
    if (buf[bytes] & (1 << i))
    printf("1");
    else
    printf("0");
    }
    }
    printf ("\n");
    return (0);
    }

    for (i = 0; i < MSR_MAX_TRACKS; i++)
    tracks.msr_tracks[i].msr_tk_len = MSR_MAX_TRACK_LEN;


    printf("Ready to do a raw read. Please slide a card.\n");
    msr_raw_read (fd, &tracks);

    for (i = 0; i < MSR_MAX_TRACKS; i++) {
    dumpbits (tracks.msr_tracks[i].msr_tk_data,
    tracks.msr_tracks[i].msr_tk_len);
    printf("\n");


    looking here http://libmsr.googlecode.com/files/M...s%20Manual.pdf

    they show the raw data bit orientation on page 15

    could some help me out on getting true binary output
    is the code wrong?

    you can find all of the source here http://code.google.com/p/libmsr/sour...wse/#svn/trunk

  2. #2
    Join Date
    Jan 2010
    Posts
    7

    Cool Re: getting binary output from a magnetic writer

    can anyone help?

  3. #3
    Join Date
    Jan 2010
    Posts
    20

    Re: getting binary output from a magnetic writer

    Hi, I just wanted to say that I own a MSR505C as well and I'm also having issues with the demo software, although my problem is that I'm unable to write to a specific card -- I simply get an error regardless of what I try to write to it.

    As such I want to write my own software for it that will hopefully be able to write to this card and that will work in GNU/Linux; I haven't gotten around to do that yet though but reading will be my first step and I'd like to be able to do raw reading as well, so if I can get it working I'll let you know. :-)

  4. #4
    Join Date
    Jan 2010
    Posts
    7

    Re: getting binary output from a magnetic writer

    did you try libmsr?
    are you trying to write an iso formatted card?

  5. #5
    Join Date
    Jan 2010
    Posts
    20

    Re: getting binary output from a magnetic writer

    Quote Originally Posted by joker5bb View Post
    did you try libmsr?
    are you trying to write an iso formatted card?
    I tried libmsr but I actually can't get it to work at all -- my MSR505C doesn't show up as a physical USB device; may I ask what kernel module/option and what device (under /dev ) you used in conjunction with libmsr?

    Yes, my card is an ISO card, but I would still like to be able to read and write raw arbitrary binary data.

  6. #6
    Join Date
    Jan 2010
    Posts
    20

    Re: getting binary output from a magnetic writer

    After compiling the usbserial module and creating the appropriate special character files with mknod I get the following when I connect the device:

    usb 2-2: Manufacturer: Prolific Technology Inc.
    usb 2-2: uevent
    usb 2-2: usb_probe_device
    usb 2-2: configuration #1 chosen from 1 choice
    usb 2-2: adding 2-2:1.0 (config #1, interface 0)
    usb 2-2:1.0: uevent
    usbserial_generic 2-2:1.0: usb_probe_interface
    usbserial_generic 2-2:1.0: usb_probe_interface - got id
    drivers/usb/core/inode.c: creating file '003'
    hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0004

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured