Injecting modules into exeDSP

Ideas and dreaming will go this forum

Posts: 23
Joined: Sun Sep 19, 2010 9:43 am

Re: Injecting modules into exeDSP

Post by flo-ogb »

tusko wrote:Good idea !! I know that this is not general enough, but the following modification does that. It works on my TV, and after the imports cache file is created, it is fast !!
Could you please post the compiled binary (preferably the CI+ version)? I don't have the toolchain ready...

I'm think this is a very useful optimisation, my TV currently takes a minute to init all extensions, even authuld finishes faster :roll:

Posts: 72
Joined: Sat Nov 07, 2009 4:39 pm

Re: Injecting modules into exeDSP

Post by nostromo1983 »

I've juste tested the injector with sample module and here is what i have, after 1min 30s of waiting:

Code: Select all

# ./injectso `pidof exeDSP` Inject_Main /dtv/

Module injector V1.1 for ARM based CPUs.
(copyleft) SmartSmurf 2010 (

Info: value of linker map is 0x12078
Info: Import 'dlopen' found at 0x004a7878
Info: Import 'dlsym' found at 0x004a6e70
Info: Import 'dlclose' found at 0x004a6924
Info: current register set:
R0 =0xFFFFFFFC R1 =0x00000000 R2 =0x00000001 R3 =0x00000000
R4 =0x00000001 R5 =0x025EA250 R6 =0x020EC358 R7 =0x000000F0
R8 =0x00000000 R9 =0x00000000 R10=0xBEB23A78 R11=0x00000000
R12=0x00000001 SP =0xBEB23A68 LR =0x4005DA44 PC =0x4005B008

Info: new SP for inject code 0xBEB23668
Is the the desired output, and why it takes 1min30s for this?
Samsung LE32B554 T-CH5DEUC 2006.0 with patched u-boot for usb boot with OpenEmbedded custom kernel with network supported and usb rootfs

Official SamyGO Developer
Posts: 111
Joined: Thu Jun 24, 2010 8:26 am
Location: Frankfurt, Germany

Re: Injecting modules into exeDSP

Post by smartsmurf »

tusko wrote:nostromo1983: It is slow because to find the dl* functions long loops of ptrace syscalls are used.

flo-ogb: Sorry, right now I do not have access to my toolchain either but I will have access in a few days, if that it is ok to you ... By the way, my TV is not CI+ but I think there should not be any differences.
You are right. The ptrace syscalls slow it down.
I updated the first post of this thread with a new version, which caches the imports. It is requires the path "/mtd_rwarea/etc" where it stores a file named "injectso.imports". For future improvements I would generate an import file for each binary which gets code injected, e.g. "/mtd_rwarea/etc/importso.d/mtd_exe/exeDSP.imports".

Posts: 23
Joined: Sun Sep 19, 2010 9:43 am

Re: Injecting modules into exeDSP

Post by flo-ogb »

wow, tanks guys! that works really beautiful! :) :)

swapping the binary with the new one makes the startup MUCH faster. from 1:49 minutes spent in before to now just 17 seconds! and i could easily shave of some more seconds, if i remove some sleeps...

EDIT: now at 11 seconds. big thumbs up!

Post Reply

Return to “[B] Brainstorm”