{"type": "func", "start": 6442703360, "end": 6442703636, "name": "sub_18003DA00", "pseudocode": "// \n// sub_18003DA00 from 0x18003da00 to 0x18003db14 (276 bytes)\n// \n// 2 xrefs:\n// > sub_18003FD60 @ 0x180040961\n// > sub_180040CB0 @ 0x18004175b\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 10:53:09 +0000\n// \n\n__int64 __fastcall sub_18003DA00(__int64 a1, _BYTE *a2)\n{\n  __int64 v2; // r8\n  __int64 v4; // r9\n  int v5; // ecx\n  int v6; // eax\n  int v7; // eax\n  int v8; // edx\n  int v9; // r11d\n  int v10; // ecx\n  int v11; // ecx\n  int v12; // eax\n\n  v2 = *(_QWORD *)(a1 + 8);\n  v4 = *(int *)(v2 + 180);\n  if ( a2[1287] )\n  {\n    if ( a2[1287] == 1 )\n    {\n      v7 = 64;\n      if ( (int)v4 >= 128 )\n        v7 = -64;\n      v5 = v7;\n    }\n    else\n    {\n      if ( a2[1287] == 2 )\n      {\n        v6 = ((int)v4 + 128) % 256;\n      }\n      else\n      {\n        if ( a2[1287] != 3 )\n        {\n          v5 = 0;\n          goto LABEL_14;\n        }\n        v6 = (384 - v4) & 0x800000FF;\n        if ( 384 - (int)v4 < 0 )\n        {\n          v5 = (int)(128 - (((0x80 - (_BYTE)v4 - 1) | 0xFFFFFF00) + 1)) >> 1;\n          goto LABEL_14;\n        }\n      }\n      v5 = (128 - v6) >> 1;\n    }\n  }\n  else\n  {\n    v5 = byte_1801AEF00[v4];\n  }\nLABEL_14:\n  v8 = (unsigned __int8)a2[1288];\n  v9 = *(_DWORD *)(v2 + 184);\n  v10 = (unsigned __int8)a2[1289] * v5;\n  if ( (_BYTE)v8 )\n    v10 = v10 * v9 / v8;\n  *(_DWORD *)(v2 + 80) += v10 >> 6;\n  v11 = v9 + 1;\n  *(_DWORD *)(v2 + 184) = v9 + 1;\n  if ( v9 + 1 > (unsigned __int8)a2[1288] )\n    v11 = (unsigned __int8)a2[1288];\n  *(_DWORD *)(v2 + 184) = v11;\n  v12 = v4 + (unsigned __int8)a2[1290];\n  *(_DWORD *)(v2 + 180) = v12;\n  if ( v12 > 255 )\n    *(_DWORD *)(v2 + 180) = v12 - 256;\n  *(_BYTE *)(v2 + 60) |= 1u;\n  return 0;\n}", "assembly": "; \n; sub_18003DA00 from 0x18003da00 to 0x18003db14 (276 bytes)\n; \n; 2 xrefs:\n; > sub_18003FD60 @ 0x180040961\n; > sub_180040CB0 @ 0x18004175b\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 10:53:09 +0000\n; \nmov     r8, [rcx+8]                                                    ; +0x0, 0x18003da00\nmov     r10, rdx                                                       ; +0x4, 0x18003da04\nmovzx   ecx, byte ptr [rdx+507h]                                       ; +0x7, 0x18003da07\nmovsxd  r9, dword ptr [r8+0B4h]                                        ; +0xe, 0x18003da0e\ntest    ecx, ecx                                                       ; +0x15, 0x18003da15\njz      short loc_18003DA8A                                            ; +0x17, 0x18003da17\nsub     ecx, 1                                                         ; +0x19, 0x18003da19\njz      short loc_18003DA71                                            ; +0x1c, 0x18003da1c\nsub     ecx, 1                                                         ; +0x1e, 0x18003da1e\njz      short loc_18003DA4F                                            ; +0x21, 0x18003da21\ncmp     ecx, 1                                                         ; +0x23, 0x18003da23\njz      short loc_18003DA2C                                            ; +0x26, 0x18003da26\nxor     ecx, ecx                                                       ; +0x28, 0x18003da28\njmp     short loc_18003DA96                                            ; +0x2a, 0x18003da2a\nmov     eax, 180h                                                      ; +0x2c, 0x18003da2c\nsub     eax, r9d                                                       ; +0x31, 0x18003da31\nand     eax, 800000FFh                                                 ; +0x34, 0x18003da34\njge     short loc_18003DA66                                            ; +0x39, 0x18003da39\ndec     eax                                                            ; +0x3b, 0x18003da3b\nmov     ecx, 80h                                                       ; +0x3d, 0x18003da3d\nor      eax, 0FFFFFF00h                                                ; +0x42, 0x18003da42\ninc     eax                                                            ; +0x47, 0x18003da47\nsub     ecx, eax                                                       ; +0x49, 0x18003da49\nsar     ecx, 1                                                         ; +0x4b, 0x18003da4b\njmp     short loc_18003DA96                                            ; +0x4d, 0x18003da4d\nlea     eax, [r9+80h]                                                  ; +0x4f, 0x18003da4f\nand     eax, 800000FFh                                                 ; +0x56, 0x18003da56\njge     short loc_18003DA66                                            ; +0x5b, 0x18003da5b\ndec     eax                                                            ; +0x5d, 0x18003da5d\nor      eax, 0FFFFFF00h                                                ; +0x5f, 0x18003da5f\ninc     eax                                                            ; +0x64, 0x18003da64\nmov     ecx, 80h                                                       ; +0x66, 0x18003da66\nsub     ecx, eax                                                       ; +0x6b, 0x18003da6b\nsar     ecx, 1                                                         ; +0x6d, 0x18003da6d\njmp     short loc_18003DA96                                            ; +0x6f, 0x18003da6f\nmov     ecx, 80h                                                       ; +0x71, 0x18003da71\nmov     eax, 40h ; '@'                                                 ; +0x76, 0x18003da76\ncmp     r9d, ecx                                                       ; +0x7b, 0x18003da7b\nmov     edx, 0FFFFFFC0h                                                ; +0x7e, 0x18003da7e\ncmovge  eax, edx                                                       ; +0x83, 0x18003da83\nmov     ecx, eax                                                       ; +0x86, 0x18003da86\njmp     short loc_18003DA96                                            ; +0x88, 0x18003da88\nlea     rcx, byte_1801AEF00                                            ; +0x8a, 0x18003da8a\nmovsx   ecx, byte ptr [r9+rcx]                                         ; +0x91, 0x18003da91\nmovzx   eax, byte ptr [r10+509h]                                       ; +0x96, 0x18003da96\nmovzx   edx, byte ptr [r10+508h]                                       ; +0x9e, 0x18003da9e\nmov     r11d, [r8+0B8h]                                                ; +0xa6, 0x18003daa6\nimul    ecx, eax                                                       ; +0xad, 0x18003daad\ntest    dl, dl                                                         ; +0xb0, 0x18003dab0\njz      short loc_18003DAC1                                            ; +0xb2, 0x18003dab2\nmov     eax, r11d                                                      ; +0xb4, 0x18003dab4\nimul    eax, ecx                                                       ; +0xb7, 0x18003dab7\nmov     ecx, edx                                                       ; +0xba, 0x18003daba\ncdq                                                                    ; +0xbc, 0x18003dabc\nidiv    ecx                                                            ; +0xbd, 0x18003dabd\nmov     ecx, eax                                                       ; +0xbf, 0x18003dabf\nsar     ecx, 6                                                         ; +0xc1, 0x18003dac1\nadd     [r8+50h], ecx                                                  ; +0xc4, 0x18003dac4\nlea     ecx, [r11+1]                                                   ; +0xc8, 0x18003dac8\nmov     [r8+0B8h], ecx                                                 ; +0xcc, 0x18003dacc\nmovzx   eax, byte ptr [r10+508h]                                       ; +0xd3, 0x18003dad3\ncmp     ecx, eax                                                       ; +0xdb, 0x18003dadb\ncmovg   ecx, eax                                                       ; +0xdd, 0x18003dadd\nmov     [r8+0B8h], ecx                                                 ; +0xe0, 0x18003dae0\nmovzx   eax, byte ptr [r10+50Ah]                                       ; +0xe7, 0x18003dae7\nadd     eax, r9d                                                       ; +0xef, 0x18003daef\nmov     [r8+0B4h], eax                                                 ; +0xf2, 0x18003daf2\ncmp     eax, 0FFh                                                      ; +0xf9, 0x18003daf9\njle     short loc_18003DB0C                                            ; +0xfe, 0x18003dafe\nadd     eax, 0FFFFFF00h                                                ; +0x100, 0x18003db00\nmov     [r8+0B4h], eax                                                 ; +0x105, 0x18003db05\nor      byte ptr [r8+3Ch], 1                                           ; +0x10c, 0x18003db0c\nxor     eax, eax                                                       ; +0x111, 0x18003db11\nretn                                                                   ; +0x113, 0x18003db13", "xrefs": ["sub_18003FD60 @ 0x180040961", "sub_180040CB0 @ 0x18004175b"], "is_objc": false, "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"}