{"type": "func", "start": 14187484, "end": 14187652, "name": "DH_compute_key_padded", "pseudocode": "// \n// DH_compute_key_padded from 0xd87bdc to 0xd87c84 (168 bytes)\n// \n// 2 xrefs:\n// > sub_E29D70 @ 0xe29e3c\n// > <???> @ 0x31788\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall DH_compute_key_padded(char *a1, __int64 a2, __int64 a3)\n{\n  __int64 result; // x0\n  int v6; // w19\n  int v7; // w0\n  int v8; // w3\n  int v9; // w0\n  unsigned int v10; // w20\n  int v11; // w2\n  size_t v12; // x21\n\n  LODWORD(result) = (*(__int64 (**)(void))(*(_QWORD *)(a3 + 120) + 16LL))();\n  v6 = result;\n  if ( (int)result <= 0 )\n    return (unsigned int)result;\n  v7 = BN_num_bits(*(_QWORD *)(a3 + 8));\n  v8 = v7 + 14;\n  v9 = v7 + 7;\n  if ( v9 >= 0 )\n    v8 = v9;\n  v10 = v8 >> 3;\n  v11 = (v8 >> 3) - v6;\n  if ( v11 > 0 )\n  {\n    v12 = v11;\n    memmove(&a1[v11], a1, v6);\n    memset(a1, 0, v12);\n  }\n  return v10;\n}", "assembly": "; \n; DH_compute_key_padded from 0xd87bdc to 0xd87c84 (168 bytes)\n; \n; 2 xrefs:\n; > sub_E29D70 @ 0xe29e3c\n; > <???> @ 0x31788\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#-0x30+var_s0]!                          ; +0x0, 0xd87bdc\nMOV             X29, SP                                                ; +0x4, 0xd87be0\nLDR             X3, [X2,#0x78]                                         ; +0x8, 0xd87be4\nSTP             X19, X20, [SP,#var_s10]                                ; +0xc, 0xd87be8\nSTP             X21, X22, [SP,#var_s20]                                ; +0x10, 0xd87bec\nLDR             X3, [X3,#0x10]                                         ; +0x14, 0xd87bf0\nMOV             X20, X2                                                ; +0x18, 0xd87bf4\nMOV             X22, X0                                                ; +0x1c, 0xd87bf8\nBLR             X3                                                     ; +0x20, 0xd87bfc\nCMP             W0, WZR                                                ; +0x24, 0xd87c00\nMOV             W19, W0                                                ; +0x28, 0xd87c04\nB.LE            loc_D87C6C                                             ; +0x2c, 0xd87c08\nLDR             X0, [X20,#8]                                           ; +0x30, 0xd87c0c\nBL              BN_num_bits                                            ; +0x34, 0xd87c10\nMOV             W3, W0                                                 ; +0x38, 0xd87c14\nADD             W3, W3, #0xE                                           ; +0x3c, 0xd87c18\nADDS            W0, W0, #7                                             ; +0x40, 0xd87c1c\nCSEL            W3, W3, W0, MI                                         ; +0x44, 0xd87c20\nASR             W20, W3, #3                                            ; +0x48, 0xd87c24\nSUB             W2, W20, W19                                           ; +0x4c, 0xd87c28\nCMP             W2, WZR                                                ; +0x50, 0xd87c2c\nB.LE            loc_D87C58                                             ; +0x54, 0xd87c30\nSXTW            X21, W2                                                ; +0x58, 0xd87c34\nMOV             X1, X22; void *                                        ; +0x5c, 0xd87c38\nSXTW            X2, W19; size_t                                        ; +0x60, 0xd87c3c\nADD             X0, X22, X21; void *                                   ; +0x64, 0xd87c40\nBL              .memmove                                               ; +0x68, 0xd87c44\nMOV             X0, X22; void *                                        ; +0x6c, 0xd87c48\nMOV             W1, #0; int                                            ; +0x70, 0xd87c4c\nMOV             X2, X21; size_t                                        ; +0x74, 0xd87c50\nBL              .memset                                                ; +0x78, 0xd87c54\nMOV             W0, W20                                                ; +0x7c, 0xd87c58\nLDP             X19, X20, [SP,#var_s10]                                ; +0x80, 0xd87c5c\nLDP             X21, X22, [SP,#var_s20]                                ; +0x84, 0xd87c60\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0x88, 0xd87c64\nRET                                                                    ; +0x8c, 0xd87c68\nMOV             W20, W0                                                ; +0x90, 0xd87c6c\nMOV             W0, W20                                                ; +0x94, 0xd87c70\nLDP             X19, X20, [SP,#var_s10]                                ; +0x98, 0xd87c74\nLDP             X21, X22, [SP,#var_s20]                                ; +0x9c, 0xd87c78\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0xa0, 0xd87c7c\nRET                                                                    ; +0xa4, 0xd87c80", "xrefs": ["sub_E29D70 @ 0xe29e3c", "<???> @ 0x31788"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}