The real empeg player app does not store the file in the /drive0/fid directory. It might be an entry for the dynamic database...

Indeed. The stock player spots those "special" (*F) fids, and writes to the dynamic database instead of the filesystem.

But I believe the dynamic database contains information about when and how many times a song was played. Can someone tell me where I can read this data off my empeg and the format of the dynamic database?

The dynamic database lives on the scratch partition. We've never given out the layout of the scratch partition (so that we could change it behind the scenes if we wanted -- it's bad enough that we're stuck with that static database format now everyone reads/writes it) but having got this far it shouldn't be hard for you to reverse-engineer it. The scratch partition layout will not change for 2.0 final, but it's not ideal and so might well change in some post-2.0 release.

Is there an easy way to determine the last fid (actually the highest) on a drive?

No. Currently you must readdir() both fid directories.

Is it wrong to include extra 0xff at the end of the database file?

Nothing will break, but you'd be wasting valuable player memory (and marginally decreasing search speed).

Peter