Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Reverse Engineering a portable mp3 player

by Boots111 (Hermit)
on Aug 10, 2001 at 17:09 UTC ( #103860=perlquestion: print w/replies, xml ) Need Help??
Boots111 has asked for the wisdom of the Perl Monks concerning the following question:

This could be slightly off-topic in that I would (ideally) like to have an answer that works in any language; however, I would be happy to have that language start out as (and possibly remain) Perl. That said:

I have a portable mp3 player from Audiovox. These folks (in all their wisdom and kindness) saw fit to write Win98 only software. Thus on my Win2000 box (not to mention my Mandrake one) I cannot change the songs on my mp3 player. As you can probably imagine this annoys me somewhat. I have exchanged emails with the audiovox people and gotten the general response, "We don't support Windows 2000; we will never support Windows 2000; and we will not tell you anything useful about how to write such code for yourself! Now go away."

Thus my question to all of you (if you have continued reading this far ;-) is "How do I even begin?" I was thinking that I might try running some sort of program on the appropriate port (it uses the printer port to do its thang), such that I could intercept all of the communications going through the port and then try to write a program that would immitate these communications.

Unfortunately this is my first attempt at reverse engineering and so I don't know if such a program exists or even how to send message to a specific port via Perl (or C++ for that matter)

Any help you could offer would be invaluable.

  • Comment on Reverse Engineering a portable mp3 player

Replies are listed 'Best First'.
Re: Reverse Engineering a portable mp3 player
by larryk (Friar) on Aug 10, 2001 at 17:19 UTC
    The parallel printer port? Not USB? If so then I suggest you download PortMon and log an entire session with your mp3 player. Maybe you can glean some info that way.

    hope this helps

    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
Re: Reverse Engineering a portable mp3 player
by bikeNomad (Priest) on Aug 10, 2001 at 18:30 UTC
    Generally, protocols that use the parallel port to talk serially (which your MP3 player probably does; count the wires) have a single data out line, a data in line, and a clock line. The clock line allows the timing to be a bit flexible.

    For details on this scheme, search for I2C or SMBus.

    The problem with using Perl directly for this is that bit timing is often somewhat crucial: there may be lower limits on bit transmission speed before one end or the other decides there's been a problem.

    If it won't work in Win2K, it's probably just wiggling the port bits directly using OUT instructions; this won't be easy to monitor without a VXD that traps the instructions. You may be able to find such a VXD, though, on the net.

    My strategy would be to do this:

    • Count the wires on the interface.
    • Trace them back to the printer port to figure out which are inputs and which are outputs (this is probably obvious from the connection, as they probably didn't depend on having bidirectional printer ports).
    • Use an oscilloscope to look at the signals on these wires to determine which is clock and which is data
    • Connect my old HP1631D logic analyzer to the pins and watch all the bits at once
    • Try to compare with I2C, SPI, OneWire, or other known serial standard
    • Write pieces of C code using Inline to send and receive bytes and words. Make this run on another PC to monitor the data traffic (having made a Y-adapter cable) (it's unlikely you'll be able to do this on the same machine successfully)

    Now, you may not have an oscilloscope or logic analyzer, which will make the job much harder. You can make a simple logic analyzer using the parallel port of another machine and a tight loop in C or assembly language where you repeatedly use inportb or whatever is appropriate for your compiler to read the parallel port lines. You can use a change in state as a trigger.

    update: I've found DIY projects for parallel port logic analyzers at and and

    Good luck in your quest!

Re: Reverse Engineering a portable mp3 player
by spudzeppelin (Pilgrim) on Aug 10, 2001 at 18:17 UTC

    Scott Penrose wrote Device::ParallelPort recently, and presented a lightning talk on it at TPC5 last month. I think you will probably find it helpful, as long as the communications aren't outstripping its capabilities (he specifically warns AGAINST using it for scanners and zip drives); if nothing else, it's a jumping-off point on your search.

    Spud Zeppelin *

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://103860]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2018-04-23 22:01 GMT
Find Nodes?
    Voting Booth?