mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Make LauncherGenerator to be able to shrink sections
This issue was found during investigation of T-IDE broken binary: they've used an .ico file of smaller size than in IDEA, and that caused the binary to become invalid. GitOrigin-RevId: 9b14d581e27dd04e5e9f6c6d25665ae895d238d6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5f0630e50c
commit
3335afcf68
Binary file not shown.
@@ -148,16 +148,12 @@ public class ExeReader extends Bin.Structure{
|
||||
|
||||
for (Bin sectionHeader : mySectionHeaders.getArray()) {
|
||||
Value virtualAddressMember = ((ImageSectionHeader)sectionHeader).getValueMember("VirtualAddress");
|
||||
long sectionVirtualAddress = virtualAddressMember.getValue();
|
||||
|
||||
// Section always starts from an address divisible by 0x1000
|
||||
if (virtualAddress % 0x1000 != 0)
|
||||
virtualAddress += 0x1000 - virtualAddress % 0x1000;
|
||||
|
||||
if (sectionVirtualAddress < virtualAddress) {
|
||||
virtualAddressMember.setValue(virtualAddress);
|
||||
}
|
||||
|
||||
virtualAddressMember.setValue(virtualAddress);
|
||||
virtualAddress += ((ImageSectionHeader)sectionHeader).getValueMember("VirtualSize").getValue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user