VideoAR Fix - Display Size
Posted: Tue Oct 06, 2009 10:25 pm
Here is what I've done to have the full screen stretch:
1) first decoded the exe.img.enc to exe.img (simple XOR with 'T-CHL7DEUC')
2) it is a FAT image so I've opened it with winhex and extracted the exeDSP main elf program that runs on the TV
3) disassembled this exeDSP (full ARM 32bit code) --- took very loooong time
Then finding the code was not so hard:
1) found the 'Fit' and 'Original' unicode messages and found some xrefs to them
2) the xrefs were in a big table called g_ToolsWStringEng
3) it is used in the CToolApp::t_CreateResource routine
4) so after that I saw these resources are loaded dinamically into 'g_ToolResMgr' when you change the OSD language so every messages are handled with their indexes (id).
5) I've checked some xrefs of g_ToolResMgr and then I figured out that there is a CResourceManager::GetWString function with the resource string ID input
6) 'Fit' was the 0x53th and 'Original' was 0x54th string in the ToolsWStringEng list
7) so I tried to find a function where GetWString was called with 0x53 and/or 0x54 ---> CToolMmbDisplaySizeItem::GetToolItemTextData
8) from this routine it can be clearly seen that CMMPlayerWrapper::GetMmpProfile with some special inputs returns 1 for FIT and 2 for ORIGINAL
9) this is when I got stuck ..... tried to continue the steps of SetMmpProfile but ended up with some kind of function pointer tables that are filled in ram so no way to find out where is the picture size set
10) after a while I had the idea check what kind of functions have the 'DisplaySize' in their name and bingo I found these worth checking:
- CMovieCore::CalculateDisplaySize
- CMovieCore::GetDisplaySize
- CMovieCore::SetDisplaySize
11) After deep analyzing the CalculateDisplaySize I saw that case 1,2,3 and "else" handled and case 2 puts the input video frames size into the center of panel screen. Case 3 still don't understand what does but the 'else' case sets DisplaySize the same as PanelSize --> screen is sctreched
So after these I took lots of deep breaths and made the patch (first for case 3 and then case 'else')
So I've modified the PressLeftRightKey and GetToolItemTextData to have 1 and 4 values to DisplaySize variable and then you get the full strech view.
Modified exeDSP written back to the FAT exe.img --- crc32 recalc and write into validinfo.txt and then encode exe.img to exe.img.enc
That's all. Browsing through the code I saw functions where the return value not just the frame size than there are some aspect ratio info is (at least the variable name is that) so I hope some aspect ratio info is recovered by the software "just" not used.
1) first decoded the exe.img.enc to exe.img (simple XOR with 'T-CHL7DEUC')
2) it is a FAT image so I've opened it with winhex and extracted the exeDSP main elf program that runs on the TV
3) disassembled this exeDSP (full ARM 32bit code) --- took very loooong time
Then finding the code was not so hard:
1) found the 'Fit' and 'Original' unicode messages and found some xrefs to them
2) the xrefs were in a big table called g_ToolsWStringEng
3) it is used in the CToolApp::t_CreateResource routine
4) so after that I saw these resources are loaded dinamically into 'g_ToolResMgr' when you change the OSD language so every messages are handled with their indexes (id).
5) I've checked some xrefs of g_ToolResMgr and then I figured out that there is a CResourceManager::GetWString function with the resource string ID input
6) 'Fit' was the 0x53th and 'Original' was 0x54th string in the ToolsWStringEng list
7) so I tried to find a function where GetWString was called with 0x53 and/or 0x54 ---> CToolMmbDisplaySizeItem::GetToolItemTextData
8) from this routine it can be clearly seen that CMMPlayerWrapper::GetMmpProfile with some special inputs returns 1 for FIT and 2 for ORIGINAL
9) this is when I got stuck ..... tried to continue the steps of SetMmpProfile but ended up with some kind of function pointer tables that are filled in ram so no way to find out where is the picture size set
10) after a while I had the idea check what kind of functions have the 'DisplaySize' in their name and bingo I found these worth checking:
- CMovieCore::CalculateDisplaySize
- CMovieCore::GetDisplaySize
- CMovieCore::SetDisplaySize
11) After deep analyzing the CalculateDisplaySize I saw that case 1,2,3 and "else" handled and case 2 puts the input video frames size into the center of panel screen. Case 3 still don't understand what does but the 'else' case sets DisplaySize the same as PanelSize --> screen is sctreched
So after these I took lots of deep breaths and made the patch (first for case 3 and then case 'else')
So I've modified the PressLeftRightKey and GetToolItemTextData to have 1 and 4 values to DisplaySize variable and then you get the full strech view.
Modified exeDSP written back to the FAT exe.img --- crc32 recalc and write into validinfo.txt and then encode exe.img to exe.img.enc
That's all. Browsing through the code I saw functions where the return value not just the frame size than there are some aspect ratio info is (at least the variable name is that) so I hope some aspect ratio info is recovered by the software "just" not used.