English Amiga Board


Go Back   English Amiga Board > Requests > request.Apps

 
 
Thread Tools
Old 01 February 2020, 19:46   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,334
Program to fix/recalculate RDB checksums?

I'm wanting to use a hex editor to manually edit fields in the RDB sectors of a a hard drive image file.

Does any program exist to fix/recalculate the RDB sector checksums?
mark_k is online now  
Old 01 February 2020, 21:16   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
block_checksum.exe name.hdf offset

RDSK is at offset 0, but you can specify a different one for PART, FSHD, LSEG,..

It use gcc __builtin for my convenience but easy to adapt.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define max_block 65536

int main(int argc, char *argv[])
{
    uint32_t buffer[max_block/4];
    uint32_t checksum=0;
    FILE *fi;

    if ((fi=fopen(argv[1],"rb"))) {
        fseek(fi, atoi(argv[2]), SEEK_SET);
        fread(buffer,1,max_block,fi);

        uint32_t size=__builtin_bswap32(buffer[1]);
        buffer[2]=0;

        while (size)
            checksum+=__builtin_bswap32(buffer[--size]);

        printf("\nchecksum=0x%8X",-checksum);
        fclose(fi);
    };
    return 0;
}

Last edited by ross; 12 May 2023 at 19:02. Reason: --size fix
ross is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
ORIGINAL WorkBench checksums Supamax request.Other 186 18 May 2021 19:10
Amiga floppy checksums catphish support.Other 7 02 January 2020 16:10
Issues with non-RDB HDFs & full drive/RDB mode mark_k support.WinUAE 22 10 July 2018 00:46
Kickstart ROM Checksums vimfuego support.Hardware 1 18 September 2009 07:41
Unknown floppies: how to identify them using their checksums/CRC32? Supamax request.Other 5 13 May 2009 19:08

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:56.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11319 seconds with 15 queries