|
|
@ -31,70 +31,79 @@ inline
|
|
|
|
uint8_t MreadByte (const uint32_t &offset)
|
|
|
|
uint8_t MreadByte (const uint32_t &offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint8_t val;
|
|
|
|
uint8_t val;
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint8_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint8_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,1,offset);
|
|
|
|
return val;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
void MreadByte (const uint32_t &offset, uint8_t &val )
|
|
|
|
void MreadByte (const uint32_t &offset, uint8_t &val )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint8_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint8_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,1,offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
uint16_t MreadWord (const uint32_t &offset)
|
|
|
|
uint16_t MreadWord (const uint32_t &offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint16_t val;
|
|
|
|
uint16_t val;
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint16_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint16_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,2,offset);
|
|
|
|
return val;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
void MreadWord (const uint32_t &offset, uint16_t &val)
|
|
|
|
void MreadWord (const uint32_t &offset, uint16_t &val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint16_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint16_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,2,offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
uint32_t MreadDWord (const uint32_t &offset)
|
|
|
|
uint32_t MreadDWord (const uint32_t &offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint32_t val;
|
|
|
|
uint32_t val;
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,4,offset);
|
|
|
|
return val;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
void MreadDWord (const uint32_t &offset, uint32_t &val)
|
|
|
|
void MreadDWord (const uint32_t &offset, uint32_t &val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,4,offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
uint64_t MreadQuad (const uint32_t &offset)
|
|
|
|
uint64_t MreadQuad (const uint32_t &offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint64_t val;
|
|
|
|
uint64_t val;
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,8,offset);
|
|
|
|
return val;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
void MreadQuad (const uint32_t &offset, uint64_t &val)
|
|
|
|
void MreadQuad (const uint32_t &offset, uint64_t &val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
//fread ( &val, sizeof(uint32_t), 1, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, &val,8,offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|
void Mread (const uint32_t &offset, const uint32_t &size, uint8_t *target)
|
|
|
|
void Mread (const uint32_t &offset, const uint32_t &size, uint8_t *target)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
//fseek(g_ProcessMemFile, offset,SEEK_SET);
|
|
|
|
fread ( target, 1, size, g_ProcessMemFile );
|
|
|
|
//fread ( target, 1, size, g_ProcessMemFile );
|
|
|
|
|
|
|
|
pread(g_ProcessMemFile, target,size,offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
inline
|
|
|
|