// // sub_10057AD10 from 0x10057ad10 to 0x10057b4e8 (2008 bytes) // // 1 xrefs: // > @ 0x10082eb90 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // __int64 __fastcall sub_10057AD10(__int64 a1, _BYTE *a2) { __int64 v3; // x19 unsigned int v4; // w25 _QWORD *v5; // x22 __int64 v6; // x27 const char *v8; // x21 const char *v9; // x8 const char *v10; // x26 _BOOL4 v11; // w27 const char *v12; // x24 __int64 v13; // x0 char *v14; // x23 __int64 v16; // x0 const char *v17; // x8 __int64 v18; // x0 char *v19; // x8 void *v20; // x0 const char *v21; // x8 const char *v22; // x27 char *v23; // x0 char *v24; // x10 void **v25; // x0 void **v26; // x24 const char *v27; // x8 const char *v28; // x9 const char *v29; // x10 const char *v30; // x11 const char *v31; // x12 const char *v32; // x13 const char *v33; // x14 const char *v34; // x15 signed __int64 v35; // x23 signed __int64 v36; // x21 const char *v37; // x0 signed __int64 v38; // x8 int v39; // w5 __int64 v40; // x6 __int64 v41; // x1 __int64 v42; // [xsp+0h] [xbp-D0h] const char *v43; // [xsp+8h] [xbp-C8h] const char *v44; // [xsp+40h] [xbp-90h] char *v45; // [xsp+48h] [xbp-88h] char *v46; // [xsp+50h] [xbp-80h] const char *v47; // [xsp+58h] [xbp-78h] const char *v48; // [xsp+60h] [xbp-70h] char *v49; // [xsp+68h] [xbp-68h] _BOOL4 v50; // [xsp+74h] [xbp-5Ch] const char *v51; // [xsp+78h] [xbp-58h] v3 = *(_QWORD *)a1; v4 = *(_DWORD *)(*(_QWORD *)a1 + 1796LL); v5 = *(_QWORD **)(*(_QWORD *)a1 + 536LL); *a2 = 1; v5[17] = *(_QWORD *)(v3 + 35616); v5[18] = 0; *(_BYTE *)(v3 + 1311) = 1; v8 = "SET_PARAMETER"; v9 = "OPTIONS"; switch ( v4 ) { case 1u: goto LABEL_11; case 2u: *(_BYTE *)(v3 + 1311) = 0; v9 = "DESCRIBE"; goto LABEL_11; case 3u: v9 = "ANNOUNCE"; goto LABEL_11; case 4u: v9 = "SETUP"; goto LABEL_11; case 5u: v9 = "PLAY"; goto LABEL_11; case 6u: v9 = "PAUSE"; goto LABEL_11; case 7u: v9 = "TEARDOWN"; LABEL_11: v10 = *(const char **)(v3 + 1672); v11 = v10 != nullptr; v8 = v9; goto LABEL_16; case 8u: *(_BYTE *)(v3 + 1311) = 0; v8 = "GET_PARAMETER"; goto LABEL_14; case 9u: goto LABEL_14; case 0xAu: v8 = "RECORD"; LABEL_14: v10 = *(const char **)(v3 + 1672); if ( !v10 ) { sub_100552734(v3, "Refusing to issue an RTSP request [%s] without a session ID."); return 43; } v11 = 1; LABEL_16: if ( *(_QWORD *)(v3 + 1680) ) v12 = *(const char **)(v3 + 1680); else v12 = "*"; v13 = sub_10054FA88(a1, "Transport:"); v14 = (char *)v13; if ( v4 != 4 || v13 != 0 ) goto LABEL_26; if ( !*(_QWORD *)(v3 + 1688) ) { sub_100552734(v3, "Refusing to issue an RTSP SETUP without a Transport: header."); return 43; } off_10085DEB8(*(void **)(a1 + 896)); *(_QWORD *)(a1 + 896) = 0; v14 = sub_1005628DC("Transport: %s\r\n", *(const char **)(v3 + 1688)); *(_QWORD *)(a1 + 896) = v14; if ( !v14 ) return 27; LABEL_26: if ( v4 != 2 ) { v51 = nullptr; goto LABEL_34; } v16 = sub_10054FA88(a1, "Accept:"); v17 = "Accept: application/sdp\r\n"; if ( v16 ) v17 = nullptr; v51 = v17; v18 = sub_10054FA88(a1, "Accept-Encoding:"); v19 = nullptr; if ( v18 ) goto LABEL_35; if ( !*(_QWORD *)(v3 + 1448) ) { LABEL_34: v19 = nullptr; goto LABEL_35; } off_10085DEB8(*(void **)(a1 + 848)); *(_QWORD *)(a1 + 848) = 0; v19 = sub_1005628DC("Accept-Encoding: %s\r\n", *(const char **)(v3 + 1448)); *(_QWORD *)(a1 + 848) = v19; if ( !v19 ) return 27; LABEL_35: v49 = v19; if ( sub_10054FA88(a1, "User-Agent:") && (v20 = *(void **)(a1 + 840)) != nullptr ) { v50 = v11; off_10085DEB8(v20); v48 = nullptr; *(_QWORD *)(a1 + 840) = 0; } else { if ( sub_10054FA88(a1, "User-Agent:") || !*(_QWORD *)(v3 + 1600) ) { v50 = v11; v21 = nullptr; } else { v50 = v11; v21 = *(const char **)(a1 + 840); } v48 = v21; } v6 = sub_10055018C((__int64 *)a1, (__int64)v8, (__int64)v12, 0); if ( (_DWORD)v6 ) return v6; v47 = *(const char **)(a1 + 832); v22 = *(const char **)(a1 + 856); off_10085DEB8(*(void **)(a1 + 872)); v23 = nullptr; *(_QWORD *)(a1 + 872) = 0; if ( *(_QWORD *)(v3 + 1936) ) { if ( sub_10054FA88(a1, "Referer:") ) v23 = nullptr; else v23 = sub_1005628DC("Referer: %s\r\n", *(const char **)(v3 + 1936)); } v46 = v23; v24 = nullptr; *(_QWORD *)(a1 + 872) = v23; if ( (v4 & 0xF) != 0 && *(_BYTE *)(v3 + 35593) ) { if ( sub_10054FA88(a1, "Range:") ) { v24 = nullptr; } else if ( *(_QWORD *)(v3 + 35600) ) { off_10085DEB8(*(void **)(a1 + 864)); *(_QWORD *)(a1 + 864) = 0; v24 = sub_1005628DC("Range: %s\r\n", *(const char **)(v3 + 35600)); *(_QWORD *)(a1 + 864) = v24; } else { v24 = nullptr; } } v45 = v24; if ( sub_10054FA88(a1, "CSeq:") ) { sub_100552734(v3, "CSeq cannot be set as a custom header."); return 85; } if ( sub_10054FA88(a1, "Session:") ) { sub_100552734(v3, "Session ID cannot be set as a custom header.", v42); return 43; } v44 = v22; v25 = (void **)sub_1005508B0(); if ( !v25 ) return 27; v43 = v12; v26 = v25; v6 = sub_100550C00(v25, "%s %s RTSP/1.0\r\nCSeq: %ld\r\n", v8, v43, v5[17]); if ( (_DWORD)v6 ) return v6; if ( v50 ) { v6 = sub_100550C00(v26, "Session: %s\r\n", v10); if ( (_DWORD)v6 ) return v6; } v27 = ""; if ( v14 ) v28 = v14; else v28 = ""; if ( v51 ) v29 = v51; else v29 = ""; if ( v49 ) v30 = v49; else v30 = ""; if ( v45 ) v31 = v45; else v31 = ""; if ( v46 ) v32 = v46; else v32 = ""; if ( v48 ) v33 = v48; else v33 = ""; if ( v47 ) v34 = v47; else v34 = ""; if ( v44 ) v27 = v44; v6 = sub_100550C00(v26, "%s%s%s%s%s%s%s%s", v28, v29, v30, v31, v32, v33, v34, v27); off_10085DEB8(*(void **)(a1 + 856)); *(_QWORD *)(a1 + 856) = 0; if ( (_DWORD)v6 ) return v6; if ( v4 == 2 || v4 == 4 ) { v6 = sub_100551124(v3, v26); if ( (_DWORD)v6 ) return v6; } v6 = sub_100550EA8((__int64 *)a1, 0, v26); if ( (_DWORD)v6 ) return v6; v35 = 0; if ( v4 <= 9 ) { v36 = 0; if ( ((1 << v4) & 0x308) != 0 ) { v36 = *(_QWORD *)(v3 + 35640); if ( *(_BYTE *)(v3 + 1313) ) { v35 = 0; *(_DWORD *)(v3 + 1064) = 4; } else { if ( v36 == -1 ) { v37 = *(const char **)(v3 + 656); if ( v37 ) v36 = strlen(v37); else v36 = 0; } *(_DWORD *)(v3 + 1064) = 2; v35 = v36; v36 = 0; } if ( v35 > 0 || v36 >= 1 ) { if ( !sub_10054FA88(a1, "Content-Length:") ) { v38 = *(_BYTE *)(v3 + 1313) ? v36 : v35; v6 = sub_100550C00(v26, "Content-Length: %ld\r\n", v38); if ( (_DWORD)v6 ) return v6; } if ( (v4 & 0xFFFFFFFE) == 8 && !sub_10054FA88(a1, "Content-Type:") ) { v6 = sub_100550C00(v26, "Content-Type: text/parameters\r\n"); if ( (_DWORD)v6 ) return v6; } if ( v4 == 3 && !sub_10054FA88(a1, "Content-Type:") ) { v6 = sub_100550C00(v26, "Content-Type: application/sdp\r\n"); if ( (_DWORD)v6 ) return v6; } *(_BYTE *)(v3 + 35560) = 0; } else if ( v4 == 8 ) { *(_DWORD *)(v3 + 1064) = 5; *(_BYTE *)(v3 + 1311) = 1; } } } else { v36 = 0; } *(_BYTE *)(v3 + 531) = 1; v6 = sub_100550CA0(v26, "\r\n", 2u); if ( (_DWORD)v6 ) return v6; if ( v35 >= 1 ) { v6 = sub_100550CA0(v26, *(void **)(v3 + 656), v35); if ( (_DWORD)v6 ) return v6; } v6 = sub_10055090C(v26, (_QWORD *)a1, (_QWORD *)(v3 + 35784), 0, 0); if ( (_DWORD)v6 ) { sub_100552734(v3, "Failed sending RTSP request"); return v6; } if ( v36 ) v39 = 0; else v39 = -1; if ( v36 ) v40 = (__int64)(v5 + 6); else v40 = 0; sub_100567898(a1, 0, -1, 1, (__int64)(v5 + 5), v39, v40); v6 = 0; ++*(_QWORD *)(v3 + 35616); v41 = v5[6]; if ( !v41 ) return v6; sub_10054A8B8(v3, v41); if ( (unsigned int)sub_10054A1EC((__int64 *)a1) ) return 42; else return 0; case 0xBu: *(_BYTE *)(v3 + 1311) = 0; sub_100567898(a1, 0, -1, 1, (__int64)(v5 + 5), -1, 0); return 0; case 0xCu: sub_100552734(v3, "Got invalid RTSP request: RTSPREQ_LAST"); return 43; default: sub_100552734(v3, "Got invalid RTSP request"); return 43; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source