//
// png_read_sig from 0x65c608 to 0x65c67c (116 bytes)
//
// 1 xrefs:
// > png_read_info @ 0x65565c
//
// 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
//
int __fastcall png_read_sig(int result, int a2)
{
unsigned int v2; // r5
int v3; // r7
int v4; // r4
v2 = *(unsigned __int8 *)(result + 541);
if ( v2 <= 7 )
{
v3 = a2 + 32;
v4 = result;
*(_DWORD *)(result + 900) = 17;
png_read_data(result);
*(_BYTE *)(v4 + 541) = 8;
result = png_sig_cmp(v3, v2, 8 - v2);
if ( result )
{
if ( v2 <= 3 )
{
if ( png_sig_cmp(v3, v2, 4 - v2) )
png_error(v4, "Not a PNG file");
}
png_error(v4, "PNG file corrupted by ASCII conversion");
}
if ( v2 <= 2 )
*(_DWORD *)(v4 + 308) |= 0x1000u;
}
return result;
}