├── .mingw ├── Makefile.am ├── Makefile.in ├── cfgmgr32.def ├── crypt32.def ├── dwmapi.def ├── setupapi.def ├── version.def ├── virtdisk.def ├── wininet.def └── wintrust.def ├── .vs ├── Generate.PDB.props ├── bled.vcxproj ├── bled.vcxproj.filters ├── ext2fs.vcxproj ├── ext2fs.vcxproj.filters ├── getopt.vcxproj ├── getopt.vcxproj.filters ├── libcdio-driver.vcxproj ├── libcdio-driver.vcxproj.filters ├── libcdio-iso9660.vcxproj ├── libcdio-iso9660.vcxproj.filters ├── libcdio-udf.vcxproj ├── libcdio-udf.vcxproj.filters ├── ms-sys.vcxproj ├── ms-sys.vcxproj.filters ├── rufus.vcxproj ├── rufus.vcxproj.filters ├── syslinux-libfat.vcxproj ├── syslinux-libfat.vcxproj.filters ├── syslinux-libinstaller.vcxproj ├── syslinux-libinstaller.vcxproj.filters ├── syslinux-win.vcxproj ├── syslinux-win.vcxproj.filters ├── wimlib.vcxproj └── wimlib.vcxproj.filters ├── ChangeLog.txt ├── LICENSE.txt ├── Makefile.am ├── Makefile.in ├── README.md ├── SECURITY.md ├── aclocal.m4 ├── compile ├── configure ├── configure.ac ├── install-sh ├── loadcfg.py ├── missing ├── res ├── appstore │ ├── .editorconfig │ ├── Images │ │ ├── LargeTile.scale-100.png │ │ ├── LargeTile.scale-125.png │ │ ├── LargeTile.scale-150.png │ │ ├── LargeTile.scale-200.png │ │ ├── LargeTile.scale-400.png │ │ ├── SmallTile.scale-100.png │ │ ├── SmallTile.scale-125.png │ │ ├── SmallTile.scale-150.png │ │ ├── SmallTile.scale-200.png │ │ ├── SmallTile.scale-400.png │ │ ├── Square150x150Logo.scale-100.png │ │ ├── Square150x150Logo.scale-125.png │ │ ├── Square150x150Logo.scale-150.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square150x150Logo.scale-400.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-24.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-32.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-48.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-125.png │ │ ├── Square44x44Logo.scale-150.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16.png │ │ ├── Square44x44Logo.targetsize-24.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-256.png │ │ ├── Square44x44Logo.targetsize-32.png │ │ ├── Square44x44Logo.targetsize-48.png │ │ ├── StoreLogo.scale-100.png │ │ ├── StoreLogo.scale-125.png │ │ ├── StoreLogo.scale-150.png │ │ ├── StoreLogo.scale-200.png │ │ ├── StoreLogo.scale-400.png │ │ ├── Wide310x150Logo.scale-100.png │ │ ├── Wide310x150Logo.scale-125.png │ │ ├── Wide310x150Logo.scale-150.png │ │ ├── Wide310x150Logo.scale-200.png │ │ └── Wide310x150Logo.scale-400.png │ ├── RufusAppxManifest.xml │ ├── ScaleAppxManifest.xml │ ├── gen_listing.ps1 │ ├── get_pe_info.c │ ├── listing │ │ ├── ar-sa │ │ │ └── Screenshot1.png │ │ ├── bg-bg │ │ │ └── Screenshot1.png │ │ ├── cs-cz │ │ │ └── Screenshot1.png │ │ ├── da-dk │ │ │ └── Screenshot1.png │ │ ├── de-de │ │ │ └── Screenshot1.png │ │ ├── el-gr │ │ │ └── Screenshot1.png │ │ ├── en-us │ │ │ ├── Screenshot1.png │ │ │ ├── Screenshot2.png │ │ │ ├── Screenshot3.png │ │ │ └── Screenshot4.png │ │ ├── es-es │ │ │ └── Screenshot1.png │ │ ├── fa-ir │ │ │ └── Screenshot1.png │ │ ├── fi-fi │ │ │ └── Screenshot1.png │ │ ├── fr-fr │ │ │ └── Screenshot1.png │ │ ├── he-il │ │ │ └── Screenshot1.png │ │ ├── hr-hr │ │ │ └── Screenshot1.png │ │ ├── hu-hu │ │ │ └── Screenshot1.png │ │ ├── id-id │ │ │ └── Screenshot1.png │ │ ├── it-it │ │ │ └── Screenshot1.png │ │ ├── ja-jp │ │ │ └── Screenshot1.png │ │ ├── ko-kr │ │ │ └── Screenshot1.png │ │ ├── listing.csv │ │ ├── lt-lt │ │ │ └── Screenshot1.png │ │ ├── lv-lv │ │ │ └── Screenshot1.png │ │ ├── ms-my │ │ │ └── Screenshot1.png │ │ ├── nb-no │ │ │ └── Screenshot1.png │ │ ├── nl-nl │ │ │ └── Screenshot1.png │ │ ├── pl-pl │ │ │ └── Screenshot1.png │ │ ├── pt-br │ │ │ └── Screenshot1.png │ │ ├── pt-pt │ │ │ └── Screenshot1.png │ │ ├── ro-ro │ │ │ └── Screenshot1.png │ │ ├── ru-ru │ │ │ └── Screenshot1.png │ │ ├── sk-sk │ │ │ └── Screenshot1.png │ │ ├── sl-si │ │ │ └── Screenshot1.png │ │ ├── sr-latn-rs │ │ │ └── Screenshot1.png │ │ ├── sv-se │ │ │ └── Screenshot1.png │ │ ├── th-th │ │ │ └── Screenshot1.png │ │ ├── tr-tr │ │ │ └── Screenshot1.png │ │ ├── uk-ua │ │ │ └── Screenshot1.png │ │ ├── vi-vn │ │ │ └── Screenshot1.png │ │ ├── zh-cn │ │ │ └── Screenshot1.png │ │ └── zh-tw │ │ │ └── Screenshot1.png │ ├── listing_template.csv │ └── runme.ps1 ├── dbx │ ├── amd64_DBXUpdate.bin │ ├── arm64_DBXUpdate.bin │ ├── arm_DBXUpdate.bin │ ├── dbx_info.h │ ├── ia64_DBXUpdate.bin │ ├── loongarch64_DBXUpdate.bin │ ├── readme.txt │ ├── riscv64_DBXUpdate.bin │ └── x86_DBXUpdate.bin ├── freedos │ ├── COMMAND.COM │ ├── DISPLAY.EXE │ ├── EGA.CPX │ ├── EGA10.CPX │ ├── EGA11.CPX │ ├── EGA12.CPX │ ├── EGA13.CPX │ ├── EGA14.CPX │ ├── EGA15.CPX │ ├── EGA16.CPX │ ├── EGA17.CPX │ ├── EGA18.CPX │ ├── EGA2.CPX │ ├── EGA3.CPX │ ├── EGA4.CPX │ ├── EGA5.CPX │ ├── EGA6.CPX │ ├── EGA7.CPX │ ├── EGA8.CPX │ ├── EGA9.CPX │ ├── KERNEL.SYS │ ├── KEYB.EXE │ ├── KEYBOARD.SYS │ ├── KEYBRD2.SYS │ ├── KEYBRD3.SYS │ ├── KEYBRD4.SYS │ ├── MODE.COM │ └── readme.txt ├── grub │ ├── grldr.mbr │ ├── grub_version.h │ └── readme.txt ├── grub2 │ ├── boot.img │ ├── core.img │ ├── grub2_version.h │ └── readme.txt ├── hogger │ ├── hogger.asm │ ├── hogger.c │ ├── hogger.exe │ └── readme.txt ├── icons │ ├── hash-16.png │ ├── hash-24.png │ ├── hash-32.png │ ├── info-16.png │ ├── info-24.png │ ├── info-32.png │ ├── lang-16.png │ ├── lang-24.png │ ├── lang-32.png │ ├── license.txt │ ├── log-16.png │ ├── log-24.png │ ├── log-32.png │ ├── log.svg │ ├── rufus-128.png │ ├── rufus-150.png │ ├── rufus-16.png │ ├── rufus-24.png │ ├── rufus-256.png │ ├── rufus-32.png │ ├── rufus-44.png │ ├── rufus-48.png │ ├── rufus-512.png │ ├── rufus-64.png │ ├── rufus-72.png │ ├── rufus.ico │ ├── save-16.png │ ├── save-24.png │ ├── save-32.png │ ├── settings-16.png │ ├── settings-24.png │ ├── settings-32.png │ ├── setup.ico │ └── setup.svg ├── loc │ ├── ChangeLog.txt │ ├── Makefile.am │ ├── Makefile.in │ ├── embedded.sed │ ├── po │ │ ├── ar-SA.po │ │ ├── bg-BG.po │ │ ├── cs-CZ.po │ │ ├── da-DK.po │ │ ├── de-DE.po │ │ ├── el-GR.po │ │ ├── es-ES.po │ │ ├── fa-IR.po │ │ ├── fi-FI.po │ │ ├── fr-FR.po │ │ ├── he-IL.po │ │ ├── hr-HR.po │ │ ├── hu-HU.po │ │ ├── id-ID.po │ │ ├── it-IT.po │ │ ├── ja-JP.po │ │ ├── ko-KR.po │ │ ├── lt-LT.po │ │ ├── lv-LV.po │ │ ├── ms-MY.po │ │ ├── nb-NO.po │ │ ├── nl-NL.po │ │ ├── pl-PL.po │ │ ├── pt-BR.po │ │ ├── pt-PT.po │ │ ├── ro-RO.po │ │ ├── ru-RU.po │ │ ├── sk-SK.po │ │ ├── sl-SI.po │ │ ├── sr-RS.po │ │ ├── sv-SE.po │ │ ├── th-TH.po │ │ ├── tr-TR.po │ │ ├── uk-UA.po │ │ ├── vi-VN.po │ │ ├── zh-CN.po │ │ └── zh-TW.po │ ├── pollock │ │ ├── Pollock.cs │ │ ├── Pollock.csproj │ │ ├── Pollock.sln │ │ ├── app.config │ │ └── pollock.ico │ ├── rufus.loc │ ├── test │ │ ├── arch_trunc.iso │ │ ├── casper_test.iso │ │ ├── esp_test.iso │ │ ├── menu_c32_test.iso │ │ └── windows_to_go.iso │ └── translation_check.py ├── mbr │ ├── Makefile │ ├── bochsrc.bxrc │ ├── mbr.S │ ├── mbr.ld │ ├── msg.S │ ├── msg.bin │ ├── msg.txt │ └── readme.txt ├── md5 │ ├── bootaa64.efi │ ├── bootarm.efi │ ├── bootia32.efi │ ├── bootloongarch64.efi │ ├── bootriscv64.efi │ ├── bootx64.efi │ └── readme.txt ├── rufus.ico ├── rufus.ini ├── scripts │ └── SspToBar.ps1 ├── setup │ ├── .editorconfig │ ├── readme.txt │ ├── resource.h │ ├── setup.c │ ├── setup.rc │ ├── setup.sln │ ├── setup.vcxproj │ ├── setup.vcxproj.filters │ ├── setup_arm64.exe │ └── setup_x64.exe ├── syslinux │ ├── ldlinux_v4.bss │ ├── ldlinux_v4.sys │ ├── ldlinux_v6.bss │ ├── ldlinux_v6.sys │ ├── mboot.c32 │ └── readme.txt └── uefi │ ├── readme.txt │ └── uefi-ntfs.img ├── rufus.sln └── src ├── .editorconfig ├── Makefile.am ├── Makefile.in ├── badblocks.c ├── badblocks.h ├── bled ├── Makefile.am ├── Makefile.in ├── bb_archive.h ├── bled.c ├── bled.h ├── crc32.c ├── data_align.c ├── data_extract_all.c ├── data_skip.c ├── decompress_bunzip2.c ├── decompress_gunzip.c ├── decompress_uncompress.c ├── decompress_unlzma.c ├── decompress_unxz.c ├── decompress_unzip.c ├── decompress_unzstd.c ├── decompress_vtsi.c ├── filter_accept_all.c ├── filter_accept_list.c ├── filter_accept_reject_list.c ├── find_list_entry.c ├── fse.h ├── fse_bitstream.h ├── fse_decompress.c ├── header_list.c ├── header_skip.c ├── header_verbose_list.c ├── huf.h ├── huf_decompress.c ├── init_handle.c ├── libbb.h ├── open_transformer.c ├── platform.h ├── seek_by_jump.c ├── seek_by_read.c ├── xxhash.c ├── xxhash.h ├── xz.h ├── xz_config.h ├── xz_dec_bcj.c ├── xz_dec_lzma2.c ├── xz_dec_stream.c ├── xz_lzma2.h ├── xz_private.h ├── xz_stream.h ├── zstd.h ├── zstd_bits.h ├── zstd_common.c ├── zstd_compiler.h ├── zstd_config.h ├── zstd_cpu.h ├── zstd_ddict.c ├── zstd_ddict.h ├── zstd_decompress.c ├── zstd_decompress_block.c ├── zstd_decompress_block.h ├── zstd_decompress_internal.h ├── zstd_deps.h ├── zstd_entropy_common.c ├── zstd_error_private.c ├── zstd_error_private.h ├── zstd_errors.h ├── zstd_internal.h └── zstd_mem.h ├── db.h ├── dev.c ├── dev.h ├── dos.c ├── dos.h ├── dos_locale.c ├── drive.c ├── drive.h ├── efi.h ├── ext2fs ├── .editorconfig ├── LICENSE.txt ├── Makefile.am ├── Makefile.in ├── alloc.c ├── alloc_sb.c ├── alloc_stats.c ├── alloc_tables.c ├── badblocks.c ├── bb_inode.c ├── bitmaps.c ├── bitops.c ├── bitops.h ├── blkmap64_ba.c ├── blkmap64_rb.c ├── blknum.c ├── block.c ├── bmap.c ├── bmap64.h ├── closefs.c ├── com_err.h ├── config.h ├── crc16.c ├── crc16.h ├── crc32c.c ├── crc32c_defs.h ├── crc32c_table.h ├── csum.c ├── dir_iterate.c ├── dirblock.c ├── dirhash.c ├── e2image.h ├── ext2_err.h ├── ext2_ext_attr.h ├── ext2_fs.h ├── ext2_io.h ├── ext2_types.h ├── ext2fs.h ├── ext2fsP.h ├── ext3_extents.h ├── ext4_acl.h ├── ext_attr.c ├── extent.c ├── fallocate.c ├── fileio.c ├── freefs.c ├── gen_bitmap.c ├── gen_bitmap64.c ├── get_num_dirs.c ├── hashmap.c ├── hashmap.h ├── i_block.c ├── ind_block.c ├── initialize.c ├── inline.c ├── inline_data.c ├── inode.c ├── io_manager.c ├── jfs_compat.h ├── kernel-jbd.h ├── kernel-list.h ├── link.c ├── lookup.c ├── mkdir.c ├── mkjournal.c ├── mmp.c ├── namei.c ├── newdir.c ├── nt_io.c ├── openfs.c ├── punch.c ├── rbtree.c ├── rbtree.h ├── read_bb.c ├── rw_bitmaps.c ├── sha512.c ├── symlink.c └── valid_blk.c ├── format.c ├── format.h ├── format_ext.c ├── format_fat32.c ├── getopt ├── .editorconfig ├── getopt.c ├── getopt.h └── getopt1.c ├── gpt_types.h ├── hash.c ├── hdd_vs_ufd.h ├── icon.c ├── iso.c ├── libcdio ├── .editorconfig ├── cdio │ ├── audio.h │ ├── bytesex.h │ ├── bytesex_asm.h │ ├── cdio.h │ ├── cdtext.h │ ├── device.h │ ├── disc.h │ ├── ds.h │ ├── dvd.h │ ├── ecma_167.h │ ├── iso9660.h │ ├── logging.h │ ├── memory.h │ ├── posix.h │ ├── read.h │ ├── rock.h │ ├── sector.h │ ├── track.h │ ├── types.h │ ├── udf.h │ ├── udf_file.h │ ├── udf_time.h │ ├── utf8.h │ ├── util.h │ ├── version.h │ └── xa.h ├── config.h ├── driver │ ├── Makefile.am │ ├── Makefile.in │ ├── _cdio_stdio.c │ ├── _cdio_stdio.h │ ├── _cdio_stream.c │ ├── _cdio_stream.h │ ├── cdio_assert.h │ ├── cdio_private.h │ ├── disc.c │ ├── ds.c │ ├── filemode.h │ ├── generic.h │ ├── logging.c │ ├── memory.c │ ├── portable.h │ ├── read.c │ ├── sector.c │ ├── track.c │ ├── utf8.c │ └── util.c ├── iso9660 │ ├── Makefile.am │ ├── Makefile.in │ ├── iso9660.c │ ├── iso9660_fs.c │ ├── iso9660_private.h │ ├── rock.c │ └── xa.c ├── mmc │ └── mmc_private.h └── udf │ ├── Makefile.am │ ├── Makefile.in │ ├── filemode.c │ ├── udf.c │ ├── udf_file.c │ ├── udf_fs.c │ ├── udf_fs.h │ ├── udf_private.h │ └── udf_time.c ├── license.h ├── localization.c ├── localization.h ├── localization_data.h ├── mbr_types.h ├── missing.h ├── ms-sys ├── .editorconfig ├── Makefile.am ├── Makefile.in ├── br.c ├── fat12.c ├── fat16.c ├── fat32.c ├── file.c ├── inc │ ├── br.h │ ├── br_fat12_0x0.h │ ├── br_fat12_0x3e.h │ ├── br_fat16_0x0.h │ ├── br_fat16_0x3e.h │ ├── br_fat16fd_0x3e.h │ ├── br_fat16ros_0x0.h │ ├── br_fat16ros_0x3e.h │ ├── br_fat32_0x0.h │ ├── br_fat32_0x3f0.h │ ├── br_fat32_0x52.h │ ├── br_fat32fd_0x3f0.h │ ├── br_fat32fd_0x52.h │ ├── br_fat32kos_0x52.h │ ├── br_fat32nt_0x1800.h │ ├── br_fat32nt_0x3f0.h │ ├── br_fat32nt_0x52.h │ ├── br_fat32pe_0x1800.h │ ├── br_fat32pe_0x3f0.h │ ├── br_fat32pe_0x52.h │ ├── br_fat32ros_0x1c00.h │ ├── br_fat32ros_0x3f0.h │ ├── br_fat32ros_0x52.h │ ├── br_ntfs_0x0.h │ ├── br_ntfs_0x54.h │ ├── fat12.h │ ├── fat16.h │ ├── fat32.h │ ├── file.h │ ├── label_11_char.h │ ├── libintl.h │ ├── mbr_2000.h │ ├── mbr_95b.h │ ├── mbr_dos.h │ ├── mbr_dos_f2.h │ ├── mbr_gpt_syslinux.h │ ├── mbr_grub.h │ ├── mbr_grub2.h │ ├── mbr_kolibri.h │ ├── mbr_msg_rufus.h │ ├── mbr_reactos.h │ ├── mbr_rufus.h │ ├── mbr_syslinux.h │ ├── mbr_vista.h │ ├── mbr_win7.h │ ├── mbr_zero.h │ ├── nls.h │ ├── ntfs.h │ └── partition_info.h ├── ntfs.c └── partition_info.c ├── msapi_utf8.h ├── msvc-missing └── unistd.h ├── net.c ├── ntdll.h ├── parser.c ├── pki.c ├── process.c ├── re.c ├── re.h ├── registry.h ├── resource.h ├── rufus.c ├── rufus.h ├── rufus.manifest ├── rufus.rc ├── settings.h ├── smart.c ├── smart.h ├── stdfn.c ├── stdio.c ├── stdlg.c ├── syslinux.c ├── syslinux ├── .editorconfig ├── libfat │ ├── Makefile.am │ ├── Makefile.in │ ├── cache.c │ ├── dumpdir.c │ ├── fat.h │ ├── fatchain.c │ ├── libfat.h │ ├── libfatint.h │ ├── open.c │ ├── searchdir.c │ └── ulint.h ├── libinstaller │ ├── Makefile.am │ ├── Makefile.in │ ├── advconst.h │ ├── fs.c │ ├── setadv.c │ ├── setadv.h │ ├── syslinux.h │ ├── syslxcom.h │ ├── syslxfs.h │ ├── syslxint.h │ └── syslxmod.c ├── sltypes.h └── win │ ├── Makefile.am │ ├── Makefile.in │ ├── ntfssect.c │ └── ntfssect.h ├── ui.c ├── ui.h ├── ui_data.h ├── vhd.c ├── vhd.h ├── wimlib ├── Makefile.am ├── Makefile.in ├── avl_tree.c ├── blob_table.c ├── compress.c ├── compress_common.c ├── compress_parallel.c ├── compress_serial.c ├── config.h ├── cpu_features.c ├── decompress.c ├── decompress_common.c ├── dentry.c ├── divsufsort.c ├── encoding.c ├── error.c ├── export_image.c ├── extract.c ├── file_io.c ├── header.c ├── inode.c ├── inode_fixup.c ├── inode_table.c ├── integrity.c ├── iterate_dir.c ├── lcpit_matchfinder.c ├── lzms_common.c ├── lzms_compress.c ├── lzms_decompress.c ├── lzx_common.c ├── lzx_compress.c ├── lzx_decompress.c ├── metadata_resource.c ├── pathlist.c ├── paths.c ├── pattern.c ├── progress.c ├── registry.c ├── reparse.c ├── resource.c ├── scan.c ├── security.c ├── sha1.c ├── solid.c ├── split.c ├── tagged_items.c ├── textfile.c ├── threads.c ├── timestamp.c ├── update_image.c ├── util.c ├── wim.c ├── wimboot.c ├── wimlib.h ├── wimlib │ ├── alloca.h │ ├── apply.h │ ├── assert.h │ ├── avl_tree.h │ ├── bitops.h │ ├── blob_table.h │ ├── bt_matchfinder.h │ ├── case.h │ ├── chunk_compressor.h │ ├── compiler.h │ ├── compress_common.h │ ├── compressor_ops.h │ ├── cpu_features.h │ ├── decompress_common.h │ ├── decompressor_ops.h │ ├── dentry.h │ ├── divsufsort.h │ ├── encoding.h │ ├── endianness.h │ ├── error.h │ ├── file_io.h │ ├── glob.h │ ├── guid.h │ ├── hc_matchfinder.h │ ├── header.h │ ├── inode.h │ ├── inode_table.h │ ├── integrity.h │ ├── lcpit_matchfinder.h │ ├── list.h │ ├── lzms_common.h │ ├── lzms_constants.h │ ├── lzx_common.h │ ├── lzx_constants.h │ ├── matchfinder_common.h │ ├── metadata.h │ ├── ntfs_3g.h │ ├── object_id.h │ ├── pathlist.h │ ├── paths.h │ ├── pattern.h │ ├── progress.h │ ├── registry.h │ ├── reparse.h │ ├── resource.h │ ├── scan.h │ ├── security.h │ ├── security_descriptor.h │ ├── sha1.h │ ├── solid.h │ ├── tagged_items.h │ ├── test_support.h │ ├── textfile.h │ ├── threads.h │ ├── timestamp.h │ ├── types.h │ ├── unaligned.h │ ├── unix_data.h │ ├── util.h │ ├── wim.h │ ├── wimboot.h │ ├── win32.h │ ├── win32_common.h │ ├── win32_vss.h │ ├── wof.h │ ├── write.h │ ├── xattr.h │ ├── xml.h │ ├── xml_windows.h │ ├── xmlproc.h │ └── xpress_constants.h ├── wimlib_tchar.h ├── win32_apply.c ├── win32_capture.c ├── win32_common.c ├── win32_replacements.c ├── win32_vss.c ├── write.c ├── xml.c ├── xml_windows.c ├── xmlproc.c ├── xpress_compress.c └── xpress_decompress.c ├── winio.h ├── wue.c ├── wue.h ├── xml.c └── xml.h /.mingw/Makefile.am: -------------------------------------------------------------------------------- 1 | # Create delay-loaded libraries from a DLL, that aren't vulnerable to side-loading 2 | AM_V_DLLTOOL_0 = @echo " LIB $@";$(DLLTOOL) 3 | AM_V_DLLTOOL_1 = $(DLLTOOL) 4 | AM_V_DLLTOOL_ = $(AM_V_DLLTOOL_$(AM_DEFAULT_VERBOSITY)) 5 | AM_V_DLLTOOL = $(AM_V_DLLTOOL_$(V)) 6 | 7 | AM_V_SED_0 = @echo " SED $<";$(SED) 8 | AM_V_SED_1 = $(SED) 9 | AM_V_SED_ = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY)) 10 | AM_V_SED = $(AM_V_SED_$(V)) 11 | 12 | # Ah the joys of Windows DLL calling conventions, that require an @## suffix in the .def 13 | # for x86_32 and but no @## for x86_64, thereby forcing us to strip stuff according to the 14 | # target arch. Oh, and we can't use 'target_cpu' or AC definitions on account that we are 15 | # switching archs when building on our local machine, and don't want to have to go though 16 | # a costly reconf each time when we can simply issue a 'make clean'. 17 | # Oh, and to find the number after the @ sign, just have a look at the MinGW .a libraries. 18 | TUPLE := $(shell $(CC) -dumpmachine) 19 | TARGET := $(word 1,$(subst -, ,$(TUPLE))) 20 | DEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64) 21 | 22 | .PHONY: all 23 | all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib 24 | 25 | %.def64: %.def 26 | $(AM_V_SED) "s/@.*//" $< >$@ 27 | 28 | %-delaylib.lib: %$(DEF_SUFFIX) 29 | $(AM_V_DLLTOOL) --input-def $< --output-delaylib $@ --dllname $(basename $<).dll 30 | 31 | clean: 32 | $(RM) -rf *.lib 33 | -------------------------------------------------------------------------------- /.mingw/cfgmgr32.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CM_Get_Device_IDA@16 3 | CM_Get_Device_ID_List_SizeA@12 4 | CM_Get_Device_ID_ListA@16 5 | CM_Locate_DevNodeA@12 6 | CM_Get_Child@12 7 | CM_Get_Sibling@12 8 | CM_Get_Parent@12 9 | CM_Get_DevNode_Status@16 10 | CM_Get_DevNode_Registry_PropertyA@24 11 | -------------------------------------------------------------------------------- /.mingw/crypt32.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CertFindCertificateInStore@24 3 | CertGetCertificateChain@32 4 | CertGetNameStringA@24 5 | CertCloseStore@8 6 | CertFreeCertificateContext@4 7 | CryptQueryObject@44 8 | CryptDecodeObjectEx@32 9 | CryptHashCertificate@28 10 | CryptMsgGetParam@20 11 | CryptMsgClose@4 12 | CryptMsgGetParam@20 13 | CryptMsgOpenToDecode@24 14 | CryptMsgUpdate@16 15 | -------------------------------------------------------------------------------- /.mingw/dwmapi.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DwmGetWindowAttribute@16 3 | -------------------------------------------------------------------------------- /.mingw/setupapi.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CM_Locate_DevNodeA@12 3 | CM_Get_DevNode_Registry_PropertyA@24 4 | CM_Get_DevNode_Status@16 5 | CM_Get_Child@12 6 | CM_Get_Parent@12 7 | CM_Get_Sibling@12 8 | CM_Get_Device_IDA@16 9 | CM_Get_Device_ID_ListA@16 10 | CM_Get_Device_ID_List_SizeA@12 11 | SetupDiGetDeviceInstanceIdA@20 12 | SetupDiGetDeviceRegistryPropertyA@28 13 | SetupDiGetDeviceRegistryPropertyW@28 14 | SetupDiChangeState@8 15 | SetupDiGetClassDevsA@16 16 | SetupDiSetClassInstallParamsW@16 17 | SetupDiEnumDeviceInfo@12 18 | SetupDiEnumDeviceInterfaces@20 19 | SetupDiDestroyDeviceInfoList@4 20 | SetupDiGetDeviceInterfaceDetailA@24 21 | -------------------------------------------------------------------------------- /.mingw/version.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | GetFileVersionInfoSizeW@8 3 | GetFileVersionInfoW@16 4 | VerQueryValueA@16 5 | -------------------------------------------------------------------------------- /.mingw/virtdisk.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | AttachVirtualDisk@24 3 | CreateVirtualDisk@36 4 | DetachVirtualDisk@12 5 | GetVirtualDiskInformation@16 6 | GetVirtualDiskPhysicalPath@12 7 | GetVirtualDiskOperationProgress@12 8 | OpenVirtualDisk@24 9 | -------------------------------------------------------------------------------- /.mingw/wininet.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | HttpQueryInfoA@20 3 | HttpOpenRequestA@32 4 | HttpSendRequestA@20 5 | HttpAddRequestHeadersA@16 6 | InternetCloseHandle@4 7 | InternetConnectA@32 8 | InternetCrackUrlA@16 9 | InternetGetConnectedState@8 10 | InternetGetLastResponseInfoA@12 11 | InternetOpenA@20 12 | InternetReadFile@16 13 | InternetSetOptionA@16 14 | -------------------------------------------------------------------------------- /.mingw/wintrust.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | WinVerifyTrustEx@12 3 | -------------------------------------------------------------------------------- /.vs/Generate.PDB.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DebugFull 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.vs/getopt.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /.vs/libcdio-udf.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | 31 | 32 | Header Files 33 | 34 | 35 | Header Files 36 | 37 | 38 | Header Files 39 | 40 | 41 | Header Files 42 | 43 | 44 | Header Files 45 | 46 | 47 | Header Files 48 | 49 | 50 | Header Files 51 | 52 | 53 | -------------------------------------------------------------------------------- /.vs/syslinux-libfat.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Header Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | Header Files 25 | 26 | 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | -------------------------------------------------------------------------------- /.vs/syslinux-libinstaller.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Header Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | -------------------------------------------------------------------------------- /.vs/syslinux-win.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | 19 | 20 | Source Files 21 | 22 | 23 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = src 2 | TARGET = rufus 3 | TAGVER = $(shell git log --oneline | wc -l) 4 | SEDCMD = s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@TAGVER@@.\4"\5/ 5 | 6 | upx: all 7 | @upx --lzma --best src/$(TARGET)$(EXEEXT) 8 | 9 | # This step produces the UPX compressed and signed releases that are made available for public download 10 | # NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/) 11 | release: all 12 | @mv src/$(TARGET)$(EXEEXT) . 13 | @sleep 1 14 | @$(STRIP) $(TARGET)$(EXEEXT) 15 | @upx --lzma --best $(TARGET)$(EXEEXT) 16 | @mv $(TARGET)$(EXEEXT) $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT) 17 | @cmd.exe //c _sign.cmd $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT) 18 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a security vulnerability 2 | 3 | To report a **security** vulnerability for Rufus (i.e. an issue that you believe could lead to malicious actors being able to exploit the Rufus application), please e-mail support@akeo.ie. 4 | 5 | Please do **NOT** use the e-mail above if you have a regular issue, such as a problem creating or using a bootable drive. Instead go back to https://github.com/pbatard/rufus/issues and create an issue using the regular *Issue Report* template. 6 | 7 | For any security vulnerability report, we kindly ask you to respect [responsible disclosure](https://en.wikipedia.org/wiki/Responsible_disclosure) practices. 8 | 9 | In return, we will endeavour to respond to security vulnerability reports within 48 hours. 10 | -------------------------------------------------------------------------------- /res/appstore/.editorconfig: -------------------------------------------------------------------------------- 1 | # indicate this is the root of the project 2 | root = true 3 | 4 | [*] 5 | charset = utf-8-bom 6 | insert_final_newline = true 7 | indent_style = space 8 | trim_trailing_whitespace = true 9 | -------------------------------------------------------------------------------- /res/appstore/Images/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/LargeTile.scale-100.png -------------------------------------------------------------------------------- /res/appstore/Images/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/LargeTile.scale-125.png -------------------------------------------------------------------------------- /res/appstore/Images/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/LargeTile.scale-150.png -------------------------------------------------------------------------------- /res/appstore/Images/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/LargeTile.scale-200.png -------------------------------------------------------------------------------- /res/appstore/Images/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/LargeTile.scale-400.png -------------------------------------------------------------------------------- /res/appstore/Images/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/SmallTile.scale-100.png -------------------------------------------------------------------------------- /res/appstore/Images/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/SmallTile.scale-125.png -------------------------------------------------------------------------------- /res/appstore/Images/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/SmallTile.scale-150.png -------------------------------------------------------------------------------- /res/appstore/Images/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/SmallTile.scale-200.png -------------------------------------------------------------------------------- /res/appstore/Images/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/SmallTile.scale-400.png -------------------------------------------------------------------------------- /res/appstore/Images/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /res/appstore/Images/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /res/appstore/Images/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /res/appstore/Images/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /res/appstore/Images/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /res/appstore/Images/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /res/appstore/Images/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /res/appstore/Images/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /res/appstore/Images/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /res/appstore/Images/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /res/appstore/Images/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /res/appstore/Images/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /res/appstore/Images/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /res/appstore/Images/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /res/appstore/Images/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /res/appstore/Images/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/Images/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /res/appstore/ScaleAppxManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 12 | true 13 | Rufus 14 | Akeo Consulting 15 | Images\StoreLogo.png 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /res/appstore/listing/ar-sa/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/ar-sa/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/bg-bg/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/bg-bg/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/cs-cz/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/cs-cz/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/da-dk/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/da-dk/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/de-de/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/de-de/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/el-gr/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/el-gr/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/en-us/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/en-us/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/en-us/Screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/en-us/Screenshot2.png -------------------------------------------------------------------------------- /res/appstore/listing/en-us/Screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/en-us/Screenshot3.png -------------------------------------------------------------------------------- /res/appstore/listing/en-us/Screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/en-us/Screenshot4.png -------------------------------------------------------------------------------- /res/appstore/listing/es-es/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/es-es/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/fa-ir/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/fa-ir/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/fi-fi/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/fi-fi/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/fr-fr/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/fr-fr/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/he-il/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/he-il/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/hr-hr/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/hr-hr/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/hu-hu/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/hu-hu/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/id-id/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/id-id/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/it-it/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/it-it/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/ja-jp/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/ja-jp/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/ko-kr/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/ko-kr/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/lt-lt/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/lt-lt/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/lv-lv/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/lv-lv/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/ms-my/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/ms-my/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/nb-no/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/nb-no/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/nl-nl/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/nl-nl/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/pl-pl/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/pl-pl/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/pt-br/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/pt-br/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/pt-pt/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/pt-pt/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/ro-ro/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/ro-ro/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/ru-ru/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/ru-ru/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/sk-sk/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/sk-sk/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/sl-si/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/sl-si/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/sr-latn-rs/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/sr-latn-rs/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/sv-se/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/sv-se/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/th-th/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/th-th/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/tr-tr/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/tr-tr/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/uk-ua/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/uk-ua/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/vi-vn/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/vi-vn/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/zh-cn/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/zh-cn/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/listing/zh-tw/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/appstore/listing/zh-tw/Screenshot1.png -------------------------------------------------------------------------------- /res/appstore/runme.ps1: -------------------------------------------------------------------------------- 1 | # PowerShell script to parse listing.csv and retrieve our screenshots 2 | # Copyright © 2023 Pete Batard 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | try { 18 | [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 19 | } catch {} 20 | 21 | # NB: All languages IDs from the .csv are lowercase version of the one 22 | # from rufus.loc, except for 'sr-RS' that becomes 'sr-latn-rs'. 23 | 24 | function GetCellByName([object]$csv, [string]$row_name, [string]$column_name) 25 | { 26 | foreach ($row in $csv | Where-Object {$_.Field -eq $row_name}) { 27 | foreach ($column in $row.PSObject.properties) { 28 | if ($column.name -eq $column_name) { 29 | return $column.value 30 | } 31 | } 32 | } 33 | return [string]::Empty 34 | } 35 | 36 | $csv = Import-Csv -Path .\listing.csv 37 | $langs = $csv | Select-Object -First 1 | Select * -ExcludeProperty 'Field','ID','Type (Type)','default' | ForEach-Object { $_.PSObject.Properties } | Select-Object -ExpandProperty Name 38 | 39 | foreach ($lang in $langs) { 40 | $null = New-Item $lang -ItemType Directory -Force 41 | $url = GetCellByName $csv 'DesktopScreenshot1' $lang 42 | # Annoying but heck if I'm gonna bother with Microsoft's Auth in PowerShell... 43 | Start-Process -NoNewWindow -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe" -ArgumentList "-new-tab $url" 44 | Write-Host $lang; 45 | $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown'); 46 | } 47 | -------------------------------------------------------------------------------- /res/dbx/amd64_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/amd64_DBXUpdate.bin -------------------------------------------------------------------------------- /res/dbx/arm64_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/arm64_DBXUpdate.bin -------------------------------------------------------------------------------- /res/dbx/arm_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/arm_DBXUpdate.bin -------------------------------------------------------------------------------- /res/dbx/dbx_info.h: -------------------------------------------------------------------------------- 1 | // Autogenerated - DO NOT EDIT 2 | 3 | #include 4 | #pragma once 5 | 6 | struct { 7 | char* url; 8 | uint64_t timestamp; 9 | } dbx_info[] = { 10 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin", 1740428422 }, 11 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin", 1740428422 }, 12 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin", 1740428422 }, 13 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin", 1740428422 }, 14 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin", 0 }, 15 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/riscv64/DBXUpdate.bin", 0 }, 16 | { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/loongarch64/DBXUpdate.bin", 0 }, 17 | }; 18 | -------------------------------------------------------------------------------- /res/dbx/ia64_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/ia64_DBXUpdate.bin -------------------------------------------------------------------------------- /res/dbx/loongarch64_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/loongarch64_DBXUpdate.bin -------------------------------------------------------------------------------- /res/dbx/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the official UEFI revocation databases, as provided by 2 | https://github.com/microsoft/secureboot_objects/tree/main/PostSignedObjects. 3 | 4 | These are used by Rufus to warn the user if a UEFI bootloader has been revoked. -------------------------------------------------------------------------------- /res/dbx/riscv64_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/riscv64_DBXUpdate.bin -------------------------------------------------------------------------------- /res/dbx/x86_DBXUpdate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/dbx/x86_DBXUpdate.bin -------------------------------------------------------------------------------- /res/freedos/COMMAND.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/COMMAND.COM -------------------------------------------------------------------------------- /res/freedos/DISPLAY.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/DISPLAY.EXE -------------------------------------------------------------------------------- /res/freedos/EGA.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA.CPX -------------------------------------------------------------------------------- /res/freedos/EGA10.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA10.CPX -------------------------------------------------------------------------------- /res/freedos/EGA11.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA11.CPX -------------------------------------------------------------------------------- /res/freedos/EGA12.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA12.CPX -------------------------------------------------------------------------------- /res/freedos/EGA13.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA13.CPX -------------------------------------------------------------------------------- /res/freedos/EGA14.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA14.CPX -------------------------------------------------------------------------------- /res/freedos/EGA15.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA15.CPX -------------------------------------------------------------------------------- /res/freedos/EGA16.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA16.CPX -------------------------------------------------------------------------------- /res/freedos/EGA17.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA17.CPX -------------------------------------------------------------------------------- /res/freedos/EGA18.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA18.CPX -------------------------------------------------------------------------------- /res/freedos/EGA2.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA2.CPX -------------------------------------------------------------------------------- /res/freedos/EGA3.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA3.CPX -------------------------------------------------------------------------------- /res/freedos/EGA4.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA4.CPX -------------------------------------------------------------------------------- /res/freedos/EGA5.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA5.CPX -------------------------------------------------------------------------------- /res/freedos/EGA6.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA6.CPX -------------------------------------------------------------------------------- /res/freedos/EGA7.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA7.CPX -------------------------------------------------------------------------------- /res/freedos/EGA8.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA8.CPX -------------------------------------------------------------------------------- /res/freedos/EGA9.CPX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/EGA9.CPX -------------------------------------------------------------------------------- /res/freedos/KERNEL.SYS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/KERNEL.SYS -------------------------------------------------------------------------------- /res/freedos/KEYB.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/KEYB.EXE -------------------------------------------------------------------------------- /res/freedos/KEYBOARD.SYS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/KEYBOARD.SYS -------------------------------------------------------------------------------- /res/freedos/KEYBRD2.SYS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/KEYBRD2.SYS -------------------------------------------------------------------------------- /res/freedos/KEYBRD3.SYS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/KEYBRD3.SYS -------------------------------------------------------------------------------- /res/freedos/KEYBRD4.SYS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/KEYBRD4.SYS -------------------------------------------------------------------------------- /res/freedos/MODE.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/freedos/MODE.COM -------------------------------------------------------------------------------- /res/freedos/readme.txt: -------------------------------------------------------------------------------- 1 | All of the executables found in this repository where extracted from FreeDOS v1.4: 2 | https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.4/FD14-FullUSB.zip 3 | 4 | o COMMAND.COM was extracted from packages\base\freecom.zip 5 | o DISPLAY.EXE was extracted from packages\base\display.zip 6 | o The EGA[#].CPX files were extracted from packages\base\cpidos.zip 7 | o KERNEL.SYS was taken from packages\base\kernel.zip (KERNL386.SYS) 8 | It was modified to have FORCELBA enabled (byte offset 0x0D set to 0x01) 9 | o KEYB.EXE was extracted from packages\base\keyb.zip 10 | o The KEYB###.SYS keyboard layouts were extracted from packages\base\keyb_lay.zip 11 | o MODE.COM was extracted from packages\base\mode.zip 12 | -------------------------------------------------------------------------------- /res/grub/grldr.mbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/grub/grldr.mbr -------------------------------------------------------------------------------- /res/grub/grub_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file contains the version string of the Grub4Dos 2.x binary embedded in Rufus. 3 | * Should be the same as the grub4dos_version file in the source Grub4Dos was compiled from. 4 | */ 5 | #define GRUB4DOS_VERSION "0.4.6a" 6 | -------------------------------------------------------------------------------- /res/grub/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the Grub4DOS boot records that are used by Rufus 2 | 3 | * grldr.mbr was taken from the official 2024-02-26 release from 4 | https://github.com/chenall/grub4dos/releases/tag/0.4.6a 5 | 6 | * Note that, for convenience reasons, the first 512 bytes from this grldr.mbr are 7 | *not* the ones that Rufus processes when writing the actual MBR (first 512 bytes). 8 | Instead, the byte array from src/ms-sys/inc/mbr_grub.h (whose content is identical) 9 | is what Rufus uses. If you have modified this file, and the MBR section is altered, 10 | be mindful that you also need to update the array in mbr_grub.h. 11 | 12 | * For details, see src/format.c, src/msys/br.c and src/msys/inc/mbr_grub.h. 13 | -------------------------------------------------------------------------------- /res/grub2/boot.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/grub2/boot.img -------------------------------------------------------------------------------- /res/grub2/core.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/grub2/core.img -------------------------------------------------------------------------------- /res/grub2/grub2_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file contains the version string of the GRUB 2.x binary embedded in Rufus. 3 | * Should be the same as GRUB's PACKAGE_VERSION in config.h. 4 | */ 5 | #pragma once 6 | 7 | #define GRUB2_PACKAGE_VERSION "2.12" 8 | -------------------------------------------------------------------------------- /res/grub2/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the Grub 2.0 boot records that are used by Rufus 2 | 3 | * boot.img and core.img were created from a patched (since the offcial GRUB 2.12 release is *BROKEN*): 4 | https://ftp.gnu.org/gnu/grub/grub-2.12.tar.xz 5 | on a Debian 12.5 x64 system using the commands: 6 | ./autogen.sh 7 | # --enable-boot-time for Manjaro Linux 8 | ./configure --disable-nls --enable-boot-time 9 | make -j4 10 | cd grub-core 11 | ../grub-mkimage -v -O i386-pc -d. -p\(hd0,msdos1\)/boot/grub biosdisk fat exfat ext2 ntfs ntfscomp part_msdos -o core.img 12 | 13 | * boot.img has been modified to nop the jump @ 0x66 as per grub2's setup.c comments: 14 | /* If DEST_DRIVE is a hard disk, enable the workaround, which is 15 | for buggy BIOSes which don't pass boot drive correctly. Instead, 16 | they pass 0x00 or 0x01 even when booted from 0x80. */ 17 | 18 | * Note that, for convenience reasons, the content of boot.img is *not* the one that 19 | Rufus processes when writing the MBR. 20 | Instead, the byte array from src/ms-sys/inc/mbr_grub2.h (whose content is identical) 21 | is what Rufus uses. If you modify these files, be mindful that you may also need 22 | to update the array in mbr_grub2.h. 23 | 24 | * For details, see src/format.c, src/msys/br.c and src/msys/inc/mbr_grub2.h. -------------------------------------------------------------------------------- /res/hogger/hogger.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Rufus: The Reliable USB Formatting Utility 3 | * Commandline hogger, C version 4 | * Copyright © 2014 Pete Batard 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | const char error_msg[] = "Unable to synchronize with UI application."; 23 | 24 | int __cdecl main(int argc_ansi, char** argv_ansi) 25 | { 26 | DWORD size; 27 | register HANDLE mutex, stdout; 28 | stdout = GetStdHandle(STD_OUTPUT_HANDLE); 29 | mutex = OpenMutexA(SYNCHRONIZE, FALSE, "Global/Rufus_CmdLine"); 30 | if (mutex == NULL) 31 | goto error; 32 | WaitForSingleObject(mutex, INFINITE); 33 | goto out; 34 | 35 | error: 36 | WriteFile(stdout, error_msg, sizeof(error_msg), &size, 0); 37 | 38 | out: 39 | ExitProcess(0); 40 | } 41 | -------------------------------------------------------------------------------- /res/hogger/hogger.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/hogger/hogger.exe -------------------------------------------------------------------------------- /res/icons/hash-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/hash-16.png -------------------------------------------------------------------------------- /res/icons/hash-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/hash-24.png -------------------------------------------------------------------------------- /res/icons/hash-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/hash-32.png -------------------------------------------------------------------------------- /res/icons/info-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/info-16.png -------------------------------------------------------------------------------- /res/icons/info-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/info-24.png -------------------------------------------------------------------------------- /res/icons/info-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/info-32.png -------------------------------------------------------------------------------- /res/icons/lang-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/lang-16.png -------------------------------------------------------------------------------- /res/icons/lang-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/lang-24.png -------------------------------------------------------------------------------- /res/icons/lang-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/lang-32.png -------------------------------------------------------------------------------- /res/icons/license.txt: -------------------------------------------------------------------------------- 1 | Please note the following licensing information for the icons: 2 | 3 | o rufus*.* - Public Domain, courtesy of PC Unleashed 4 | http://pcunleashed.com 5 | 6 | o hash-*.png, info-*.png, lang-*.png, log-*.png, save-*.png, settings-*.png 7 | From Axialis Fluent Pro 2018 Icon Set 8 | CC BY-ND 4.0 when used as native resolution bitmaps, Commercial License otherwise 9 | See https://www.axialis.com/icongenerator/iconset-license.html#free 10 | 11 | o setup.ico 12 | Base SVG from https://tablericons.com/ 13 | No attribution required. 14 | With arrow overlay from Axialis Icon Set. 15 | 16 | NB: To be on the safe side with regards to icon use and redistribution, we 17 | did purchase a Commercial License for the Axialis icons. 18 | If you are planning to use these icons outside of this project, you may 19 | need to contact Axialis Software to clarify the extent to which you are 20 | legally entitled to do so. 21 | -------------------------------------------------------------------------------- /res/icons/log-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/log-16.png -------------------------------------------------------------------------------- /res/icons/log-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/log-24.png -------------------------------------------------------------------------------- /res/icons/log-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/log-32.png -------------------------------------------------------------------------------- /res/icons/log.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/icons/rufus-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-128.png -------------------------------------------------------------------------------- /res/icons/rufus-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-150.png -------------------------------------------------------------------------------- /res/icons/rufus-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-16.png -------------------------------------------------------------------------------- /res/icons/rufus-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-24.png -------------------------------------------------------------------------------- /res/icons/rufus-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-256.png -------------------------------------------------------------------------------- /res/icons/rufus-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-32.png -------------------------------------------------------------------------------- /res/icons/rufus-44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-44.png -------------------------------------------------------------------------------- /res/icons/rufus-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-48.png -------------------------------------------------------------------------------- /res/icons/rufus-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-512.png -------------------------------------------------------------------------------- /res/icons/rufus-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-64.png -------------------------------------------------------------------------------- /res/icons/rufus-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus-72.png -------------------------------------------------------------------------------- /res/icons/rufus.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/rufus.ico -------------------------------------------------------------------------------- /res/icons/save-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/save-16.png -------------------------------------------------------------------------------- /res/icons/save-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/save-24.png -------------------------------------------------------------------------------- /res/icons/save-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/save-32.png -------------------------------------------------------------------------------- /res/icons/settings-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/settings-16.png -------------------------------------------------------------------------------- /res/icons/settings-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/settings-24.png -------------------------------------------------------------------------------- /res/icons/settings-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/settings-32.png -------------------------------------------------------------------------------- /res/icons/setup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/icons/setup.ico -------------------------------------------------------------------------------- /res/icons/setup.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/loc/Makefile.am: -------------------------------------------------------------------------------- 1 | all-local: embedded.loc 2 | 3 | BUILT_SOURCES = embedded.loc 4 | noinst_PROGRAMS = 5 | noinst_EXES = 6 | 7 | AM_V_SED_0 = @echo " SED $<";$(SED) 8 | AM_V_SED_1 = $(SED) 9 | AM_V_SED_ = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY)) 10 | AM_V_SED = $(AM_V_SED_$(V)) 11 | 12 | embedded.loc: rufus.loc 13 | $(AM_V_SED) -f $(srcdir)/embedded.sed $< > $@ 14 | 15 | clean-local: 16 | -rm -rf embedded.loc 17 | -------------------------------------------------------------------------------- /res/loc/embedded.sed: -------------------------------------------------------------------------------- 1 | # This sed script removes everything we don't need from rufus.loc, for embedding. 2 | 3 | # remove comments (but not so aggressively as to drop the end of MSG_298!) 4 | s/^#.*$// 5 | s/[ \t]#.*$// 6 | 7 | # remove empty lines 8 | /^$/d 9 | 10 | # remove trailing whitespaces 11 | s/[ \t]*$// 12 | 13 | # remove the UI controls for "en-US" as they are just here for translators 14 | # 1,300 means we only do this for the the first 300 lines 15 | 1,300 {/^g IDD_DIALOG/,/^t MSG_001/{/^t MSG_001/!d}} 16 | 17 | # remove the Windows AppStore specific messages 18 | /MSG_9/d 19 | 20 | # output file *MUST* be CR/LF 21 | s/$/\r/ -------------------------------------------------------------------------------- /res/loc/pollock/Pollock.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2035 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pollock", "Pollock.csproj", "{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {E598CE39-98F7-4F0F-BF91-3C29C30919F9} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /res/loc/pollock/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/loc/pollock/pollock.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/loc/pollock/pollock.ico -------------------------------------------------------------------------------- /res/loc/test/arch_trunc.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/loc/test/arch_trunc.iso -------------------------------------------------------------------------------- /res/loc/test/casper_test.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/loc/test/casper_test.iso -------------------------------------------------------------------------------- /res/loc/test/esp_test.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/loc/test/esp_test.iso -------------------------------------------------------------------------------- /res/loc/test/menu_c32_test.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/loc/test/menu_c32_test.iso -------------------------------------------------------------------------------- /res/loc/test/windows_to_go.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/loc/test/windows_to_go.iso -------------------------------------------------------------------------------- /res/mbr/mbr.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_ARCH(i8086) 2 | MEMORY { MBR (rx) : org = 0x7c00 , len = 0x200 } 3 | SECTIONS { 4 | ENTRY(mbr) 5 | .main 0x7c00 : { *(main) } 6 | .igot 0x0000 : { *(.igot.plt) } 7 | } 8 | -------------------------------------------------------------------------------- /res/mbr/msg.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/mbr/msg.bin -------------------------------------------------------------------------------- /res/mbr/msg.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/mbr/msg.txt -------------------------------------------------------------------------------- /res/md5/bootaa64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/md5/bootaa64.efi -------------------------------------------------------------------------------- /res/md5/bootarm.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/md5/bootarm.efi -------------------------------------------------------------------------------- /res/md5/bootia32.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/md5/bootia32.efi -------------------------------------------------------------------------------- /res/md5/bootloongarch64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/md5/bootloongarch64.efi -------------------------------------------------------------------------------- /res/md5/bootriscv64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/md5/bootriscv64.efi -------------------------------------------------------------------------------- /res/md5/bootx64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/md5/bootx64.efi -------------------------------------------------------------------------------- /res/md5/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the uefi-md5sum bootloaders added by Rufus for media validation. 2 | 3 | See https://github.com/pbatard/uefi-md5sum for details. 4 | -------------------------------------------------------------------------------- /res/rufus.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/rufus.ico -------------------------------------------------------------------------------- /res/setup/.editorconfig: -------------------------------------------------------------------------------- 1 | # indicate this is the root of the project 2 | root = true 3 | 4 | [*] 5 | indent_style = tab 6 | indent_size = 4 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | charset = utf-8 10 | -------------------------------------------------------------------------------- /res/setup/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by setup.rc 4 | // 5 | #define IDI_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /res/setup/setup.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/setup/setup.rc -------------------------------------------------------------------------------- /res/setup/setup.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29926.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "setup", "setup.vcxproj", "{6C2BED99-5A0A-42A2-AEBE-66717FA92232}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|arm64 = Debug|arm64 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|arm64 = Release|arm64 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|arm64.ActiveCfg = Debug|ARM64 19 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|arm64.Build.0 = Debug|ARM64 20 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x64.ActiveCfg = Debug|x64 21 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x64.Build.0 = Debug|x64 22 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x86.ActiveCfg = Debug|Win32 23 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x86.Build.0 = Debug|Win32 24 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|arm64.ActiveCfg = Release|ARM64 25 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|arm64.Build.0 = Release|ARM64 26 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x64.ActiveCfg = Release|x64 27 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x64.Build.0 = Release|x64 28 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x86.ActiveCfg = Release|Win32 29 | {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x86.Build.0 = Release|Win32 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {7994FC0C-9D7C-4AD7-855B-C3525FD8709A} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /res/setup/setup.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {e9f75410-9e5d-4ea8-b75a-0c45bb23e331} 10 | 11 | 12 | 13 | 14 | Source Files 15 | 16 | 17 | 18 | 19 | Resources 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /res/setup/setup_arm64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/setup/setup_arm64.exe -------------------------------------------------------------------------------- /res/setup/setup_x64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/setup/setup_x64.exe -------------------------------------------------------------------------------- /res/syslinux/ldlinux_v4.bss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/syslinux/ldlinux_v4.bss -------------------------------------------------------------------------------- /res/syslinux/ldlinux_v4.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/syslinux/ldlinux_v4.sys -------------------------------------------------------------------------------- /res/syslinux/ldlinux_v6.bss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/syslinux/ldlinux_v6.bss -------------------------------------------------------------------------------- /res/syslinux/ldlinux_v6.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/syslinux/ldlinux_v6.sys -------------------------------------------------------------------------------- /res/syslinux/mboot.c32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/syslinux/mboot.c32 -------------------------------------------------------------------------------- /res/syslinux/readme.txt: -------------------------------------------------------------------------------- 1 | o ldlinux_v4.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-4.07/core/ 2 | o ldlinux_v6.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-6.04-pre1/bios/core/ 3 | o mboot.c32 comes from syslinux-4.07/com32/mboot 4 | http://www.kernel.org/pub/linux/utils/boot/syslinux/ -------------------------------------------------------------------------------- /res/uefi/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a flat image of the FAT UEFI:NTFS partition added by 2 | Rufus for NTFS and exFAT UEFI boot support. 3 | 4 | See https://github.com/pbatard/uefi-ntfs for more details. 5 | 6 | This image, which can be mounted as a FAT file system or opened in 7-zip, 7 | contains the following data: 8 | 9 | o Secure Boot signed NTFS UEFI drivers, derived from ntfs-3g [1]. 10 | These drivers are the exact same as the read-only binaries from release 1.7, 11 | except for the addition of Microsoft's Secure Boot signature. 12 | Note that, per Microsoft's current Secure Boot signing policies, the 32-bit 13 | ARM driver (ntfs_arm.efi) is not Secure Boot signed. 14 | 15 | o Non Secure Boot signed exFAT UEFI drivers from EfiFs [2]. 16 | These drivers are the exact same as the binaries from EfiFs release 1.9 but, 17 | because they are licensed under GPLv3, cannot be Secure Boot signed. 18 | 19 | o Secure Boot signed UEFI:NTFS bootloader binaries [3]. 20 | These drivers are the exact same as the binaries from release 2.3, except for 21 | the addition of Microsoft's Secure Boot signature. 22 | Note that, per Microsoft's current Secure Boot signing policies, the 32-bit 23 | ARM bootloader (bootarm.efi) is not Secure Boot signed. 24 | 25 | The above means that, if booting an NTFS partition on an x86_32, x86_64 or ARM64 26 | system, Secure Boot does not need to be disabled. 27 | 28 | The FAT partition was created on Debian GNU/Linux using the following commands 29 | dd if=/dev/zero of=uefi-ntfs.img bs=512 count=2048 30 | mkfs.vfat -n UEFI_NTFS uefi-ntfs.img 31 | and then mounting the uefi-ntfs.img image and copying the relevant files. 32 | 33 | [1] https://github.com/pbatard/ntfs-3g 34 | [2] https://github.com/pbatard/efifs 35 | [3] https://github.com/pbatard/uefi-ntfs 36 | -------------------------------------------------------------------------------- /res/uefi/uefi-ntfs.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/res/uefi/uefi-ntfs.img -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | # indicate this is the root of the project 2 | root = true 3 | 4 | [*] 5 | trim_trailing_whitespace = true 6 | insert_final_newline = true 7 | # Finally, having a default of UTF-8 *without* BOM got fixed in VS2017 15.3 8 | charset = utf-8 9 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc 2 | # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: 3 | NONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll 4 | # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: 5 | # See https://github.com/pbatard/rufus/issues/2272 6 | VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib 7 | 8 | noinst_PROGRAMS = rufus 9 | 10 | AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES) 11 | AM_V_WINDRES_1 = $(WINDRES) 12 | AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) 13 | AM_V_WINDRES = $(AM_V_WINDRES_$(V)) 14 | 15 | %_rc.o: %.rc ../res/loc/embedded.loc 16 | $(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@ 17 | 18 | rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ 19 | localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c 20 | rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ 21 | -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus 22 | rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw 23 | rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ 24 | libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) 25 | -------------------------------------------------------------------------------- /src/badblocks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * badblocks.c - Bad blocks checker 3 | * 4 | * Copyright (C) 1992, 1993, 1994 Remy Card 5 | * Laboratoire MASI, Institut Blaise Pascal 6 | * Universite Pierre et Marie Curie (Paris VI) 7 | * 8 | * Copyright 1995, 1996, 1997, 1998, 1999 by Theodore Ts'o 9 | * Copyright 1999 by David Beattie 10 | * Copyright 2011-2024 by Pete Batard 11 | * 12 | * This file is based on the minix file system programs fsck and mkfs 13 | * written and copyrighted by Linus Torvalds 14 | * 15 | * %Begin-Header% 16 | * This file may be redistributed under the terms of the GNU Public 17 | * License. 18 | * %End-Header% 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include "ext2fs/ext2fs.h" 25 | 26 | typedef struct bb_struct_u64_list *bb_badblocks_list; 27 | typedef struct bb_struct_u64_iterate *bb_badblocks_iterate; 28 | typedef struct bb_struct_u64_list *bb_u64_list; 29 | typedef struct bb_struct_u64_iterate *bb_u64_iterate; 30 | 31 | #define BB_ET_NO_MEMORY RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY) 32 | #define BB_ET_MAGIC_BADBLOCKS_LIST RUFUS_ERROR(ERROR_OBJECT_IN_LIST) 33 | #define BB_ET_MAGIC_BADBLOCKS_ITERATE RUFUS_ERROR(ERROR_INVALID_BLOCK) 34 | 35 | #define BB_CHECK_MAGIC(struct, code) if ((struct)->magic != (code)) return (code) 36 | #define BB_BAD_BLOCKS_THRESHOLD 256 37 | #define BB_BLOCKS_AT_ONCE 64 38 | #define BB_SYS_PAGE_SIZE 4096 39 | 40 | enum error_types { READ_ERROR, WRITE_ERROR, CORRUPTION_ERROR }; 41 | enum op_type { OP_READ, OP_WRITE }; 42 | 43 | /* 44 | * Badblocks report 45 | */ 46 | typedef struct { 47 | uint32_t bb_count; 48 | uint32_t num_read_errors; 49 | uint32_t num_write_errors; 50 | uint32_t num_corruption_errors; 51 | } badblocks_report; 52 | 53 | /* 54 | * Shared prototypes 55 | */ 56 | BOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, int nb_passes, 57 | int flash_type, badblocks_report *report, FILE* fd); 58 | -------------------------------------------------------------------------------- /src/bled/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libbled.a 2 | 3 | libbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c decompress_bunzip2.c \ 4 | decompress_gunzip.c decompress_uncompress.c decompress_unlzma.c decompress_unxz.c decompress_unzip.c \ 5 | decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \ 6 | find_list_entry.c fse_decompress.c header_list.c header_skip.c header_verbose_list.c huf_decompress.c \ 7 | init_handle.c open_transformer.c seek_by_jump.c seek_by_read.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ 8 | xxhash.c zstd_common.c zstd_decompress.c zstd_decompress_block.c zstd_ddict.c zstd_entropy_common.c \ 9 | zstd_error_private.c 10 | libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing 11 | -------------------------------------------------------------------------------- /src/bled/data_align.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary) 9 | { 10 | unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; 11 | 12 | archive_handle->seek(archive_handle->src_fd, skip_amount); 13 | archive_handle->offset += skip_amount; 14 | } 15 | -------------------------------------------------------------------------------- /src/bled/data_skip.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC data_skip(archive_handle_t *archive_handle) 9 | { 10 | archive_handle->seek(archive_handle->src_fd, archive_handle->file_header->size); 11 | } 12 | -------------------------------------------------------------------------------- /src/bled/filter_accept_all.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Copyright (C) 2002 by Glenn McGrath 4 | * 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 | */ 7 | #include "libbb.h" 8 | #include "bb_archive.h" 9 | 10 | /* Accept any non-null name, its not really a filter at all */ 11 | char FAST_FUNC filter_accept_all(archive_handle_t *archive_handle) 12 | { 13 | if (archive_handle->file_header->name) 14 | return EXIT_SUCCESS; 15 | return EXIT_FAILURE; 16 | } 17 | -------------------------------------------------------------------------------- /src/bled/filter_accept_list.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Copyright (C) 2002 by Glenn McGrath 4 | * 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 | */ 7 | #include "libbb.h" 8 | #include "bb_archive.h" 9 | 10 | /* 11 | * Accept names that are in the accept list, ignoring reject list. 12 | */ 13 | char FAST_FUNC filter_accept_list(archive_handle_t *archive_handle) 14 | { 15 | if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) 16 | return EXIT_SUCCESS; 17 | return EXIT_FAILURE; 18 | } 19 | -------------------------------------------------------------------------------- /src/bled/filter_accept_reject_list.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Copyright (C) 2002 by Glenn McGrath 4 | * 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 | */ 7 | 8 | #include "libbb.h" 9 | #include "bb_archive.h" 10 | 11 | /* 12 | * Accept names that are in the accept list and not in the reject list 13 | */ 14 | char FAST_FUNC filter_accept_reject_list(archive_handle_t *archive_handle) 15 | { 16 | const char *key; 17 | const llist_t *reject_entry; 18 | const llist_t *accept_entry; 19 | 20 | key = archive_handle->file_header->name; 21 | 22 | /* If the key is in a reject list fail */ 23 | reject_entry = find_list_entry2(archive_handle->reject, key); 24 | if (reject_entry) { 25 | return EXIT_FAILURE; 26 | } 27 | 28 | /* Fail if an accept list was specified and the key wasnt in there */ 29 | if (archive_handle->accept) { 30 | accept_entry = find_list_entry2(archive_handle->accept, key); 31 | if (!accept_entry) { 32 | return EXIT_FAILURE; 33 | } 34 | } 35 | 36 | /* Accepted */ 37 | return EXIT_SUCCESS; 38 | } 39 | -------------------------------------------------------------------------------- /src/bled/find_list_entry.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Copyright (C) 2002 by Glenn McGrath 4 | * 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 | */ 7 | 8 | #include "libbb.h" 9 | #include "bb_archive.h" 10 | 11 | /* Find a string in a shell pattern list */ 12 | const llist_t* FAST_FUNC find_list_entry(const llist_t *list, const char *filename) 13 | { 14 | while (list) { 15 | if (fnmatch(list->data, filename, 0) == 0) { 16 | return list; 17 | } 18 | list = list->link; 19 | } 20 | return NULL; 21 | } 22 | 23 | /* Same, but compares only path components present in pattern 24 | * (extra trailing path components in filename are assumed to match) 25 | */ 26 | const llist_t* FAST_FUNC find_list_entry2(const llist_t *list, const char *filename) 27 | { 28 | char buf[PATH_MAX]; 29 | int pattern_slash_cnt; 30 | const char *c; 31 | char *d; 32 | 33 | while (list) { 34 | c = list->data; 35 | pattern_slash_cnt = 0; 36 | while (*c) 37 | if (*c++ == '/') pattern_slash_cnt++; 38 | c = filename; 39 | d = buf; 40 | /* paranoia is better than buffer overflows */ 41 | while (*c && d != buf + sizeof(buf)-1) { 42 | if (*c == '/' && --pattern_slash_cnt < 0) 43 | break; 44 | *d++ = *c++; 45 | } 46 | *d = '\0'; 47 | if (fnmatch(list->data, buf, 0) == 0) { 48 | return list; 49 | } 50 | list = list->link; 51 | } 52 | return NULL; 53 | } 54 | -------------------------------------------------------------------------------- /src/bled/header_list.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC header_list(const file_header_t *file_header) 9 | { 10 | //TODO: cpio -vp DIR should output "DIR/NAME", not just "NAME" */ 11 | puts(file_header->name); 12 | } 13 | -------------------------------------------------------------------------------- /src/bled/header_skip.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC header_skip(const file_header_t *file_header UNUSED_PARAM) 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /src/bled/header_verbose_list.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) 9 | { 10 | struct tm tm_time; 11 | struct tm *ptm = &tm_time; //localtime(&file_header->mtime); 12 | 13 | #if ENABLE_FEATURE_TAR_UNAME_GNAME 14 | char uid[sizeof(int)*3 + 2]; 15 | /*char gid[sizeof(int)*3 + 2];*/ 16 | char *user; 17 | char *group; 18 | 19 | localtime_r(&file_header->mtime, ptm); 20 | 21 | user = file_header->tar__uname; 22 | if (user == NULL) { 23 | sprintf(uid, "%u", (unsigned)file_header->uid); 24 | user = uid; 25 | } 26 | group = file_header->tar__gname; 27 | if (group == NULL) { 28 | /*sprintf(gid, "%u", (unsigned)file_header->gid);*/ 29 | group = utoa(file_header->gid); 30 | } 31 | printf("%u %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", 32 | file_header->mode, 33 | user, 34 | group, 35 | file_header->size, 36 | 1900 + ptm->tm_year, 37 | 1 + ptm->tm_mon, 38 | ptm->tm_mday, 39 | ptm->tm_hour, 40 | ptm->tm_min, 41 | ptm->tm_sec, 42 | file_header->name); 43 | 44 | #else /* !FEATURE_TAR_UNAME_GNAME */ 45 | 46 | localtime_r(&file_header->mtime, ptm); 47 | 48 | printf("%u %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", 49 | file_header->mode, 50 | (unsigned)file_header->uid, 51 | (unsigned)file_header->gid, 52 | file_header->size, 53 | 1900 + ptm->tm_year, 54 | 1 + ptm->tm_mon, 55 | ptm->tm_mday, 56 | ptm->tm_hour, 57 | ptm->tm_min, 58 | ptm->tm_sec, 59 | file_header->name); 60 | 61 | #endif /* FEATURE_TAR_UNAME_GNAME */ 62 | 63 | /* NB: GNU tar shows "->" for symlinks and "link to" for hardlinks */ 64 | if (file_header->link_target) { 65 | printf(" -> %s", file_header->link_target); 66 | } 67 | bb_putchar('\n'); 68 | } 69 | -------------------------------------------------------------------------------- /src/bled/init_handle.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | archive_handle_t* FAST_FUNC init_handle(void) 9 | { 10 | archive_handle_t *archive_handle; 11 | 12 | /* Initialize default values */ 13 | archive_handle = xzalloc(sizeof(archive_handle_t)); 14 | if (archive_handle == NULL) 15 | return NULL; 16 | archive_handle->file_header = xzalloc(sizeof(file_header_t)); 17 | archive_handle->action_header = header_skip; 18 | archive_handle->action_data = data_skip; 19 | archive_handle->filter = filter_accept_all; 20 | archive_handle->seek = seek_by_jump; 21 | #if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM 22 | archive_handle->cpio__owner.uid = (uid_t)-1L; 23 | archive_handle->cpio__owner.gid = (gid_t)-1L; 24 | #endif 25 | 26 | return archive_handle; 27 | } 28 | -------------------------------------------------------------------------------- /src/bled/seek_by_jump.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC seek_by_jump(int fd, off_t amount) 9 | { 10 | if (amount 11 | && lseek(fd, amount, SEEK_CUR) == (off_t) -1 12 | ) { 13 | if (errno == ESPIPE) 14 | seek_by_read(fd, amount); 15 | else 16 | bb_perror_msg_and_die("seek failure"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/bled/seek_by_read.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | /* If we are reading through a pipe, or from stdin then we can't lseek, 9 | * we must read and discard the data to skip over it. 10 | */ 11 | void FAST_FUNC seek_by_read(int fd, off_t amount) 12 | { 13 | if (amount) 14 | bb_copyfd_exact_size(fd, -1, amount); 15 | } 16 | -------------------------------------------------------------------------------- /src/bled/xxhash.c: -------------------------------------------------------------------------------- 1 | /* 2 | * xxHash - Extremely Fast Hash algorithm 3 | * Copyright (c) Yann Collet - Meta Platforms, Inc 4 | * 5 | * This source code is licensed under both the BSD-style license (found in the 6 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found 7 | * in the COPYING file in the root directory of this source tree). 8 | * You may select, at your option, one of the above-listed licenses. 9 | */ 10 | 11 | /* 12 | * xxhash.c instantiates functions defined in xxhash.h 13 | */ 14 | 15 | #define XXH_STATIC_LINKING_ONLY /* access advanced declarations */ 16 | #define XXH_IMPLEMENTATION /* access definitions */ 17 | 18 | #include "xxhash.h" 19 | -------------------------------------------------------------------------------- /src/bled/xz_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions for handling the .xz file format 3 | * 4 | * Author: Lasse Collin 5 | * 6 | * This file has been put into the public domain. 7 | * You can do whatever you want with this file. 8 | */ 9 | 10 | #ifndef XZ_STREAM_H 11 | #define XZ_STREAM_H 12 | 13 | #if defined(__KERNEL__) && !XZ_INTERNAL_CRC32 14 | # include 15 | # undef crc32 16 | # define xz_crc32(buf, size, crc) \ 17 | (~crc32_le(~(uint32_t)(crc), buf, size)) 18 | #endif 19 | 20 | /* 21 | * See the .xz file format specification at 22 | * http://tukaani.org/xz/xz-file-format.txt 23 | * to understand the container format. 24 | */ 25 | 26 | #define STREAM_HEADER_SIZE 12 27 | 28 | #define HEADER_MAGIC "\xFD" "7zXZ" 29 | #define HEADER_MAGIC_SIZE 6 30 | 31 | #define FOOTER_MAGIC "YZ" 32 | #define FOOTER_MAGIC_SIZE 2 33 | 34 | /* 35 | * Variable-length integer can hold a 63-bit unsigned integer or a special 36 | * value indicating that the value is unknown. 37 | * 38 | * Experimental: vli_type can be defined to uint32_t to save a few bytes 39 | * in code size (no effect on speed). Doing so limits the uncompressed and 40 | * compressed size of the file to less than 256 MiB and may also weaken 41 | * error detection slightly. 42 | */ 43 | typedef uint64_t vli_type; 44 | 45 | #define VLI_MAX ((vli_type)-1 / 2) 46 | #define VLI_UNKNOWN ((vli_type)-1) 47 | 48 | /* Maximum encoded size of a VLI */ 49 | #define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7) 50 | 51 | /* Integrity Check types */ 52 | enum xz_check { 53 | XZ_CHECK_NONE = 0, 54 | XZ_CHECK_CRC32 = 1, 55 | XZ_CHECK_CRC64 = 4, 56 | XZ_CHECK_SHA256 = 10 57 | }; 58 | 59 | /* Maximum possible Check ID */ 60 | #define XZ_CHECK_MAX 15 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/bled/zstd_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under both the BSD-style license (found in the 6 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found 7 | * in the COPYING file in the root directory of this source tree). 8 | * You may select, at your option, one of the above-listed licenses. 9 | */ 10 | 11 | 12 | 13 | /*-************************************* 14 | * Dependencies 15 | ***************************************/ 16 | #define ZSTD_DEPS_NEED_MALLOC 17 | #include "zstd_error_private.h" 18 | #include "zstd_internal.h" 19 | 20 | 21 | /*-**************************************** 22 | * Version 23 | ******************************************/ 24 | unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; } 25 | 26 | const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; } 27 | 28 | 29 | /*-**************************************** 30 | * ZSTD Error Management 31 | ******************************************/ 32 | #undef ZSTD_isError /* defined within zstd_internal.h */ 33 | /*! ZSTD_isError() : 34 | * tells if a return value is an error code 35 | * symbol is required for external callers */ 36 | unsigned ZSTD_isError(size_t code) { return ERR_isError(code); } 37 | 38 | /*! ZSTD_getErrorName() : 39 | * provides error code string from function result (useful for debugging) */ 40 | const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); } 41 | 42 | /*! ZSTD_getError() : 43 | * convert a `size_t` function result into a proper ZSTD_errorCode enum */ 44 | ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); } 45 | 46 | /*! ZSTD_getErrorString() : 47 | * provides error code string from enum */ 48 | const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); } 49 | -------------------------------------------------------------------------------- /src/bled/zstd_config.h: -------------------------------------------------------------------------------- 1 | #ifndef ZSTD_CONFIG 2 | #define ZSTD_CONFIG 3 | 4 | #define ZSTD_DEBUGLEVEL 0 5 | #define ZSTD_LEGACY_SUPPORT 0 6 | #define ZSTD_LIB_DEPRECATED 0 7 | #define ZSTD_NO_UNUSED_FUNCTIONS 1 8 | #define ZSTD_STRIP_ERROR_STRINGS 0 9 | #define ZSTD_TRACE 0 10 | #define ZSTD_DECOMPRESS_DICTIONARY 0 11 | #define ZSTD_DECOMPRESS_MULTIFRAME 0 12 | #define ZSTD_NO_TRACE 1 13 | 14 | #if CONFIG_FEATURE_ZSTD_SMALL >= 9 15 | #define ZSTD_NO_INLINE 1 16 | #endif 17 | 18 | #if CONFIG_FEATURE_ZSTD_SMALL >= 7 19 | #define HUF_FORCE_DECOMPRESS_X1 1 20 | #define ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT 1 21 | #elif CONFIG_FEATURE_ZSTD_SMALL >= 5 22 | #define HUF_FORCE_DECOMPRESS_X1 1 23 | #endif 24 | 25 | #if CONFIG_FEATURE_ZSTD_SMALL <= 7 26 | /* doesnt blow up code too much, -O3 is horrible */ 27 | #ifdef __GNUC__ 28 | #pragma GCC optimize ("O2") 29 | #endif 30 | #endif 31 | 32 | #if CONFIG_FEATURE_ZSTD_SMALL > 0 33 | /* no dynamic detection of bmi2 instruction, 34 | * prefer using CFLAGS setting to -march=haswell or similar */ 35 | # if !defined(__BMI2__) 36 | # define DYNAMIC_BMI2 0 37 | # endif 38 | #endif 39 | 40 | #ifdef __GNUC__ 41 | #pragma GCC diagnostic push 42 | #pragma GCC diagnostic ignored "-Wunused-function" 43 | #endif 44 | 45 | #ifndef __has_attribute 46 | #define __has_attribute(x) 0 47 | #endif 48 | #ifndef __has_builtin 49 | #define __has_builtin(x) 0 50 | #endif 51 | #ifndef __has_feature 52 | #define __has_feature(x) 0 53 | #endif 54 | 55 | /* Include zstd_deps.h first with all the options we need enabled. */ 56 | #define ZSTD_DEPS_NEED_MALLOC 57 | #define ZSTD_DEPS_NEED_MATH64 58 | #define ZSTD_DEPS_NEED_STDINT 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/bled/zstd_ddict.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under both the BSD-style license (found in the 6 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found 7 | * in the COPYING file in the root directory of this source tree). 8 | * You may select, at your option, one of the above-listed licenses. 9 | */ 10 | 11 | 12 | #ifndef ZSTD_DDICT_H 13 | #define ZSTD_DDICT_H 14 | 15 | /*-******************************************************* 16 | * Dependencies 17 | *********************************************************/ 18 | #include "zstd_deps.h" /* size_t */ 19 | #include "zstd.h" /* ZSTD_DDict, and several public functions */ 20 | 21 | 22 | /*-******************************************************* 23 | * Interface 24 | *********************************************************/ 25 | 26 | /* note: several prototypes are already published in `zstd.h` : 27 | * ZSTD_createDDict() 28 | * ZSTD_createDDict_byReference() 29 | * ZSTD_createDDict_advanced() 30 | * ZSTD_freeDDict() 31 | * ZSTD_initStaticDDict() 32 | * ZSTD_sizeof_DDict() 33 | * ZSTD_estimateDDictSize() 34 | * ZSTD_getDictID_fromDict() 35 | */ 36 | 37 | const void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict); 38 | size_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict); 39 | 40 | void ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); 41 | 42 | 43 | 44 | #endif /* ZSTD_DDICT_H */ 45 | -------------------------------------------------------------------------------- /src/efi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Rufus: The Reliable USB Formatting Utility 3 | * UEFI constants and structs 4 | * Copyright © 2025 Pete Batard 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #pragma pack(1) 24 | 25 | typedef struct { 26 | UINT16 Year; 27 | UINT8 Month; 28 | UINT8 Day; 29 | UINT8 Hour; 30 | UINT8 Minute; 31 | UINT8 Second; 32 | UINT8 Pad1; 33 | UINT32 Nanosecond; 34 | INT16 TimeZone; 35 | UINT8 Daylight; 36 | UINT8 Pad2; 37 | } EFI_TIME; 38 | 39 | typedef struct _WIN_CERTIFICATE { 40 | UINT32 dwLength; 41 | UINT16 wRevision; 42 | UINT16 wCertificateType; 43 | } WIN_CERTIFICATE; 44 | 45 | typedef struct _WIN_CERTIFICATE_UEFI_GUID { 46 | WIN_CERTIFICATE Hdr; 47 | GUID CertType; 48 | UINT8 CertData[1]; 49 | } WIN_CERTIFICATE_UEFI_GUID; 50 | 51 | typedef struct { 52 | EFI_TIME TimeStamp; 53 | WIN_CERTIFICATE_UEFI_GUID AuthInfo; 54 | } EFI_VARIABLE_AUTHENTICATION_2; 55 | 56 | typedef struct { 57 | GUID SignatureOwner; 58 | UINT8 SignatureData[1]; 59 | } EFI_SIGNATURE_DATA; 60 | 61 | typedef struct { 62 | GUID SignatureType; 63 | UINT32 SignatureListSize; 64 | UINT32 SignatureHeaderSize; 65 | UINT32 SignatureSize; 66 | } EFI_SIGNATURE_LIST; 67 | 68 | #pragma pack() 69 | 70 | const GUID EFI_CERT_SHA256_GUID = { 0xc1c41626, 0x504c, 0x4092, { 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 } }; 71 | -------------------------------------------------------------------------------- /src/ext2fs/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = tab 3 | tab_width = 8 4 | -------------------------------------------------------------------------------- /src/ext2fs/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libext2fs.a 2 | 3 | libext2fs_a_SOURCES = alloc.c alloc_sb.c alloc_stats.c alloc_tables.c badblocks.c bb_inode.c bitmaps.c \ 4 | bitops.c blkmap64_ba.c blkmap64_rb.c blknum.c block.c bmap.c closefs.c crc16.c crc32c.c \ 5 | csum.c dirblock.c dirhash.c dir_iterate.c extent.c ext_attr.c extent.c fallocate.c fileio.c \ 6 | freefs.c gen_bitmap.c gen_bitmap64.c get_num_dirs.c hashmap.c i_block.c ind_block.c initialize.c \ 7 | inline.c inline_data.c inode.c io_manager.c link.c lookup.c mkdir.c mkjournal.c namei.c mmp.c \ 8 | newdir.c nt_io.c openfs.c punch.c rbtree.c read_bb.c rw_bitmaps.c sha512.c symlink.c valid_blk.c 9 | 10 | libext2fs_a_CFLAGS = $(AM_CFLAGS) -DEXT2_FLAT_INCLUDES=0 -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing -Wno-shadow 11 | -------------------------------------------------------------------------------- /src/ext2fs/crc16.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crc16.h - CRC-16 routine 3 | * 4 | * Implements the standard CRC-16: 5 | * Width 16 6 | * Poly 0x8005 (x16 + x15 + x2 + 1) 7 | * Init 0 8 | * 9 | * Copyright (c) 2005 Ben Gardner 10 | * 11 | * This source code is licensed under the GNU General Public License, 12 | * Version 2. See the file COPYING for more details. 13 | */ 14 | 15 | #ifndef __CRC16_H 16 | #define __CRC16_H 17 | 18 | /* for an unknown reason, PPC treats __u16 as signed and keeps doing sign 19 | * extension on the value. Instead, use only the low 16 bits of an 20 | * unsigned int for holding the CRC value to avoid this. 21 | */ 22 | typedef unsigned int crc16_t; 23 | 24 | extern crc16_t ext2fs_crc16(crc16_t crc, const void *buffer, unsigned int len); 25 | 26 | #endif /* __CRC16_H */ 27 | -------------------------------------------------------------------------------- /src/ext2fs/crc32c_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * There are multiple 16-bit CRC polynomials in common use, but this is 3 | * *the* standard CRC-32 polynomial, first popularized by Ethernet. 4 | * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0 5 | */ 6 | #define CRCPOLY_LE 0xedb88320 7 | #define CRCPOLY_BE 0x04c11db7 8 | 9 | /* 10 | * This is the CRC32c polynomial, as outlined by Castagnoli. 11 | * x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+x^19+x^18+x^14+x^13+x^11+x^10+x^9+ 12 | * x^8+x^6+x^0 13 | */ 14 | #define CRC32C_POLY_LE 0x82F63B78 15 | #define CRC32C_POLY_BE 0x1EDC6F41 16 | 17 | /* How many bits at a time to use. Valid values are 1, 2, 4, 8, 32 and 64. */ 18 | /* For less performance-sensitive, use 4 */ 19 | #ifndef CRC_LE_BITS 20 | # define CRC_LE_BITS 64 21 | #endif 22 | #ifndef CRC_BE_BITS 23 | # define CRC_BE_BITS 64 24 | #endif 25 | 26 | /* 27 | * Little-endian CRC computation. Used with serial bit streams sent 28 | * lsbit-first. Be sure to use cpu_to_le32() to append the computed CRC. 29 | */ 30 | #if CRC_LE_BITS > 64 || CRC_LE_BITS < 1 || CRC_LE_BITS == 16 || \ 31 | CRC_LE_BITS & CRC_LE_BITS-1 32 | # error "CRC_LE_BITS must be one of {1, 2, 4, 8, 32, 64}" 33 | #endif 34 | 35 | /* 36 | * Big-endian CRC computation. Used with serial bit streams sent 37 | * msbit-first. Be sure to use cpu_to_be32() to append the computed CRC. 38 | */ 39 | #if CRC_BE_BITS > 64 || CRC_BE_BITS < 1 || CRC_BE_BITS == 16 || \ 40 | CRC_BE_BITS & CRC_BE_BITS-1 41 | # error "CRC_BE_BITS must be one of {1, 2, 4, 8, 32, 64}" 42 | #endif 43 | 44 | 45 | #define ___constant_swab32(x) \ 46 | ((uint32_t)( \ 47 | (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ 48 | (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ 49 | (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ 50 | (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24))) 51 | 52 | 53 | #if (__GNUC__ >= 3) 54 | #define likely(x) __builtin_expect(!!(x), 1) 55 | #define unlikely(x) __builtin_expect(!!(x), 0) 56 | #else 57 | #define likely(x) (x) 58 | #define unlikely(x) (x) 59 | #endif 60 | -------------------------------------------------------------------------------- /src/ext2fs/e2image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * e2image.h --- header file describing the ext2 image format 3 | * 4 | * Copyright (C) 2000 Theodore Ts'o. 5 | * 6 | * Note: this uses the POSIX IO interfaces, unlike most of the other 7 | * functions in this library. So sue me. 8 | * 9 | * %Begin-Header% 10 | * This file may be redistributed under the terms of the GNU Library 11 | * General Public License, version 2. 12 | * %End-Header% 13 | */ 14 | 15 | struct ext2_image_hdr { 16 | __u32 magic_number; /* This must be EXT2_ET_MAGIC_E2IMAGE */ 17 | char magic_descriptor[16]; /* "Ext2 Image 1.0", w/ null padding */ 18 | char fs_hostname[64];/* Hostname of machine of image */ 19 | char fs_netaddr[32]; /* Network address */ 20 | __u32 fs_netaddr_type;/* 0 = IPV4, 1 = IPV6, etc. */ 21 | __u32 fs_device; /* Device number of image */ 22 | char fs_device_name[64]; /* Device name */ 23 | char fs_uuid[16]; /* UUID of filesystem */ 24 | __u32 fs_blocksize; /* Block size of the filesystem */ 25 | __u32 fs_reserved[8]; 26 | 27 | __u32 image_device; /* Device number of image file */ 28 | __u32 image_inode; /* Inode number of image file */ 29 | __u32 image_time; /* Time of image creation */ 30 | __u32 image_reserved[8]; 31 | 32 | __u32 offset_super; /* Byte offset of the sb and descriptors */ 33 | __u32 offset_inode; /* Byte offset of the inode table */ 34 | __u32 offset_inodemap; /* Byte offset of the inode bitmaps */ 35 | __u32 offset_blockmap; /* Byte offset of the inode bitmaps */ 36 | __u32 offset_reserved[8]; 37 | }; 38 | -------------------------------------------------------------------------------- /src/ext2fs/ext2_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * If linux/types.h is already been included, assume it has defined 3 | * everything we need. (cross fingers) Other header files may have 4 | * also defined the types that we need. 5 | */ 6 | #if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ 7 | !defined(_EXT2_TYPES_H)) 8 | #define _EXT2_TYPES_H 9 | 10 | #include 11 | 12 | #ifndef HAVE___U8 13 | #define HAVE___U8 14 | typedef uint8_t __u8; 15 | #endif /* HAVE___U8 */ 16 | 17 | #ifndef HAVE___S8 18 | #define HAVE___S8 19 | typedef int8_t __s8; 20 | #endif /* HAVE___S8 */ 21 | 22 | #ifndef HAVE___U16 23 | #define HAVE___U16 24 | typedef uint16_t __u16; 25 | #endif /* HAVE___U16 */ 26 | 27 | #ifndef HAVE___S16 28 | #define HAVE___S16 29 | typedef int16_t __s16; 30 | #endif /* HAVE___S16 */ 31 | 32 | #ifndef HAVE___U32 33 | #define HAVE___U32 34 | typedef uint32_t __u32; 35 | #endif /* HAVE___U32 */ 36 | 37 | #ifndef HAVE___S32 38 | #define HAVE___S32 39 | typedef int32_t __s32; 40 | #endif /* HAVE___S32 */ 41 | 42 | #ifndef HAVE___U64 43 | #define HAVE___U64 44 | typedef uint64_t __u64; 45 | #endif /* HAVE___U64 */ 46 | 47 | #ifndef HAVE___S64 48 | #define HAVE___S64 49 | typedef int64_t __s64; 50 | #endif /* HAVE___S64 */ 51 | 52 | #undef __S8_TYPEDEF 53 | #undef __U8_TYPEDEF 54 | #undef __S16_TYPEDEF 55 | #undef __U16_TYPEDEF 56 | #undef __S32_TYPEDEF 57 | #undef __U32_TYPEDEF 58 | #undef __S64_TYPEDEF 59 | #undef __U64_TYPEDEF 60 | 61 | #endif /* _*_TYPES_H */ 62 | 63 | /* endian checking stuff */ 64 | #ifndef EXT2_ENDIAN_H_ 65 | #define EXT2_ENDIAN_H_ 66 | 67 | #ifdef __CHECKER__ 68 | # ifndef __bitwise 69 | # define __bitwise __attribute__((bitwise)) 70 | # endif 71 | #define __force __attribute__((force)) 72 | #else 73 | # ifndef __bitwise 74 | # define __bitwise 75 | # endif 76 | #define __force 77 | #endif 78 | 79 | typedef __u16 __bitwise __le16; 80 | typedef __u32 __bitwise __le32; 81 | typedef __u64 __bitwise __le64; 82 | typedef __u16 __bitwise __be16; 83 | typedef __u32 __bitwise __be32; 84 | typedef __u64 __bitwise __be64; 85 | 86 | #endif /* EXT2_ENDIAN_H_ */ 87 | 88 | /* These defines are needed for the public ext2fs.h header file */ 89 | #define HAVE_SYS_TYPES_H 1 90 | #undef WORDS_BIGENDIAN 91 | -------------------------------------------------------------------------------- /src/ext2fs/ext4_acl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Ext4's on-disk acl format. From linux/fs/ext4/acl.h 3 | */ 4 | 5 | #define EXT4_ACL_VERSION 0x0001 6 | 7 | /* 23.2.5 acl_tag_t values */ 8 | 9 | #define ACL_UNDEFINED_TAG (0x00) 10 | #define ACL_USER_OBJ (0x01) 11 | #define ACL_USER (0x02) 12 | #define ACL_GROUP_OBJ (0x04) 13 | #define ACL_GROUP (0x08) 14 | #define ACL_MASK (0x10) 15 | #define ACL_OTHER (0x20) 16 | 17 | /* 23.3.6 acl_type_t values */ 18 | 19 | #define ACL_TYPE_ACCESS (0x8000) 20 | #define ACL_TYPE_DEFAULT (0x4000) 21 | 22 | /* 23.2.7 ACL qualifier constants */ 23 | 24 | #define ACL_UNDEFINED_ID ((id_t)-1) 25 | 26 | typedef struct { 27 | __le16 e_tag; 28 | __le16 e_perm; 29 | __le32 e_id; 30 | } ext4_acl_entry; 31 | 32 | typedef struct { 33 | __le16 e_tag; 34 | __le16 e_perm; 35 | } ext4_acl_entry_short; 36 | 37 | typedef struct { 38 | __le32 a_version; 39 | } ext4_acl_header; 40 | 41 | 42 | /* Supported ACL a_version fields */ 43 | #define POSIX_ACL_XATTR_VERSION 0x0002 44 | 45 | typedef struct { 46 | __le16 e_tag; 47 | __le16 e_perm; 48 | __le32 e_id; 49 | } posix_acl_xattr_entry; 50 | 51 | typedef struct { 52 | __le32 a_version; 53 | #if __GNUC_PREREQ (4, 8) 54 | #pragma GCC diagnostic push 55 | #pragma GCC diagnostic ignored "-Wpedantic" 56 | #endif 57 | posix_acl_xattr_entry a_entries[0]; 58 | #if __GNUC_PREREQ (4, 8) 59 | #pragma GCC diagnostic pop 60 | #endif 61 | } posix_acl_xattr_header; 62 | 63 | -------------------------------------------------------------------------------- /src/ext2fs/get_num_dirs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * get_num_dirs.c -- calculate number of directories 3 | * 4 | * Copyright 1997 by Theodore Ts'o 5 | * 6 | * %Begin-Header% 7 | * This file may be redistributed under the terms of the GNU Library 8 | * General Public License, version 2. 9 | * %End-Header% 10 | */ 11 | 12 | #include "config.h" 13 | #include 14 | #if HAVE_UNISTD_H 15 | #include 16 | #endif 17 | #include 18 | #include 19 | 20 | #include "ext2_fs.h" 21 | #include "ext2fsP.h" 22 | 23 | /* 24 | * Returns the number of directories in the filesystem as reported by 25 | * the group descriptors. Of course, the group descriptors could be 26 | * wrong! 27 | */ 28 | errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs) 29 | { 30 | dgrp_t i; 31 | ext2_ino_t num_dirs, max_dirs; 32 | 33 | EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); 34 | 35 | num_dirs = 0; 36 | max_dirs = fs->super->s_inodes_per_group; 37 | for (i = 0; i < fs->group_desc_count; i++) { 38 | if (ext2fs_bg_used_dirs_count(fs, i) > max_dirs) 39 | num_dirs += max_dirs / 8; 40 | else 41 | num_dirs += ext2fs_bg_used_dirs_count(fs, i); 42 | } 43 | if (num_dirs > fs->super->s_inodes_count) 44 | num_dirs = fs->super->s_inodes_count; 45 | 46 | *ret_num_dirs = num_dirs; 47 | 48 | return 0; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/ext2fs/hashmap.h: -------------------------------------------------------------------------------- 1 | #ifndef HASHMAP_H 2 | # define HASHMAP_H 3 | 4 | # include 5 | # include 6 | 7 | #ifndef __GNUC_PREREQ 8 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) 9 | #define __GNUC_PREREQ(maj, min) \ 10 | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 11 | #else 12 | #define __GNUC_PREREQ(maj, min) 0 13 | #endif 14 | #endif 15 | 16 | struct ext2fs_hashmap; 17 | 18 | struct ext2fs_hashmap_entry { 19 | void *data; 20 | const void *key; 21 | size_t key_len; 22 | struct ext2fs_hashmap_entry *next; 23 | struct ext2fs_hashmap_entry *list_next; 24 | struct ext2fs_hashmap_entry *list_prev; 25 | }; 26 | 27 | struct ext2fs_hashmap *ext2fs_hashmap_create( 28 | uint32_t(*hash_fct)(const void*, size_t), 29 | void(*free_fct)(void*), size_t size); 30 | void ext2fs_hashmap_add(struct ext2fs_hashmap *h, void *data, const void *key, 31 | size_t key_len); 32 | void *ext2fs_hashmap_lookup(struct ext2fs_hashmap *h, const void *key, 33 | size_t key_len); 34 | void *ext2fs_hashmap_iter_in_order(struct ext2fs_hashmap *h, 35 | struct ext2fs_hashmap_entry **it); 36 | void ext2fs_hashmap_del(struct ext2fs_hashmap *h, 37 | struct ext2fs_hashmap_entry *e); 38 | void ext2fs_hashmap_free(struct ext2fs_hashmap *h); 39 | 40 | uint32_t ext2fs_djb2_hash(const void *str, size_t size); 41 | 42 | #endif /* !HASHMAP_H */ 43 | -------------------------------------------------------------------------------- /src/ext2fs/ind_block.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ind_block.c --- indirect block I/O routines 3 | * 4 | * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 5 | * 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o. 6 | * 7 | * %Begin-Header% 8 | * This file may be redistributed under the terms of the GNU Library 9 | * General Public License, version 2. 10 | * %End-Header% 11 | */ 12 | 13 | #include "config.h" 14 | #include 15 | #include 16 | #if HAVE_UNISTD_H 17 | #include 18 | #endif 19 | 20 | #include "ext2_fs.h" 21 | #include "ext2fs.h" 22 | 23 | errcode_t ext2fs_read_ind_block(ext2_filsys fs, blk_t blk, void *buf) 24 | { 25 | errcode_t retval; 26 | #ifdef WORDS_BIGENDIAN 27 | blk_t *block_nr; 28 | int i; 29 | int limit = fs->blocksize >> 2; 30 | #endif 31 | 32 | if ((fs->flags & EXT2_FLAG_IMAGE_FILE) && 33 | (fs->io != fs->image_io)) 34 | memset(buf, 0, fs->blocksize); 35 | else { 36 | retval = io_channel_read_blk(fs->io, blk, 1, buf); 37 | if (retval) 38 | return retval; 39 | } 40 | #ifdef WORDS_BIGENDIAN 41 | block_nr = (blk_t *) buf; 42 | for (i = 0; i < limit; i++, block_nr++) 43 | *block_nr = ext2fs_swab32(*block_nr); 44 | #endif 45 | return 0; 46 | } 47 | 48 | errcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf) 49 | { 50 | #ifdef WORDS_BIGENDIAN 51 | blk_t *block_nr; 52 | int i; 53 | int limit = fs->blocksize >> 2; 54 | #endif 55 | 56 | if (fs->flags & EXT2_FLAG_IMAGE_FILE) 57 | return 0; 58 | 59 | #ifdef WORDS_BIGENDIAN 60 | block_nr = (blk_t *) buf; 61 | for (i = 0; i < limit; i++, block_nr++) 62 | *block_nr = ext2fs_swab32(*block_nr); 63 | #endif 64 | return io_channel_write_blk(fs->io, blk, 1, buf); 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/ext2fs/lookup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * lookup.c --- ext2fs directory lookup operations 3 | * 4 | * Copyright (C) 1993, 1994, 1994, 1995 Theodore Ts'o. 5 | * 6 | * %Begin-Header% 7 | * This file may be redistributed under the terms of the GNU Library 8 | * General Public License, version 2. 9 | * %End-Header% 10 | */ 11 | 12 | #include "config.h" 13 | #include 14 | #include 15 | #if HAVE_UNISTD_H 16 | #include 17 | #endif 18 | 19 | #include "ext2_fs.h" 20 | #include "ext2fs.h" 21 | 22 | struct lookup_struct { 23 | const char *name; 24 | int len; 25 | ext2_ino_t *inode; 26 | int found; 27 | }; 28 | 29 | #ifdef __TURBOC__ 30 | #pragma argsused 31 | #endif 32 | static int lookup_proc(struct ext2_dir_entry *dirent, 33 | int offset EXT2FS_ATTR((unused)), 34 | int blocksize EXT2FS_ATTR((unused)), 35 | char *buf EXT2FS_ATTR((unused)), 36 | void *priv_data) 37 | { 38 | struct lookup_struct *ls = (struct lookup_struct *) priv_data; 39 | 40 | if (ls->len != ext2fs_dirent_name_len(dirent)) 41 | return 0; 42 | if (strncmp(ls->name, dirent->name, ext2fs_dirent_name_len(dirent))) 43 | return 0; 44 | *ls->inode = dirent->inode; 45 | ls->found++; 46 | return DIRENT_ABORT; 47 | } 48 | 49 | 50 | errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name, 51 | int namelen, char *buf, ext2_ino_t *inode) 52 | { 53 | errcode_t retval; 54 | struct lookup_struct ls; 55 | 56 | EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); 57 | 58 | ls.name = name; 59 | ls.len = namelen; 60 | ls.inode = inode; 61 | ls.found = 0; 62 | 63 | retval = ext2fs_dir_iterate(fs, dir, 0, buf, lookup_proc, &ls); 64 | if (retval) 65 | return retval; 66 | 67 | return (ls.found) ? 0 : EXT2_ET_FILE_NOT_FOUND; 68 | } 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/ext2fs/valid_blk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * valid_blk.c --- does the inode have valid blocks? 3 | * 4 | * Copyright 1997 by Theodore Ts'o 5 | * 6 | * %Begin-Header% 7 | * This file may be redistributed under the terms of the GNU Library 8 | * General Public License, version 2. 9 | * %End-Header% 10 | */ 11 | 12 | #include "config.h" 13 | #include 14 | #if HAVE_UNISTD_H 15 | #include 16 | #endif 17 | #include 18 | #include 19 | 20 | #include "ext2_fs.h" 21 | #include "ext2fs.h" 22 | 23 | /* 24 | * This function returns 1 if the inode's block entries actually 25 | * contain block entries. 26 | */ 27 | int ext2fs_inode_has_valid_blocks2(ext2_filsys fs, struct ext2_inode *inode) 28 | { 29 | /* 30 | * Only directories, regular files, and some symbolic links 31 | * have valid block entries. 32 | */ 33 | if (!LINUX_S_ISDIR(inode->i_mode) && !LINUX_S_ISREG(inode->i_mode) && 34 | !LINUX_S_ISLNK(inode->i_mode)) 35 | return 0; 36 | 37 | /* 38 | * If the symbolic link is a "fast symlink", then the symlink 39 | * target is stored in the block entries. 40 | */ 41 | if (LINUX_S_ISLNK (inode->i_mode)) { 42 | if (ext2fs_file_acl_block(fs, inode) == 0) { 43 | /* With no EA block, we can rely on i_blocks */ 44 | if (inode->i_blocks == 0) 45 | return 0; 46 | } else { 47 | /* With an EA block, life gets more tricky */ 48 | if (inode->i_size >= EXT2_N_BLOCKS*4) 49 | return 1; /* definitely using i_block[] */ 50 | if (inode->i_size > 4 && inode->i_block[1] == 0) 51 | return 1; /* definitely using i_block[] */ 52 | return 0; /* Probably a fast symlink */ 53 | } 54 | } 55 | 56 | /* 57 | * If this inode has inline data, it shouldn't have valid block 58 | * entries. 59 | */ 60 | if (inode->i_flags & EXT4_INLINE_DATA_FL) 61 | return 0; 62 | return 1; 63 | } 64 | 65 | int ext2fs_inode_has_valid_blocks(struct ext2_inode *inode) 66 | { 67 | return ext2fs_inode_has_valid_blocks2(NULL, inode); 68 | } 69 | -------------------------------------------------------------------------------- /src/getopt/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | tab_width = 8 3 | -------------------------------------------------------------------------------- /src/libcdio/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | tab_width = 8 3 | -------------------------------------------------------------------------------- /src/libcdio/cdio/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 Robert Kausch 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | /*! 19 | * \file memory.h 20 | * 21 | * \brief memory management utility functions. 22 | * 23 | */ 24 | 25 | #ifndef CDIO_MEMORY_H_ 26 | #define CDIO_MEMORY_H_ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif /* __cplusplus */ 31 | 32 | /*! 33 | Free the passed pointer. 34 | */ 35 | void cdio_free(void *p_memory); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif /* __cplusplus */ 40 | 41 | #endif /* CDIO_MEMORY_H_ */ 42 | -------------------------------------------------------------------------------- /src/libcdio/cdio/posix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005, 2008, 2012 Rocky Bernstein 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | /*! 18 | * \file posix.h 19 | * 20 | * \brief various POSIX definitions. 21 | */ 22 | 23 | #ifndef CDIO_POSIX_H_ 24 | #define CDIO_POSIX_H_ 25 | 26 | typedef uint32_t posix_mode_t; 27 | typedef uint32_t posix_nlink_t; 28 | typedef uint32_t posix_uid_t; 29 | typedef uint32_t posix_gid_t; 30 | typedef uint16_t unicode16_t; 31 | 32 | #endif /* CDIO_POSIX_H_ */ 33 | 34 | 35 | /* 36 | * Local variables: 37 | * c-file-style: "gnu" 38 | * tab-width: 8 39 | * indent-tabs-mode: nil 40 | * End: 41 | */ 42 | -------------------------------------------------------------------------------- /src/libcdio/cdio/version.h: -------------------------------------------------------------------------------- 1 | /** \file version.h 2 | * 3 | * \brief A file containing the libcdio package version 4 | * number (20201) and OS build name. 5 | */ 6 | 7 | /*! CDIO_VERSION is a C-Preprocessor macro of a string that shows what 8 | version is used. cdio_version_string has the same value, but it is a 9 | constant variable that can be accessed at run time. */ 10 | #define CDIO_VERSION "2.2.1 (Rufus)" 11 | extern const char *cdio_version_string; /**< = CDIO_VERSION */ 12 | 13 | /*! LIBCDIO_VERSION_NUM is a C-Preprocessor macro that can be used for 14 | testing in the C preprocessor. libcdio_version_num has the same 15 | value, but it is a constant variable that can be accessed at run 16 | time. */ 17 | #define LIBCDIO_VERSION_NUM 20201 18 | 19 | extern const unsigned int libcdio_version_num; /**< = LIBCDIO_VERSION_NUM */ 20 | -------------------------------------------------------------------------------- /src/libcdio/driver/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libdriver.a 2 | libdriver_a_SOURCES = disc.c ds.c logging.c memory.c read.c sector.c track.c util.c _cdio_stdio.c _cdio_stream.c utf8.c 3 | # Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang! 4 | libdriver_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. 5 | -------------------------------------------------------------------------------- /src/libcdio/driver/_cdio_stdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003, 2008, 2012 Rocky Bernstein 3 | Copyright (C) 2000 Herbert Valerio Riedel 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | 20 | #ifndef CDIO_STDIO_H_ 21 | #define CDIO_STDIO_H_ 22 | 23 | #include "_cdio_stream.h" 24 | 25 | /*! 26 | Initialize a new stdio stream reading from pathname. 27 | A pointer to the stream is returned or NULL if there was an error. 28 | 29 | cdio_stream_free should be called on the returned value when you 30 | don't need the stream any more. No other finalization is needed. 31 | */ 32 | CdioDataSource_t * cdio_stdio_new(const char psz_path[]); 33 | 34 | /*! 35 | Deallocate resources assocaited with obj. After this obj is unusable. 36 | */ 37 | void cdio_stdio_destroy(CdioDataSource_t *p_obj); 38 | 39 | 40 | #endif /* CDIO_STDIO_H_ */ 41 | 42 | 43 | /* 44 | * Local variables: 45 | * c-file-style: "gnu" 46 | * tab-width: 8 47 | * indent-tabs-mode: nil 48 | * End: 49 | */ 50 | -------------------------------------------------------------------------------- /src/libcdio/driver/cdio_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008, 2011, 2012 Rocky Bernstein 3 | Copyright (C) 2000 Herbert Valerio Riedel 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef CDIO_ASSERT_H_ 20 | #define CDIO_ASSERT_H_ 21 | 22 | #if defined(__GNUC__) && !defined(__MINGW32__) 23 | 24 | #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) 25 | # include "config.h" 26 | # define __CDIO_CONFIG_H__ 1 27 | #endif 28 | 29 | #include 30 | #include 31 | 32 | #define cdio_assert(expr) \ 33 | { \ 34 | if (GNUC_UNLIKELY (!(expr))) cdio_log (CDIO_LOG_ASSERT, \ 35 | "file %s: line %d (%s): assertion failed: (%s)", \ 36 | __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ 37 | } 38 | 39 | #define cdio_assert_not_reached() \ 40 | { \ 41 | cdio_log (CDIO_LOG_ASSERT, \ 42 | "file %s: line %d (%s): should not be reached", \ 43 | __FILE__, __LINE__, __PRETTY_FUNCTION__); \ 44 | } 45 | 46 | #else /* non GNU C */ 47 | 48 | #include 49 | 50 | #define cdio_assert(expr) \ 51 | assert(expr) 52 | 53 | #define cdio_assert_not_reached() \ 54 | assert(0) 55 | 56 | #endif 57 | 58 | #endif /* CDIO_ASSERT_H_ */ 59 | -------------------------------------------------------------------------------- /src/libcdio/driver/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014-2015 Robert Kausch 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include "config.h" 21 | # define __CDIO_CONFIG_H__ 1 22 | #endif 23 | 24 | #ifdef HAVE_STDLIB_H 25 | #include 26 | #endif 27 | 28 | #include 29 | #include 30 | 31 | /*! 32 | Free the passed pointer. 33 | 34 | @param p_memory a pointer to memory allocated by a libcdio funtion. 35 | */ 36 | void 37 | cdio_free (void *p_memory) 38 | { 39 | if (p_memory != NULL) 40 | free(p_memory); 41 | } 42 | -------------------------------------------------------------------------------- /src/libcdio/driver/portable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | /* 19 | This file contains definitions to fill in for differences or 20 | deficiencies to OS or compiler irregularities. If this file is 21 | included other routines can be more portable. 22 | */ 23 | 24 | #ifndef CDIO_DRIVER_PORTABLE_H_ 25 | #define CDIO_DRIVER_PORTABLE_H_ 26 | 27 | #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) 28 | # include "config.h" 29 | # define __CDIO_CONFIG_H__ 1 30 | #endif 31 | 32 | #if !defined(HAVE_FTRUNCATE) 33 | # if defined (_WIN32) 34 | # define ftruncate chsize 35 | # endif 36 | #endif /*HAVE_FTRUNCATE*/ 37 | 38 | #if !defined(HAVE_SNPRINTF) 39 | # if defined (_MSC_VER) 40 | # define snprintf _snprintf 41 | # endif 42 | #endif /*HAVE_SNPRINTF*/ 43 | 44 | #if !defined(HAVE_VSNPRINTF) 45 | # if defined (_MSC_VER) 46 | # define vsnprintf _vsnprintf 47 | # endif 48 | #endif /*HAVE_SNPRINTF*/ 49 | 50 | #if !defined(HAVE_DRAND48) && defined(HAVE_RAND) 51 | # define drand48() (rand() / (double)RAND_MAX) 52 | #endif 53 | 54 | #endif /* CDIO_DRIVER_PORTABLE_H_ */ 55 | -------------------------------------------------------------------------------- /src/libcdio/iso9660/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libiso9660.a 2 | libiso9660_a_SOURCES = iso9660.c iso9660_fs.c rock.c xa.c 3 | # Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang! 4 | libiso9660_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../driver 5 | -------------------------------------------------------------------------------- /src/libcdio/mmc/mmc_private.h: -------------------------------------------------------------------------------- 1 | /* placeholder for unused MMC helper routines. */ 2 | 3 | typedef driver_return_code_t (*mmc_run_cmd_fn_t) ( void ); 4 | -------------------------------------------------------------------------------- /src/libcdio/udf/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libudf.a 2 | libudf_a_SOURCES = udf.c udf_file.c udf_fs.c udf_time.c filemode.c 3 | # Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang! 4 | libudf_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../driver 5 | -------------------------------------------------------------------------------- /src/libcdio/udf/udf_fs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006, 2008, 2012 Rocky Bernstein 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef CDIO_UDF_UDF_FS_H_ 19 | #define CDIO_UDF_UDF_FS_H_ 20 | 21 | #include 22 | /** 23 | * Check the descriptor tag for both the correct id and correct checksum. 24 | * Return zero if all is good, -1 if not. 25 | */ 26 | int udf_checktag(const udf_tag_t *p_tag, udf_Uint16_t tag_id); 27 | 28 | #endif /* CDIO_UDF_UDF_FS_H_ */ 29 | 30 | 31 | /* 32 | * Local variables: 33 | * c-file-style: "gnu" 34 | * tab-width: 8 35 | * indent-tabs-mode: nil 36 | * End: 37 | */ 38 | -------------------------------------------------------------------------------- /src/libcdio/udf/udf_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005, 2006, 2008, 2011, 2012 Rocky Bernstein 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef CDIO_UDF_UDF_PRIVATE_H_ 19 | #define CDIO_UDF_UDF_PRIVATE_H_ 20 | 21 | #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) && !defined(__CDIO_CONFIG_H__) 22 | # include "config.h" 23 | # define __CDIO_CONFIG_H__ 1 24 | #endif 25 | 26 | #ifdef HAVE_STDBOOL_H 27 | # include 28 | #endif 29 | 30 | #include 31 | #include 32 | #include 33 | #include "_cdio_stdio.h" 34 | 35 | /* Implementation of opaque types */ 36 | 37 | struct udf_s { 38 | bool b_stream; /* Use stream pointer, else use p_cdio */ 39 | off_t i_position; /* Position in file if positive */ 40 | CdioDataSource_t *stream; /* Stream pointer if stream */ 41 | CdIo_t *cdio; /* Cdio pointer if read device */ 42 | anchor_vol_desc_ptr_t anchor_vol_desc_ptr; 43 | uint32_t pvd_lba; /* sector of Primary Volume Descriptor */ 44 | partition_num_t i_partition; /* partition number */ 45 | uint32_t i_part_start; /* start of Partition Descriptor */ 46 | uint32_t lvd_lba; /* sector of Logical Volume Descriptor */ 47 | uint32_t fsd_offset; /* lba of fileset descriptor */ 48 | }; 49 | 50 | #endif /* CDIO_UDF_UDF_PRIVATE_H_ */ 51 | 52 | 53 | /* 54 | * Local variables: 55 | * c-file-style: "gnu" 56 | * tab-width: 8 57 | * indent-tabs-mode: nil 58 | * End: 59 | */ 60 | -------------------------------------------------------------------------------- /src/ms-sys/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | tab_width = 8 3 | -------------------------------------------------------------------------------- /src/ms-sys/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libmssys.a 2 | 3 | libmssys_a_SOURCES = fat12.c fat16.c fat32.c ntfs.c partition_info.c br.c file.c 4 | libmssys_a_CFLAGS = -I$(srcdir)/inc $(AM_CFLAGS) 5 | -------------------------------------------------------------------------------- /src/ms-sys/inc/br_fat12_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat12_0x0[] = { 2 | 0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31 3 | }; 4 | -------------------------------------------------------------------------------- /src/ms-sys/inc/br_fat16_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat16_0x0[] = { 2 | 0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31 3 | }; 4 | -------------------------------------------------------------------------------- /src/ms-sys/inc/br_fat16ros_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat16_0x0[] = { 2 | 0xeb, 0x71, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30 3 | }; 4 | -------------------------------------------------------------------------------- /src/ms-sys/inc/br_fat32_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32_0x0[] = { 2 | 0xeb, 0x58, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31 3 | }; 4 | -------------------------------------------------------------------------------- /src/ms-sys/inc/br_fat32ros_0x3f0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32ros_0x3f0[] = { 2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x55, 0xaa 4 | }; 5 | -------------------------------------------------------------------------------- /src/ms-sys/inc/br_ntfs_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_ntfs_0x0[] = { 2 | 0xEB, 0x52, 0x90, 0x4E, 0x54, 0x46, 0x53, 0x20, 0x20, 0x20, 0x20 3 | }; 4 | -------------------------------------------------------------------------------- /src/ms-sys/inc/fat12.h: -------------------------------------------------------------------------------- 1 | #ifndef FAT12_H 2 | #define FAT12_H 3 | 4 | /* returns TRUE if the file has a FAT12 file system, otherwise FALSE. 5 | The file position will change when this function is called! */ 6 | int is_fat_12_fs(FILE *fp); 7 | 8 | /* returns TRUE if the file has an exact match ot the FAT12 boot record this 9 | program would create, otherwise FALSE. 10 | The file position will change when this function is called! */ 11 | int entire_fat_12_br_matches(FILE *fp); 12 | 13 | /* Writes a FAT12 boot record to a file, returns TRUE on success, otherwise 14 | FALSE */ 15 | int write_fat_12_br(FILE *fp, int bKeepLabel); 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/ms-sys/inc/fat16.h: -------------------------------------------------------------------------------- 1 | #ifndef FAT16_H 2 | #define FAT16_H 3 | 4 | #include 5 | 6 | /* returns TRUE if the file has a FAT16 file system, otherwise FALSE. 7 | The file position will change when this function is called! */ 8 | int is_fat_16_fs(FILE *fp); 9 | 10 | /* returns TRUE if the file has a FAT16 boot record, otherwise FALSE. 11 | The file position will change when this function is called! */ 12 | int is_fat_16_br(FILE *fp); 13 | 14 | /* returns TRUE if the file has an exact match of the FAT16 boot record this 15 | program would create, otherwise FALSE. 16 | The file position will change when this function is called! */ 17 | int entire_fat_16_br_matches(FILE *fp); 18 | 19 | /* Writes a FAT16 boot record to a file, returns TRUE on success, otherwise 20 | FALSE */ 21 | int write_fat_16_br(FILE *fp, int bKeepLabel); 22 | 23 | /* returns TRUE if the file has an exact match of the FAT16 boot record this 24 | program would create for FreeDOS, otherwise FALSE. 25 | The file position will change when this function is called! */ 26 | int entire_fat_16_fd_br_matches(FILE *fp); 27 | 28 | /* Writes a FAT16 FreeDOS boot record to a file, returns TRUE on success, 29 | otherwise FALSE */ 30 | int write_fat_16_fd_br(FILE *fp, int bKeepLabel); 31 | 32 | /* returns TRUE if the file has an exact match of the FAT16 boot record this 33 | program would create for ReactOS, otherwise FALSE. 34 | The file position will change when this function is called! */ 35 | int entire_fat_16_ros_br_matches(FILE *fp); 36 | 37 | /* Writes a FAT16 ReactOS boot record to a file, returns TRUE on success, 38 | otherwise FALSE */ 39 | int write_fat_16_ros_br(FILE *fp, int bKeepLabel); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/ms-sys/inc/file.h: -------------------------------------------------------------------------------- 1 | #ifndef FILE_H 2 | #define FILE_H 3 | 4 | #include 5 | 6 | /* Max valid value of uiLen for contains_data */ 7 | #define MAX_DATA_LEN 65536 8 | 9 | /* We hijack the FILE structure for our own needs */ 10 | typedef struct { 11 | void *_handle; 12 | uint64_t _offset; 13 | } FAKE_FD; 14 | 15 | /* Checks if a file contains a data pattern of length Len at position 16 | Position. The file pointer will change when calling this function! */ 17 | int contains_data(FILE *fp, uint64_t Position, 18 | const void *pData, uint64_t Len); 19 | 20 | /* Reads data of length Len at position Position. 21 | The file pointer will change when calling this function! */ 22 | int read_data(FILE *fp, uint64_t Position, 23 | void *pData, uint64_t uiLen); 24 | 25 | /* Writes a data pattern of length Len at position Position. 26 | The file pointer will change when calling this function! */ 27 | int write_data(FILE *fp, uint64_t Position, 28 | const void *pData, uint64_t Len); 29 | 30 | /* Writes nSectors of size SectorSize starting at sector StartSector */ 31 | int64_t write_sectors(void *hDrive, uint64_t SectorSize, 32 | uint64_t StartSector, uint64_t nSectors, 33 | const void *pBuf); 34 | 35 | /* Reads nSectors of size SectorSize starting at sector StartSector */ 36 | int64_t read_sectors(void *hDrive, uint64_t SectorSize, 37 | uint64_t StartSector, uint64_t nSectors, 38 | void *pBuf); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/ms-sys/inc/label_11_char.h: -------------------------------------------------------------------------------- 1 | unsigned char label_11_char[] = {'N','O',' ','N','A','M','E',' ',' ',' ',' '}; 2 | -------------------------------------------------------------------------------- /src/ms-sys/inc/libintl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBINTL_H 2 | #define LIBINTL_H 3 | 4 | /* This file is only supposed to be used on systems which doesn't have a 5 | builtin libintl.h and which also miss gnu gettext */ 6 | 7 | #define NO_LIBINTL_OR_GETTEXT 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/ms-sys/inc/mbr_reactos.h: -------------------------------------------------------------------------------- 1 | /* First 267 bytes of MBR from ReactOS */ 2 | unsigned char mbr_reactos_0x0[] = { 3 | 0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xd0, 0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0x8d, 4 | 0x66, 0xe0, 0xfb, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, 0x89, 0xef, 5 | 0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x22, 0x7c, 0xe0, 0x1f, 0x8e, 0xd8, 6 | 0x8e, 0xd0, 0x31, 0xc0, 0x8e, 0xc0, 0x8d, 0xbe, 0xbe, 0x01, 0xf6, 0x05, 7 | 0x80, 0x75, 0x6d, 0x83, 0xc7, 0x10, 0x81, 0xff, 0xfe, 0x7d, 0x72, 0xf2, 8 | 0xe8, 0xc4, 0x00, 0x6e, 0x6f, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 9 | 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 10 | 0x6f, 0x75, 0x6e, 0x64, 0x00, 0xeb, 0xfe, 0xe8, 0xa5, 0x00, 0x72, 0x65, 11 | 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x77, 0x68, 0x69, 12 | 0x6c, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x64, 13 | 0x72, 0x69, 0x76, 0x65, 0x00, 0xeb, 0xda, 0xe8, 0x81, 0x00, 0x70, 0x61, 14 | 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x69, 0x67, 0x6e, 15 | 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x21, 0x3d, 0x20, 0x35, 0x35, 0x41, 16 | 0x41, 0x00, 0xeb, 0xb9, 0xe8, 0x10, 0x00, 0x72, 0xb6, 0x26, 0x81, 0x3e, 17 | 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0xd1, 0xea, 0x00, 0x7c, 0x00, 0x00, 0xbb, 18 | 0xaa, 0x55, 0xb4, 0x41, 0xcd, 0x13, 0x72, 0x32, 0x81, 0xfb, 0x55, 0xaa, 19 | 0x75, 0x2c, 0xf6, 0xc1, 0x01, 0x74, 0x27, 0xeb, 0x10, 0x10, 0x00, 0x04, 20 | 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x00, 0x8b, 0x45, 0x08, 0xa3, 0xd1, 0x7c, 0x8b, 0x45, 0x0a, 0xa3, 0xd3, 22 | 0x7c, 0xb8, 0x00, 0x42, 0xbe, 0xc9, 0x7c, 0xcd, 0x13, 0xc3, 0xb8, 0x04, 23 | 0x02, 0xbb, 0x00, 0x7c, 0x8b, 0x4d, 0x02, 0x8a, 0x75, 0x01, 0xcd, 0x13, 24 | 0xc3, 0x31, 0xdb, 0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xac, 0x56, 0x3c, 0x00, 25 | 0x75, 0xf3, 0xc3 26 | }; 27 | -------------------------------------------------------------------------------- /src/ms-sys/inc/nls.h: -------------------------------------------------------------------------------- 1 | #ifndef NLS_H 2 | #define NLS_H 3 | 4 | #include 5 | 6 | #ifdef NO_LIBINTL_OR_GETTEXT 7 | #define _(String) (String) 8 | #else 9 | #define _(String) gettext(String) 10 | #endif 11 | #define gettext_noop(String) (String) 12 | #define N_(String) gettext_noop(String) 13 | 14 | /* Init Native language support */ 15 | void nls_init(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/ms-sys/inc/ntfs.h: -------------------------------------------------------------------------------- 1 | #ifndef NTFS_H 2 | #define NTFS_H 3 | 4 | #include 5 | 6 | /* returns TRUE if the file has an NFTS file system, otherwise FALSE. 7 | The file position will change when this function is called! */ 8 | int is_ntfs_fs(FILE *fp); 9 | 10 | /* returns TRUE if the file has a NTFS boot record, otherwise FALSE. 11 | The file position will change when this function is called! */ 12 | int is_ntfs_br(FILE *fp); 13 | 14 | /* returns TRUE if the file has an exact match of the NTFS boot record 15 | this program would create, otherwise FALSE. 16 | The file position will change when this function is called! */ 17 | int entire_ntfs_br_matches(FILE *fp); 18 | 19 | /* Writes a NTFS boot record to a file, returns TRUE on success, otherwise 20 | FALSE */ 21 | int write_ntfs_br(FILE *fp); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/ms-sys/inc/partition_info.h: -------------------------------------------------------------------------------- 1 | #ifndef PARTITION_INFO_H 2 | #define PARTITION_INFO_H 3 | 4 | /* Writes the number of heads to a partition 5 | returns TRUE on success, otherwise FALSE */ 6 | int write_partition_number_of_heads(FILE *fp, int iHeads); 7 | 8 | /* Writes the start sector number to a partition (also known as 9 | "number of hidden sectors"), returns TRUE on success, otherwise FALSE */ 10 | int write_partition_start_sector_number(FILE *fp, int iStartSector); 11 | 12 | /* Writes a physical disk drive id of 0x80 (for C:) to a partition */ 13 | int write_partition_physical_disk_drive_id_fat32(FILE *fp); 14 | int write_partition_physical_disk_drive_id_fat16(FILE *fp); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/msvc-missing/unistd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file was originally part of the w64 mingw-runtime package. 4 | */ 5 | 6 | /* Workaround unistd.h for MS compilers */ 7 | 8 | #ifndef _MSC_VER 9 | #error This header should only be used with Microsoft compilers 10 | #endif 11 | 12 | #include 13 | 14 | #ifndef _UNISTD_H_ 15 | #define _UNISTD_H_ 16 | 17 | /* mode_t is used in the libcdio headers */ 18 | #ifndef _MODE_T_DEFINED 19 | #define _MODE_T_DEFINED 20 | typedef unsigned short mode_t; 21 | #endif /* _MODE_T_DEFINED */ 22 | 23 | /* ssize_t is also not available (copy/paste from MinGW) */ 24 | #ifndef _SSIZE_T_DEFINED 25 | #define _SSIZE_T_DEFINED 26 | #undef ssize_t 27 | #ifdef _WIN64 28 | typedef __int64 ssize_t; 29 | #else 30 | typedef int ssize_t; 31 | #endif /* _WIN64 */ 32 | #endif /* _SSIZE_T_DEFINED */ 33 | 34 | /* ext2fs needs this, which we picked from libcdio-driver/filemode.h */ 35 | #if !defined S_IFBLK && defined _WIN32 36 | # define S_IFBLK 0x3000 37 | #endif 38 | #if !defined S_ISBLK && defined S_IFBLK 39 | # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 40 | #endif 41 | 42 | /* access() mode flags */ 43 | #ifndef R_OK 44 | #define R_OK 4 45 | #endif 46 | #ifndef W_OK 47 | #define W_OK 2 48 | #endif 49 | #ifndef F_OK 50 | #define F_OK 0 51 | #endif 52 | #endif 53 | 54 | /* Standard file descriptors. */ 55 | #ifndef STDIN_FILENO 56 | #define STDIN_FILENO 0 57 | #endif 58 | #ifndef STDOUT_FILENO 59 | #define STDOUT_FILENO 1 60 | #endif 61 | #ifndef STDERR_FILENO 62 | #define STDERR_FILENO 2 63 | #endif 64 | 65 | /* For wimlib */ 66 | #define ftruncate _chsize_s 67 | #define snwprintf(dst, count, ...) _snwprintf_s(dst, count, _TRUNCATE, __VA_ARGS__) 68 | #define vsnwprintf _vsnwprintf 69 | -------------------------------------------------------------------------------- /src/re.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Mini regex-module inspired by Rob Pike's regex code described in: 4 | * 5 | * http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html 6 | * 7 | * 8 | * 9 | * Supports: 10 | * --------- 11 | * '.' Dot, matches any character 12 | * '^' Start anchor, matches beginning of string 13 | * '$' End anchor, matches end of string 14 | * '*' Asterisk, match zero or more (greedy) 15 | * '+' Plus, match one or more (greedy) 16 | * '?' Question, match zero or one (non-greedy) 17 | * '[abc]' Character class, match if one of {'a', 'b', 'c'} 18 | * '[^abc]' Inverted class, match if NOT one of {'a', 'b', 'c'} -- NOTE: feature is currently broken! 19 | * '[a-zA-Z]' Character ranges, the character set of the ranges { a-z | A-Z } 20 | * '\s' Whitespace, \t \f \r \n \v and spaces 21 | * '\S' Non-whitespace 22 | * '\w' Alphanumeric, [a-zA-Z0-9_] 23 | * '\W' Non-alphanumeric 24 | * '\d' Digits, [0-9] 25 | * '\D' Non-digits 26 | * 27 | * 28 | */ 29 | 30 | #ifndef _TINY_REGEX_C 31 | #define _TINY_REGEX_C 32 | 33 | 34 | #ifndef RE_DOT_MATCHES_NEWLINE 35 | /* Define to 0 if you DON'T want '.' to match '\r' + '\n' */ 36 | #define RE_DOT_MATCHES_NEWLINE 1 37 | #endif 38 | 39 | #ifdef __cplusplus 40 | extern "C"{ 41 | #endif 42 | 43 | 44 | 45 | /* Typedef'd pointer to get abstract datatype. */ 46 | typedef struct regex_t* re_t; 47 | 48 | 49 | /* Compile regex string pattern to a regex_t-array. */ 50 | re_t re_compile(const char* pattern); 51 | 52 | 53 | /* Find matches of the compiled pattern inside text. */ 54 | int re_matchp(re_t pattern, const char* text, int* matchlength); 55 | 56 | 57 | /* Find matches of the txt pattern inside text (will compile automatically first). */ 58 | int re_match(const char* pattern, const char* text, int* matchlength); 59 | 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* ifndef _TINY_REGEX_C */ 66 | -------------------------------------------------------------------------------- /src/rufus.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/rufus/688f011f317492225ded10b51edc19b39d62fbd4/src/rufus.rc -------------------------------------------------------------------------------- /src/syslinux/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_size = 4 3 | tab_width = 8 4 | -------------------------------------------------------------------------------- /src/syslinux/libfat/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libfat.a 2 | 3 | libfat_a_SOURCES = cache.c fatchain.c open.c searchdir.c dumpdir.c 4 | libfat_a_CFLAGS = $(AM_CFLAGS) 5 | -------------------------------------------------------------------------------- /src/syslinux/libfat/libfatint.h: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------- * 2 | * 3 | * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, Inc., 53 Temple Place Ste 330, 8 | * Boston MA 02111-1307, USA; either version 2 of the License, or 9 | * (at your option) any later version; incorporated herein by reference. 10 | * 11 | * ----------------------------------------------------------------------- */ 12 | 13 | /* 14 | * libfatint.h 15 | * 16 | * Internals for the libfat filesystem 17 | */ 18 | 19 | #ifndef LIBFATINT_H 20 | #define LIBFATINT_H 21 | 22 | #include "libfat.h" 23 | #include "fat.h" 24 | 25 | #if defined(__GNUC__) 26 | #define ALIGN_START(m) 27 | #define ALIGN_END(m) __attribute__ ((__aligned__(m))) 28 | #elif defined(_MSC_VER) 29 | #define ALIGN_START(m) __declspec(align(m)) 30 | #define ALIGN_END(m) 31 | #endif 32 | 33 | ALIGN_START(16) struct libfat_sector { 34 | libfat_sector_t n; /* Sector number */ 35 | struct libfat_sector *next; /* Next in list */ 36 | /* data[0] MUST be aligned to at least 8 bytes - see cache.c */ 37 | ALIGN_START(16) char data[0] ALIGN_END(16); 38 | } ALIGN_END(16); 39 | 40 | enum fat_type { 41 | FAT12, 42 | FAT16, 43 | FAT28 44 | }; 45 | 46 | struct libfat_filesystem { 47 | int (*read) (intptr_t, void *, size_t, libfat_sector_t); 48 | intptr_t readptr; 49 | 50 | enum fat_type fat_type; 51 | unsigned int clustsize; 52 | int clustshift; 53 | int32_t endcluster; /* Highest legal cluster number + 1 */ 54 | int32_t rootcluster; /* Root directory cluster */ 55 | 56 | libfat_sector_t fat; /* Start of FAT */ 57 | libfat_sector_t rootdir; /* Start of root directory */ 58 | libfat_sector_t data; /* Start of data area */ 59 | libfat_sector_t end; /* End of filesystem */ 60 | 61 | struct libfat_sector *sectors; 62 | }; 63 | 64 | #endif /* LIBFATINT_H */ 65 | -------------------------------------------------------------------------------- /src/syslinux/libfat/searchdir.c: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------- * 2 | * 3 | * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, Inc., 53 Temple Place Ste 330, 8 | * Boston MA 02111-1307, USA; either version 2 of the License, or 9 | * (at your option) any later version; incorporated herein by reference. 10 | * 11 | * ----------------------------------------------------------------------- */ 12 | 13 | /* 14 | * searchdir.c 15 | * 16 | * Search a FAT directory for a particular pre-mangled filename. 17 | * Copies the directory entry into direntry and returns the starting cluster 18 | * if found; returns -2 on not found, -1 on error, 0 on empty file. 19 | */ 20 | 21 | #include 22 | #include "libfatint.h" 23 | 24 | int32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust, 25 | const void *name, struct libfat_direntry *direntry) 26 | { 27 | struct fat_dirent *dep; 28 | int nent; 29 | libfat_sector_t s = libfat_clustertosector(fs, dirclust); 30 | 31 | while (1) { 32 | if (s == 0) 33 | return -2; /* Not found */ 34 | else if (s == (libfat_sector_t) - 1) 35 | return -1; /* Error */ 36 | 37 | dep = libfat_get_sector(fs, s); 38 | if (!dep) 39 | return -1; /* Read error */ 40 | 41 | for (nent = 0; nent < LIBFAT_SECTOR_SIZE; 42 | nent += sizeof(struct fat_dirent)) { 43 | /* Filter out volume labels (0x08) and devices (0x40) from the search */ 44 | if (!(dep->attribute & 0x48) && !memcmp(dep->name, name, 11)) { 45 | if (direntry) { 46 | memcpy(direntry->entry, dep, sizeof(*dep)); 47 | direntry->sector = s; 48 | direntry->offset = nent; 49 | } 50 | if (read32(&dep->size) == 0) 51 | return 0; /* An empty file has no clusters */ 52 | else 53 | return read16(&dep->clustlo) + 54 | (read16(&dep->clusthi) << 16); 55 | } 56 | 57 | if (dep->name[0] == 0) 58 | return -2; /* Hit high water mark */ 59 | 60 | dep++; 61 | } 62 | 63 | s = libfat_nextsector(fs, s); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/syslinux/libinstaller/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libinstaller.a 2 | 3 | libinstaller_a_SOURCES = fs.c setadv.c syslxmod.c 4 | libinstaller_a_CFLAGS = $(AM_CFLAGS) -Wno-address-of-packed-member -------------------------------------------------------------------------------- /src/syslinux/libinstaller/advconst.h: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------- * 2 | * 3 | * Copyright 2007-2008 H. Peter Anvin - All Rights Reserved 4 | * Copyright 2009 Intel Corporation; author: H. Peter Anvin 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or 11 | * sell copies of the Software, and to permit persons to whom 12 | * the Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall 16 | * be included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ----------------------------------------------------------------------- */ 28 | 29 | /* 30 | * syslinux/advconst.h 31 | * 32 | * ADV defined constants 33 | * 34 | * Defined in a separate file so it can be used by non-COM32 code. 35 | * Some of these constants are also defined in adv.inc, they better match... 36 | */ 37 | 38 | #ifndef _SYSLINUX_ADVCONST_H 39 | #define _SYSLINUX_ADVCONST_H 40 | 41 | #define ADV_END 0 42 | #define ADV_BOOTONCE 1 43 | #define ADV_MENUSAVE 2 44 | 45 | #endif /* _SYSLINUX_ADVCONST_H */ 46 | -------------------------------------------------------------------------------- /src/syslinux/libinstaller/setadv.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_SET_ADV_ 2 | #define _H_SET_ADV_ 3 | 4 | /* ADV information */ 5 | #define ADV_SIZE 512 /* Total size */ 6 | #define ADV_LEN (ADV_SIZE-3*4) /* Usable data size */ 7 | 8 | extern unsigned char syslinux_adv[2 * ADV_SIZE]; 9 | 10 | int syslinux_setadv(int tag, size_t size, const void *data); 11 | void syslinux_reset_adv(unsigned char *advbuf); 12 | int syslinux_validate_adv(unsigned char *advbuf); 13 | int read_adv(const char *path, const char *cfg); 14 | int write_adv(const char *path, const char *cfg); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/syslinux/libinstaller/syslinux.h: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------- * 2 | * 3 | * Copyright 1998-2008 H. Peter Anvin - All Rights Reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, Inc., 53 Temple Place Ste 330, 8 | * Boston MA 02111-1307, USA; either version 2 of the License, or 9 | * (at your option) any later version; incorporated herein by reference. 10 | * 11 | * ----------------------------------------------------------------------- */ 12 | 13 | #ifndef SYSLINUX_H 14 | #define SYSLINUX_H 15 | 16 | #include 17 | #include "advconst.h" 18 | #include "setadv.h" 19 | 20 | #ifdef __CHECKER__ 21 | # define _slimg __attribute__((noderef,address_space(1))) 22 | # define _force __attribute__((force)) 23 | #else 24 | # define _slimg 25 | # define _force 26 | #endif 27 | 28 | /* The standard boot sector and ldlinux image */ 29 | extern unsigned char* syslinux_ldlinux[2]; 30 | extern unsigned long syslinux_ldlinux_len[2]; 31 | extern const int syslinux_ldlinux_mtime[2]; 32 | 33 | #define boot_sector syslinux_ldlinux[1] 34 | #define boot_sector_len syslinux_ldlinux_len[1] 35 | #define boot_image syslinux_ldlinux[0] 36 | #define boot_image_len syslinux_ldlinux_len[0] 37 | 38 | extern unsigned char syslinux_mbr[]; 39 | extern const unsigned int syslinux_mbr_len; 40 | extern const int syslinux_mbr_mtime; 41 | 42 | /* Sector size variables are defined externally for 4K support */ 43 | extern uint32_t SECTOR_SHIFT; 44 | extern uint32_t SECTOR_SIZE; 45 | 46 | /* This takes a boot sector and merges in the syslinux fields */ 47 | void syslinux_make_bootsect(void *bs, int fs_type); 48 | 49 | /* Check to see that what we got was indeed an MS-DOS boot sector/superblock */ 50 | const char *syslinux_check_bootsect(const void *bs, int *fs_type); 51 | 52 | /* This patches the boot sector and ldlinux.sys based on a sector map */ 53 | typedef uint64_t sector_t; 54 | int syslinux_patch(const sector_t *sectors, int nsectors, 55 | int stupid, int raid_mode, 56 | const char *subdir, const char *subvol); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/syslinux/libinstaller/syslxcom.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_SYSLXCOM_ 2 | #define _H_SYSLXCOM_ 3 | 4 | /* Rufus placeholder */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/syslinux/libinstaller/syslxfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2012 Paulo Alcantara 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, Inc., 53 Temple Place Ste 330, 7 | * Boston MA 02111-1307, USA; either version 2 of the License, or 8 | * (at your option) any later version; incorporated herein by reference. 9 | * 10 | * ----------------------------------------------------------------------- */ 11 | 12 | #ifndef _SYSLXFS_H_ 13 | #define _SYSLXFS_H_ 14 | 15 | /* Global fs_type for handling fat, ntfs, ext2/3/4, btrfs, xfs and ufs1/2 */ 16 | enum filesystem { 17 | NONE, 18 | EXT2, 19 | BTRFS, 20 | VFAT, 21 | NTFS, 22 | XFS, 23 | UFS1, 24 | UFS2, 25 | }; 26 | 27 | //extern int fs_type; 28 | 29 | #endif /* _SYSLXFS_H_ */ 30 | -------------------------------------------------------------------------------- /src/syslinux/sltypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _MSC_VER 2 | #error This header should only be used with Microsoft compilers 3 | #endif 4 | 5 | /* The addons below are not part of inttypes but required for syslinux */ 6 | 7 | #ifndef _SLTYPES_H_ 8 | #define _SLTYPES_H_ 9 | 10 | /* On MS environments, the inline keyword is available in C++ only */ 11 | #ifndef inline 12 | #define inline __inline 13 | #endif 14 | 15 | /* ssize_t is also not available (copy/paste from MinGW) */ 16 | #ifndef _SSIZE_T_DEFINED 17 | #define _SSIZE_T_DEFINED 18 | #undef ssize_t 19 | #ifdef _WIN64 20 | typedef __int64 ssize_t; 21 | #else 22 | typedef int ssize_t; 23 | #endif /* _WIN64 */ 24 | #endif /* _SSIZE_T_DEFINED */ 25 | 26 | #endif -------------------------------------------------------------------------------- /src/syslinux/win/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libwin.a 2 | 3 | libwin_a_SOURCES = ntfssect.c 4 | libwin_a_CFLAGS = $(AM_CFLAGS) 5 | -------------------------------------------------------------------------------- /src/wimlib/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libwim.a 2 | libwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress_parallel.c \ 3 | compress_serial.c cpu_features.c decompress.c decompress_common.c dentry.c divsufsort.c \ 4 | encoding.c error.c export_image.c extract.c file_io.c header.c inode.c inode_fixup.c \ 5 | inode_table.c integrity.c iterate_dir.c lcpit_matchfinder.c lzms_common.c lzms_compress.c \ 6 | lzms_decompress.c lzx_common.c lzx_compress.c lzx_decompress.c metadata_resource.c \ 7 | pathlist.c paths.c pattern.c progress.c registry.c reparse.c resource.c scan.c security.c \ 8 | sha1.c solid.c split.c tagged_items.c textfile.c threads.c timestamp.c update_image.c \ 9 | util.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \ 10 | win32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c 11 | libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -I$(srcdir)/../libcdio -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point 12 | -------------------------------------------------------------------------------- /src/wimlib/pathlist.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pathlist.c 3 | * 4 | * Utility function for reading path list files. 5 | */ 6 | 7 | /* 8 | * Copyright (C) 2013 Eric Biggers 9 | * 10 | * This file is free software; you can redistribute it and/or modify it under 11 | * the terms of the GNU Lesser General Public License as published by the Free 12 | * Software Foundation; either version 3 of the License, or (at your option) any 13 | * later version. 14 | * 15 | * This file is distributed in the hope that it will be useful, but WITHOUT 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 18 | * details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with this file; if not, see https://www.gnu.org/licenses/. 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | # include "config.h" 26 | #endif 27 | 28 | #include "wimlib/pathlist.h" 29 | #include "wimlib/textfile.h" 30 | 31 | int 32 | read_path_list_file(const tchar *listfile, 33 | tchar ***paths_ret, size_t *num_paths_ret, 34 | void **mem_ret) 35 | { 36 | STRING_LIST(paths); 37 | struct text_file_section tmp = { 38 | .name = T(""), 39 | .strings = &paths, 40 | }; 41 | void *buf; 42 | int ret; 43 | 44 | ret = load_text_file(listfile, NULL, 0, &buf, &tmp, 1, 45 | LOAD_TEXT_FILE_REMOVE_QUOTES | 46 | LOAD_TEXT_FILE_ALLOW_STDIN, NULL); 47 | if (ret) 48 | return ret; 49 | 50 | *paths_ret = paths.strings; 51 | *num_paths_ret = paths.num_strings; 52 | *mem_ret = buf; 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /src/wimlib/progress.c: -------------------------------------------------------------------------------- 1 | /* 2 | * progress.c 3 | */ 4 | 5 | /* 6 | * Copyright (C) 2014 Eric Biggers 7 | * 8 | * This file is free software; you can redistribute it and/or modify it under 9 | * the terms of the GNU Lesser General Public License as published by the Free 10 | * Software Foundation; either version 3 of the License, or (at your option) any 11 | * later version. 12 | * 13 | * This file is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 16 | * details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this file; if not, see https://www.gnu.org/licenses/. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | # include "config.h" 24 | #endif 25 | 26 | #include "wimlib/progress.h" 27 | 28 | int 29 | report_error(wimlib_progress_func_t progfunc, 30 | void *progctx, int error_code, const tchar *path) 31 | { 32 | int ret; 33 | union wimlib_progress_info progress; 34 | tchar *cookie; 35 | 36 | if (error_code == WIMLIB_ERR_SUCCESS || 37 | error_code == WIMLIB_ERR_ABORTED_BY_PROGRESS || 38 | error_code == WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS) 39 | return error_code; 40 | 41 | progress.handle_error.path = path; 42 | progress.handle_error.error_code = error_code; 43 | progress.handle_error.will_ignore = false; 44 | 45 | cookie = progress_get_win32_path(path); 46 | 47 | ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_HANDLE_ERROR, 48 | &progress, progctx); 49 | 50 | progress_put_win32_path(cookie); 51 | 52 | if (ret) 53 | return ret; 54 | 55 | if (!progress.handle_error.will_ignore) 56 | return error_code; 57 | 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/alloca.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_ALLOCA_H 2 | #define _WIMLIB_ALLOCA_H 3 | 4 | #ifdef HAVE_ALLOCA_H 5 | # include 6 | #else 7 | # include 8 | #endif 9 | 10 | #endif /* _WIMLIB_ALLOCA_H */ 11 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/assert.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_ASSERT_H 2 | #define _WIMLIB_ASSERT_H 3 | 4 | #include 5 | #define wimlib_assert(expr) assert(expr) 6 | 7 | #endif /* _WIMLIB_ASSERT_H */ 8 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/case.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_CASE_H 2 | #define _WIMLIB_CASE_H 3 | 4 | #include 5 | 6 | /* Note: the NTFS-3G headers define CASE_SENSITIVE, hence the WIMLIB prefix. */ 7 | typedef enum { 8 | /* Use either case-sensitive or case-insensitive search, depending on 9 | * the variable @default_ignore_case. */ 10 | WIMLIB_CASE_PLATFORM_DEFAULT = 0, 11 | 12 | /* Use case-sensitive search. */ 13 | WIMLIB_CASE_SENSITIVE = 1, 14 | 15 | /* Use case-insensitive search. */ 16 | WIMLIB_CASE_INSENSITIVE = 2, 17 | } CASE_SENSITIVITY_TYPE; 18 | 19 | extern bool default_ignore_case; 20 | 21 | static inline bool 22 | will_ignore_case(CASE_SENSITIVITY_TYPE case_type) 23 | { 24 | if (case_type == WIMLIB_CASE_SENSITIVE) 25 | return false; 26 | if (case_type == WIMLIB_CASE_INSENSITIVE) 27 | return true; 28 | 29 | return default_ignore_case; 30 | } 31 | 32 | #endif /* _WIMLIB_CASE_H */ 33 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/compress_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * compress_common.h 3 | * 4 | * Header for compression code shared by multiple compression formats. 5 | */ 6 | 7 | #ifndef _WIMLIB_COMPRESS_COMMON_H 8 | #define _WIMLIB_COMPRESS_COMMON_H 9 | 10 | #include "wimlib/types.h" 11 | 12 | #define MAX_NUM_SYMS 799 /* LZMS_MAX_NUM_SYMS */ 13 | #define MAX_CODEWORD_LEN 16 14 | 15 | void 16 | make_canonical_huffman_code(unsigned num_syms, unsigned max_codeword_len, 17 | const u32 freqs[], u8 lens[], u32 codewords[]); 18 | 19 | #endif /* _WIMLIB_COMPRESS_COMMON_H */ 20 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/compressor_ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * compressor_ops.h 3 | * 4 | * Interface implemented by compressors for specific formats. 5 | */ 6 | 7 | #ifndef _WIMLIB_COMPRESSOR_OPS_H 8 | #define _WIMLIB_COMPRESSOR_OPS_H 9 | 10 | #include "wimlib/types.h" 11 | 12 | struct compressor_ops { 13 | 14 | u64 (*get_needed_memory)(size_t max_block_size, 15 | unsigned int compression_level, 16 | bool destructive); 17 | 18 | int (*create_compressor)(size_t max_block_size, 19 | unsigned int compression_level, 20 | bool destructive, 21 | void **private_ret); 22 | 23 | size_t (*compress)(const void *uncompressed_data, 24 | size_t uncompressed_size, 25 | void *compressed_data, 26 | size_t compressed_size_avail, 27 | void *private); 28 | 29 | void (*free_compressor)(void *private); 30 | }; 31 | 32 | extern const struct compressor_ops lzx_compressor_ops; 33 | extern const struct compressor_ops xpress_compressor_ops; 34 | extern const struct compressor_ops lzms_compressor_ops; 35 | 36 | #endif /* _WIMLIB_COMPRESSOR_OPS_H */ 37 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/cpu_features.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_CPU_FEATURES_H 2 | #define _WIMLIB_CPU_FEATURES_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | #define X86_CPU_FEATURE_SSSE3 0x00000001 7 | #define X86_CPU_FEATURE_SSE4_1 0x00000002 8 | #define X86_CPU_FEATURE_SSE4_2 0x00000004 9 | #define X86_CPU_FEATURE_AVX 0x00000008 10 | #define X86_CPU_FEATURE_BMI2 0x00000010 11 | #define X86_CPU_FEATURE_SHA 0x00000020 12 | 13 | #define ARM_CPU_FEATURE_SHA1 0x00000001 14 | 15 | #if (defined(__i386__) || defined(__x86_64__)) || \ 16 | (defined (_M_IX86) || defined (_M_X64) || defined(_M_ARM64)) || \ 17 | (defined(__aarch64__) && defined(__linux__)) || \ 18 | (defined(__aarch64__) && defined(__linux__)) || \ 19 | (defined(__aarch64__) && defined(__APPLE__)) || \ 20 | (defined(__aarch64__) && defined(_WIN32)) 21 | 22 | #define CPU_FEATURES_ENABLED 1 23 | extern u32 cpu_features; 24 | 25 | void init_cpu_features(void); 26 | 27 | #else 28 | 29 | #define CPU_FEATURES_ENABLED 0 30 | #define cpu_features 0 31 | 32 | static inline void 33 | init_cpu_features(void) 34 | { 35 | } 36 | 37 | #endif 38 | 39 | #endif /* _WIMLIB_CPU_FEATURES_H */ 40 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/decompressor_ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * decompressor_ops.h 3 | * 4 | * Interface implemented by decompressors for specific formats. 5 | */ 6 | 7 | #ifndef _WIMLIB_DECOMPRESSOR_OPS_H 8 | #define _WIMLIB_DECOMPRESSOR_OPS_H 9 | 10 | #include 11 | 12 | struct decompressor_ops { 13 | 14 | int (*create_decompressor)(size_t max_block_size, void **private_ret); 15 | 16 | int (*decompress)(const void *compressed_data, 17 | size_t compressed_size, 18 | void *uncompressed_data, 19 | size_t uncompressed_size, 20 | void *private); 21 | 22 | void (*free_decompressor)(void *private); 23 | }; 24 | 25 | extern const struct decompressor_ops lzx_decompressor_ops; 26 | extern const struct decompressor_ops xpress_decompressor_ops; 27 | extern const struct decompressor_ops lzms_decompressor_ops; 28 | 29 | #endif /* _WIMLIB_DECOMPRESSOR_OPS_H */ 30 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/divsufsort.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_DIVSUFSORT_H 2 | #define _WIMLIB_DIVSUFSORT_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | void 7 | divsufsort(const u8 *T, u32 *SA, u32 n, u32 *tmp); 8 | 9 | #define DIVSUFSORT_TMP_LEN (256 + (256 * 256)) 10 | 11 | #endif /* _WIMLIB_DIVSUFSORT_H */ 12 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/error.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_ERROR_H 2 | #define _WIMLIB_ERROR_H 3 | 4 | #include 5 | 6 | #include "wimlib.h" /* Get error code definitions */ 7 | #include "wimlib/compiler.h" 8 | #include "wimlib/types.h" 9 | 10 | void _format_attribute(printf, 1, 2) __attribute__((cold)) 11 | wimlib_error(const tchar *format, ...); 12 | 13 | void _format_attribute(printf, 1, 2) __attribute__((cold)) 14 | wimlib_error_with_errno(const tchar *format, ...); 15 | 16 | void _format_attribute(printf, 1, 2) __attribute__((cold)) 17 | wimlib_warning(const tchar *format, ...); 18 | 19 | void _format_attribute(printf, 1, 2) __attribute__((cold)) 20 | wimlib_warning_with_errno(const tchar *format, ...); 21 | 22 | #ifdef _RUFUS 23 | #include "rufus.h" 24 | #ifdef ERROR 25 | #undef ERROR 26 | #endif 27 | #define ERROR(format, ...) wuprintf(T(format)T("\n"), ## __VA_ARGS__) 28 | #define ERROR_WITH_ERRNO ERROR 29 | #define WARNING(format, ...) wuprintf(T(format)T("\n"), ## __VA_ARGS__) 30 | #define WARNING_WITH_ERRNO WARNING 31 | #else 32 | #define ERROR(format, ...) wimlib_error(T(format), ## __VA_ARGS__) 33 | #define ERROR_WITH_ERRNO(format, ...) wimlib_error_with_errno(T(format), ## __VA_ARGS__) 34 | #define WARNING(format, ...) wimlib_warning(T(format), ## __VA_ARGS__) 35 | #define WARNING_WITH_ERRNO(format, ...) wimlib_warning_with_errno(T(format), ## __VA_ARGS__) 36 | #endif 37 | 38 | extern bool wimlib_print_errors; 39 | extern FILE *wimlib_error_file; 40 | 41 | void 42 | print_byte_field(const u8 *field, size_t len, FILE *out); 43 | 44 | #endif /* _WIMLIB_ERROR_H */ 45 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/file_io.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_FILE_IO_H 2 | #define _WIMLIB_FILE_IO_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #ifdef WITH_LIBCDIO 10 | # define DO_NOT_WANT_COMPATIBILITY 11 | # undef PRAGMA_BEGIN_PACKED 12 | # undef PRAGMA_END_PACKED 13 | # include 14 | # include 15 | #endif 16 | 17 | /* Wrapper around a file descriptor that keeps track of offset (including in 18 | * pipes, which don't support lseek()), allows the handling of files that are 19 | * contained within ISO images, and a cached flag that tells whether the file 20 | * descriptor is a pipe or not. */ 21 | struct filedes { 22 | union { 23 | int fd; 24 | #ifdef WITH_LIBCDIO 25 | iso9660_t* p_iso; 26 | udf_t* p_udf; 27 | #endif 28 | }; 29 | unsigned int is_pipe : 1; 30 | #ifdef WITH_LIBCDIO 31 | unsigned int is_iso : 1; 32 | unsigned int is_udf : 1; 33 | union { 34 | udf_dirent_t* p_udf_file; 35 | iso9660_stat_t* p_iso_file; 36 | }; 37 | #endif 38 | off_t offset; 39 | }; 40 | 41 | int 42 | full_read(struct filedes *fd, void *buf, size_t n); 43 | 44 | int 45 | full_pread(struct filedes *fd, void *buf, size_t nbyte, off_t offset); 46 | 47 | int 48 | full_write(struct filedes *fd, const void *buf, size_t n); 49 | 50 | int 51 | full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset); 52 | 53 | #ifndef _WIN32 54 | # define O_BINARY 0 55 | #endif 56 | 57 | off_t 58 | filedes_seek(struct filedes *fd, off_t offset); 59 | 60 | bool 61 | filedes_is_seekable(struct filedes *fd); 62 | 63 | static inline void filedes_init(struct filedes *fd, int raw_fd) 64 | { 65 | memset(fd, 0, sizeof(*fd)); 66 | fd->fd = raw_fd; 67 | } 68 | 69 | static inline void filedes_invalidate(struct filedes *fd) 70 | { 71 | fd->fd = -1; 72 | } 73 | 74 | #ifdef _MSC_VER 75 | #include 76 | #define filedes_close(f) _close((f)->fd) 77 | #else 78 | #define filedes_close(f) close((f)->fd) 79 | #endif 80 | 81 | static inline bool 82 | filedes_valid(const struct filedes *fd) 83 | { 84 | return fd->fd != -1; 85 | } 86 | 87 | #endif /* _WIMLIB_FILE_IO_H */ 88 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/glob.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_GLOB_H 2 | #define _WIMLIB_GLOB_H 3 | 4 | #ifndef _WIN32 5 | # include 6 | #else 7 | #include 8 | #include 9 | 10 | typedef struct { 11 | size_t gl_pathc; 12 | wchar_t **gl_pathv; 13 | size_t gl_offs; 14 | } glob_t; 15 | 16 | /* WARNING: this is a reduced functionality replacement */ 17 | int 18 | win32_wglob(const wchar_t *pattern, int flags, 19 | int (*errfunc)(const wchar_t *epath, int eerrno), 20 | glob_t *pglob); 21 | 22 | void globfree(glob_t *pglob); 23 | 24 | #define GLOB_ERR 0x1 /* Return on read errors. */ 25 | #define GLOB_NOSORT 0x2 /* Don't sort the names. */ 26 | 27 | /* Error returns from `glob'. */ 28 | #define GLOB_NOSPACE 1 /* Ran out of memory. */ 29 | #define GLOB_ABORTED 2 /* Read error. */ 30 | #define GLOB_NOMATCH 3 /* No matches found. */ 31 | 32 | #endif /* _WIN32 */ 33 | 34 | #endif /* _WIMLIB_GLOB_H */ 35 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/guid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * guid.h 3 | * 4 | * Utility functions for handling 16-byte globally unique identifiers (GUIDs). 5 | */ 6 | 7 | #ifndef _WIMLIB_GUID_H 8 | #define _WIMLIB_GUID_H 9 | 10 | #include 11 | 12 | #include "wimlib/util.h" 13 | 14 | #define GUID_SIZE 16 15 | 16 | static inline void 17 | copy_guid(u8 dest[GUID_SIZE], const u8 src[GUID_SIZE]) 18 | { 19 | memcpy(dest, src, GUID_SIZE); 20 | } 21 | 22 | static inline int 23 | cmp_guids(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE]) 24 | { 25 | return memcmp(guid1, guid2, GUID_SIZE); 26 | } 27 | 28 | static inline bool 29 | guids_equal(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE]) 30 | { 31 | return !cmp_guids(guid1, guid2); 32 | } 33 | 34 | static inline void 35 | generate_guid(u8 guid[GUID_SIZE]) 36 | { 37 | get_random_bytes(guid, GUID_SIZE); 38 | } 39 | 40 | #endif /* _WIMLIB_GUID_H */ 41 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/inode_table.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_INODE_TABLE_H 2 | #define _WIMLIB_INODE_TABLE_H 3 | 4 | #include "wimlib/list.h" 5 | #include "wimlib/types.h" 6 | #include "wimlib/util.h" 7 | 8 | struct wim_dentry; 9 | 10 | /* Hash table to find inodes for hard link detection, given an inode number (in 11 | * the case of reading a WIM image), or both an inode number and a device number 12 | * (in the case of adding files to a WIM image). Also contains an extra list to 13 | * hold inodes for which no additional hard link detection is desired. In both 14 | * cases the inodes are linked by i_hlist_node. */ 15 | struct wim_inode_table { 16 | struct hlist_head *array; 17 | size_t filled; 18 | size_t capacity; 19 | struct hlist_head extra_inodes; 20 | }; 21 | 22 | 23 | /* Compute the index of the hash bucket to use for the given inode number and 24 | * device number. */ 25 | static inline size_t 26 | hash_inode(const struct wim_inode_table *table, u64 ino, u64 devno) 27 | { 28 | return (hash_u64(ino) + devno) & (table->capacity - 1); 29 | } 30 | 31 | int 32 | init_inode_table(struct wim_inode_table *table, size_t capacity); 33 | 34 | int 35 | inode_table_new_dentry(struct wim_inode_table *table, const tchar *name, 36 | u64 ino, u64 devno, bool noshare, 37 | struct wim_dentry **dentry_ret); 38 | 39 | void 40 | enlarge_inode_table(struct wim_inode_table *table); 41 | 42 | void 43 | inode_table_prepare_inode_list(struct wim_inode_table *table, 44 | struct hlist_head *head); 45 | 46 | void 47 | destroy_inode_table(struct wim_inode_table *table); 48 | 49 | #endif /* _WIMLIB_INODE_TABLE_H */ 50 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/integrity.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_INTEGRITY_H 2 | #define _WIMLIB_INTEGRITY_H 3 | 4 | #include 5 | 6 | #include "wimlib/types.h" 7 | 8 | #define WIM_INTEGRITY_OK 0 9 | #define WIM_INTEGRITY_NOT_OK -1 10 | #define WIM_INTEGRITY_NONEXISTENT -2 11 | 12 | struct integrity_table; 13 | 14 | int 15 | read_integrity_table(WIMStruct *wim, u64 num_checked_bytes, 16 | struct integrity_table **table_ret); 17 | 18 | #define free_integrity_table(table) FREE(table) 19 | 20 | int 21 | write_integrity_table(WIMStruct *wim, 22 | off_t new_blob_table_end, 23 | off_t old_blob_table_end, 24 | struct integrity_table *old_table); 25 | 26 | int 27 | check_wim_integrity(WIMStruct *wim); 28 | 29 | #endif /* _WIMLIB_INTEGRITY_H */ 30 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/lzx_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * lzx_common.h 3 | * 4 | * Declarations shared between LZX compression and decompression. 5 | */ 6 | 7 | #ifndef _LZX_COMMON_H 8 | #define _LZX_COMMON_H 9 | 10 | #include "wimlib/lzx_constants.h" 11 | #include "wimlib/types.h" 12 | 13 | extern const s32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1]; 14 | 15 | extern const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS]; 16 | 17 | unsigned 18 | lzx_get_window_order(size_t max_bufsize); 19 | 20 | unsigned 21 | lzx_get_num_main_syms(unsigned window_order); 22 | 23 | void 24 | lzx_preprocess(u8 *data, u32 size); 25 | 26 | void 27 | lzx_postprocess(u8 *data, u32 size); 28 | 29 | #endif /* _LZX_COMMON_H */ 30 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/ntfs_3g.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_NTFS_3G_H 2 | #define _WIMLIB_NTFS_3G_H 3 | 4 | #ifdef WITH_NTFS_3G 5 | 6 | #include "wimlib/types.h" 7 | 8 | struct blob_descriptor; 9 | struct consume_chunk_callback; 10 | struct ntfs_location; 11 | 12 | int 13 | read_ntfs_attribute_prefix(const struct blob_descriptor *blob, u64 size, 14 | const struct consume_chunk_callback *cb, 15 | bool recover_data); 16 | 17 | struct ntfs_location * 18 | clone_ntfs_location(const struct ntfs_location *loc); 19 | 20 | void 21 | free_ntfs_location(struct ntfs_location *loc); 22 | 23 | int 24 | cmp_ntfs_locations(const struct ntfs_location *loc1, 25 | const struct ntfs_location *loc2); 26 | 27 | #endif /* WITH_NTFS_3G */ 28 | 29 | #endif /* _WIMLIB_NTFS_3G_H */ 30 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/object_id.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_OBJECT_ID_H 2 | #define _WIMLIB_OBJECT_ID_H 3 | 4 | #include "wimlib/tagged_items.h" 5 | 6 | /* Unconfirmed: are all 64 bytes of the object ID always present? Since NTFS-3G 7 | * permits shorter object IDs, we'll do the same for now. */ 8 | #define OBJECT_ID_MIN_LENGTH 16 9 | 10 | static inline const void * 11 | inode_get_object_id(const struct wim_inode *inode, u32 *len_ret) 12 | { 13 | return inode_get_tagged_item(inode, TAG_OBJECT_ID, OBJECT_ID_MIN_LENGTH, 14 | len_ret); 15 | } 16 | 17 | static inline bool 18 | inode_has_object_id(const struct wim_inode *inode) 19 | { 20 | return inode_get_object_id(inode, NULL) != NULL; 21 | } 22 | 23 | static inline bool 24 | inode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len) 25 | { 26 | return inode_set_tagged_item(inode, TAG_OBJECT_ID, object_id, len); 27 | } 28 | 29 | #endif /* _WIMLIB_OBJECT_ID_H */ 30 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/pathlist.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_PATHLIST_H 2 | #define _WIMLIB_PATHLIST_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | int 7 | read_path_list_file(const tchar *listfile, 8 | tchar ***paths_ret, size_t *num_paths_ret, 9 | void **mem_ret); 10 | 11 | #endif /* _WIMLIB_PATHLIST_H */ 12 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/paths.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_PATHS_H 2 | #define _WIMLIB_PATHS_H 3 | 4 | #include "wimlib/compiler.h" 5 | #include "wimlib/types.h" 6 | 7 | const tchar * 8 | path_basename(const tchar *path); 9 | 10 | const tchar * 11 | path_basename_with_len(const tchar *path, size_t len); 12 | 13 | const tchar * 14 | path_stream_name(const tchar *path); 15 | 16 | void 17 | do_canonicalize_path(const tchar *in, tchar *out); 18 | 19 | tchar * 20 | canonicalize_wim_path(const tchar *wim_path); 21 | 22 | /* is_any_path_separator() - characters treated as path separators in WIM path 23 | * specifications and capture configuration files (the former will be translated 24 | * to WIM_PATH_SEPARATOR; the latter will be translated to 25 | * OS_PREFERRED_PATH_SEPARATOR) 26 | * 27 | * OS_PREFERRED_PATH_SEPARATOR - preferred (or only) path separator on the 28 | * operating system. Used when constructing filesystem paths to extract or 29 | * archive. 30 | * 31 | * WIM_PATH_SEPARATOR - character treated as path separator for WIM paths. 32 | * Currently needs to be '/' on UNIX for the WIM mounting code to work properly. 33 | */ 34 | 35 | #ifdef _WIN32 36 | # define OS_PREFERRED_PATH_SEPARATOR L'\\' 37 | # define is_any_path_separator(c) ((c) == L'/' || (c) == L'\\') 38 | #else 39 | # define OS_PREFERRED_PATH_SEPARATOR '/' 40 | # define is_any_path_separator(c) ((c) == '/' || (c) == '\\') 41 | #endif 42 | 43 | #define WIM_PATH_SEPARATOR WIMLIB_WIM_PATH_SEPARATOR 44 | 45 | #endif /* _WIMLIB_PATHS_H */ 46 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/pattern.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_PATTERN_H 2 | #define _WIMLIB_PATTERN_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | struct wim_dentry; 7 | 8 | /* Flags for match_path() and match_pattern_list() */ 9 | 10 | /* 11 | * If set, subdirectories (and sub-files) are also matched. 12 | * For example, the pattern "/dir" would match the path "/dir/file". 13 | */ 14 | #define MATCH_RECURSIVELY 0x01 15 | 16 | /* 17 | * If set, ancestor directories are also matched. 18 | * For example, the pattern "/dir/file" would match the path "/dir". 19 | */ 20 | #define MATCH_ANCESTORS 0x02 21 | 22 | bool 23 | match_path(const tchar *path, const tchar *pattern, int match_flags); 24 | 25 | int 26 | expand_path_pattern(struct wim_dentry *root, const tchar *pattern, 27 | int (*consume_dentry)(struct wim_dentry *, void *), 28 | void *ctx); 29 | 30 | #endif /* _WIMLIB_PATTERN_H */ 31 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/registry.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_REGISTRY_H 2 | #define _WIMLIB_REGISTRY_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | struct regf; 7 | 8 | enum hive_status { 9 | HIVE_OK, 10 | HIVE_CORRUPT, 11 | HIVE_UNSUPPORTED, 12 | HIVE_KEY_NOT_FOUND, 13 | HIVE_VALUE_NOT_FOUND, 14 | HIVE_VALUE_IS_WRONG_TYPE, 15 | HIVE_OUT_OF_MEMORY, 16 | HIVE_ITERATION_STOPPED, 17 | }; 18 | 19 | enum hive_status 20 | hive_validate(const void *hive_mem, size_t hive_size); 21 | 22 | enum hive_status 23 | hive_get_string(const struct regf *regf, const tchar *key_name, 24 | const tchar *value_name, tchar **value_ret); 25 | 26 | enum hive_status 27 | hive_get_number(const struct regf *regf, const tchar *key_name, 28 | const tchar *value_name, s64 *value_ret); 29 | 30 | enum hive_status 31 | hive_list_subkeys(const struct regf *regf, const tchar *key_name, 32 | tchar ***subkeys_ret); 33 | 34 | void 35 | hive_free_subkeys_list(tchar **subkeys); 36 | 37 | const char * 38 | hive_status_to_string(enum hive_status status); 39 | 40 | #endif /* _WIMLIB_REGISTRY_H */ 41 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/security.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_SECURITY_H 2 | #define _WIMLIB_SECURITY_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | struct wim_security_data; 7 | struct avl_tree_node; 8 | 9 | /* Map from SHA1 message digests of security descriptors to security IDs, which 10 | * are themselves indices into the table of security descriptors in the 'struct 11 | * wim_security_data'. */ 12 | struct wim_sd_set { 13 | struct wim_security_data *sd; 14 | struct avl_tree_node *root; 15 | s32 orig_num_entries; 16 | }; 17 | 18 | /* Table of security descriptors for a WIM image. */ 19 | struct wim_security_data { 20 | /* The total length of the security data, in bytes. If there are no 21 | * security descriptors, this field, when read from the on-disk metadata 22 | * resource, may be either 8 (which is correct) or 0 (which is 23 | * interpreted as 8). */ 24 | u32 total_length; 25 | 26 | /* The number of security descriptors in the array @descriptors. */ 27 | u32 num_entries; 28 | 29 | /* Array of sizes of the descriptors, in bytes, in the array 30 | * @descriptors. */ 31 | u64 *sizes; 32 | 33 | /* Array of pointers to the security descriptors in the 34 | * SECURITY_DESCRIPTOR_RELATIVE format. */ 35 | u8 **descriptors; 36 | }; 37 | 38 | void 39 | rollback_new_security_descriptors(struct wim_sd_set *sd_set); 40 | 41 | void 42 | destroy_sd_set(struct wim_sd_set *sd_set); 43 | 44 | s32 45 | sd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[], 46 | size_t size); 47 | 48 | int 49 | init_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd); 50 | 51 | struct wim_security_data * 52 | new_wim_security_data(void); 53 | 54 | int 55 | read_wim_security_data(const u8 *buf, size_t buf_len, 56 | struct wim_security_data **sd_ret); 57 | 58 | u8 * 59 | write_wim_security_data(const struct wim_security_data * restrict sd, 60 | u8 * restrict p); 61 | 62 | void 63 | print_wim_security_data(const struct wim_security_data *sd); 64 | 65 | void 66 | free_wim_security_data(struct wim_security_data *sd); 67 | 68 | #endif /* _WIMLIB_SECURITY_H */ 69 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/solid.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_SOLID_H 2 | #define _WIMLIB_SOLID_H 3 | 4 | struct list_head; 5 | 6 | int 7 | sort_blob_list_for_solid_compression(struct list_head *blob_list); 8 | 9 | #endif /* _WIMLIB_SOLID_H */ 10 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/tagged_items.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_TAGGED_ITEMS_H 2 | #define _WIMLIB_TAGGED_ITEMS_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | struct wim_inode; 7 | 8 | /* Windows-style object ID */ 9 | #define TAG_OBJECT_ID 0x00000001 10 | 11 | /* Extended attributes */ 12 | #define TAG_XATTRS 0x00000002 13 | 14 | /* [wimlib extension] Standard UNIX metadata: uid, gid, mode, and rdev */ 15 | #define TAG_WIMLIB_UNIX_DATA 0x337DD873 16 | 17 | /* 18 | * [wimlib extension] Linux-style extended attributes 19 | * (deprecated in favor of TAG_XATTRS) 20 | */ 21 | #define TAG_WIMLIB_LINUX_XATTRS 0x337DD874 22 | 23 | void * 24 | inode_get_tagged_item(const struct wim_inode *inode, u32 tag, u32 min_len, 25 | u32 *actual_len_ret); 26 | 27 | bool 28 | inode_set_tagged_item(struct wim_inode *inode, u32 tag, 29 | const void *data, u32 len); 30 | 31 | #endif /* _WIMLIB_TAGGED_ITEMS_H */ 32 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/test_support.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_TEST_SUPPORT_H 2 | #define _WIMLIB_TEST_SUPPORT_H 3 | 4 | #ifdef ENABLE_TEST_SUPPORT 5 | 6 | #include "wimlib.h" 7 | #include "wimlib/types.h" 8 | 9 | #define WIMLIB_ERR_IMAGES_ARE_DIFFERENT 200 10 | 11 | #define WIMLIB_ADD_FLAG_GENERATE_TEST_DATA 0x08000000 12 | 13 | #define WIMLIB_CMP_FLAG_UNIX_MODE 0x00000001 14 | #define WIMLIB_CMP_FLAG_NTFS_3G_MODE 0x00000002 15 | #define WIMLIB_CMP_FLAG_WINDOWS_MODE 0x00000004 16 | #define WIMLIB_CMP_FLAG_EXT4 0x00000008 17 | 18 | WIMLIBAPI void 19 | wimlib_seed_random(u64 seed); 20 | 21 | WIMLIBAPI int 22 | wimlib_compare_images(WIMStruct *wim1, int image1, 23 | WIMStruct *wim2, int image2, int cmp_flags); 24 | 25 | WIMLIBAPI int 26 | wimlib_parse_and_write_xml_doc(const tchar *in, tchar **out_ret); 27 | 28 | WIMLIBAPI int 29 | wimlib_utf8_to_utf16le(const char *in, size_t in_nbytes, 30 | utf16lechar **out_ret, size_t *out_nbytes_ret); 31 | 32 | WIMLIBAPI int 33 | wimlib_utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes, 34 | char **out_ret, size_t *out_nbytes_ret); 35 | 36 | #endif /* ENABLE_TEST_SUPPORT */ 37 | 38 | #endif /* _WIMLIB_TEST_SUPPORT_H */ 39 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/textfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_TEXTFILE_H_ 2 | #define _WIMLIB_TEXTFILE_H_ 3 | 4 | #include "wimlib/types.h" 5 | 6 | struct string_list { 7 | tchar **strings; 8 | size_t num_strings; 9 | size_t num_alloc_strings; 10 | }; 11 | 12 | #define STRING_LIST_INITIALIZER \ 13 | { .strings = NULL, .num_strings = 0, .num_alloc_strings = 0, } 14 | 15 | #define STRING_LIST(_strings) \ 16 | struct string_list _strings = STRING_LIST_INITIALIZER 17 | 18 | typedef int (*line_mangle_t)(tchar *line, const tchar *filename, 19 | unsigned long line_no); 20 | 21 | struct text_file_section { 22 | const tchar *name; 23 | struct string_list *strings; 24 | }; 25 | 26 | #define LOAD_TEXT_FILE_REMOVE_QUOTES 0x00000001 27 | #define LOAD_TEXT_FILE_NO_WARNINGS 0x00000002 28 | #define LOAD_TEXT_FILE_ALLOW_STDIN 0x00000004 29 | 30 | int 31 | load_text_file(const tchar *path, const void *buf, size_t bufsize, 32 | void **mem_ret, 33 | const struct text_file_section *pos_sections, 34 | int num_pos_sections, 35 | int flags, line_mangle_t mangle_line); 36 | 37 | #endif /* _WIMLIB_TEXTFILE_H_ */ 38 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/threads.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_THREADS_H 2 | #define _WIMLIB_THREADS_H 3 | 4 | #include 5 | 6 | #ifdef _WIN32 7 | 8 | struct thread { 9 | void *win32_thread; 10 | void *(*thrproc)(void *); 11 | void *arg; 12 | }; 13 | 14 | struct mutex { void *win32_crit; }; 15 | #define MUTEX_INITIALIZER { NULL } 16 | 17 | struct condvar { void *win32_cond; }; 18 | 19 | #else /* _WIN32 */ 20 | 21 | #include 22 | 23 | struct thread { pthread_t pthread; }; 24 | 25 | struct mutex { pthread_mutex_t pthread_mutex; }; 26 | #define MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER } 27 | 28 | struct condvar { pthread_cond_t pthread_cond; }; 29 | 30 | #endif /* !_WIN32 */ 31 | 32 | bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg); 33 | void thread_join(struct thread *t); 34 | bool mutex_init(struct mutex *m); 35 | void mutex_destroy(struct mutex *m); 36 | void mutex_lock(struct mutex *m); 37 | void mutex_unlock(struct mutex *m); 38 | bool condvar_init(struct condvar *c); 39 | void condvar_destroy(struct condvar *c); 40 | void condvar_wait(struct condvar *c, struct mutex *m); 41 | void condvar_signal(struct condvar *c); 42 | void condvar_broadcast(struct condvar *c); 43 | 44 | #endif /* _WIMLIB_THREADS_H */ 45 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/timestamp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * timestamp.h 3 | * 4 | * Conversion between Windows NT timestamps and UNIX timestamps. 5 | */ 6 | 7 | #ifndef _WIMLIB_TIMESTAMP_H 8 | #define _WIMLIB_TIMESTAMP_H 9 | 10 | #ifdef HAVE_SYS_TIMES_H 11 | #include 12 | #endif 13 | #include 14 | 15 | #include "wimlib/types.h" 16 | 17 | struct wimlib_timespec; 18 | 19 | time_t 20 | wim_timestamp_to_time_t(u64 timestamp); 21 | 22 | void 23 | wim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts, 24 | s32 *high_part_ret); 25 | 26 | struct timeval 27 | wim_timestamp_to_timeval(u64 timestamp); 28 | 29 | struct timespec 30 | wim_timestamp_to_timespec(u64 timestamp); 31 | 32 | u64 33 | time_t_to_wim_timestamp(time_t t); 34 | 35 | u64 36 | timeval_to_wim_timestamp(const struct timeval *tv); 37 | 38 | u64 39 | timespec_to_wim_timestamp(const struct timespec *ts); 40 | 41 | u64 42 | now_as_wim_timestamp(void); 43 | 44 | void 45 | wim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len); 46 | 47 | #endif /* _WIMLIB_TIMESTAMP_H */ 48 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_TYPES_H 2 | #define _WIMLIB_TYPES_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "wimlib_tchar.h" 9 | #include "wimlib/compiler.h" 10 | 11 | #ifndef _NTFS_TYPES_H 12 | /* Unsigned integer types of exact size in bits */ 13 | typedef uint8_t u8; 14 | typedef uint16_t u16; 15 | typedef uint32_t u32; 16 | typedef uint64_t u64; 17 | 18 | /* Signed integer types of exact size in bits */ 19 | typedef int8_t s8; 20 | typedef int16_t s16; 21 | typedef int32_t s32; 22 | typedef int64_t s64; 23 | 24 | /* Unsigned little endian types of exact size */ 25 | typedef uint16_t _bitwise_attr le16; 26 | typedef uint32_t _bitwise_attr le32; 27 | typedef uint64_t _bitwise_attr le64; 28 | 29 | /* Unsigned big endian types of exact size */ 30 | typedef uint16_t _bitwise_attr be16; 31 | typedef uint32_t _bitwise_attr be32; 32 | typedef uint64_t _bitwise_attr be64; 33 | #endif 34 | 35 | /* A pointer to 'utf16lechar' indicates a UTF-16LE encoded string */ 36 | typedef le16 utf16lechar; 37 | 38 | #ifndef WIMLIB_WIMSTRUCT_DECLARED 39 | typedef struct WIMStruct WIMStruct; 40 | # define WIMLIB_WIMSTRUCT_DECLARED 41 | #endif 42 | 43 | /* 44 | * Type of a machine word. 'unsigned long' would be logical, but that is only 45 | * 32 bits on x86_64 Windows. The same applies to 'uint_fast32_t'. So the best 46 | * we can do without a bunch of #ifdefs appears to be 'size_t'. 47 | */ 48 | typedef size_t machine_word_t; 49 | 50 | #define WORDBYTES sizeof(machine_word_t) 51 | #define WORDBITS (8 * WORDBYTES) 52 | 53 | #endif /* _WIMLIB_TYPES_H */ 54 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/unix_data.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_UNIX_DATA_H 2 | #define _WIMLIB_UNIX_DATA_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | struct wimlib_unix_data { 7 | u32 uid; 8 | u32 gid; 9 | u32 mode; 10 | u32 rdev; 11 | }; 12 | 13 | struct wim_inode; 14 | 15 | bool 16 | inode_has_unix_data(const struct wim_inode *inode); 17 | 18 | bool 19 | inode_get_unix_data(const struct wim_inode *inode, 20 | struct wimlib_unix_data *unix_data); 21 | 22 | #define UNIX_DATA_UID 0x1 23 | #define UNIX_DATA_GID 0x2 24 | #define UNIX_DATA_MODE 0x4 25 | #define UNIX_DATA_RDEV 0x8 26 | 27 | #define UNIX_DATA_ALL 0xF 28 | 29 | bool 30 | inode_set_unix_data(struct wim_inode *inode, 31 | struct wimlib_unix_data *unix_data, int which); 32 | 33 | #endif /* _WIMLIB_UNIX_DATA_H */ 34 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/wimboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMBOOT_H_ 2 | #define _WIMBOOT_H_ 3 | 4 | #include "wimlib/header.h" 5 | #include "wimlib/sha1.h" 6 | #include "wimlib/types.h" 7 | #include "wimlib/win32_common.h" 8 | 9 | struct blob_descriptor; 10 | 11 | int 12 | wimboot_alloc_data_source_id(const wchar_t *wim_path, 13 | const u8 guid[GUID_SIZE], int image, 14 | const wchar_t *target, u64 *data_source_id_ret, 15 | bool *wof_running_ret); 16 | 17 | bool 18 | wimboot_set_pointer(HANDLE h, 19 | const struct blob_descriptor *blob, 20 | u64 data_source_id, 21 | const u8 blob_table_hash[SHA1_HASH_SIZE], 22 | bool wof_running); 23 | 24 | 25 | #endif /* _WIMBOOT_H_ */ 26 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * win32.h - Windows-specific declarations needed by non-Windows-specific files. 3 | */ 4 | 5 | #ifndef _WIMLIB_WIN32_H 6 | #define _WIMLIB_WIN32_H 7 | 8 | #ifdef _WIN32 9 | 10 | #include 11 | #include "wimlib/types.h" 12 | 13 | struct blob_descriptor; 14 | struct consume_chunk_callback; 15 | struct windows_file; 16 | 17 | struct windows_file * 18 | clone_windows_file(const struct windows_file *file); 19 | 20 | void 21 | free_windows_file(struct windows_file *file); 22 | 23 | int 24 | cmp_windows_files(const struct windows_file *file1, 25 | const struct windows_file *file2); 26 | 27 | int 28 | read_windows_file_prefix(const struct blob_descriptor *blob, u64 size, 29 | const struct consume_chunk_callback *cb, 30 | bool recover_data); 31 | 32 | int 33 | win32_global_init(int init_flags); 34 | 35 | void 36 | win32_global_cleanup(void); 37 | 38 | int 39 | fsync(int fd); 40 | 41 | tchar * 42 | realpath(const tchar *path, tchar *resolved_path); 43 | 44 | int 45 | win32_rename_replacement(const tchar *oldpath, const tchar *newpath); 46 | 47 | int 48 | win32_truncate_replacement(const tchar *path, off_t size); 49 | 50 | int 51 | win32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen); 52 | 53 | FILE * 54 | win32_open_logfile(const wchar_t *path); 55 | 56 | ssize_t 57 | win32_read(int fd, void *buf, size_t count); 58 | 59 | ssize_t 60 | win32_write(int fd, const void *buf, size_t count); 61 | 62 | ssize_t 63 | win32_pread(int fd, void *buf, size_t count, off_t offset); 64 | 65 | ssize_t 66 | win32_pwrite(int fd, const void *buf, size_t count, off_t offset); 67 | 68 | #endif /* _WIN32 */ 69 | 70 | #endif /* _WIMLIB_WIN32_H */ 71 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/win32_vss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * win32_vss.h - Declarations for managing VSS snapshots. This header should 3 | * only be included by Windows-specific files. 4 | */ 5 | 6 | #ifndef _WIMLIB_WIN32_VSS_H 7 | #define _WIMLIB_WIN32_VSS_H 8 | 9 | #include "wimlib/win32_common.h" 10 | 11 | /* A reference counter for a VSS snapshot. This is embedded in another data 12 | * structure only visible to win32_vss.c. */ 13 | struct vss_snapshot { 14 | size_t refcnt; 15 | }; 16 | 17 | void 18 | vss_delete_snapshot(struct vss_snapshot *snapshot); 19 | 20 | /* Acquire a reference to the specified VSS snapshot. */ 21 | static inline struct vss_snapshot * 22 | vss_get_snapshot(struct vss_snapshot *snapshot) 23 | { 24 | if (snapshot) 25 | snapshot->refcnt++; 26 | return snapshot; 27 | } 28 | 29 | /* Release a reference to the specified VSS snapshot. When the last reference 30 | * is released, the snapshot is deleted. */ 31 | static inline void 32 | vss_put_snapshot(struct vss_snapshot *snapshot) 33 | { 34 | if (snapshot && --snapshot->refcnt == 0) 35 | vss_delete_snapshot(snapshot); 36 | } 37 | 38 | int 39 | vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret, 40 | struct vss_snapshot **snapshot_ret); 41 | 42 | void 43 | vss_global_cleanup(void); 44 | 45 | #endif /* _WIMLIB_WIN32_VSS_H */ 46 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/xml.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_XML_H 2 | #define _WIMLIB_XML_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | /*****************************************************************************/ 7 | 8 | struct wim_xml_info; 9 | 10 | struct wim_xml_info * 11 | xml_new_info_struct(void); 12 | 13 | void 14 | xml_free_info_struct(struct wim_xml_info *info); 15 | 16 | /*****************************************************************************/ 17 | 18 | int 19 | xml_get_image_count(const struct wim_xml_info *info); 20 | 21 | u64 22 | xml_get_total_bytes(const struct wim_xml_info *info); 23 | 24 | u64 25 | xml_get_image_total_bytes(const struct wim_xml_info *info, int image); 26 | 27 | u64 28 | xml_get_image_hard_link_bytes(const struct wim_xml_info *info, int image); 29 | 30 | bool 31 | xml_get_wimboot(const struct wim_xml_info *info, int image); 32 | 33 | u64 34 | xml_get_windows_build_number(const struct wim_xml_info *info, int image); 35 | 36 | int 37 | xml_set_wimboot(struct wim_xml_info *info, int image); 38 | 39 | /*****************************************************************************/ 40 | 41 | int 42 | xml_update_image_info(WIMStruct *wim, int image); 43 | 44 | int 45 | xml_add_image(struct wim_xml_info *info, const tchar *name); 46 | 47 | int 48 | xml_export_image(const struct wim_xml_info *src_info, int src_image, 49 | struct wim_xml_info *dest_info, const tchar *dest_image_name, 50 | const tchar *dest_image_description, bool wimboot); 51 | 52 | void 53 | xml_delete_image(struct wim_xml_info *info, int image); 54 | 55 | 56 | void 57 | xml_print_image_info(struct wim_xml_info *info, int image); 58 | 59 | /*****************************************************************************/ 60 | 61 | struct wim_reshdr; 62 | 63 | #define WIM_TOTALBYTES_USE_EXISTING ((u64)(-1)) 64 | #define WIM_TOTALBYTES_OMIT ((u64)(-2)) 65 | 66 | int 67 | read_wim_xml_data(WIMStruct *wim); 68 | 69 | int 70 | write_wim_xml_data(WIMStruct *wim, int image, 71 | u64 total_bytes, struct wim_reshdr *out_reshdr, 72 | int write_resource_flags); 73 | 74 | #endif /* _WIMLIB_XML_H */ 75 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/xml_windows.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIMLIB_XML_WINDOWS_H 2 | #define _WIMLIB_XML_WINDOWS_H 3 | 4 | #include "wimlib/types.h" 5 | 6 | int 7 | set_windows_specific_info(WIMStruct *wim); 8 | 9 | #endif /* _WIMLIB_XML_WINDOWS_H */ 10 | -------------------------------------------------------------------------------- /src/wimlib/wimlib/xpress_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * xpress_constants.h 3 | * 4 | * Constants for the XPRESS compression format. 5 | */ 6 | 7 | #ifndef _XPRESS_CONSTANTS_H 8 | #define _XPRESS_CONSTANTS_H 9 | 10 | #define XPRESS_NUM_CHARS 256 11 | #define XPRESS_NUM_SYMBOLS 512 12 | #define XPRESS_MAX_CODEWORD_LEN 15 13 | 14 | #define XPRESS_END_OF_DATA 256 15 | 16 | #define XPRESS_MIN_OFFSET 1 17 | #define XPRESS_MAX_OFFSET 65535 18 | 19 | #define XPRESS_MIN_MATCH_LEN 3 20 | #define XPRESS_MAX_MATCH_LEN 65538 21 | 22 | #endif /* _XPRESS_CONSTANTS_H */ 23 | -------------------------------------------------------------------------------- /src/wue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Rufus: The Reliable USB Formatting Utility 3 | * Windows User Experience 4 | * Copyright © 2022 Pete Batard 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #pragma once 23 | 24 | extern int unattend_xml_flags, unattend_xml_mask; 25 | extern int wintogo_index, wininst_index; 26 | extern char* unattend_xml_path; 27 | 28 | char* CreateUnattendXml(int arch, int flags); 29 | BOOL ApplyWindowsCustomization(char drive_letter, int flags); 30 | int SetWinToGoIndex(void); 31 | BOOL SetupWinPE(char drive_letter); 32 | BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp); 33 | BOOL PopulateWindowsVersion(void); 34 | --------------------------------------------------------------------------------