1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| var dos1, dos2, dos3, dos4, sn1, sn2, soi1, soi2, soi3, soi4 : byte; soierg, Byte1, Byte2, Byte3, Byte4 : DWord;
File1.seek(pepos, soFromBeginning); // PE - File1.seek(+82, soFromCurrent); // SizeOfHeaders File1.read(soi4,1); File1.read(soi3,1); File1.read(soi2,1); File1.read(soi1,1); // soierg := MakeLONG(MAKEWORD(soi1, soi2), MAKEWORD(soi3, soi4)); soierg := MakeLONG(soi1, soi2) AND MAKELONG(soi3, soi4); showmessage(inttostr(soierg)); soierg := soierg + $200; //add sizeofheader entry Byte1 := soierg and $FF; Byte2 := (soierg shr 8 ) and $FF; Byte3 := (soierg shr 16) and $FF; Byte4 := (soierg shr 24) and $FF; File1.seek(-4, soFromCurrent); File1.write(Byte1, 1); File1.write(Byte2, 1); File1.write(Byte3, 1); File1.write(Byte4, 1); // Write new SizeOFHeaders |