[*] fix ipc handle checksum rng

This commit is contained in:
Reece Wilson 2022-07-21 07:25:45 +01:00
parent febd836d99
commit e24c35d2d0

View File

@ -104,10 +104,10 @@ namespace Aurora::IO::IPC
return false;
}
AuUInt32 magic {};
AuUInt32 magic {0x811c9dc5};
for (int i = 0; i < in.size() - 1; i++)
{
magic ^= ((in[i] ^ 0x811c9dc5) * 0x01000193);
magic ^= (in[i] * 0x01000193);
}
if (AuUInt8(AuUInt8(in[in.size() - 1] - 'A') & 15) != AuUInt8(magic & 15))
@ -171,7 +171,7 @@ namespace Aurora::IO::IPC
this->pid = nextInt;
}
auto readIPC = [&](IPCHeader header, IPCValue &value)
auto readIPC = [&](IPCHeader header, IPCValue &value)
{
value.subtype = (EIPCHandleType)header.bmType;
@ -285,10 +285,10 @@ namespace Aurora::IO::IPC
}
AuUInt32 magic {};
AuUInt32 magic {0x811c9dc5};
for (int i = 0; i < ret.size(); i++)
{
magic ^= ((AuUInt32(ret[i]) ^ 0x811c9dc5) * 0x01000193);
magic ^= (ret[i] * 0x01000193);
}
ret.push_back(((magic & 15) + 'A'));