{"type": "func", "start": 4296004784, "end": 4296005046, "name": "GJBaseGameLayer::getPortalTarget", "pseudocode": "// \n// GJBaseGameLayer::getPortalTarget from 0x1000fd4b0 to 0x1000fd5b6 (262 bytes)\n// \n// 1 xrefs:\n// > GJBaseGameLayer::teleportPlayer @ 0x1000fce69\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:21:19 +0000\n// \n\n__int64 __fastcall GJBaseGameLayer::getPortalTarget(__int64 a1, __int64 a2)\n{\n  __int64 result; // rax\n  int v3; // eax\n  __int64 v4; // r14\n  __int64 v5; // rax\n  __int64 v6; // rbx\n  int v7; // eax\n  __m128 v8; // xmm0\n\n  result = *(_QWORD *)(a2 + 1848);\n  if ( result )\n    return result;\n  v3 = *(_DWORD *)(a2 + 1464);\n  if ( v3 <= 0 )\n    return 0;\n  v4 = 9999;\n  if ( (unsigned int)v3 < 0x270F )\n    v4 = (unsigned int)v3;\n  v5 = *(_QWORD *)(a1 + 3616);\n  v6 = *(_QWORD *)(v5 + 8 * v4);\n  if ( !v6 )\n  {\n    v6 = sub_1007FE900(a1);\n    cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 3592), v6, v4);\n    *(_QWORD *)(*(_QWORD *)(a1 + 3616) + 8 * v4) = v6;\n    v7 = sub_1007FEF90(v6);\n    if ( v7 > 0 )\n      goto LABEL_7;\n    return 0;\n  }\n  v7 = sub_1007FEF90(*(_QWORD *)(v5 + 8 * v4));\n  if ( v7 <= 0 )\n    return 0;\nLABEL_7:\n  v8 = 0;\n  if ( v7 != 1 )\n  {\n    qword_100BE12A0 = 214013 * qword_100BE12A0 + 2531011;\n    v8 = 0;\n    v8.f32[0] = (float)(WORD1(qword_100BE12A0) & 0x7FFF) / 32767.0;\n  }\n  return sub_1007FEFE0(\n           v6,\n           (unsigned int)(int)(float)((float)v7 * _mm_andnot_ps(_mm_cmpeq_ss((__m128)0x3F800000u, v8), v8).f32[0]));\n}", "assembly": "; \n; GJBaseGameLayer::getPortalTarget from 0x1000fd4b0 to 0x1000fd5b6 (262 bytes)\n; \n; 1 xrefs:\n; > GJBaseGameLayer::teleportPlayer @ 0x1000fce69\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:21:19 +0000\n; \npush    rbp                                                            ; +0x0, 0x1000fd4b0\nmov     rbp, rsp                                                       ; +0x1, 0x1000fd4b1\npush    r15                                                            ; +0x4, 0x1000fd4b4\npush    r14                                                            ; +0x6, 0x1000fd4b6\npush    rbx                                                            ; +0x8, 0x1000fd4b8\npush    rax                                                            ; +0x9, 0x1000fd4b9\nmov     rax, [rsi+738h]                                                ; +0xa, 0x1000fd4ba\ntest    rax, rax                                                       ; +0x11, 0x1000fd4c1\njnz     loc_1000FD5AB                                                  ; +0x14, 0x1000fd4c4\nmov     eax, [rsi+5B8h]                                                ; +0x1a, 0x1000fd4ca\ntest    eax, eax                                                       ; +0x20, 0x1000fd4d0\njle     loc_1000FD5A9                                                  ; +0x22, 0x1000fd4d2\ncmp     eax, 270Fh                                                     ; +0x28, 0x1000fd4d8\nmov     r14d, 270Fh                                                    ; +0x2d, 0x1000fd4dd\ncmovb   r14d, eax                                                      ; +0x33, 0x1000fd4e3\nmov     rax, [rdi+0E20h]                                               ; +0x37, 0x1000fd4e7\nmov     rbx, [rax+r14*8]                                               ; +0x3e, 0x1000fd4ee\ntest    rbx, rbx                                                       ; +0x42, 0x1000fd4f2\njz      short loc_1000FD571                                            ; +0x45, 0x1000fd4f5\nmov     rdi, rbx                                                       ; +0x47, 0x1000fd4f7\ncall    sub_1007FEF90                                                  ; +0x4a, 0x1000fd4fa\ntest    eax, eax                                                       ; +0x4f, 0x1000fd4ff\njle     loc_1000FD5A9                                                  ; +0x51, 0x1000fd501\nxorps   xmm0, xmm0                                                     ; +0x57, 0x1000fd507\ncmp     eax, 1                                                         ; +0x5a, 0x1000fd50a\njz      short loc_1000FD540                                            ; +0x5d, 0x1000fd50d\nimul    rcx, cs:qword_100BE12A0, 343FDh                                ; +0x5f, 0x1000fd50f\nadd     rcx, 269EC3h                                                   ; +0x6a, 0x1000fd51a\nmov     cs:qword_100BE12A0, rcx                                        ; +0x71, 0x1000fd521\nshr     ecx, 10h                                                       ; +0x78, 0x1000fd528\nand     ecx, 7FFFh                                                     ; +0x7b, 0x1000fd52b\nxorps   xmm0, xmm0                                                     ; +0x81, 0x1000fd531\ncvtsi2ss xmm0, ecx                                                     ; +0x84, 0x1000fd534\ndivss   xmm0, cs:dword_100A04C30                                       ; +0x88, 0x1000fd538\nmovss   xmm1, cs:alpha                                                 ; +0x90, 0x1000fd540\ncmpeqss xmm1, xmm0                                                     ; +0x98, 0x1000fd548\nandnps  xmm1, xmm0                                                     ; +0x9d, 0x1000fd54d\nxorps   xmm0, xmm0                                                     ; +0xa0, 0x1000fd550\ncvtsi2ss xmm0, eax                                                     ; +0xa3, 0x1000fd553\nmulss   xmm0, xmm1                                                     ; +0xa7, 0x1000fd557\ncvttss2si esi, xmm0                                                    ; +0xab, 0x1000fd55b\nmov     rdi, rbx                                                       ; +0xaf, 0x1000fd55f\nadd     rsp, 8                                                         ; +0xb2, 0x1000fd562\npop     rbx                                                            ; +0xb6, 0x1000fd566\npop     r14                                                            ; +0xb7, 0x1000fd567\npop     r15                                                            ; +0xb9, 0x1000fd569\npop     rbp                                                            ; +0xbb, 0x1000fd56b\njmp     sub_1007FEFE0                                                  ; +0xbc, 0x1000fd56c\nmov     r15, rdi                                                       ; +0xc1, 0x1000fd571\ncall    sub_1007FE900                                                  ; +0xc4, 0x1000fd574\nmov     rbx, rax                                                       ; +0xc9, 0x1000fd579\nmov     rdi, [r15+0E08h]                                               ; +0xcc, 0x1000fd57c\nmov     rsi, rax                                                       ; +0xd3, 0x1000fd583\nmov     rdx, r14                                                       ; +0xd6, 0x1000fd586\ncall    cocos2d__CCDictionary__setObject_1                             ; +0xd9, 0x1000fd589\nmov     rax, [r15+0E20h]                                               ; +0xde, 0x1000fd58e\nmov     [rax+r14*8], rbx                                               ; +0xe5, 0x1000fd595\nmov     rdi, rbx                                                       ; +0xe9, 0x1000fd599\ncall    sub_1007FEF90                                                  ; +0xec, 0x1000fd59c\ntest    eax, eax                                                       ; +0xf1, 0x1000fd5a1\njg      loc_1000FD507                                                  ; +0xf3, 0x1000fd5a3\nxor     eax, eax                                                       ; +0xf9, 0x1000fd5a9\nadd     rsp, 8                                                         ; +0xfb, 0x1000fd5ab\npop     rbx                                                            ; +0xff, 0x1000fd5af\npop     r14                                                            ; +0x100, 0x1000fd5b0\npop     r15                                                            ; +0x102, 0x1000fd5b2\npop     rbp                                                            ; +0x104, 0x1000fd5b4\nretn                                                                   ; +0x105, 0x1000fd5b5", "xrefs": ["GJBaseGameLayer::teleportPlayer @ 0x1000fce69"], "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"}