Autoloader for Content Library Games

From SamyGO
Jump to: navigation, search

With this hack, you can load content library programs to your TV even if your TV doesn't have game menu.

Hack uses GDB to injecting code to exeDSP. Here is the script that loads plugins.


### begin configure me
# gdb_binary: where your gdb binary resides
# gdb_commands: this is a temporary file where gdb commands are stored
# gdb_delay: gdb will be scheduled to run after $gdb_delay seconds
#            this is for letting exeDSP to settle down at TV startup
# libraries: absolute path of libraries to be loaded
#            there can be several, separated spaces!!
#            this script requires paths WITHOUT spaces
libraries="/mtd_tlib/GGame/avrfix2-cip/" # add more libraries here 
### end configure me

exeDSP_PID=$(pidof exeDSP)
temp='attach '$exeDSP_PID'\n'

for l in $libraries
      if [ -e "$l" ] ;then
                temp=$temp'call dlopen("'$l'", 2)\n'
                let i++
                temp=$temp'call dlsym($'$i', "Game_Main")\n'
                let i++
                temp=$temp'call $'$i'("'${l%/*}/'", 0)\n'
                let i++
                temp=$temp'call dlclose($'$((i-2))')\n'
                let i++

echo -e 'The following commands:\n---\n'$temp'---\nwill be executed by '$gdb_binary' in '$gdb_delay' secs!!\n'

echo -e $temp >$gdb_commands
{ sleep $gdb_delay; $gdb_binary -batch -x $gdb_commands; rm $gdb_commands; } &

Related forum page is here