// // tls1_cbc_remove_padding from 0x78b278 to 0x78b3dc (356 bytes) // // 2 xrefs: // > tls1_enc @ 0x78ba50 // > @ 0x5aacc // // 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 // int __fastcall tls1_cbc_remove_padding(int a1, _DWORD *a2, int a3, int a4) { unsigned int v4; // r6 unsigned int v5; // r3 int v6; // r12 int v7; // r4 int v8; // r2 int v10; // r4 int v11; // r0 unsigned int v12; // r1 int v13; // r12 unsigned int v14; // r6 unsigned int v15; // r0 unsigned int v16; // lr int v17; // r3 char v18; // r2 char v19; // t1 char v20; // r3 int v21; // r12 v4 = a4 + 1; v5 = a2[2]; if ( (*(_DWORD *)(*(_DWORD *)(*(_DWORD *)(a1 + 4) + 100) + 52) & 1) != 0 ) { if ( v4 + a3 > v5 ) return 0; v5 -= a3; v6 = a2[5] + a3; v7 = a2[6] + a3; v8 = a2[3] - a3; a2[2] = v5; a2[5] = v6; a2[6] = v7; a2[3] = v8; } else { if ( v4 > v5 ) return *(_DWORD *)(*(_DWORD *)(*(_DWORD *)(a1 + 4) + 100) + 52) & 1; v6 = a2[5]; } v10 = *(unsigned __int8 *)(v6 + v5 - 1); v11 = EVP_CIPHER_CTX_cipher(*(_DWORD *)(a1 + 176)); if ( (EVP_CIPHER_flags(v11) & 0x200000) == 0 ) { v12 = a2[2]; v13 = ~((int)(((v12 - (v10 + v4)) ^ (v10 + v4) | (v10 + v4) ^ v12) ^ v12) >> 31); if ( v12 <= 0xFF ) { if ( !v12 ) { LABEL_12: v21 = ((((unsigned __int8)v13 ^ 0xFF) - 1) & ~((unsigned __int8)v13 ^ 0xFF)) >> 31; a2[2] = v12 - ((v10 + 1) & v21); return ~v21 | v21 & 1; } v14 = a2[2]; } else { v14 = 256; } v15 = 0; v16 = a2[5] + v12; do { v17 = ((v10 - v15) ^ v15 | v15 ^ v10) ^ v10; v19 = *(_BYTE *)--v16; v18 = v19; ++v15; if ( v17 < 0 ) v20 = 0; else v20 = v10 ^ v18; LOBYTE(v13) = v13 & ~v20; } while ( v14 > v15 ); goto LABEL_12; } a2[2] = a2[2] - 1 - v10; return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source