Best way to patch exeDSP?

General forum for C series TVs.

Neoplane
Posts: 9
Joined: Thu Apr 12, 2012 3:38 pm

Best way to patch exeDSP?

Post by Neoplane »

Hello everyone,

Since some months our C series don't work with latest Plex Media Server (and PlexForSamsung App) and found that the problem is in the Samsung player itself, that seems to don't be developed according to HLS protocol. Original plex thread: http://forums.plex.tv/discussion/176169 ... er-problem.

I've found out how to patch exeDSP in order to solve that problem (thanks sectroyer for all the info about debugging on C series!). I know which memory address should I overwrite and what should I write in (just a NOP in the end), thus right now using a "set" in gdb I've fixed the problem.

My question is about which is the safest way to deploy this fix. In the end I just need to overwrite exeDSP, being able to rollback the change if something goes wrong.

Many thanks!!!
sectroyer
Official SamyGO Developer
Posts: 6305
Joined: Wed May 04, 2011 5:10 pm

Re: Best way to patch exeDSP?

Post by sectroyer »

The safest way is to write lib which dynamically finds correct place to patch and use samyGOso to load it. When you use such approach you share the libs with others. BTW what does your patch "do" ?:)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on https://pastebin.com Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!
Neoplane
Posts: 9
Joined: Thu Apr 12, 2012 3:38 pm

Re: Best way to patch exeDSP?

Post by Neoplane »

I'll take a look in other patches then to get an example :)

Found that, when player is reproducing a m3u8 playlist and it includes an ext3 tag that is not in the list of recognized tags by the player, it is stopping. In HLS protocol is specified that when an unrecognized tag is found, player should ignore it.

New plex media server is including one new tag in their playlist when transcoding, thus player is always stopping under this circunstances.

Fix is plain easy, change a branch for a nop. Anyway, plex developers are developing a fix on plex server thus my patch may not be needed. But as I've already made the ivestigation, I'll create and distribute the patch asap.

Thanks!!
sectroyer
Official SamyGO Developer
Posts: 6305
Joined: Wed May 04, 2011 5:10 pm

Re: Best way to patch exeDSP?

Post by sectroyer »

Sure. Share with us. At the same time you will learn a lot :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on https://pastebin.com Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!
tempinbox
Posts: 317
Joined: Wed May 11, 2011 7:00 pm

Re: Best way to patch exeDSP?

Post by tempinbox »

Neoplane wrote:I'll take a look in other patches then to get an example :)

Found that, when player is reproducing a m3u8 playlist and it includes an ext3 tag that is not in the list of recognized tags by the player, it is stopping. In HLS protocol is specified that when an unrecognized tag is found, player should ignore it.

New plex media server is including one new tag in their playlist when transcoding, thus player is always stopping under this circunstances.

Fix is plain easy, change a branch for a nop. Anyway, plex developers are developing a fix on plex server thus my patch may not be needed. But as I've already made the ivestigation, I'll create and distribute the patch asap.

Thanks!!
if you need a tester i'm here. ;)
Neoplane
Posts: 9
Joined: Thu Apr 12, 2012 3:38 pm

Re: Best way to patch exeDSP?

Post by Neoplane »

Thanks tempinbox! I'll send it to you asap :)

Just after holidays I started to create the patch, but I'm having some trouble...

find_func_by_string is not finding the symbol I need. The symbol (and patch point) it's not itself on exeDSP but on libahas.so. I'm using utils taken from NoDRMPatch, but it seems that it's not getting the symtable for linked libraries. I know everything it's working because I'm able to read all the symbols from exeDSP when executing the patch, and I get the symbols using libahas instead of exeDSP, I'm able to retrieve the memory offset, but it's not the correct one (as it's not the loaded in memory).

Which may be the best approach to find my starting point to patch? Should I use another patch as example? This one seemed fairly easy to understand... :)

One idea that I have is to get symbol offset directly from library, then retrieve at which mem offset the library is currently loaded (cat /proc/pid/maps | grep libahas), and start moving from that point...

As you may see, I'm totally new to this :)

Thanks!!
sectroyer
Official SamyGO Developer
Posts: 6305
Joined: Wed May 04, 2011 5:10 pm

Re: Best way to patch exeDSP?

Post by sectroyer »

if symbol is exported simply use dlopen/dlsym :) find_func_by_string is for NOT exported symbols that are NOT in symtable :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on https://pastebin.com Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!
Neoplane
Posts: 9
Joined: Thu Apr 12, 2012 3:38 pm

Re: Best way to patch exeDSP?

Post by Neoplane »

Hello sectroyer,

I'm still having some problems creating the patch...

If I try to dlopen the library (libahas.so) I get an undefined symbol error (_ZN7CCDebug5ResetEv) thus I cannot dlsym to get a starting point to find right place to patch... I think that this symbol is found in the same exeDSP, and I'm correctly attached (using ptrace) to exeDSP process, as I can patch if I set the mem address manually...

How can I deal with this?

Many thanks :)
sectroyer
Official SamyGO Developer
Posts: 6305
Joined: Wed May 04, 2011 5:10 pm

Re: Best way to patch exeDSP?

Post by sectroyer »

dlopen fails ? dlopen should NOT fail. Also _ZN7CCDebug.... is NOT libahas.so symbol :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on https://pastebin.com Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!
Neoplane
Posts: 9
Joined: Thu Apr 12, 2012 3:38 pm

Re: Best way to patch exeDSP?

Post by Neoplane »

I'm getting a NULL as return of dlopen, and I'm getting this message as return of dlerror:
/mtd_exe/Comp_LIB/libahas.so: undefined symbol: _ZN7CCDebug5ResetEv

This symbol I think that it's found in exe_DSP itself, I can find it in "C_exports.txt file that you attached in the thread about how to debug in C series.

What may be my problem then?

Many thanks for your help! :)

Post Reply

Return to “[C] General”