//
// cocos2d::CCConfiguration::gatherGPUInfo from 0x1800bc610 to 0x1800bd057 (2631 bytes)
//
// 3 xrefs:
// > cocos2d::CCDirector::setOpenGLView @ 0x1800bf88d
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b909c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=7
void __fastcall cocos2d::CCConfiguration::gatherGPUInfo(cocos2d::CCConfiguration *this)
{
GLubyte *String; // rax
cocos2d::CCObject *v3; // rax
void *v4; // rcx
void *v5; // rcx
GLubyte *v6; // rax
cocos2d::CCObject *v7; // rax
void *v8; // rcx
void *v9; // rcx
GLubyte *v10; // rax
cocos2d::CCObject *v11; // rax
void *v12; // rcx
void *v13; // rcx
int v14; // esi
cocos2d::CCObject *v15; // rax
cocos2d::CCObject *v16; // rbx
void *v17; // rcx
int v18; // esi
cocos2d::CCObject *v19; // rax
cocos2d::CCObject *v20; // rbx
void *v21; // rcx
void *v22; // rax
bool v23; // bl
const char *v24; // rcx
void *v25; // rcx
char v26; // si
cocos2d::CCObject *v27; // rax
cocos2d::CCObject *v28; // rbx
void *v29; // rcx
char v30; // si
cocos2d::CCObject *v31; // rax
cocos2d::CCObject *v32; // rbx
void *v33; // rcx
void *v34; // rax
bool v35; // bl
const char *v36; // rcx
void *v37; // rcx
struct cocos2d::CCBool *v38; // rax
void *v39; // rcx
bool v40; // bl
void **v41; // rax
char *v42; // rcx
unsigned __int64 v43; // rdx
char *v44; // rax
struct cocos2d::CCBool *v45; // rax
void *v46; // rcx
bool v47; // bl
void **v48; // rax
char *v49; // rcx
unsigned __int64 v50; // rdx
char *v51; // rax
struct cocos2d::CCBool *v52; // rax
void *v53; // rcx
void *v54[2]; // [rsp+28h] [rbp-58h] BYREF
__int64 v55; // [rsp+38h] [rbp-48h]
unsigned __int64 v56; // [rsp+40h] [rbp-40h]
void *Block[2]; // [rsp+48h] [rbp-38h] BYREF
__m128i si128; // [rsp+58h] [rbp-28h]
v54[1] = (void *)114;
v55 = 9;
v56 = 15;
v54[0] = (void *)0x6F646E65762E6C67LL;
String = (GLubyte *)glGetString(0x1F00u);
sub_180005910(Block, String);
v3 = cocos2d::CCString::create((__int64)Block);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v3, (unsigned __int8 *)v54);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v4 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v4 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v4 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v4);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);
LOBYTE(Block[0]) = 0;
if ( v56 > 0xF )
{
v5 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v5 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v5);
}
v55 = 11;
v56 = 15;
v54[0] = (void *)0x65646E65722E6C67LL;
v54[1] = (void *)7497074;
v6 = (GLubyte *)glGetString(0x1F01u);
sub_180005910(Block, v6);
v7 = cocos2d::CCString::create((__int64)Block);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v7, (unsigned __int8 *)v54);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v8 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v8);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);
LOBYTE(Block[0]) = 0;
if ( v56 > 0xF )
{
v9 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v9 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v9);
}
v54[1] = (void *)28271;
v55 = 10;
v56 = 15;
v54[0] = (void *)0x69737265762E6C67LL;
v10 = (GLubyte *)glGetString(0x1F02u);
sub_180005910(Block, v10);
v11 = cocos2d::CCString::create((__int64)Block);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v11, (unsigned __int8 *)v54);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v12 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v12);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);
LOBYTE(Block[0]) = 0;
if ( v56 > 0xF )
{
v13 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v13 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v13 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v13);
}
*((_QWORD *)this + 10) = glGetString(0x1F03u);
glGetIntegerv(0xD33u, (GLint *)this + 14);
*(_OWORD *)v54 = 0;
v55 = 0;
v56 = 15;
v54[0] = operator new(0x20u);
v55 = 19;
v56 = 31;
strcpy((char *)v54[0], "gl.max_texture_size");
v14 = *((_DWORD *)this + 14);
v15 = (cocos2d::CCObject *)operator new(0x40u);
v16 = v15;
if ( v15 )
{
cocos2d::CCObject::CCObject(v15);
v16->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCInteger::`vftable';
LODWORD(v16[1].__vftable) = v14;
}
else
{
v16 = nullptr;
}
cocos2d::CCObject::autorelease(v16);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v16, (unsigned __int8 *)v54);
if ( v56 > 0xF )
{
v17 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v17 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v17 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v17);
}
glGetIntegerv(0x8B4Du, (GLint *)this + 19);
*(_OWORD *)v54 = 0;
v55 = 0;
v56 = 15;
v54[0] = operator new(0x20u);
v55 = 20;
v56 = 31;
strcpy((char *)v54[0], "gl.max_texture_units");
v18 = *((_DWORD *)this + 19);
v19 = (cocos2d::CCObject *)operator new(0x40u);
v20 = v19;
if ( v19 )
{
cocos2d::CCObject::CCObject(v19);
v20->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCInteger::`vftable';
LODWORD(v20[1].__vftable) = v18;
}
else
{
v20 = nullptr;
}
cocos2d::CCObject::autorelease(v20);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v20, (unsigned __int8 *)v54);
if ( v56 > 0xF )
{
v21 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v21 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v21 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v21);
}
*(_OWORD *)Block = 0;
v22 = operator new(0x30u);
Block[0] = v22;
si128.m128i_i64[0] = 32;
si128.m128i_i64[1] = 47;
strcpy((char *)v22, "GL_IMG_texture_compression_pvrtc");
v23 = 0;
v24 = *((const char **)this + 10);
if ( v24 )
v23 = strstr(v24, (const char *)v22) != nullptr;
*((_BYTE *)this + 64) = v23;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v25 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v25 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v25 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v25);
}
*(_OWORD *)v54 = 0;
v55 = 0;
v56 = 15;
v54[0] = operator new(0x20u);
v55 = 17;
v56 = 31;
strcpy((char *)v54[0], "gl.supports_PVRTC");
v26 = *((_BYTE *)this + 64);
v27 = (cocos2d::CCObject *)operator new(0x40u);
v28 = v27;
if ( v27 )
{
cocos2d::CCObject::CCObject(v27);
v28->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCBool::`vftable';
LOBYTE(v28[1].__vftable) = v26;
}
else
{
v28 = nullptr;
}
if ( v28 )
cocos2d::CCObject::autorelease(v28);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v28, (unsigned __int8 *)v54);
if ( v56 > 0xF )
{
v29 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v29 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v29 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v29);
}
*((_BYTE *)this + 65) = 1;
*(_OWORD *)v54 = 0;
v55 = 0;
v56 = 15;
v54[0] = operator new(0x20u);
v55 = 16;
v56 = 31;
strcpy((char *)v54[0], "gl.supports_NPOT");
v30 = *((_BYTE *)this + 65);
v31 = (cocos2d::CCObject *)operator new(0x40u);
v32 = v31;
if ( v31 )
{
cocos2d::CCObject::CCObject(v31);
v32->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCBool::`vftable';
LOBYTE(v32[1].__vftable) = v30;
}
else
{
v32 = nullptr;
}
if ( v32 )
cocos2d::CCObject::autorelease(v32);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v32, (unsigned __int8 *)v54);
if ( v56 > 0xF )
{
v33 = v54[0];
if ( v56 + 1 >= 0x1000 )
{
v33 = *((void **)v54[0] - 1);
if ( (unsigned __int64)((char *)v54[0] - (char *)v33 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v33);
}
Block[1] = nullptr;
v34 = operator new(0x20u);
Block[0] = v34;
si128.m128i_i64[0] = 29;
si128.m128i_i64[1] = 31;
strcpy((char *)v34, "GL_IMG_texture_format_BGRA888");
v35 = 0;
v36 = *((const char **)this + 10);
if ( v36 )
v35 = strstr(v36, (const char *)v34) != nullptr;
*((_BYTE *)this + 66) = v35;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v37 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v37 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v37 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v37);
}
sub_180005910(Block, "gl.supports_BGRA8888");
v38 = cocos2d::CCBool::create(*((_BYTE *)this + 66));
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v38, (unsigned __int8 *)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v39 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v39 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v39 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v39);
}
sub_180005910(Block, "GL_EXT_discard_framebuffer");
v40 = 0;
v41 = Block;
v42 = (char *)Block[0];
v43 = si128.m128i_u64[1];
if ( si128.m128i_i64[1] > 0xFuLL )
v41 = (void **)Block[0];
if ( *((_QWORD *)this + 10) )
{
v40 = strstr(*((const char **)this + 10), (const char *)v41) != nullptr;
v43 = si128.m128i_u64[1];
v42 = (char *)Block[0];
}
*((_BYTE *)this + 67) = v40;
if ( v43 > 0xF )
{
v44 = v42;
if ( v43 + 1 >= 0x1000 )
{
v42 = *((char **)v42 - 1);
if ( (unsigned __int64)(v44 - v42 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v42);
}
sub_180005910(Block, "gl.supports_discard_framebuffer");
v45 = cocos2d::CCBool::create(*((_BYTE *)this + 67));
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v45, (unsigned __int8 *)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v46 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v46 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v46 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v46);
}
sub_180005910(Block, "vertex_array_object");
v47 = 0;
v48 = Block;
v49 = (char *)Block[0];
v50 = si128.m128i_u64[1];
if ( si128.m128i_i64[1] > 0xFuLL )
v48 = (void **)Block[0];
if ( *((_QWORD *)this + 10) )
{
v47 = strstr(*((const char **)this + 10), (const char *)v48) != nullptr;
v50 = si128.m128i_u64[1];
v49 = (char *)Block[0];
}
*((_BYTE *)this + 68) = v47;
if ( v50 > 0xF )
{
v51 = v49;
if ( v50 + 1 >= 0x1000 )
{
v49 = *((char **)v49 - 1);
if ( (unsigned __int64)(v51 - v49 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v49);
}
sub_180005910(Block, "gl.supports_vertex_array_object");
v52 = cocos2d::CCBool::create(*((_BYTE *)this + 68));
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), v52, (unsigned __int8 *)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v53 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v53 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v53 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v53);
}
}