Librarchy: Difference between revisions

From Lundman Wiki
mNo edit summary
No edit summary
Line 38: Line 38:


[1] I note the SMP Libraries handles HTTP:// URLs internally, so possible could exploit this to play remote media.
[1] I note the SMP Libraries handles HTTP:// URLs internally, so possible could exploit this to play remote media.
=== Changelog ===
* Stopped opendir()s inside opendir() from causing a rescan for RARs. (Common way to get directory size)
* Small-skips forwards are not handled by reading and discarding bytes.

Revision as of 01:59, 6 March 2009

librarcy

Since Dune does not handle talking to llink (over HTTP) in any form [1], I found myself missing the unrar streaming support that llink provides. So I started considering a solution for this problem. I have assumed that Dune developers are not approachable, nor particularly interested in helping someone on the outside, so it would have to be a solution I could do myself.

I started on the idea of using LD_PRELOAD to point to my glue code, which intercepts the calls open64/read/lseek/close/opendir/readdir64/closedir/lstat64/stat64.

Please note that librarcy needs a special version of unrar that features the extra option -sk to seek into an archive. This is available in the llink packages.


<paypal></paypal>

Sources

librarcy-1.0.1.tar.gz 


Environment Variable

LIBRARCY_UNRAR=/path   : specify path to unrar. Default "/tmp/unrar"
LIBRARCY_DEBUG=1       : Enable debug log "/tmp/librarcy.log"

Dune binaries

I have now reached a point where this appears to work. To test the libc replacement library, assuming you already have telnet access, download the binary and setup like:

# cd /tmp
# wget http://lundman.net/ftp/librarcy/librarcy.so.0.1.0
# wget http://lundman.net/ftp/librarcy/unrar
# killall shell root
# export LD_LIBRARY_PATH=/tango/firmware/lib
# cd /
# env LD_PRELOAD=/tmp/librarcy.so.0.1.0 firmware/bin/root &


If you enabled debug, it will be sent to stdout.


[1] I note the SMP Libraries handles HTTP:// URLs internally, so possible could exploit this to play remote media.


Changelog

* Stopped opendir()s inside opendir() from causing a rescan for RARs. (Common way to get directory size)
* Small-skips forwards are not handled by reading and discarding bytes.