Bona Fide OS Developer
View unanswered posts | View active topics It is currently Tue Mar 19, 2024 5:56 am



Post new topic Reply to topic  [ 5 posts ] 
 partcopy 
Author Message

Joined: Sat Jul 25, 2009 6:10 am
Posts: 112
Location: United Kingdom
Post partcopy
Anyone know if a partcopy is available for Windows x64?

_________________
Thanks,
Michael Sammels

OS Developing is 10% luck, 20% skill, 15% concentrated power of will. 5% pleasure, 50% pain, and a 100% reason continue the game.


Tue Feb 09, 2010 5:02 am
Profile
Site Admin

Joined: Sat Jul 25, 2009 7:44 am
Posts: 274
Location: United Kingdom
Post Re: partcopy
I dont know mate, But I do know that the source code is out there...

_________________
Thank you for reading,

Kieran C G Foot


Tue Feb 09, 2010 6:05 am
Profile WWW

Joined: Sat Jul 25, 2009 6:10 am
Posts: 112
Location: United Kingdom
Post Re: partcopy
I have found the solution:

http://sourceforge.net/projects/mingw/f ... z/download

_________________
Thanks,
Michael Sammels

OS Developing is 10% luck, 20% skill, 15% concentrated power of will. 5% pleasure, 50% pain, and a 100% reason continue the game.


Fri Feb 12, 2010 4:45 am
Profile
Site Admin

Joined: Sat Jul 25, 2009 7:44 am
Posts: 274
Location: United Kingdom
Post Re: partcopy
Cool mate. I knew it would be out there :P

_________________
Thank you for reading,

Kieran C G Foot


Sun Feb 14, 2010 1:25 pm
Profile WWW

Joined: Tue Dec 28, 2010 2:17 pm
Posts: 11
Post Re: partcopy
I think the following piece of code does the 'write sector 0' part of the partcopy
Code:
/*
    FileName: bootsectorwrite.cpp
    Author: dumb_terminal
    usage: <program> <drive letter> <bootloader file>
*/
#include <stdio.h>
#include <string.h>
#include <windows.h>

#pragma comment (lib, "LIBCD.lib")

int main(int argc, char *argv[]){
    char drvPath[255] = "" ;
    char bootFile[255] = "" ;

    char buffer[512] ;

    DWORD szRead, szWrite ;

    if (argc != 3){
        printf("Usage BootSectorWrite <DriveLetterUCase> <BinaryBootImage>\n") ;
        return 0 ;
    }

    strcpy(bootFile, argv[2]) ;
    sprintf(drvPath, "\\\\.\\%c:", argv[1][0]) ;
    HANDLE hFile = CreateFile(bootFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL) ;
    HANDLE hDrv = CreateFile(drvPath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, NULL) ;

    if (hFile == INVALID_HANDLE_VALUE || hDrv == INVALID_HANDLE_VALUE){
        printf("Error occured\n") ;
        return 0 ;
    }
   
    ReadFile(hFile, &buffer[0], 512, &szRead, NULL) ;
    WriteFile(hDrv, &buffer[0], szRead, &szWrite, NULL) ;

    CloseHandle(hFile) ;
    CloseHandle(hDrv) ;

    return 0 ;
}

well tried to be helpful.


Wed Dec 29, 2010 11:57 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.