// // sub_BAACC0 from 0xbaacc0 to 0xbab508 (2120 bytes) // // 1 xrefs: // > @ 0x111cd00 // // 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_BAACC0(__int64 *a1, _BYTE *a2) { __int64 v3; // x19 _QWORD *v4; // x22 int v5; // w24 __int64 v6; // x2 __int64 result; // x0 const char *v8; // x21 const char *v9; // x27 char *v10; // d8 const char *v11; // d9 const char *v12; // x23 __int64 v13; // x25 void *v14; // x0 const char *v15; // x28 int v16; // w4 int v17; // w5 int v18; // w6 int v19; // w7 const char *v20; // d12 char *v21; // d13 __int64 v22; // x0 char *v23; // d11 char *v24; // d10 const char *v25; // x1 char *v26; // x0 const char *v27; // x1 char *v28; // x0 const char *v29; // x1 char *v30; // x0 char *v31; // x0 char **v32; // x0 char **v33; // d14 const char *v34; // x2 const char *v35; // x3 const char *v36; // x4 const char *v37; // x5 const char *v38; // x6 const char *v39; // x7 const char *v40; // x0 const char *v41; // x8 unsigned int v42; // w21 __int64 v43; // x23 unsigned int v44; // w21 int v45; // w5 __int64 v46; // x6 __int64 v47; // x1 __int64 v48; // x21 const char *v49; // x0 __int64 v50; // x2 char v51; // [xsp+0h] [xbp-10h] v3 = *a1; v4 = *(_QWORD **)(*a1 + 536); v5 = *(_DWORD *)(*a1 + 2172); v6 = *(_QWORD *)(*a1 + 36064); *a2 = 1; v4[17] = v6; v4[18] = 0; *(_BYTE *)(v3 + 1568) = 1; switch ( v5 ) { case 1: v12 = "OPTIONS"; goto LABEL_26; case 2: *(_BYTE *)(v3 + 1568) = 0; v12 = "DESCRIBE"; goto LABEL_26; case 3: v8 = *(const char **)(v3 + 2032); v9 = *(const char **)(v3 + 2024); if ( v8 ) { v10 = nullptr; v11 = nullptr; v12 = "ANNOUNCE"; v13 = sub_B77070((__int64)a1, "Transport:"); goto LABEL_7; } v12 = "ANNOUNCE"; v8 = "*"; goto LABEL_29; case 4: v12 = "SETUP"; goto LABEL_26; case 5: v12 = "PLAY"; goto LABEL_26; case 6: v12 = "PAUSE"; goto LABEL_26; case 7: v12 = "TEARDOWN"; LABEL_26: v9 = *(const char **)(v3 + 2024); goto LABEL_27; case 8: *(_BYTE *)(v3 + 1568) = 0; v12 = "GET_PARAMETER"; goto LABEL_35; case 9: v12 = "SET_PARAMETER"; goto LABEL_35; case 10: v12 = "RECORD"; LABEL_35: v9 = *(const char **)(v3 + 2024); if ( !v9 ) { sub_B7B690(v3, "Refusing to issue an RTSP request [%s] without a session ID.", v12); return 43; } LABEL_27: v8 = *(const char **)(v3 + 2032); if ( !v8 ) v8 = "*"; LABEL_29: v13 = sub_B77070((__int64)a1, "Transport:"); if ( !v13 && v5 == 4 ) { if ( !*(_QWORD *)(v3 + 2040) ) { sub_B7B690(v3, "Refusing to issue an RTSP SETUP without a Transport: header."); return 43; } off_1231008((void *)a1[140]); v27 = *(const char **)(v3 + 2040); a1[140] = 0; v28 = sub_B8F880("Transport: %s\r\n", v27); a1[140] = (__int64)v28; v13 = (__int64)v28; if ( !v28 ) return 27; goto LABEL_33; } if ( v5 != 2 ) { LABEL_33: v10 = nullptr; v11 = nullptr; goto LABEL_7; } if ( sub_B77070((__int64)a1, "Accept:") ) v11 = nullptr; else v11 = "Accept: application/sdp\r\n"; v10 = nullptr; if ( !sub_B77070((__int64)a1, "Accept-Encoding:") ) { if ( *(_QWORD *)(v3 + 1720) ) { off_1231008((void *)a1[134]); v29 = *(const char **)(v3 + 1720); a1[134] = 0; v30 = sub_B8F880("Accept-Encoding: %s\r\n", v29); a1[134] = (__int64)v30; v10 = v30; if ( !v30 ) return 27; } } LABEL_7: if ( sub_B77070((__int64)a1, "User-Agent:") && (v14 = (void *)a1[133]) != nullptr ) { v15 = nullptr; off_1231008(v14); a1[133] = 0; } else { v15 = nullptr; if ( !sub_B77070((__int64)a1, "User-Agent:") && *(_QWORD *)(v3 + 1936) ) v15 = (const char *)a1[133]; } result = sub_B7756C((__int64)a1, (__int64)v12, (__int64)v8, 0, v16, v17, v18, v19, v51); if ( (_DWORD)result ) return result; v20 = (const char *)a1[132]; v21 = (char *)a1[135]; off_1231008((void *)a1[137]); v22 = *(_QWORD *)(v3 + 2328); a1[137] = 0; if ( v22 && !sub_B77070((__int64)a1, "Referer:") ) { v31 = sub_B8F880("Referer: %s\r\n", *(const char **)(v3 + 2328)); a1[137] = (__int64)v31; v23 = v31; } else { v23 = nullptr; a1[137] = 0; } if ( *(_BYTE *)(v3 + 36041) && (v5 & 0xF) != 0 && !sub_B77070((__int64)a1, "Range:") && *(_QWORD *)(v3 + 36048) ) { off_1231008((void *)a1[136]); v25 = *(const char **)(v3 + 36048); a1[136] = 0; v26 = sub_B8F880("Range: %s\r\n", v25); a1[136] = (__int64)v26; v24 = v26; } else { v24 = nullptr; } if ( sub_B77070((__int64)a1, "CSeq:") ) { sub_B7B690(v3, "CSeq cannot be set as a custom header."); return 85; } if ( sub_B77070((__int64)a1, "Session:") ) { sub_B7B690(v3, "Session ID cannot be set as a custom header."); return 43; } v32 = (char **)sub_B77CF4(); v33 = v32; if ( !v32 ) return 27; result = sub_B77FA8(v32, (__int64)"%s %s RTSP/1.0\r\nCSeq: %ld\r\n", v12, v8, v4[17]); if ( !(_DWORD)result ) { if ( !v9 || (result = sub_B77FA8(v33, (__int64)"Session: %s\r\n", v9), !(_DWORD)result) ) { v34 = (const char *)v13; if ( !v13 ) v34 = &byte_F288A0; if ( v11 ) v35 = v11; else v35 = &byte_F288A0; if ( v10 ) v36 = v10; else v36 = &byte_F288A0; if ( v24 ) v37 = v24; else v37 = &byte_F288A0; if ( v23 ) v38 = v23; else v38 = &byte_F288A0; if ( v15 ) v39 = v15; else v39 = &byte_F288A0; v40 = v20; if ( !v20 ) v40 = &byte_F288A0; v41 = v21 ? v21 : &byte_F288A0; v42 = sub_B77FA8(v33, (__int64)"%s%s%s%s%s%s%s%s", v34, v35, v36, v37, v38, v39, v40, v41); off_1231008((void *)a1[135]); a1[135] = 0; result = v42; if ( !v42 ) { if ( ((v5 - 2) & 0xFFFFFFFD) != 0 || (result = sub_B78668(v3, v33), !(_DWORD)result) ) { result = sub_B783EC(a1, 0, v33); if ( !(_DWORD)result ) { if ( (unsigned int)(v5 - 8) > 1 ) { v43 = 0; if ( v5 != 3 ) goto LABEL_85; } if ( *(_BYTE *)(v3 + 1569) ) { v43 = *(_QWORD *)(v3 + 36088); v48 = 0; *(_DWORD *)(v3 + 1072) = 4; } else { v48 = *(_QWORD *)(v3 + 36088); if ( v48 == -1 ) { v49 = *(const char **)(v3 + 656); if ( v49 ) v48 = strlen(v49); else v48 = 0; } v43 = 0; *(_DWORD *)(v3 + 1072) = 2; } if ( v48 <= 0 && v43 <= 0 ) { if ( v5 == 8 ) { *(_DWORD *)(v3 + 1072) = 5; *(_BYTE *)(v3 + 1568) = 1; } LABEL_85: *(_BYTE *)(v3 + 531) = 1; result = sub_B781B4(v33, &word_F203D8, 2u); if ( (_DWORD)result ) return result; LABEL_86: v44 = sub_B77D60(v33, a1, (_QWORD *)(v3 + 36240), 0, 0); if ( v44 ) { sub_B7B690(v3, "Failed sending RTSP request"); return v44; } else { if ( v43 ) { v46 = (__int64)(v4 + 6); v45 = 0; } else { v45 = -1; v46 = 0; } sub_B94394((__int64)a1, 0, -1, 1, (__int64)(v4 + 5), v45, v46); v47 = v4[6]; ++*(_QWORD *)(v3 + 36064); if ( v47 && (sub_B72384((_QWORD *)v3, v47), (unsigned int)sub_B72490(a1)) ) return 42; else return 0; } } if ( sub_B77070((__int64)a1, "Content-Length:") || (!*(_BYTE *)(v3 + 1569) ? (v50 = v48) : (v50 = v43), result = sub_B77FA8(v33, (__int64)"Content-Length: %ld\r\n", v50), !(_DWORD)result) ) { if ( (unsigned int)(v5 - 8) <= 1 ) { if ( !sub_B77070((__int64)a1, "Content-Type:") ) { result = sub_B77FA8(v33, (__int64)"Content-Type: text/parameters\r\n"); if ( (_DWORD)result ) return result; } } else if ( !sub_B77070((__int64)a1, "Content-Type:") ) { result = sub_B77FA8(v33, (__int64)"Content-Type: application/sdp\r\n"); if ( (_DWORD)result ) return result; } *(_BYTE *)(v3 + 36008) = 0; *(_BYTE *)(v3 + 531) = 1; result = sub_B781B4(v33, &word_F203D8, 2u); if ( (_DWORD)result ) return result; if ( v48 > 0 ) { result = sub_B781B4(v33, *(void **)(v3 + 656), v48); if ( (_DWORD)result ) return result; } goto LABEL_86; } } } } } } return result; case 11: *(_BYTE *)(v3 + 1568) = 0; sub_B94394((__int64)a1, 0, -1, 1, (__int64)(v4 + 5), -1, 0); return 0; case 12: sub_B7B690(v3, "Got invalid RTSP request: RTSPREQ_LAST"); return 43; default: sub_B7B690(v3, "Got invalid RTSP request"); return 43; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source