• R/O
  • SSH
  • HTTPS

pefrm-units: Commit


Commit MetaInfo

Revision56 (tree)
Time2019-04-14 23:21:00
Authorquiret

Log Message

- bugfixes
- updated to Visual Studio 2019

Change Summary

Incremental Difference

--- pefrmrunfixed/src/main.cpp (revision 55)
+++ pefrmrunfixed/src/main.cpp (revision 56)
@@ -138,9 +138,10 @@
138138 // Map the binary into address space.
139139 // This is done in a very basic way and it is left up to the reader to improve it.
140140 {
141- fixedExec.ForAllSections(
142- [&]( PEFile::PESection *theSect )
141+ for ( auto iter = fixedExec.GetSectionIterator(); !iter.IsEnd(); iter.Increment() )
143142 {
143+ PEFile::PESection *theSect = iter.Resolve();
144+
144145 std::uint32_t virtualAddr = theSect->GetVirtualAddress();
145146
146147 std::uint32_t dataSize = (std::uint32_t)theSect->stream.Size();
@@ -149,7 +150,7 @@
149150
150151 theSect->stream.Seek( 0 );
151152 theSect->stream.Read( sectMem, dataSize );
152- });
153+ }
153154 }
154155
155156 // We do not have to relocate.
@@ -191,7 +192,7 @@
191192 }
192193 else
193194 {
194- funcAddr = GetProcAddress( memoryModule, funcInfo.name.c_str() );
195+ funcAddr = GetProcAddress( memoryModule, funcInfo.name.GetConstString() );
195196 }
196197
197198 if ( funcAddr == nullptr )
@@ -216,7 +217,7 @@
216217 for ( const PEFile::PEImportDesc& importEntry : fixedExec.imports )
217218 {
218219 // Load the actual module.
219- HMODULE memoryModule = LoadLibraryA( importEntry.DLLName.c_str() );
220+ HMODULE memoryModule = LoadLibraryA( importEntry.DLLName.GetConstString() );
220221
221222 assert( memoryModule != nullptr );
222223
@@ -231,7 +232,7 @@
231232 {
232233 for ( const PEFile::PEDelayLoadDesc& delayLoad : fixedExec.delayLoads )
233234 {
234- HMODULE modHandle = LoadLibraryA( delayLoad.DLLName.c_str() );
235+ HMODULE modHandle = LoadLibraryA( delayLoad.DLLName.GetConstString() );
235236
236237 assert( modHandle != nullptr );
237238
--- peresembed/src/main.cpp (revision 55)
+++ peresembed/src/main.cpp (revision 56)
@@ -637,12 +637,12 @@
637637 }
638638
639639 // Turn it into a relative node path from the embed root.
640- bool isFile;
641- dirNames relFileNodePath;
640+ normalNodePath relNodePath;
642641
643- embedRoot->GetRelativePathNodesFromRoot( absFilePath, relFileNodePath, isFile );
642+ embedRoot->GetRelativePathNodesFromRoot( absFilePath, relNodePath );
644643
645- assert( isFile == true );
644+ assert( relNodePath.isFilePath == true );
645+ assert( relNodePath.backCount == 0 );
646646
647647 FileSystem::filePtr stream = embedRoot->Open( absFilePath, "rb" );
648648
@@ -674,11 +674,11 @@
674674 // Get to the resource directory.
675675 PEFile::PEResourceDir *putDir = &inputImage.resourceRoot;
676676
677- size_t numDirItems = ( relFileNodePath.GetCount() - 1 );
677+ size_t numDirItems = ( relNodePath.travelNodes.GetCount() - 1 );
678678
679679 for ( size_t n = 0; n < numDirItems; n++ )
680680 {
681- filePath nodeName = relFileNodePath[ n ];
681+ filePath nodeName = relNodePath.travelNodes[ n ];
682682
683683 nodeName.transform_to <char16_t> ();
684684
@@ -690,7 +690,7 @@
690690 }
691691
692692 // Then create our data node.
693- filePath dataNodeName = std::move( relFileNodePath[ numDirItems ] );
693+ filePath dataNodeName = std::move( relNodePath.travelNodes[ numDirItems ] );
694694
695695 dataNodeName.transform_to <char16_t> ();
696696
Show on old repository browser