// // sub_617D7C from 0x617d7c to 0x617ed4 (344 bytes) // // 4 xrefs: // > GJChestSprite::switchToState @ 0x617faa // > GJChestSprite::switchToState @ 0x617fe8 // > GJChestSprite::switchToState @ 0x618260 // > GJChestSprite::switchToState @ 0x61829e // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 11:54:57 +0000 // int *__fastcall sub_617D7C(int *a1, char *a2, const char *a3) { int v6; // r3 size_t v7; // r0 size_t v8; // r0 size_t i; // r3 int v10; // r1 unsigned __int8 *v11; // r7 unsigned int v12; // r1 unsigned __int8 *v13; // r6 int v14; // r0 unsigned __int8 *v15; // lr unsigned __int8 *v16; // r1 int v17; // r8 unsigned __int8 *v18; // r0 unsigned __int8 *v19; // r8 unsigned __int8 *v20; // r3 int v21; // r9 unsigned __int8 *v22; // r12 unsigned __int8 *v23; // r9 int v24; // t1 size_t v25; // r8 unsigned int v26; // r2 char *v27; // r3 size_t v28; // r1 int v29; // r3 int v31; // [sp+14h] [bp-20h] BYREF unsigned int v32; // [sp+18h] [bp-1Ch] unsigned __int8 *v33; // [sp+1Ch] [bp-18h] int v34; // [sp+20h] [bp-14h] BYREF size_t v35; // [sp+24h] [bp-10h] char *v36; // [sp+28h] [bp-Ch] int v37; // [sp+2Ch] [bp-8h] a1[1] = 0; a1[2] = 0; v6 = _stack_chk_guard; *a1 = 0; v37 = v6; v7 = strlen(a2); std::string::__init(a1, a2, v7); v31 = 0; v32 = 0; v33 = nullptr; std::string::__init(&v31, "_001", 4u); v34 = 0; v35 = 0; v36 = nullptr; v8 = strlen(a3); std::string::__init(&v34, a3, v8); for ( i = 0; ; i = v29 + v25 ) { v10 = *(unsigned __int8 *)a1; if ( (v10 & 1) != 0 ) { v11 = (unsigned __int8 *)a1[2]; v12 = a1[1]; } else { v11 = (unsigned __int8 *)a1 + 1; v12 = v10 >> 1; } if ( (v31 & 1) != 0 ) { v13 = v33; v14 = v32; } else { v14 = (int)(unsigned __int8)v31 >> 1; v13 = (unsigned __int8 *)&v31 + 1; } if ( i > v12 || v12 - i < v14 ) break; if ( v14 ) { v15 = &v11[i]; v16 = &v11[v12]; if ( v16 - &v11[i] >= v14 ) { v17 = 1 - v14; v18 = &v13[v14]; v19 = &v16[v17]; LABEL_12: while ( 1 ) { v20 = v15; if ( v15 == v19 ) break; v21 = *v15++; if ( v21 == *v13 ) { v22 = v13; v23 = v20; while ( ++v22 != v18 ) { v24 = *++v23; if ( v24 != *v22 ) goto LABEL_12; } goto LABEL_19; } } } v20 = v16; LABEL_19: if ( v20 == v16 ) break; v25 = v20 - v11; } else { v25 = i; } if ( v25 == -1 ) break; if ( (v31 & 1) != 0 ) v26 = v32; else v26 = (int)(unsigned __int8)v31 >> 1; if ( (v34 & 1) != 0 ) { v27 = v36; v28 = v35; } else { v28 = (int)(unsigned __int8)v34 >> 1; v27 = (char *)&v34 + 1; } std::string::replace(a1, v25, v26, v27, v28); if ( (v34 & 1) != 0 ) v29 = v35; else v29 = (int)(unsigned __int8)v34 >> 1; } std::string::~string((int)&v34); std::string::~string((int)&v31); return a1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source