Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,856 Members 46,339 Now Online
XDA Developers Android and Mobile Development Forum

AllShareCast/ScreenMirror fix for custom ROMs (I9500, I9505, I9506, E330, N9005)

Tip us?
 
jackyaway
Old
#211  
Senior Member
Thanks Meter 634
Posts: 529
Join Date: Dec 2009
Hi @sorg! And Hi to all users!
I have a note 3 N9005 with TW Kitkat 4.4.2 and i'm trying to make screen mirroring working with custom kernel by following your "how-to".
I decompiled libwfdsm.so (both original and mod) and with the help of file compare and user's comments, i made this change:

from:
Code:
Select Code
.text:00004C90 loc_4C90                                ; CODE XREF: SessionManager::setUserCapability(int,void *)+2Ej
.text:00004C90                 LDR             R1, =(aProtected - 0x4C98) ; jumptable 00004BCE case 21
.text:00004C92                 MOV             R0, R4  ; s1
.text:00004C94                 ADD             R1, PC  ; "Protected"
.text:00004C96                 BLX             strcasecmp
.text:00004C9A                 CBZ             R0, loc_4CA0
.text:00004C9C                 MOVS            R2, #1
.text:00004C9E                 B               loc_4CB0
.text:00004CA0 ; ---------------------------------------------------------------------------
.text:00004CA0
.text:00004CA0 loc_4CA0                                ; CODE XREF: SessionManager::setUserCapability(int,void *)+FAj
.text:00004CA0                 LDR             R1, =(aUnprotected - 0x4CA8)
.text:00004CA2                 MOV             R0, R4  ; s1
.text:00004CA4                 ADD             R1, PC  ; "Unprotected"
.text:00004CA6                 BLX             strcasecmp
.text:00004CAA                 CMP             R0, #0
.text:00004CAC                 BEQ             locret_4D0C
.text:00004CAE                 MOVS            R2, #2
.text:00004CB0
.text:00004CB0 loc_4CB0                                ; CODE XREF: SessionManager::setUserCapability(int,void *)+FEj
.text:00004CB0                 STR             R2, [R5,#0x58]
.text:00004CB2                 POP             {R3-R7,PC}
to:
Code:
Select Code
.text:00004C90 loc_4C90                                ; CODE XREF: SessionManager::setUserCapability(int,void *)+2Ej
.text:00004C90                 LDR             R1, =(aProtected - 0x4C98) ; jumptable 00004BCE case 21
.text:00004C92                 MOV             R0, R4  ; s1
.text:00004C94                 ADD             R1, PC  ; "Protected"
.text:00004C96                 BLX             strcasecmp
.text:00004C9A                 CBZ             R0, loc_4CA0
.text:00004C9C                 MOVS            R2, #0
.text:00004C9E                 B               loc_4CB0
.text:00004CA0 ; ---------------------------------------------------------------------------
.text:00004CA0
.text:00004CA0 loc_4CA0                                ; CODE XREF: SessionManager::setUserCapability(int,void *)+FAj
.text:00004CA0                 LDR             R1, =(aUnprotected - 0x4CA8)
.text:00004CA2                 MOV             R0, R4  ; s1
.text:00004CA4                 ADD             R1, PC  ; "Unprotected"
.text:00004CA6                 BLX             strcasecmp
.text:00004CAA                 CMP             R0, #0
.text:00004CAC                 BEQ             locret_4D0C
.text:00004CAE                 MOVS            R2, #0
.text:00004CB0
.text:00004CB0 loc_4CB0                                ; CODE XREF: SessionManager::setUserCapability(int,void *)+FEj
.text:00004CB0                 STR             R2, [R5,#0x58]
.text:00004CB2                 POP             {R3-R7,PC}
from:
Code:
Select Code
.text:00007C98                 ADD.W           R3, R0, #0x1000
.text:00007C9C                 LDR             R2, [R3]
.text:00007C9E                 LDRB.W          R1, [R2,#0x2A]
.text:00007CA2                 BL              _ZN12MMCapability22isHDCPVersionSupportedEi ; MMCapability::isHDCPVersionSupported(int)
.text:00007CA6                 CMP             R0, #0
.text:00007CA8                 BNE             loc_7D08
.text:00007CAA                 B               loc_7CB4
.text:00007CAC ; ---------------------------------------------------------------------------
.text:00007CAC
.text:00007CAC loc_7CAC                                ; CODE XREF: cback::setupCallback(rtspApiMesg &)+22Ej
.text:00007CAC                 LDR             R0, [R7]
.text:00007CAE                 LDRH            R3, [R0,#0x2C]
.text:00007CB0                 CMP             R3, #0
.text:00007CB2                 BEQ             loc_7D1C
.text:00007CB4
.text:00007CB4 loc_7CB4                                ; CODE XREF: cback::setupCallback(rtspApiMesg &)+19Ej
.text:00007CB4                                         ; cback::setupCallback(rtspApiMesg &)+1A6j ...
.text:00007CB4                 LDR             R0, [R6,#0x64]
.text:00007CB6                 BL              _ZNK6Device13getDeviceTypeEv ; Device::getDeviceType(void)
.text:00007CBA                 MOV             R1, R0
.text:00007CBC                 MOV             R0, R8
.text:00007CBE                 BL              _ZN9MMAdaptor13createSessionEP12MMCapability10DeviceType ; MMAdaptor::createSession(MMCapability *,DeviceType)
.text:00007CC2                 LDR             R2, [R5,#4]
.text:00007CC4                 LDR             R1, [R2,#0x20]
.text:00007CC6                 CBZ             R1, loc_7CE4
.text:00007CC8                 LDR             R1, =(aRtspsession_cp - 0x7CD2)
.text:00007CCA                 MOVS            R0, #6
.text:00007CCC                 LDR             R2, =(aSetRtpSourcePo - 0x7CD4)
.text:00007CCE                 ADD             R1, PC  ; "RTSPSession_CPP"
.text:00007CD0                 ADD             R2, PC  ; "Set RTP Source port num"
.text:00007CD2                 BLX             __android_log_print
.text:00007CD6                 LDR             R0, [R5,#4]
.text:00007CD8                 MOVS            R2, #1
.text:00007CDA                 LDR             R3, [R0,#0x20]
.text:00007CDC                 STRB.W          R2, [R4,#0x228]
.text:00007CE0                 STR.W           R3, [R4,#0x21C]
.text:00007CE4
.text:00007CE4 loc_7CE4                                ; CODE XREF: cback::setupCallback(rtspApiMesg &)+1DAj
.text:00007CE4                 LDR             R1, [R5,#4]
.text:00007CE6                 LDR             R0, [R1,#0x24]
.text:00007CE8                 CBZ             R0, loc_7D3E
.text:00007CEA                 LDR             R1, =(aRtspsession_cp - 0x7CF4)
.text:00007CEC                 MOVS            R0, #6
.text:00007CEE                 LDR             R2, =(aSetRtcpSourceP - 0x7CF6)
.text:00007CF0                 ADD             R1, PC  ; "RTSPSession_CPP"
.text:00007CF2                 ADD             R2, PC  ; "Set RTCP Source Port Num"
.text:00007CF4                 BLX             __android_log_print
.text:00007CF8                 LDR             R3, [R5,#4]
.text:00007CFA                 MOVS            R1, #1
.text:00007CFC                 LDR             R2, [R3,#0x24]
to:
Code:
Select Code
.text:00007C98                 ADD.W           R3, R0, #0x1000
.text:00007C9C                 LDR             R2, [R3]
.text:00007C9E                 LDRB.W          R1, [R2,#0x2A]
.text:00007CA2                 BL              _ZN12MMCapability22isHDCPVersionSupportedEi ; MMCapability::isHDCPVersionSupported(int)
.text:00007CA6                 CMP             R0, #0
.text:00007CA8                 BNE             loc_7D08
.text:00007CAA                 B               loc_7CB4
.text:00007CAC ; ---------------------------------------------------------------------------
.text:00007CAC
.text:00007CAC loc_7CAC                                ; CODE XREF: cback::setupCallback(rtspApiMesg &)+22Ej
.text:00007CAC                 LDR             R0, [R7]
.text:00007CAE                 LDRH            R3, [R0,#0x2C]
.text:00007CB0                 CMP             R3, #0
.text:00007CB2                 BEQ             loc_7D1C
.text:00007CB4
.text:00007CB4 loc_7CB4                                ; CODE XREF: cback::setupCallback(rtspApiMesg &)+19Ej
.text:00007CB4                                         ; cback::setupCallback(rtspApiMesg &)+1A6j ...
.text:00007CB4                 LDR             R0, [R6,#0x64]
.text:00007CB6                 BL              _ZNK6Device13getDeviceTypeEv ; Device::getDeviceType(void)
.text:00007CBA                 MOV             R1, R0
.text:00007CBC                 MOV             R0, R8
.text:00007CBE                 BL              _ZN9MMAdaptor13createSessionEP12MMCapability10DeviceType ; MMAdaptor::createSession(MMCapability *,DeviceType)
.text:00007CC2                 LDR             R2, [R5,#4]
.text:00007CC4                 LDR             R1, [R2,#0x20]
.text:00007CC6                 MOVS            R0, #0
.text:00007CC8                 LDR             R1, =(aRtspsession_cp - 0x7CD2)
.text:00007CCA                 MOVS            R0, #6
.text:00007CCC                 LDR             R2, =(aSetRtpSourcePo - 0x7CD4)
.text:00007CCE                 ADD             R1, PC  ; "RTSPSession_CPP"
.text:00007CD0                 ADD             R2, PC  ; "Set RTP Source port num"
.text:00007CD2                 BLX             __android_log_print
.text:00007CD6                 LDR             R0, [R5,#4]
.text:00007CD8                 MOVS            R2, #1
.text:00007CDA                 LDR             R3, [R0,#0x20]
.text:00007CDC                 STRB.W          R2, [R4,#0x228]
.text:00007CE0                 STR.W           R3, [R4,#0x21C]
.text:00007CE4                 LDR             R1, [R5,#4]
.text:00007CE6                 LDR             R0, [R1,#0x24]
.text:00007CE8                 CBZ             R0, loc_7D3E
.text:00007CEA                 LDR             R1, =(aRtspsession_cp - 0x7CF4)
.text:00007CEC                 MOVS            R0, #6
.text:00007CEE                 LDR             R2, =(aSetRtcpSourceP - 0x7CF6)
.text:00007CF0                 ADD             R1, PC  ; "RTSPSession_CPP"
.text:00007CF2                 ADD             R2, PC  ; "Set RTCP Source Port Num"
.text:00007CF4                 BLX             __android_log_print
.text:00007CF8                 LDR             R3, [R5,#4]
.text:00007CFA                 MOVS            R1, #1
.text:00007CFC                 LDR             R2, [R3,#0x24]
from:
Code:
Select Code
.text:0000C34C loc_C34C                                ; CODE XREF: MMCapability::setKeyValue(char *,char *)+F4j
.text:0000C34C                 LDR.W           R1, =(aWfd_3d_video_f - 0xC356)
.text:0000C350                 MOV             R0, R5  ; s1
.text:0000C352                 ADD             R1, PC  ; "wfd_3d_video_formats"
.text:0000C354                 BLX             strcmp
.text:0000C358                 CMP             R0, #0
.text:0000C35A                 BEQ.W           loc_C7B4
.text:0000C35E                 LDR.W           R1, =(aWfd_content_pr - 0xC368)
.text:0000C362                 MOV             R0, R5  ; s1
.text:0000C364                 ADD             R1, PC  ; "wfd_content_protection"
.text:0000C366                 BLX             strcmp
.text:0000C36A                 CMP             R0, #0
.text:0000C36C                 BNE             loc_C3E0
.text:0000C36E                 LDR.W           R1, =(aHdcp2_ - 0xC378)
.text:0000C372                 MOV             R0, R6  ; haystack
.text:0000C374                 ADD             R1, PC  ; "HDCP2."
.text:0000C376                 BLX             strstr
.text:0000C37A                 CBZ             R0, loc_C3B4
.text:0000C37C                 ADDS            R0, R6, #6 ; nptr
.text:0000C37E                 ADD.W           R5, R4, #0x1000
.text:0000C382                 BLX             atoi
.text:0000C386                 LDR             R7, [R5]
.text:0000C388                 ADDS            R3, R0, #1
.text:0000C38A                 MOVW            R0, #0x177D
.text:0000C38E                 STRB.W          R3, [R7,#0x2A]
.text:0000C392                 BLX             GetLogMask
.text:0000C396                 LSLS            R0, R0, #0x1C
.text:0000C398                 BPL             loc_C3B4
.text:0000C39A                 LDR             R0, [R5]
.text:0000C39C                 LDR.W           R1, =(aMmcapability_c - 0xC3AC)
.text:0000C3A0                 LDR.W           R2, =(aWfd_cfg_parser - 0xC3B0)
.text:0000C3A4                 LDRB.W          R3, [R0,#0x2A]
.text:0000C3A8                 ADD             R1, PC  ; "MMCapability_CPP"
.text:0000C3AA                 MOVS            R0, #6
.text:0000C3AC                 ADD             R2, PC  ; "wfd_cfg_parser->getSupportedHDCPVersion"...
.text:0000C3AE                 SUBS            R3, #1
.text:0000C3B0                 BLX             __android_log_print
.text:0000C3B4
.text:0000C3B4 loc_C3B4                                ; CODE XREF: MMCapability::setKeyValue(char *,char *)+3CAj
.text:0000C3B4                                         ; MMCapability::setKeyValue(char *,char *)+3E8j
.text:0000C3B4                 LDR.W           R1, =(aPort - 0xC3BE)
.text:0000C3B8                 MOV             R0, R6  ; haystack
.text:0000C3BA                 ADD             R1, PC  ; "port="
.text:0000C3BC                 BLX             strstr
.text:0000C3C0                 CMP             R0, #0
.text:0000C3C2                 BEQ.W           loc_C7B4
to:
Code:
Select Code
.text:0000C34C loc_C34C                                ; CODE XREF: MMCapability::setKeyValue(char *,char *)+F4j
.text:0000C34C                 LDR.W           R1, =(aWfd_3d_video_f - 0xC356)
.text:0000C350                 MOV             R0, R5  ; s1
.text:0000C352                 ADD             R1, PC  ; "wfd_3d_video_formats"
.text:0000C354                 BLX             strcmp
.text:0000C358                 CMP             R0, #0
.text:0000C35A                 BEQ.W           loc_C7B4
.text:0000C35E                 LDR.W           R1, =(aWfd_content_pr - 0xC368)
.text:0000C362                 MOV             R0, R5  ; s1
.text:0000C364                 ADD             R1, PC  ; "wfd_content_protection"
.text:0000C366                 BLX             strcmp
.text:0000C36A                 CMP             R0, #0
.text:0000C36C                 BNE             loc_C3E0
.text:0000C36E                 LDR.W           R1, =(aHdcp2_ - 0xC378)
.text:0000C372                 MOV             R0, R6  ; haystack
.text:0000C374                 ADD             R1, PC  ; "HDCP2."
.text:0000C376                 BLX             strstr
.text:0000C37A                 CBZ             R0, loc_C3B4
.text:0000C37C                 ADDS            R0, R6, #6 ; nptr
.text:0000C37E                 ADD.W           R5, R4, #0x1000
.text:0000C382                 BLX             atoi
.text:0000C386                 LDR             R7, [R5]
.text:0000C388                 MOVS            R3, #0
.text:0000C38A                 MOVW            R0, #0x177D
.text:0000C38E                 STRB.W          R3, [R7,#0x2A]
.text:0000C392                 BLX             GetLogMask
.text:0000C396                 LSLS            R0, R0, #0x1C
.text:0000C398                 BPL             loc_C3B4
.text:0000C39A                 LDR             R0, [R5]
.text:0000C39C                 LDR.W           R1, =(aMmcapability_c - 0xC3AC)
.text:0000C3A0                 LDR.W           R2, =(aWfd_cfg_parser - 0xC3B0)
.text:0000C3A4                 LDRB.W          R3, [R0,#0x2A]
.text:0000C3A8                 ADD             R1, PC  ; "MMCapability_CPP"
.text:0000C3AA                 MOVS            R0, #6
.text:0000C3AC                 ADD             R2, PC  ; "wfd_cfg_parser->getSupportedHDCPVersion"...
.text:0000C3AE                 SUBS            R3, #1
.text:0000C3B0                 BLX             __android_log_print
.text:0000C3B4
.text:0000C3B4 loc_C3B4                                ; CODE XREF: MMCapability::setKeyValue(char *,char *)+3CAj
.text:0000C3B4                                         ; MMCapability::setKeyValue(char *,char *)+3E8j
.text:0000C3B4                 LDR.W           R1, =(aPort - 0xC3BE)
.text:0000C3B8                 MOV             R0, R6  ; haystack
.text:0000C3BA                 ADD             R1, PC  ; "port="
.text:0000C3BC                 BLX             strstr
.text:0000C3C0                 CMP             R0, #0
.text:0000C3C2                 BEQ.W           loc_C7B4
If someone can help me, please. Thank you for the time.
I attached an archive with bot original and modified (mio.txt) files.
Attached Files
File Type: rar N9005KITKAT_libwfdsm.rar - [Click for QR Code] (453.0 KB, 3 views)
If you like my works JACKYAWAY ROM SM-N9005
 
monroe0328
Old
#212  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Nov 2012
Can a fix be made for the galaxy s5? I have the sprint varient running m.o.a.r. and ktoons kernel. Soon as I rooted I lost the screen mirroring ability. When I had the s4 this thread saved my ass. Much thanks to the dev!
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes