[REQUEST/INFO] Windows 98 Editions for collectors

Discussion in 'Windows XP / Older OS' started by Threat, Mar 28, 2014.

  1. pamonha

    pamonha MDL Novice

    Aug 11, 2017
    20
    13
    0
    All files corrected and links updated in the original post.
    Thank you.
     
  2. pamonha

    pamonha MDL Novice

    Aug 11, 2017
    20
    13
    0
    #283 pamonha, Nov 6, 2024
    Last edited: Dec 18, 2024
    This is the Linux script I use to remove the overdumped bytes based on the information from @vanelle:

    Code:
    #!/bin/bash
    #
    # License: CC0
    # Author: pamonha
    
    # Function to display error message and exit
    error_exit() {
        echo "$1" 1>&2
        exit 1
    }
    
    # Check if an argument (ISO file) was provided
    if [ $# -ne 1 ]; then
        error_exit "Usage: $0 <path_to_iso_file>"
    fi
    
    # Get the ISO file from the command-line argument
    iso_file="$1"
    
    # Check if the file exists
    if [ ! -f "$iso_file" ]; then
        error_exit "Error: ISO file not found: $iso_file"
    fi
    
    # Get the file size in bytes
    iso_file_size=$(stat --format="%s" "$iso_file")
    if [ -z "$iso_file_size" ] || [ "$iso_file_size" -le 0 ]; then
        error_exit "Error: Unable to retrieve file size or file is empty."
    fi
    
    # Calculate the file sector size (file size / 2048)
    file_sector_size=$((iso_file_size / 2048))
    
    # Define the fixed block size for ISO volume (286352 blocks of 2048 bytes)
    block_count=$(isoinfo -d -i "$iso_file" | awk '/^Volume size is:/ {print $4}')
    
    # Calculate the difference between the file sector size and the block count
    sector_diff=$((file_sector_size - block_count))
    
    # Calculate the number of bytes to exclude
    bytes_to_exclude=$((sector_diff * 2048))
    
    # Check if there are bytes to exclude
    if [ "$bytes_to_exclude" -le 0 ]; then
        error_exit "Error: No bytes to exclude. The ISO file is smaller than the expected block size."
    fi
    
    # Create a new output file name adding _new, keep the original intact
    new_iso_file="${iso_file%.*}_new.iso"
    
    # Perform the exclusion using dd, writing to a new file
    echo "Excluding $bytes_to_exclude bytes from the end of the ${iso_file%.*}..."
    dd if="$iso_file" of="$new_iso_file" bs=2048 count=$((file_sector_size - sector_diff)) status=progress
    
    # Confirm completion
    echo "Process completed. The modified ISO file has been saved as $new_iso_file."
    
    exit 0
    Name it whatever you want, do 'chmod 775 trim_iso_overdump.sh' and run:

    Code:
    $ ./trim_iso_overdump.sh 'WINDOWS_98_BR(OEM).iso'
    Excluding 303104 bytes from the end of the ISO file...
    471240704 bytes (471 MB, 449 MiB) copied, 4 s, 118 MB/s
    286352+0 records in
    286352+0 records out
    586448896 bytes (586 MB, 559 MiB) copied, 4.95718 s, 118 MB/s
    Process completed. The modified ISO file has been saved as WINDOWS_98_BR(OEM)_new.iso.
    Now the ISO match the correct sha1:

    Code:
    SHA1: c9c632b41cd5053e9ced7ea60a970dae14d9fe21
    I don't have all possible Windows media to test the script with. To preserve the original ISO, the script saves all changes to a new ISO file. The script doesn't work with files signed with AutoCRC (at least not with the ones I have), for those ISOs you have to use the dtn tool (the tool just removes zeros from the end of the ISO).

    The script works as is, feel free to improve it.

    Edit: Calculate our $block_count instead of using a fixed value.