//
// __scrt_is_nonwritable_in_current_image from 0x140677954 to 0x1406779ec (152 bytes)
//
// 3 xrefs:
// > __scrt_common_main_seh @ 0x140677ea4
// > __scrt_common_main_seh @ 0x140677ed0
// > ??> @ 0x1409326d8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:36:00 +0000
//
bool __fastcall _scrt_is_nonwritable_in_current_image(__int64 a1)
{
_DWORD *v2; // rcx
unsigned __int64 v3; // r8
_DWORD *v4; // rdx
_DWORD *v5; // r9
unsigned __int64 v6; // rcx
if ( LOWORD(MEMORY[0x140000000].unused) != 23117 )
return 0;
v2 = (_DWORD *)(0x140000000LL + MEMORY[0x14000003C]);
if ( *v2 != 17744 || *(_WORD *)(0x140000018LL + MEMORY[0x14000003C]) != 523 )
return 0;
v3 = a1 - 0x140000000LL;
v4 = (_DWORD *)((char *)v2 + *(unsigned __int16 *)(0x140000014LL + MEMORY[0x14000003C]) + 24);
v5 = &v4[10 * *(unsigned __int16 *)(0x140000006LL + MEMORY[0x14000003C])];
while ( v4 != v5 )
{
v6 = (unsigned int)v4[3];
if ( v3 >= v6 && v3 < (unsigned int)(v6 + v4[2]) )
return v4 && v4[9] >= 0;
v4 += 10;
}
v4 = nullptr;
return v4 && v4[9] >= 0;
}