• R/O
  • SSH
  • HTTPS

pefrm-units: Commit


Commit MetaInfo

Revision36 (tree)
Time2018-01-12 03:20:58
Authorquiret

Log Message

- added Code::Blocks project
- minor adjustments to please GCC compiler + bugfixes (meow!)

Change Summary

Incremental Difference

--- pefrmdllembed/src/main.cpp (revision 35)
+++ pefrmdllembed/src/main.cpp (revision 36)
@@ -48,7 +48,7 @@
4848 const char *curPat = patterns[patIdx];
4949
5050 size_t patternLen = (size_t)*curPat++;
51-
51+
5252 bool curPatternMatch = true;
5353
5454 size_t curIter = n;
@@ -230,7 +230,7 @@
230230 return hasChanged;
231231 }
232232
233- // Clones a resource item
233+ // Clones a resource item
234234 template <typename sectResolver_t>
235235 static PEFile::PEResourceItem* CloneResourceItem( const sectResolver_t& sectResolver, const PEFile::PEResourceItem *srcItem )
236236 {
@@ -276,7 +276,7 @@
276276 catch( ... )
277277 {
278278 delete newItem;
279-
279+
280280 throw;
281281 }
282282 });
@@ -297,7 +297,7 @@
297297 std::uint32_t itemRVA = ( targetSect->GetVirtualAddress() + sectOffset );
298298
299299 targetSect->stream.Seek( sectOffset );
300-
300+
301301 if ( archPointerSize == 4 )
302302 {
303303 targetSect->stream.WriteUInt32( (std::uint32_t)( virtualAddress ) );
@@ -317,7 +317,7 @@
317317 PEFile::PEBaseReloc::eRelocType relocType = PEFile::PEBaseReloc::GetRelocTypeForPointerSize( archPointerSize );
318318
319319 if ( relocType != PEFile::PEBaseReloc::eRelocType::ABSOLUTE )
320- {
320+ {
321321 image.AddRelocation( itemRVA, relocType );
322322 }
323323 }
@@ -413,7 +413,7 @@
413413 std::uint32_t ordinalOfImport = impFunc.ordinal_hint;
414414 const std::string& nameOfImport = impFunc.name;
415415
416- const PEFile::PEExportDir::func *expFuncMatch = expFuncMatch = exportDir.ResolveExport( isOrdinalMatch, ordinalOfImport, nameOfImport );
416+ const PEFile::PEExportDir::func *expFuncMatch = exportDir.ResolveExport( isOrdinalMatch, ordinalOfImport, nameOfImport );
417417
418418 if ( expFuncMatch != NULL )
419419 {
@@ -436,7 +436,7 @@
436436 std::uint32_t thunkTableOffset = (std::uint32_t)( archPointerSize * impFuncIter );
437437 {
438438 PEFile::PESectionDataReference exeImageFuncRef = ResolvePEDataRedirect( expFuncMatch->expRef, sectResolver );
439-
439+
440440 std::uint64_t exeImageFuncVA = ( exeImageFuncRef.GetRVA() + image.GetImageBase() );
441441
442442 PEFile::PESection *thunkSect = firstThunkRef.GetSection();
@@ -601,7 +601,7 @@
601601 std::uint64_t modImageBase = moduleImage.GetImageBase();
602602
603603 // Generate code along with binding.
604-
604+
605605 // Perform binding of PE references.
606606 // We keep a list of all sections that we put into the executable image.
607607 // This is important to transfer all the remaining data that is tied to sections.
@@ -638,7 +638,7 @@
638638
639639 return -13;
640640 }
641-
641+
642642 moduleImage.ForAllSections(
643643 [&]( PEFile::PESection *theSect )
644644 {
@@ -648,7 +648,7 @@
648648 PEFile::PESection newSect;
649649 newSect.shortName = theSect->shortName;
650650 newSect.chars = theSect->chars;
651-
651+
652652 size_t sectDataSize = (size_t)theSect->stream.Size();
653653
654654 theSect->stream.Seek( 0 );
@@ -968,7 +968,7 @@
968968 newImports.DLLName = impDesc.DLLName;
969969 newImports.DLLName_allocEntry = ResolvePEAllocation( impDesc.DLLName_allocEntry, resolveSectionLink );
970970 newImports.DLLHandleAlloc = ResolvePEAllocation( impDesc.DLLHandleAlloc, resolveSectionLink );
971-
971+
972972 // The IAT always needs special handling.
973973 newImports.IATRef = ResolvePEDataRedirect( impDesc.IATRef, resolveSectionLink );
974974
@@ -1005,7 +1005,7 @@
10051005 }
10061006
10071007 bool hasStaticTLS = ( moduleImage.tlsInfo.addressOfIndexRef.GetSection() != NULL );
1008-
1008+
10091009 if ( hasStaticTLS )
10101010 {
10111011 std::cout << "WARNING: module image has static TLS; might not work as expected" << std::endl;
@@ -1233,7 +1233,7 @@
12331233 const decltype( PEFile::delayLoads )::iterator& dstImpDescIter;
12341234
12351235 AINLINE delayedImpDescriptorHandler( AssemblyEnvironment& env, PEFile::PEDelayLoadDesc& impDesc, std::uint32_t archPointerSize, const decltype( PEFile::delayLoads )::iterator& dstImpDescIter )
1236- : impDesc( impDesc ), env( env ), dstImpDescIter( dstImpDescIter )
1236+ : env( env ), impDesc( impDesc ), dstImpDescIter( dstImpDescIter )
12371237 {
12381238 this->archPointerSize = archPointerSize;
12391239 }
@@ -1261,7 +1261,7 @@
12611261 AINLINE void MoveIATBy( PEFile& image, std::uint32_t moveBytes )
12621262 {
12631263 impDesc.IATRef = image.ResolveRVAToRef( impDesc.IATRef.GetRVA() + moveBytes );
1264-
1264+
12651265 // Move the other if it is available.
12661266 PEFile::PESectionDataReference& unloadIAT = impDesc.unloadInfoTableRef;
12671267
@@ -1750,7 +1750,7 @@
17501750 // Create a nice debug string.
17511751 {
17521752 std::cout << "loading: \"" << inputExecImageName << "\"";
1753-
1753+
17541754 for ( unsigned int n = 0; n < numberModules; n++ )
17551755 {
17561756 const char *inputModImageName = toEmbedList[ n ];
@@ -1757,7 +1757,7 @@
17571757
17581758 std::cout << ", \"" << inputModImageName << "\"";
17591759 }
1760-
1760+
17611761 std::cout << std::endl << std::endl;
17621762 }
17631763
@@ -1906,7 +1906,7 @@
19061906
19071907 exeImage.imports.push_back( std::move( utilImports ) );
19081908 }
1909-
1909+
19101910 if ( metaSection.IsEmpty() == false )
19111911 {
19121912 metaSection.Finalize();
@@ -2130,4 +2130,4 @@
21302130 }
21312131
21322132 return iReturnCode;
2133-}
\ No newline at end of file
2133+}
Show on old repository browser