@@ -347,9 +347,9 @@ dyn_ptr<SectionHeader> File::createSection(int i, const char *name, uint32_t roo
347
347
if (!at_end && !this ->move (pos, header_used_size-pos, sizeof (SectionHeader))) { return nulldp; }
348
348
if (!this ->set (&s, sizeof (SectionHeader), pos)) { return nulldp; }
349
349
++this ->header ->NumberOfSections ;
350
- for (uint16_t s = (uint16_t )i + 1 ; s <= nSects; ++s ) { // update the location and VA of all subsequent sections
351
- this ->sections [s ].VirtualAddress += move_va;
352
- this ->sections [s ].PointerToRawData += raw_size;
350
+ for (uint16_t si = (uint16_t )i + 1 ; si <= nSects; ++si ) { // update the location and VA of all subsequent sections
351
+ this ->sections [si ].VirtualAddress += move_va;
352
+ this ->sections [si ].PointerToRawData += raw_size;
353
353
}
354
354
uint32_t ddCount = this ->getDataDirectoryCount ();
355
355
for (uint32_t d = 0 ; d < ddCount; ++d) { // update the VA of all subsequent data directories
@@ -410,7 +410,7 @@ bool File::resourceExists(const_resid type, const_resid name, uint16_t* lang) co
410
410
void * File::getResource (const_resid type, const_resid name, uint16_t lang, size_t * size) const { return this ->res ->get (type, name, lang, size); }
411
411
void * File::getResource (const_resid type, const_resid name, uint16_t * lang, size_t * size) const { return this ->res ->get (type, name, lang, size); }
412
412
bool File::removeResource (const_resid type, const_resid name, uint16_t lang) { return !this ->data .isreadonly () && this ->res ->remove (type, name, lang); }
413
- bool File::addResource (const_resid type, const_resid name, uint16_t lang, const void * data , size_t size, Overwrite overwrite) { return !this ->data .isreadonly () && this ->res ->add (type, name, lang, data , size, overwrite); }
413
+ bool File::addResource (const_resid type, const_resid name, uint16_t lang, const void * dat , size_t size, Overwrite overwrite) { return !this ->data .isreadonly () && this ->res ->add (type, name, lang, dat , size, overwrite); }
414
414
#pragma endregion
415
415
416
416
#pragma region Direct Data Functions
@@ -536,7 +536,7 @@ bool File::removeRelocs(uint32_t start, uint32_t end, bool reverse) {
536
536
if (!sect) { return true ; } // no relocations exist, so nothing to remove!
537
537
538
538
uint32_t size = sect->SizeOfRawData , pntr = sect->PointerToRawData ;
539
- dyn_ptr<byte> data = this ->get (pntr);
539
+ dyn_ptr<byte> dat = this ->get (pntr);
540
540
541
541
// ABSOLUTE = IMAGE_REL_I386_ABSOLUTE or IMAGE_REL_AMD64_ABSOLUTE
542
542
// HIGHLOW => ??? or IMAGE_REL_AMD64_ADDR32NB (32-bit address w/o image base (RVA))
@@ -545,8 +545,8 @@ bool File::removeRelocs(uint32_t start, uint32_t end, bool reverse) {
545
545
546
546
// Remove everything that is between start and end
547
547
// We do a thorough search for possible relocations and do not assume that they are in order
548
- dyn_ptr<void > entry_end = data + size;
549
- for (dyn_ptr<BaseRelocation> entry = (dyn_ptr<BaseRelocation>)data ; entry < entry_end && entry->SizeOfBlock > 0 ; entry = NEXT_RELOCS (entry)) {
548
+ dyn_ptr<void > entry_end = dat + size;
549
+ for (dyn_ptr<BaseRelocation> entry = (dyn_ptr<BaseRelocation>)dat ; entry < entry_end && entry->SizeOfBlock > 0 ; entry = NEXT_RELOCS (entry)) {
550
550
551
551
// Check that the ranges overlap
552
552
if (entry->VirtualAddress +0xFFF < start || entry->VirtualAddress > end) continue ;
0 commit comments