{"type": "func", "start": 4297594768, "end": 4297595168, "name": "-[NSData makeCryptedVersionWithKeyData:ofLength:decrypt:]", "pseudocode": "// \n// -[NSData makeCryptedVersionWithKeyData:ofLength:decrypt:] from 0x100281790 to 0x100281920 (400 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x100bdc230\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:27:43 +0000\n// \n\nid __cdecl -[NSData makeCryptedVersionWithKeyData:ofLength:decrypt:](\n        NSData *self,\n        SEL a2,\n        const void *a3,\n        int a4,\n        bool a5)\n{\n  int v5; // eax\n  char *v6; // r13\n  void *v7; // r14\n  id v8; // r15\n  char v9; // r12\n  id v10; // rax\n  CCCryptorStatus v11; // eax\n  __int64 v12; // rdx\n  __CFString *v13; // rdi\n  void *v14; // rbx\n  const char *v15; // rsi\n  size_t dataOutMoved; // [rsp+0h] [rbp-60h] BYREF\n  CCOperation op; // [rsp+Ch] [rbp-54h]\n  _OWORD key[2]; // [rsp+10h] [rbp-50h] BYREF\n\n  op = a5;\n  memset(key, 0, sizeof(key));\n  v5 = 32;\n  if ( a4 < 32 )\n    v5 = a4;\n  __memcpy_chk(key, a3, v5, 32);\n  v6 = (char *)-[NSData length](self, \"length\") + 16;\n  v7 = malloc((size_t)v6);\n  v8 = -[NSData bytes](self, \"bytes\");\n  v9 = op;\n  v10 = -[NSData length](self, \"length\");\n  v11 = CCCrypt(op, 0, 3u, key, 0x20u, nullptr, v8, (size_t)v10, v7, (size_t)v6, &dataOutMoved);\n  switch ( v11 )\n  {\n    case -4305:\n      v13 = CFSTR(\"Error: NSData: Could not %s data: Unimplemented\");\n      goto LABEL_13;\n    case -4304:\n      v13 = CFSTR(\"Error: NSData: Could not %s data: Decode error\");\n      goto LABEL_13;\n    case -4303:\n      v13 = CFSTR(\"Error: NSData: Could not %s data: Alignment error\");\n      goto LABEL_13;\n    case -4302:\n      v13 = CFSTR(\"Error: NSData: Could not %s data: Memory failure\");\n      goto LABEL_13;\n    case -4301:\n      v13 = CFSTR(\"Error: NSData: Could not %s data: Buffer too small\");\n      goto LABEL_13;\n    case -4300:\n      v13 = (__CFString *)CFSTR(\"Error: NSData: Could not %s data: Param error\");\n      goto LABEL_13;\n    default:\n      if ( !v11 )\n        return +[NSData dataWithBytesNoCopy:length:](\n                 &OBJC_CLASS___NSData,\n                 \"dataWithBytesNoCopy:length:\",\n                 v7,\n                 dataOutMoved);\n      v13 = CFSTR(\"Error: NSData: Could not %s data: Unknown error\");\nLABEL_13:\n      v15 = \"encrypt\";\n      if ( v9 )\n        v15 = \"decrypt\";\n      v14 = nullptr;\n      NSLog(&v13->isa, v15, v12, (unsigned int)(v11 + 4305));\n      free(v7);\n      return v14;\n  }\n}", "assembly": "; \n; -[NSData makeCryptedVersionWithKeyData:ofLength:decrypt:] from 0x100281790 to 0x100281920 (400 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x100bdc230\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:27:43 +0000\n; \npush    rbp                                                            ; +0x0, 0x100281790\nmov     rbp, rsp                                                       ; +0x1, 0x100281791\npush    r15                                                            ; +0x4, 0x100281794\npush    r14                                                            ; +0x6, 0x100281796\npush    r13                                                            ; +0x8, 0x100281798\npush    r12                                                            ; +0xa, 0x10028179a\npush    rbx                                                            ; +0xc, 0x10028179c\nsub     rsp, 38h                                                       ; +0xd, 0x10028179d\nmov     [rbp+op], r8d                                                  ; +0x11, 0x1002817a1\nmov     r12, rdi                                                       ; +0x15, 0x1002817a5\nmov     rax, cs:___stack_chk_guard_ptr                                 ; +0x18, 0x1002817a8\nmov     rax, [rax]                                                     ; +0x1f, 0x1002817af\nmov     [rbp+var_30], rax                                              ; +0x22, 0x1002817b2\nxorps   xmm0, xmm0                                                     ; +0x26, 0x1002817b6\nmovaps  [rbp+var_40], xmm0                                             ; +0x29, 0x1002817b9\nmovaps  [rbp+key], xmm0                                                ; +0x2d, 0x1002817bd\ncmp     ecx, 20h ; ' '                                                 ; +0x31, 0x1002817c1\nmov     eax, 20h ; ' '                                                 ; +0x34, 0x1002817c4\ncmovl   eax, ecx                                                       ; +0x39, 0x1002817c9\ncdqe                                                                   ; +0x3c, 0x1002817cc\nlea     rdi, [rbp+key]                                                 ; +0x3e, 0x1002817ce\nmov     ecx, 20h ; ' '                                                 ; +0x42, 0x1002817d2\nmov     rsi, rdx                                                       ; +0x47, 0x1002817d7\nmov     rdx, rax                                                       ; +0x4a, 0x1002817da\ncall    ___memcpy_chk                                                  ; +0x4d, 0x1002817dd\nmov     rsi, cs:selRef_length; SEL                                     ; +0x52, 0x1002817e2\nmov     rbx, cs:_objc_msgSend_ptr                                      ; +0x59, 0x1002817e9\nmov     rdi, r12; id                                                   ; +0x60, 0x1002817f0\ncall    rbx ; _objc_msgSend; -[NSData length] ...                      ; +0x63, 0x1002817f3\nmov     r13, rax                                                       ; +0x65, 0x1002817f5\nadd     r13, 10h                                                       ; +0x68, 0x1002817f8\nmov     rdi, r13; __size                                               ; +0x6c, 0x1002817fc\ncall    _malloc                                                        ; +0x6f, 0x1002817ff\nmov     r14, rax                                                       ; +0x74, 0x100281804\nmov     rsi, cs:selRef_bytes; SEL                                      ; +0x77, 0x100281807\nmov     rdi, r12; id                                                   ; +0x7e, 0x10028180e\ncall    rbx ; _objc_msgSend; -[NSData bytes] ...                       ; +0x81, 0x100281811\nmov     r15, rax                                                       ; +0x83, 0x100281813\nmov     rdi, r12; id                                                   ; +0x86, 0x100281816\nmov     rsi, cs:selRef_length; SEL                                     ; +0x89, 0x100281819\nmov     r12d, [rbp+op]                                                 ; +0x90, 0x100281820\ncall    rbx ; _objc_msgSend; -[NSData length] ...                      ; +0x94, 0x100281824\nsub     rsp, 8                                                         ; +0x96, 0x100281826\nlea     r10, [rbp+dataOutMoved]                                        ; +0x9a, 0x10028182a\nmov     r8d, 20h ; ' '; keyLength                                      ; +0x9e, 0x10028182e\nmov     edi, r12d; op                                                  ; +0xa4, 0x100281834\nxor     esi, esi; alg                                                  ; +0xa7, 0x100281837\nmov     edx, 3; options                                                ; +0xa9, 0x100281839\nlea     rcx, [rbp+key]; key                                            ; +0xae, 0x10028183e\nxor     r9d, r9d; iv                                                   ; +0xb2, 0x100281842\npush    r10; dataOutMoved                                              ; +0xb5, 0x100281845\npush    r13; dataOutAvailable                                          ; +0xb7, 0x100281847\npush    r14; dataOut                                                   ; +0xb9, 0x100281849\npush    rax; dataInLength                                              ; +0xbb, 0x10028184b\npush    r15; dataIn                                                    ; +0xbc, 0x10028184c\ncall    _CCCrypt                                                       ; +0xbe, 0x10028184e\nadd     rsp, 30h                                                       ; +0xc3, 0x100281853\nlea     ecx, [rax+10D1h]; switch 6 cases                               ; +0xc7, 0x100281857\ncmp     ecx, 5                                                         ; +0xcd, 0x10028185d\nja      short def_100281870; jumptable 0000000100281870 default case   ; +0xd0, 0x100281860\nlea     rax, jpt_100281870                                             ; +0xd2, 0x100281862\nmovsxd  rcx, (jpt_100281870 - 100281920h)[rax+rcx*4]                   ; +0xd9, 0x100281869\nadd     rcx, rax                                                       ; +0xdd, 0x10028186d\njmp     rcx; switch jump                                               ; +0xe0, 0x100281870\nlea     rdi, cfstr_ErrorNsdataCou_4; jumptable 0000000100281870 case -4305 ; +0xe2, 0x100281872\njmp     short loc_1002818D3                                            ; +0xe9, 0x100281879\ntest    eax, eax; jumptable 0000000100281870 default case              ; +0xeb, 0x10028187b\njnz     short loc_1002818B1                                            ; +0xed, 0x10028187d\nmov     rdi, cs:classRef_NSData; id                                    ; +0xef, 0x10028187f\nmov     rcx, [rbp+dataOutMoved]                                        ; +0xf6, 0x100281886\nmov     rsi, cs:selRef_dataWithBytesNoCopy_length_; SEL                ; +0xfa, 0x10028188a\nmov     rdx, r14                                                       ; +0x101, 0x100281891\ncall    cs:_objc_msgSend_ptr; +[NSData dataWithBytesNoCopy:length:] ... ; +0x104, 0x100281894\nmov     rbx, rax                                                       ; +0x10a, 0x10028189a\njmp     short loc_1002818F9                                            ; +0x10d, 0x10028189d\nlea     rdi, cfstr_ErrorNsdataCou_0; jumptable 0000000100281870 case -4301 ; +0x10f, 0x10028189f\njmp     short loc_1002818D3                                            ; +0x116, 0x1002818a6\nlea     rdi, cfstr_ErrorNsdataCou_2; jumptable 0000000100281870 case -4303 ; +0x118, 0x1002818a8\njmp     short loc_1002818D3                                            ; +0x11f, 0x1002818af\nlea     rdi, cfstr_ErrorNsdataCou_5; \"Error: NSData: Could not %s data: Unknown error\" ; +0x121, 0x1002818b1\njmp     short loc_1002818D3                                            ; +0x128, 0x1002818b8\nlea     rdi, cfstr_ErrorNsdataCou_1; jumptable 0000000100281870 case -4302 ; +0x12a, 0x1002818ba\njmp     short loc_1002818D3                                            ; +0x131, 0x1002818c1\nlea     rdi, cfstr_ErrorNsdataCou_3; jumptable 0000000100281870 case -4304 ; +0x133, 0x1002818c3\njmp     short loc_1002818D3                                            ; +0x13a, 0x1002818ca\nlea     rdi, cfstr_ErrorNsdataCou; jumptable 0000000100281870 case -4300 ; +0x13c, 0x1002818cc\nlea     rax, aDecrypt; \"decrypt\"                                       ; +0x143, 0x1002818d3\nlea     rsi, aEncrypt; \"encrypt\"                                       ; +0x14a, 0x1002818da\ntest    r12b, r12b                                                     ; +0x151, 0x1002818e1\ncmovnz  rsi, rax                                                       ; +0x154, 0x1002818e4\nxor     ebx, ebx                                                       ; +0x158, 0x1002818e8\nxor     eax, eax                                                       ; +0x15a, 0x1002818ea\ncall    _NSLog                                                         ; +0x15c, 0x1002818ec\nmov     rdi, r14; void *                                               ; +0x161, 0x1002818f1\ncall    _free                                                          ; +0x164, 0x1002818f4\nmov     rax, cs:___stack_chk_guard_ptr                                 ; +0x169, 0x1002818f9\nmov     rax, [rax]                                                     ; +0x170, 0x100281900\ncmp     rax, [rbp+var_30]                                              ; +0x173, 0x100281903\njnz     short loc_10028191B                                            ; +0x177, 0x100281907\nmov     rax, rbx                                                       ; +0x179, 0x100281909\nadd     rsp, 38h                                                       ; +0x17c, 0x10028190c\npop     rbx                                                            ; +0x180, 0x100281910\npop     r12                                                            ; +0x181, 0x100281911\npop     r13                                                            ; +0x183, 0x100281913\npop     r14                                                            ; +0x185, 0x100281915\npop     r15                                                            ; +0x187, 0x100281917\npop     rbp                                                            ; +0x189, 0x100281919\nretn                                                                   ; +0x18a, 0x10028191a\ncall    ___stack_chk_fail                                              ; +0x18b, 0x10028191b", "xrefs": ["<???> @ 0x100bdc230"], "is_objc": true, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}