ScrapExplorer - x86BootSector.java

Home / lab / FileConstruct / demos Lines: 1 | Size: 1064 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* FileConstruct 2 * Construct custom files with ease. 3 * 4 * Examples/x86BootSector.java 5 * 6 * COPYRIGHT NOTICE 7 * Copyright (C) 2024 0x4248 and contributors 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the license is not changed. 10 * 11 * This software is free and open source. Licensed under the GNU general 12 * public license version 3.0 as published by the Free Software Foundation. 13 */ 14 15package lab.FileConstruct.demos; 16 17import lab.FileConstruct.FileConstructor; 18 19class x86BootSector { 20 21 // Boot sector signature 22 public static String SIGNATURE = "55 AA"; 23 24 public static void main(String[] args) { 25 // Create a new file constructor 26 FileConstructor FC = new FileConstructor(); 27 FC.filename = "bootdisk.img"; 28 29 // Resize the disk image to 510 bytes 30 int fill = 510 - FC.size; 31 FC.Fill(fill, new byte[] { 0 }); 32 33 // Place in the boot sector signature 34 FC.PutHexStr(SIGNATURE); 35 36 // Dump the file 37 FC.Dump(); 38 } 39} 40
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.