1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59:
| AssignFile(f, Edit1.Text); Reset(f,1); lPos := 0; if (IOResult = 0) then begin repeat { If (Button2.Caption = '&Stop') and (Button2. begin CloseFile(f); exit; end; } // If RadioButton1.Checked = false then lPos := filepos(f); // if RadioButton1.Checked = true then lPos := lPos + 16; BlockRead(f,u,2,iRead); if (iRead = 2) then begin if(lstrcmp(u,'PE') = 0) then begin Seek(f,lPos + 5); BlockRead(f,u,1,iRead); sectionnum := iRead; sectionheadersize := sectionnum * 40; headersize := sectionheadersize + 241; Seek (f, headersize); FillChar(u,sizeof(u),#00); BlockWrite(f,u,512,iWrite); if (iWrite <> 512) then break;
// Seek(f,lPos + 1); // BlockRead(f,u,1,iRead); // sectionnum := iRead + sectionnum; // showmessage(IntToStr(sectionnum));
// Showmessage(Format('"%s" at position %d',[u,lPos])); // showmessage('BlockWrite' + IntToStr(lPos)); // fillchar(u,sizeof(u),'f'); // BlockWrite(f,u,110000,iWrite); /// if (iWrite <> 110000) then break; // fillchar(u,sizeof(u),#0); // Label3.Caption := filelabel3 + '1'; end else // If RadioButton1.Checked = true then Seek(f,lPos); // If RadioButton1.Checked = false then // Seek(f,lPos + 1); // Label1.Caption := IntToStr(lPos) + ' / ' + InttoStr(sizeprogress) + ' bytes'; randomize; rand := random(50); if (rand = 29) then Application.ProcessMessages; end until(iRead = 0); CloseFile(f); end; {$S+}
end; |