MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / ReadMemoryStringW

Function ReadMemoryStringW

ReClass/stdafx.cpp:148–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148CStringW ReadMemoryStringW( ULONG_PTR address, SIZE_T max )
149{
150 SIZE_T bytesRead = 0;
151 auto buffer = std::make_unique<wchar_t[]>( max + 1 );
152
153 if (ReClassReadMemory( (PVOID)address, (LPVOID)buffer.get( ), max * sizeof( wchar_t ), &bytesRead ) != 0)
154 {
155 bytesRead /= sizeof( wchar_t );
156
157 for (int i = 0; i < bytesRead; i++)
158 {
159 if (!(buffer[i] > 0x1F && buffer[i] < 0xFF && buffer[i] != 0x7F) && buffer[i] != '\0')
160 buffer[i] = '.';
161 }
162 buffer[bytesRead] = '\0';
163 return CStringW( buffer.get( ) );
164 }
165 else
166 {
167 #ifdef _DEBUG
168 PrintOut( _T( "[ReadMemoryString]: Failed to read memory, GetLastError() = %s" ), Utils::GetLastErrorString( ).GetString( ) );
169 #endif
170 return CStringW( L".." );
171 }
172}
173
174BOOLEAN PauseResumeThreadList( BOOL bResumeThread )
175{

Callers 1

DrawMethod · 0.85

Calls 2

ReClassReadMemoryFunction · 0.85
GetLastErrorStringFunction · 0.85

Tested by

no test coverage detected