• R/O
  • SSH
  • HTTPS

pefrm-units: Commit


Commit MetaInfo

Revision34 (tree)
Time2017-12-26 20:19:56
Authorquiret

Log Message

- fixed compilation of pefrmrunfixed

Change Summary

Incremental Difference

--- pefrmrunfixed/src/main.cpp (revision 33)
+++ pefrmrunfixed/src/main.cpp (revision 34)
@@ -35,7 +35,7 @@
3535 int main( int argc, char *argv[] )
3636 {
3737 // Get our module base address.
38- void *ourBase = GetModuleHandleW( NULL );
38+ void *ourBase = GetModuleHandleW( nullptr );
3939
4040 // Verify that our executable buffer is placed alright.
4141 if ( exe_loader_buffer - _peFixedBaseOffset != ourBase )
@@ -183,7 +183,7 @@
183183 const PEFile::PEImportDesc::importFunc& funcInfo = *thunkInfoIter;
184184
185185 // Patch the function ptr.
186- void *funcAddr = NULL;
186+ void *funcAddr = nullptr;
187187
188188 if ( funcInfo.isOrdinalImport )
189189 {
@@ -194,7 +194,7 @@
194194 funcAddr = GetProcAddress( memoryModule, funcInfo.name.c_str() );
195195 }
196196
197- if ( funcAddr == NULL )
197+ if ( funcAddr == nullptr )
198198 {
199199 std::cout << "failed to resolve module import\n";
200200
@@ -218,7 +218,7 @@
218218 // Load the actual module.
219219 HMODULE memoryModule = LoadLibraryA( importEntry.DLLName.c_str() );
220220
221- assert( memoryModule != NULL );
221+ assert( memoryModule != nullptr );
222222
223223 // Need to write into the thunk.
224224 IMAGE_THUNK_DATA *modThunkIter = (IMAGE_THUNK_DATA*)( (char*)ourBase + importEntry.firstThunkRef.GetRVA() );
@@ -233,11 +233,11 @@
233233 {
234234 HMODULE modHandle = LoadLibraryA( delayLoad.DLLName.c_str() );
235235
236- assert( modHandle != NULL );
236+ assert( modHandle != nullptr );
237237
238238 // Write it into memory.
239239 {
240- void *modHandlePtr = ( (char*)ourBase + delayLoad.DLLHandleRef.GetRVA() );
240+ void *modHandlePtr = ( (char*)ourBase + delayLoad.DLLHandleAlloc.ResolveOffset( 0 ) );
241241
242242 *( (HMODULE*)modHandlePtr ) = modHandle;
243243 }
Show on old repository browser