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