Jump to content











Photo

Managing MBR's by jaclaz MBRBatch Release 0.01 ALPHA


  • Please log in to reply
44 replies to this topic

#1 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 22 June 2008 - 03:16 PM

=============================================================================
Managing MBR's by jaclaz MBRBatch Release 0.01 ALPHA
=============================================================================

Hi

This tutorial is based on information given by "jaclaz" in link below.Thanks jaclaze for
good work:

http://www.boot-land...?showtopic=3191

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx

One that works in boot projects needs to have informations about MBR ,savingit,changing
that and ...to be able to work by various OS's,boot loaders,and else

He needs to make several images to test his ideas and realy should work hard and hard
to exprement new things and make new methodes.

To help this kind of users , jaclaz has made an small nice script, that works fast and
safe with few small free files,and by using that you can do a lot of operations fastly
and easy for example:

save MBR code of disk or an mbr file.
Copy MBR code of disk or an mbr file to another file.
Can write the MBR code of source file to destdrive.
Creates MBR from a 2k/XP file saving it as targetfile.
Show partition entries in source MBR(either a MBR file or a drive).
Edit one partition entry in MBR file.
Patches sourcefile with "HP" USB/int13 modification.
create HD like images of arbitrary size and to format them with various geometries.


In this small tutor I just have put together informations from link above,In other
words i have just bring you files needed,and some descriptions of commands by examples
for each command.

All You need at this time is to Download MBRBatch.zip from attachment ,extract that
some where .Contents of MBRBatch.zip are as below:

dsfi.exe
dsfo.exe
DumpHex.exe
fsz.exe
gsar.exe
MAKEFILE
mbr0toX.cmd
mbrbatch.cmd ( mbrbatch002)
mkimg.cmd (mkimg003)
mksparse.c
mksparse.exe
mksparse.rc
sources
vdk.exe
vdk.sys

Now you can go to cmd prompt and use commands in next paragraph to do your works.
Only Note that:

1.All commands must be DOS 8.3 format and using spaces in names and else are not allowed.

2.When using syntaxes,[source] can be a file or a drive number, [sourcefile] must be
a <=512 bytes file.source can be ANY file or PhysicalDrive number, the batch extracts just
the first 512 bytes of "source".if "source" does not has a MBR as first sector, results of
the VIEW command will be pretty much garbage.Drive numbers begin with 0.

3.When using syntaxes,[target] can be a file or a drive number, [targetfile] must be a NEW
file .If any non-optional parameter is missing, it will enter interactive mode.

4.In general syntax,first argument passed to the batch is ALWAYS a COMMAND, second and
further arguments are ALWAYS [parameters].

Hope if i had missed some thing or had any mistake,jaclaz will help.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx
Commands and Examples
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx


The general syntax is: MBRBATCH COMMAND [parameters]
------------------------------------------------------------------------------------------
Commands and examples:
================================================================================
==========

MBRBATCH COPY source targetfile length

Copies length bytes from source, saving it as targetfile

Example_1:

mbrbatch copy xxx.bin yyy.bin 512
will make yyy.bin and will copy xxx.bin code on it.(see pic_b from attachment)
here xxx.bin is a mbr file that you had placed in the same directory as
mbrbath file,and yyy.bin will be made in this directory too.

example_02:
mbrbatch.cmd COPY C:\MBRBATCHDIR\my_MBR.mbr C:\ANOTHERDIR\SomeMBR.bin

example_03:
mbrbatch.cmd COPY 0 my_MBR.mbr
================================================================================
==========

MBRBATCH WRITE source target [/F]

Simply writes the MBR code of source file to destdrive.For security reasons, if you input
first disk, i.e. 0, you NEED to add the parameter /F (for FORCE) when mbrbatch.cmd is
invoked from command line or from amother batch.In interactive mode, a confirmation will be
asked anyway.

Example_01:

C:\MBR>mbrbatch write xxx.bin zzz.bin
writes from xxx.bin to zzz.bin (see pic_c from attachment)

Example_02:

mbrbatch.cmd WRITE C:\A_directory\my_MBR.mbr 1
will write contents of file my_MBR.mbr (512 bytes) to \\.\PHYSICALDRIVE1

Example_03:

mbrbatch.cmd WRITE C:\A_directory\my_MBR.mbr 0 /F
will write contents of file my_MBR.mbr (512 bytes) to \\.\PHYSICALDRIVE0

================================================================================
==========
MBRBATCH HELP command

Displays help for the given command

Example:

mbrbatch help copy
will show help for copy command (pic_d)

================================================================================
==========
MBRBATCH CREATE targetfile

Creates MBR from a 2k/XP file saving it as targetfile.

================================================================================
==========
MBRBATCH VIEW source

Shows partition entries in source MBR.Source can be either a MBR file or a drive number.
Drive numbers begin with 0.

example_01:

mbrbatch view xxx.bin 512
will show as pic_a from attachment

example_02:

mbrbatch.cmd VIEW C:\MBRBATCHDIR\my_MBR.mbr

example_03:

mbrbatch.cmd VIEW 0

================================================================================
==========
MBRBATCH EDIT sourcefile [params]

Edits one partition entry in MBR file.Source can be ONLY a MBR file (CREATEd or COPYed).
This command is compex.run "mbrbatch help edit" to see more help

Example_01:

mbrbatch.cmd CHANGE my_MBR.mbr 255/63 1 0B 80 CHS 0 1 1 127 254 63

Example_02:

mbrbatch.cmd CHANGE my_MBR.mbr 255/63 1 0B 80 LBA 63 2056257

================================================================================
==========
MBRBATCH UPATCH sourcefile

Patches sourcefile with "HP" USB/int13 modification. sourcefile (MBR) must contain
2K/XP/2003 MBR code).Simply changes the MBR code of source file to skip Extended INT13h
checks, exactly as the DataSystem/HP utility does.This is only worth a try if you are
managing a MBR on a USB Mass Storage Device, be it an external hard disk or Flash memory
device, and only if the drive does not boot on a certain type of motherboard with the
normal MBR, i.e. the one you can CREATE with this batch.

Example:

mbrbatch.cmd UPATCH C:\A_directory\my_MBR.mbr

================================================================================
==========
MKIMG
by typing this command it will:

1) asks for a file name (for the moment use the same directory where the script and all
utilities are)
2) asks for an image size in bytes, Kbytes, Mbytes or Gbytes
3) asks for the desired geometry
4) asks for the desired Partition (filesystem) type
5) asks whether you want to use the (default) mksparse.exe to create a sparse image or
fsz.exe to create a full image
6) creates the image
7) autocalculates partition table entries to create the single biggest possible partition
for given image size and creates a MBR with this data and 2K/XP MBR code
8) copies this MBR to the image
9) mounts the image with VDK and formats it using "standard" FORMAT
10) opens with Explorer the freshly mounted Virtual Disk

The script works both in interactive mode and invoked from command line with all parameters,
in this case it accepts a further switch "/np" for "NO PROMPTS" that COMPLETELY REMOVES any
confirmation to delete existing files and to format the Virtual Disk.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxx

have nice times

hope that jaclaz will complete tutor

shirin

Attached Files



#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 June 2008 - 04:32 PM

Very good! :)

I want to add only a couple of things.

With very little effort the batch files can be used to fdisk/format a USB stick, by creating a disk image.

Basically you need to know the EXACT size of the USB stick, a method (a bit slow though) is to copy the whole stick using dsfo/dsfi.

If you have just one drive, it will be \\.\PhysicalDrive0 and the USB stick will be \\.\PhysicalDrive1 (change drive number for your situation)

Now, open a command prompt in the directory where the batch and tools are and:
dsfo \\.\PHYSICALDRIVE1 0 0 NUL
this will copy the whole stick to the NUL device (thus occupying NO space on any of your drives), you'll get something like this:

OK, 128000000 bytes, 6.540s, MD5 = 786a48c5db7548a6bf34cb945b62ae75


Jolt down the number of transferred bytes, 128000000 in this example.

Now, possibly on a NTFS partition (to get the advantage of using mksparse and have a sparse file that will occupy just a bunch of Kbytes) create a disk image (K:\OFS\test.img in this example):

K:\OFS\>mkimg
Please enter target file name: test.img
Image size, in bytes or suffixed by K, M or G for Kilo Mega or Giga
Please enter target image size: 128000000
Please type desired geometry [255/63 128/63 64/63 16/63 64/32]: 255/63
Available partition types for this image, 128000000 bytes:
06 FAT 16 CHS Mapped
07 NTFS
0B FAT 32 CHS Mapped
0C FAT 32 LBA Mapped
0E FAT 16 LBA Mapped
Please type desired Partition Type [06 07 0B 0C 0E]: 06
Please type /fsz to use fsz.exe or [ENTER] to use mksparse.exe:
Creating a MBR from G:\WINNT\System32\dmadmin.exe with dsfo.exe:
OK, 512 bytes, 0.000s, MD5 = 61a174a7d3cbe41d9996de0f124b7ebf

Image will be mounted as 06h:FAT16

The batch has detected that the newly created image is mounted as drive M:

NOW it would be the perfect time to stop if you are not sure about
what you are doing.

Press any key to continue . . .


or directly on command line:
mkimg test.img 128000000 255/63 06 /mks

You will be prompted to format the mounted virtual drive, once this has been done, an Explorer window will open on the (empty) virtual drive.

Copy to the mounted virtual drive what you want to experiment with, typically NTLDR, NTDETECT.COM and BOOT.INI, or use this other batch:
http://www.boot-land...?showtopic=2362
to change name of the loader if using a renamed SETUPLDR.BIN like PELDR, grub4dos GRLDR or whatever, then close the Explorer window, the drive will be unmounted and VDK driver removed.

Now all you have to do is to copy the image to the USB stick:
dsfi \\.\PHYSICALDRIVE1 0 0 K&#58;\OFS\test.img

Something to remember:
Most, if not ALL devices have a geometry of nx255x63, so generally speaking giving mkimg a parameter of 255/63 for geometry should be first attempt.

Qemu BIOS is a more "exact" one and for small images it "needs" a geometry of 16/63.

If the partition is formatted with any of the LBA Partition ID's:
07 NTFS
0C FAT 32 LBA Mapped
0E FAT 16 LBA Mapped
geometry should not be a problem, but it is always better to have something that can work with BOTH types of addressing, as long as the drive size is within the CHS addressing limits (either 504 Mib or 7.888 Gib depending on BIOS):
http://www.pcguide.c...odesECHS-c.html

a "correctly" formatted disk image or USB stick should boot equally well when you change for example with BEEBLEBROX or PTEDIT32, the partition ID from 06 to 0E and viceversa or from 0B to 0C and viceversa.

If the stick does not boot this way, you can try using the mbrbatch to apply the int13 patch that the HP USB formatting utility uses:
MBRBATCH COPY 1 my_MBR.mbr
(this will copy MBR from \\.\PhysicalDrive1 to file my_MBR.mbr)

MBRBATCH UPATCH my_MBR.mbr
(this will apply the patch to file my_MBR.mbr)

MBRBATCH WRITE my_MBR.mbr 1
(this will copy MBR from file my_MBR.mbr to \\.\PhysicalDrive1)


Have fun.

:)

jaclaz

#3 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 22 June 2008 - 08:20 PM

[quote name='jaclaz' date='Jun 22 2008, 04:32 PM' post='38197']
Very good! :)

I want to add only a couple of things.

=========================================
Hi jaclaz

1. thank you for adding more information

2.I have not heared about "sparse" files befor.so would you talk about what are those files
and what is usage of making image and loading them??

I will be happy to learn more if you help

have nice times

shirin

#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 June 2008 - 07:05 AM

The NTFS filesystem (NOT FAT16, NOT FAT32) allows for making "sparse" files.

In a nutshell a sparse file is a file that "declares" itself to be a given size, say 1 Gb, but actually occupies on disk ONLY the space of data that is written in it.

Just open a command prompt on a NTFS volume and run

mksparse test.dat 1G

Now run:
dir test.dat

You will get:
23/06/2008  08.59		1.073.741.824 test.dat

If you open the directory in Explorer you will see test.dat as being 1.048.576 Kb.

Now right click on it an select Properties, you'll see:
Size 1,00 GB (1.073.741.824 byte)
Size on disk 4,00 KB (4.096 byte)

Such a file, when mounted as a disk image, will grow in disk occupation according to what you add to it.

When you copy the file, it will be "padded" with 00 sectors until the "declared" size has been reached.

jaclaz

#5 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 23 June 2008 - 09:53 AM

[quote name='jaclaz' date='Jun 23 2008, 07:05 AM' post='38242']
The NTFS filesystem (NOT FAT16, NOT FAT32) allows for making "sparse" files.

==========================================================
Hi jaclaz

very new and interesting for me.That can help me in my exprements (by using your mbrbatch)
very much and fast

thank you for informations

shirin

#6 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 24 September 2008 - 07:39 PM

Success :)
****All useful info from post #6 to post #44 are gathered together in this post so now MBRBatch works better :huh:

(ps: I change places of post #6 and post #14 so it will be easier to find this useful post)

here is the file
Download MBRBatch_x64_&_x86_Compatible.rar

Here are all modification (summary) i made to use MBRBatch.zip prepared by Shirin Zaban at post #1
1) Now compatible with both with x86 and x64 (tested with xpsp2x86, 2k3sp2x64, Vistax86 (i guess will work with Vistax64 too))
** Only Vista users: Ask a xp user friend for dmadmin.exe file, or obtain it from a service pack of xp or 2k3, and put dmadmin.exe to the folder where mbrbatch.cmd exists.
2) Also correction for parttype added
3) Optional feature added to mkimg.cmd so
3a) you can create .\BootFiles\ folder and put one or more files: boot.ini, NTDETECT.COM, NTLDR, grldr, MENU.LST so they are copied automatically after mounting created image
3b) you can create .\ExtraFiles\ folder and put files in it (ex: livexp :)) so they are copied after \BootFiles\
ps: This is an optional feature, means you dont have to create .\BootFiles\ or/and .\ExtraFiles\ folders, if folders are not created you will only get an empty image which will work for your needs.


Added files:
1) bpatcher.exe (To make command hexedit) (4KB) (look end of message for info)
2) vdk_x64.exe (Sfx archive including vdk.exe vdk.sys)
3) vdk_x86.exe (Sfx archive including vdk.exe vdk.sys)
4) BeeblebroxNT.exe (v1.0, very helpful mbr utility)
5) nfgdump.exe (used for only to obtain disk number of virtual disk)
6) 99_cmd.cmd (To start command interface easly)

Deleted files:
Reason: they are already in Sfx archive vdk_x86.exe
1) vdk.exe
2) vdk.sys

Overwrite files:
1) mkimg.cmd - i used mkimg003.zip (post #12) of jaclaz
2) mbrbatch.cmd - i used mbrbatch002.zip of jaclaz

Added lines (bold lines are added ones, others to make a reference to find easly)

mkimg.cmd file:

REM mkimg.cmd Modded From mkimg003.zip of jaclaz
VDK.EXE STOP
VDK.EXE REMOVE
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" start /wait vdk_x64.exe
if "%PROCESSOR_ARCHITECTURE%" == "x86" start /wait vdk_x86.exe
cls
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS
.
.
.


If NOT EXIST .\BootFiles goto :Skipcopybootfilesxx
IF /I NOT %NoPrompts%.==/np. CALL :docopyfiles BootFiles
:Skipcopybootfilesxx
If NOT EXIST .\ExtraFiles goto :Skipcopyextrafilesxx
IF /I NOT %NoPrompts%.==/np. CALL :docopyfiles Extrafiles
:Skipcopyextrafilesxx
goto :Skipcopyfilesxx
:docopyfiles
SET Confirm=Y
CLS
ECHO Do you want to copy %1 to the mounted image?
ECHO For YES press any key (or just ENTER)
ECHO For NO press N and ENTER
SET /P Confirm=
IF /I NOT %Confirm%==Y GOTO :EOF
IF NOT %1.==BootFiles. GOTO :Skipbootfiles
FOR /F "tokens=1 delims=" %%A in ('DIR /b .\Bootfiles\' ) DO (
copy /y .\BootFiles\%%A %drive%
)
IF NOT %1.==Extrafiles. GOTO :Skipextrafiles
:Skipbootfiles
xcopy .\%1\*.* %drive%\*.* /i /s /e /r /v /k /f /c /h
:Skipextrafiles
GOTO :EOF
:Skipcopyfilesxx

REM CORRECTION on vdk mounted image
if "%PartType%" == "0E" CALL :correctionfixa
if "%PartType%" == "0C" CALL :correctionfixa

IF /I NOT %NoPrompts%.==/np. (
START /WAIT %SystemRoot%\explorer.exe %drive%
ECHO.
ECHO Press any key to unmount the image and uninstall vdk.exe...
ECHO.
PAUSE
)
VDK.EXE REMOVE
vdk.exe open * %Targetfile% /rw
VDK.EXE REMOVE
GOTO :EOF

:correctionfixa
for /f "tokens=3 delims=\Dev " %%A in ('nfgdump list^|FIND "%DRIVE%"') do SET Drivenumber=%%A
IF EXIST %Targetfile%512a.mbr del /q /f %Targetfile%512a.mbr
dsfo \\.\PHYSICALDRIVE%Drivenumber% 0 512 %Targetfile%512a.mbr
bpatcher.exe %Targetfile%512a.mbr 1C2 %PartType%
dsfi \\.\PHYSICALDRIVE%Drivenumber% 0 512 %Targetfile%512a.mbr
del /q /f %Targetfile%512a.mbr
GOTO :EOF

:MKIMGI_TF



mbrbatch.cmd file:

REM mbrbatch.cmd Modded From mbrbatch002.zip of jaclaz
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS
.
.
.
SET Sysfile=%SystemRoot%\System32\dmadmin.exe
if exist .\dmadmin.exe goto dmadimexeexist
if exist .\dmadmin.ex_ goto dmadimexexist
if exist %SystemRoot%\System32\dmadmin.exe copy %SystemRoot%\System32\dmadmin.exe .\
goto dmadimexeexist
:dmadimexexist
expand dmadmin.ex_ .\dmadmin.exe
:dmadimexeexist
if not exist dmadmin.exe goto dmadminnotexist
goto dmadmincontinue
:dmadminnotexist
cls
ECHO dmadmin.exe or dmadmin.ex_ not found press any key to exit
pause
exit
:dmadmincontinue
set Sysfile=%~dp0dmadmin.exe

.
.
.
.
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto echooox64bypass
if not exist echoo.com (
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6
echo ?@xAyJHmH@=a?}VjuN?_LEkS?`w`s_{OCIvJDGEHtc{OCIKGMgELCI?GGg
echo EL?s?WL`LRBcx=k_K?AxVD?fCo?Cd?BLDs0
)>>echoo.com
echoo.com %DataString% >TMPDATA.$$$
goto echooobpatbypass
:echooox64bypass
echo 0123456789ABCD>TMPDATA.$$$
bpatcher.exe TMPDATA.$$$ 00 %Active%
bpatcher.exe TMPDATA.$$$ 01 %BHd%
bpatcher.exe TMPDATA.$$$ 02 %BSec%
bpatcher.exe TMPDATA.$$$ 03 %BCyl%
bpatcher.exe TMPDATA.$$$ 04 %Parttype%
bpatcher.exe TMPDATA.$$$ 05 %EHd%
bpatcher.exe TMPDATA.$$$ 06 %ESec%
bpatcher.exe TMPDATA.$$$ 07 %ECyl%
bpatcher.exe TMPDATA.$$$ 08 %StartLBA:~0,2%
bpatcher.exe TMPDATA.$$$ 09 %StartLBA:~2,2%
bpatcher.exe TMPDATA.$$$ 0A %StartLBA:~4,2%
bpatcher.exe TMPDATA.$$$ 0B %StartLBA:~6,2%
bpatcher.exe TMPDATA.$$$ 0C %SectorsLBA:~0,2%
bpatcher.exe TMPDATA.$$$ 0D %SectorsLBA:~2,2%
bpatcher.exe TMPDATA.$$$ 0E %SectorsLBA:~4,2%
bpatcher.exe TMPDATA.$$$ 0F %SectorsLBA:~6,2%
:echooobpatbypass

dsfi %source% %Offset% %Length% TMPDATA.$$$>nul


Thanks a lot to Shrin getting everything together with a nice tutorial,
Thanks a lot to jaclaz for making these commands, and all help,
now i can learn what i can do more easly by using this wonderful utility on my hostos :huh:.


ps:
i cant find source for bpatcher, for incase situations here is a bpatcher.exe
Copy inside codebox to a notepad and save it to a txt file
Open tiny hexer , choose File--->Import, select txt file, when screen comes select 'Hex text' and click import,
Than File--->Save As--->bpatcher.exe (md5: 070F4064552937858066A77A8ACEF9E2 )
[codebox]4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D8 00 00 00 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 00 73 96 E0 D4 37 F7 8E 87 37 F7 8E 87 37 F7 8E 87 CB D7 9C 87 34 F7 8E 87 B9 E8 9D 87 24 F7 8E 87 54 D5 A4 87 36 F7 8E 87 41 6A F2 87 36 F7 8E 87 41 6A F6 87 36 F7 8E 87 52 69 63 68 37 F7 8E 87 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 45 00 00 4C 01 04 00 23 CE 7F 44 00 00 00 00 00 00 00 00 E0 00 03 01 0B 01 08 00 00 04 00 00 00 08 00 00 00 00 00 00 00 10 00 00 00 10 00 00 00 20 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 04 00 00 00 00 00 00 03 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 40 20 00 00 50 00 00 00 00 40 00 00 88 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 74 65 78 74 00 00 00 40 03 00 00 00 10 00 00 00 04 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 60 2E 72 64 61 74 61 00 00 B8 01 00 00 00 20 00 00 00 02 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 40 2E 64 61 74 61 00 00 00 08 01 00 00 00 30 00 00 00 02 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 C0 2E 72 73 72 63 00 00 00 88 03 00 00 00 40 00 00 00 04 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C7 05 E0 30 40 00 01 00 00 00 E8 47 02 00 00 50 E8 19 03 00 00 85 C0 0F 84 B3 01 00 00 A3 E4 30 40 00 50 E8 98 02 00 00 8B 15 E4 30 40 00 85 C0 0F 84 9A 01 00 00 48 80 3C 10 20 74 F1 C6 44 10 01 00 85 C0 0F 84 86 01 00 00 48 80 3C 10 20 75 F1 C6 04 10 00 8D 4C 10 01 89 0D EC 30 40 00 85 C0 0F 84 69 01 00 00 48 80 3C 10 20 75 F1 C6 04 10 00 8D 4C 10 01 89 0D E8 30 40 00 6A 00 6A 00 6A 03 6A 00 6A 00 68 00 00 00 C0 FF 35 E4 30 40 00 E8 AE 01 00 00 83 F8 FF 0F 84 31 01 00 00 A3 F0 30 40 00 6A 00 50 E8 B0 01 00 00 83 F8 00 0F 8E 10 01 00 00 A3 FC 30 40 00 6A 00 6A 00 6A 00 6A 04 6A 00 FF 35 F0 30 40 00 E8 7B 01 00 00 85 C0 0F 84 EE 00 00 00 A3 F4 30 40 00 6A 00 6A 00 6A 00 6A 02 50 E8 78 01 00 00 85 C0 0F 84 C8 00 00 00 A3 F8 30 40 00 FF 35 E8 30 40 00 E8 6E 01 00 00 3B 05 FC 30 40 00 72 0F C7 05 E0 30 40 00 02 00 00 00 E9 96 00 00 00 50 FF 35 EC 30 40 00 E8 4B 01 00 00 59 03 0D F8 30 40 00 88 01 C7 05 E0 30 40 00 00 00 00 00 81 3D FC 30 40 00 00 04 00 00 7C 6B A1 F8 30 40 00 66 81 38 4D 5A 75 5F 03 40 3C 8B C8 81 C1 F8 00 00 00 2B 0D F8 30 40 00 3B 0D FC 30 40 00 73 46 81 38 50 45 00 00 75 3E 66 81 78 18 0B 01 75 36 50 68 04 31 40 00 68 00 31 40 00 FF 35 FC 30 40 00 FF 35 F8 30 40 00 E8 A3 00 00 00 59 85 C0 75 0C C7 05 E0 30 40 00 03 00 00 00 EB 09 8B 15 04 31 40 00 89 51 58 FF 35 F8 30 40 00 E8 AE 00 00 00 FF 35 F4 30 40 00 E8 79 00 00 00 FF 35 F0 30 40 00 E8 6E 00 00 00 68 00 30 40 00 E8 1E 01 00 00 83 3D E0 30 40 00 00 75 0C 68 21 30 40 00 E8 0B 01 00 00 EB 3D 83 3D E0 30 40 00 01 75 0C 68 3E 30 40 00 E8 F6 00 00 00 EB 28 83 3D E0 30 40 00 02 75 0C 68 5D 30 40 00 E8 E1 00 00 00 EB 13 83 3D E0 30 40 00 03 75 0A 68 93 30 40 00 E8 CC 00 00 00 FF 35 E0 30 40 00 E8 19 00 00 00 CC FF 25 00 20 40 00 FF 25 08 20 40 00 FF 25 0C 20 40 00 FF 25 10 20 40 00 FF 25 14 20 40 00 FF 25 18 20 40 00 FF 25 1C 20 40 00 FF 25 20 20 40 00 FF 25 24 20 40 00 CC CC 55 8B EC 53 56 57 8B 7D 08 8B 75 08 8A 07 47 0A C0 75 F9 2B F7 33 DB 03 FE 33 D2 F7 D6 EB 23 8A 07 3C 41 72 0C 2C 57 80 D2 00 C0 E2 05 02 C2 EB 02 2C 30 8D 4E FF 83 E0 0F C1 E1 02 D3 E0 03 D8 47 4E 0B F6 75 D9 8B C3 5F 5E 5B C9 C2 04 00 CC 8B 44 24 04 53 8D 50 03 8B 18 83 C0 04 8D 8B FF FE FE FE F7 D3 23 CB 81 E1 80 80 80 80 74 E9 F7 C1 80 80 00 00 75 06 C1 E9 10 83 C0 02 D0 E1 1B C2 5B C2 04 00 CC CC CC 55 8B EC 83 C4 F4 6A F5 E8 2F 00 00 00 89 45 FC FF 75 08 E8 B0 FF FF FF 89 45 F4 6A 00 8D 45 F8 50 FF 75 F4 FF 75 08 FF 75 FC E8 13 00 00 00 8B 45 F8 C9 C2 04 00 FF 25 34 20 40 00 FF 25 28 20 40 00 FF 25 2C 20 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CC 20 00 00 00 00 00 00 F0 20 00 00 FE 20 00 00 0C 21 00 00 22 21 00 00 30 21 00 00 42 21 00 00 50 21 00 00 60 21 00 00 9C 21 00 00 AC 21 00 00 00 00 00 00 80 21 00 00 00 00 00 00 00 00 00 00 90 20 00 00 00 00 00 00 00 00 00 00 E2 20 00 00 00 20 00 00 98 20 00 00 00 00 00 00 00 00 00 00 72 21 00 00 08 20 00 00 C4 20 00 00 00 00 00 00 00 00 00 00 90 21 00 00 34 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CC 20 00 00 00 00 00 00 F0 20 00 00 FE 20 00 00 0C 21 00 00 22 21 00 00 30 21 00 00 42 21 00 00 50 21 00 00 60 21 00 00 9C 21 00 00 AC 21 00 00 00 00 00 00 80 21 00 00 00 00 00 00 02 00 43 68 65 63 6B 53 75 6D 4D 61 70 70 65 64 46 69 6C 65 00 00 69 6D 61 67 65 68 6C 70 2E 64 6C 6C 00 00 1A 00 43 6C 6F 73 65 48 61 6E 64 6C 65 00 30 00 43 72 65 61 74 65 46 69 6C 65 41 00 31 00 43 72 65 61 74 65 46 69 6C 65 4D 61 70 70 69 6E 67 41 00 00 80 00 45 78 69 74 50 72 6F 63 65 73 73 00 C8 00 47 65 74 43 6F 6D 6D 61 6E 64 4C 69 6E 65 41 00 F5 00 47 65 74 46 69 6C 65 53 69 7A 65 00 BA 01 4D 61 70 56 69 65 77 4F 66 46 69 6C 65 00 77 02 55 6E 6D 61 70 56 69 65 77 4F 66 46 69 6C 65 00 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 00 00 30 00 50 61 74 68 47 65 74 41 72 67 73 41 00 00 73 68 6C 77 61 70 69 2E 64 6C 6C 00 34 01 47 65 74 53 74 64 48 61 6E 64 6C 65 00 00 9E 02 57 72 69 74 65 46 69 6C 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 0A 20 42 50 61 74 63 68 65 72 20 31 2E 30 0D 0A 20 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 0D 0A 00 20 46 69 6C 65 20 70 61 74 63 68 69 6E 67 20 73 75 63 63 65 73 73 66 75 6C 6C 0D 0A 00 20 41 6E 20 75 6E 65 78 70 65 63 74 65 64 20 65 72 72 6F 72 20 6F 63 63 75 72 65 64 0D 0A 00 20 54 68 65 20 6F 66 66 73 65 74 20 70 61 72 61 6D 65 74 65 72 20 69 73 20 74 6F 6F 20 68 69 67 68 20 66 6F 72 20 74 68 65 20 66 69 6C 65 20 73 69 7A 65 0D 0A 00 20 54 68 65 20 66 69 6C 65 20 68 61 73 20 62 65 65 6E 20 70 61 74 63 68 65 64 20 62 75 74 20 63 68 65 63 6B 73 75 6D 20 63 6F 72 72 65 63 74 69 6F 6E 20 68 61 73 20 66 61 69 6C 65 64 0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 10 00 00 00 18 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 30 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 48 00 00 00 60 40 00 00 24 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 03 34 00 00 00 56 00 53 00 5F 00 56 00 45 00 52 00 53 00 49 00 4F 00 4E 00 5F 00 49 00 4E 00 46 00 4F 00 00 00 00 00 BD 04 EF FE 00 00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 02 00 00 01 00 53 00 74 00 72 00 69 00 6E 00 67 00 46 00 69 00 6C 00 65 00 49 00 6E 00 66 00 6F 00 00 00 5E 02 00 00 01 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 00 00 54 00 16 00 01 00 46 00 69 00 6C 00 65 00 44 00 65 00 73 00 63 00 72 00 69 00 70 00 74 00 69 00 6F 00 6E 00 00 00 00 00 42 00 79 00 74 00 65 00 20 00 70 00 61 00 74 00 63 00 68 00 65 00 72 00 20 00 70 00 72 00 6F 00 67 00 72 00 61 00 6D 00 2E 00 00 00 32 00 09 00 01 00 50 00 72 00 6F 00 64 00 75 00 63 00 74 00 4E 00 61 00 6D 00 65 00 00 00 00 00 42 00 50 00 61 00 74 00 63 00 68 00 65 00 72 00 00 00 00 00 28 00 04 00 01 00 46 00 69 00 6C 00 65 00 56 00 65 00 72 00 73 00 69 00 6F 00 6E 00 00 00 00 00 31 00 2E 00 30 00 00 00 32 00 09 00 01 00 49 00 6E 00 74 00 65 00 72 00 6E 00 61 00 6C 00 4E 00 61 00 6D 00 65 00 00 00 42 00 50 00 41 00 54 00 43 00 48 00 45 00 52 00 00 00 00 00 42 00 0D 00 01 00 4F 00 72 00 69 00 67 00 69 00 6E 00 61 00 6C 00 46 00 69 00 6C 00 65 00 6E 00 61 00 6D 00 65 00 00 00 42 00 50 00 41 00 54 00 43 00 48 00 45 00 52 00 2E 00 45 00 58 00 45 00 00 00 00 00 56 00 19 00 01 00 4C 00 65 00 67 00 61 00 6C 00 43 00 6F 00 70 00 79 00 72 00 69 00 67 00 68 00 74 00 00 00 50 00 68 00 69 00 6C 00 69 00 70 00 70 00 65 00 20 00 43 00 6F 00 75 00 6C 00 6F 00 6D 00 62 00 65 00 20 00 A9 00 20 00 32 00 30 00 30 00 36 00 00 00 00 00 5C 00 22 00 01 00 57 00 65 00 62 00 20 00 73 00 69 00 74 00 65 00 00 00 68 00 74 00 74 00 70 00 3A 00 2F 00 2F 00 77 00 77 00 77 00 33 00 2E 00 73 00 79 00 6D 00 70 00 61 00 74 00 69 00 63 00 6F 00 2E 00 63 00 61 00 2F 00 6C 00 61 00 7A 00 69 00 6D 00 75 00 74 00 65 00 00 00 3E 00 13 00 01 00 43 00 6F 00 6E 00 74 00 61 00 63 00 74 00 00 00 00 00 65 00 62 00 6D 00 6F 00 6C 00 75 00 6F 00 63 00 70 00 40 00 79 00 61 00 68 00 6F 00 6F 00 2E 00 63 00 61 00 00 00 00 00 2A 00 09 00 01 00 43 00 6F 00 6D 00 6D 00 65 00 6E 00 74 00 73 00 00 00 46 00 72 00 65 00 65 00 77 00 61 00 72 00 65 00 00 00 00 00 44 00 00 00 01 00 56 00 61 00 72 00 46 00 69 00 6C 00 65 00 49 00 6E 00 66 00 6F 00 00 00 00 00 24 00 04 00 00 00 54 00 72 00 61 00 6E 00 73 00 6C 00 61 00 74 00 69 00 6F 00 6E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [/codebox]***Tip For advanced ghost users (v11 used here):copying the image to the USB stick by using dsfi is very slow,example:[code]dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img[/code] Instead of using dsfi, after explorer opens, copy extra files, and close explorer.drive numbers start from 1 with ghost,so instead of 5 and 4 use 6 and 5[code]ghost32.exe -clone,mode=copy,src=6,dst=5 -ib[/code]
first this screen come warning for size
http://img162.images...56/snap4qj7.png
Click YES
Than last confirmation screen http://img162.images...57/snap5oe9.png
so all done in 6 seconds.
Interestingly ghost change 0C to 0B like format does. You may or maynot want to change 0B to 0C by using BeeblebroxNT.exe or anyother utility.

ps: i tried many but couldnt find a free command utility that works as fast as ghost32 (or nearly as fast as ghost32), please inform if you have faster results than dsfi with a free command utility.


***
Here is a mini simple example.
what i do to make my '4gb Kingston USB flash stick' bootable with jaclaz post #2 tutorial:

WARNING: If you install acronis diskdirector, it is reported that snapman.sys installed with acronis diskdirector prevents access to disk mbr, so before using this guide or tutorials at post #1 / #2 (or maybe any other disk utility) first uninstall diskdirector.
1)
i extract "MBRBatch_x64_&_x86_Compatible.rar" to D:\ (it can be C:\ , E:\ ...., i will use D:\ as an example) , for this mini guide D:\ should be ntfs, if fat32 look jaclaz post #2
** Only Vista users: Ask a xp user friend for dmadmin.exe file, or obtain it from a service pack of xp or 2k3, and put dmadmin.exe to D:\MBRBatch
* Optional1: Create a folder C:\MBRBatch\BootFiles and put NTDETECT.COM , NTLDR , boot.ini in it (you can use this option to copy these files, or you should copy in further steps)
* Optional2: Create a folder C:\MBRBatch\BootFiles and put grldr , MENU.LST in it (if you want to use grub use Option2 , grldr from grub4dos)
* Optional3: Create a folder C:\MBRBatch\ExtraFiles and put files you want to add to usb stick (maybe PE, maybe sth other)
ps: "Optional-->You dont have to, left to one's choice, not compulsory, voluntary, discretionary"
In this guide i use Option1 and 2
2)
I double click BeeblebroxNT.exe , by looking at "Size in Megabytes" I found out that disk drive number of my flash stick is 4
http://img519.images...4/snap1buu6.png
3)
I open command prompt and wrote:
dsfo \\.\PHYSICALDRIVE4 0 0 NUL
and result is: http://img374.images...34/snap2qf1.png
so here is what i need: 4127195136
4)
I wrote this lines to command prompt
mkimg yUSB.img 4127195136 255/63 0C /mks
http://img521.images...53/snap3eg4.png
Here warning says "NOW it would be the perfect time to stop if you are not sure about what you are doing." means The created virtual disk image (yUSB.img) is mounted to I: and I: will be formatted (drive letter I: will change due to your disk settings), If you dont have a mounted "letter" before this operation and you are sure this "letter" created now, than press a key to continue
http://img122.images...37/snap4yu4.png
last warning before format, press Y if you are sure
5)
Now image mounted and an explorer window opened, so if you want you can put extra files in it.
http://img122.images...13/snap5rf7.png
as i use option1 and option2, i have 5 files here. If you dont use option1 and option2, you wont have anyfiles.
If you dont use option1, than at least (must) copy NTDETECT.COM , NTLDR , boot.ini. (ps: a modified ntdetect.com and ntldr may be required, i prefer getting these files from tinyempire's ntldrusb.zip, also there are other methods around)
After putting extra files, press a key on command window, you will get a screen look like this
http://img122.images...48/snap6nx8.png
6)
Now all you have to do is to copy the image to the USB stick by using this command
dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img

and wait for a while than you will see this screen
http://img387.images...17/snap7bt4.png
7)
now close command window, safely remove usb stick, and plug in usb stick.
At this stage Everything worked nice for me

If the stick does not boot this way, you can try using the mbrbatch to apply the int13 patch that the HP USB formatting utility uses. Look end of post #2 of jaclaz.


Edit:
jaclaz also point this post to be used in future.
http://www.boot-land...?showtopic=3191
:)

#7 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 September 2008 - 09:17 AM

@Lancelot

The problem with reference to the two screenshots is that MBRBATCH/MKIMG (wanting to be REALLY "kosher") does not include the MBR code and "takes" it from a System file.

If you check the batch, you will see that the file used is dmadmin.exe (but there are two alternate possibilities) which is a file present in a 32 bit 2K/XP/Server 2003.

I have no 64 bit files, and definitely not an installed 64 bit system, so I have no way to find which is the "corresponding" file in those OS's.

What you could do would be to use a "good" (as opposed to XP Search, which is a joke :huh:) search program and scan your installed system files for the byte sequences that a MBR starts with, this should be enough:
33 C0 8E D0 BC 00
(of course, as soon as you hopefully find some "positives", the whole 512 bytes must be checked)
see also here:
http://thestarman.pc...asm/mbr/WTC.htm

Cannot say about the differences if any between my "original" files and those posted here.

The "good" ones are those in the original thread:
MKIMG 0.03
http://www.boot-land...opic=3191&st=11
or
MKIMG 0.03 "G"
(I trust Galapo enough to "bless" his modified version :huh:)
http://www.boot-land...opic=3191&st=12
MBRBATCH 0.02
http://www.boot-land...topic=3191&st=4

jaclaz

#8 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 25 September 2008 - 02:43 PM

33 C0 8E D0 BC 00
is in
dmadmin.exe
http://img360.images...16/snap3da2.png

so in mbrbatch.cmd i added these to lines in bold:

copy /y %SystemRoot%\System32\dmadmin.exe .\
set Sysfile=dmadmin.exe

dsfo %Sysfile% %Offset% %Length% %Target%


Here is 30.$$$ file (DELETED after jaclaz answer)

If this is right file, than a solution can be that way maybe (an idea only, as you are the master you know better)
x64 dont let x86 applications read files from C:\Windows\system32 etc.
but using copy from command line works fine :huh:


***
Than now echoo.com gave error???!!!

http://img515.images...01/snap2iz9.png

Is there anything else to use instead of echoo.com ????? (echoo.com %DataString% >TMPDATA.$$$)

ps:
i download ftp://137.193.64.130/pub/assembler/ube.zip to find an explanation to understand (probably my knowledge is not enough)
from http://forum.winimag...opic.php?t=2640 i got DumpHex.exe (read), for only info, DumpHex.exe reads with x64

#9 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 September 2008 - 05:54 PM

Hmmm, :) LOTS of questions, I don't think I have ALL answers in my hat :) (nor up my sleeve) :huh:.

The file 30.$$$ is "garbage" :) , it appears like being 512 bytes from the BEGINNING of the whole file, what you need is the 512 bytes beginning with:
33 C0 8E D0 BC 00

It seems like the %Offset% is 0. :)

Try adding the bolded lines:

copy /y %SystemRoot%\System32\dmadmin.exe .\
set Sysfile=dmadmin.exe
ECHO dsfo %Sysfile% %Offset% %Length% %Target%
PAUSE

dsfo %Sysfile% %Offset% %Length% %Target%


The first 440 bytes of the resulting 512 bytes files need to be the same as the first 440 bytes of ANY MBR of a disk partitioned under 2K/XP/2003 (32 bit).

However, what I was presuming was that somewhere, a copy of the MBR code should be in the x64 files. :)

I used echoo.com as it was a nice and easy app, that did just what was needed to avoid (yet another) external utility.

Probably it is a "more" general problem with .com files under x64. :)

I guess that there should be some other tool/utility capable of writing hex bytes to a file from command line, one could probably also use gsar.

Does gsar work under x64? Or is there a x64 version of gsar? ;)

An "explanation" of echoo.com way of working was posted here on boot-land:
http://www.boot-land...?showtopic=2681
http://www.boot-land...opic=2681&st=27

what is the part that is not clear? :huh:

jaclaz

#10 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 25 September 2008 - 09:23 PM

Sorry for late answer,

-
with codes you gave here is a picture i guess you want
http://img378.images...09260001vp7.png

-
as the file 30.$$$ i sent before is "garbage" :huh:
i get dmadmin.exe from a xpsp2enu (x86) machine and put it in the directory
and only add 1 line

set Sysfile=dmadmin.exe
dsfo %Sysfile% %Offset% %Length% %Target%

again garbage i guess :huh:
but i guess you will see the difference
http://lancelot.winbuilder.net/5F/30.$..._ile_Yaptim.rar

-
gsar seems to be working , i got gsar121 from http://home.online.no/~tjaberg/
what should i write instead of line
echoo.com %DataString% >TMPDATA.$$$
with gsar?

-

what is the part that is not clear?

i am learning rookie jaclaz :)

-
Edit:
links are/will deleted after your confirmations for not to alter any rules, please remind if i forget sth.

#11 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 25 September 2008 - 11:12 PM

After reading/looking more, i think i overcome the %Offset%=0 problem i guess,
so i add 2 lines in :MBRCREATE section (bold) in this way:


:MBRCREATE
IF %INTERACTIVE%.==1. CALL :MBRCREATEI
SET gsarstring=gsar -b -s:x33:xC0:x8E:xD0:xBC:x00:x7C:xFB:x50
SET Sysfile=%SystemRoot%\System32\dmadmin.exe
copy /y %SystemRoot%\System32\dmadmin.exe .\
set Sysfile=%~dp0dmadmin.exe
REM SET Sysfile=%SystemRoot%\System32\spcmdcon.sys
REM SET Sysfile=%SystemRoot%\ServicePackFiles\I386\setupdd.sys
FOR /F "tokens=3 delims=:" %%A IN ('%gsarstring% %Sysfile%^|FIND "%Sysfile%"^| FIND /V "match found"') DO SET /A Offset=%%A
SET /A Offset=%Offset%
Set /A Length=512
SET Target=%2
ECHO Creating a MBR from %Sysfile% with dsfo.exe:
REM IF EXIST %Target% del %Target%
dsfo %Sysfile% %Offset% %Length% %Target%
GOTO :EOF

so now 30.$$$ file start with "33 C0 8E D0 BC 00"

i made 3 trials, 2 of which are identical

http://lancelot.winbuilder.net/5F/30_dmadm...36;$$
http://lancelot.winbuilder.net/5F/30_dmadm...36;$$
http://lancelot.winbuilder.net/5F/30_dmadm...36;$$

30.$$$ file created under xpsp2 32bit have some more entries

80 01 01 00 06 FE 3F 81 3F 00 00 00 C3 DD 1F

maybe they are added in further steps of batch file, guessing added by using TMPDATA.$$$

-
and reminding asking what should i use instead of "echoo.com %DataString% >TMPDATA.$$$" ? :huh:

#12 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 September 2008 - 08:21 AM

-
gsar seems to be working , i got gsar121 from http://home.online.no/~tjaberg/
what should i write instead of line
echoo.com %DataString% >TMPDATA.$$$
with gsar?



30.$$$ file created under xpsp2 32bit have some more entries

80 01 01 00 06 FE 3F 81 3F 00 00 00 C3 DD 1F

maybe they are added in further steps of batch file, guessing added by using TMPDATA.$$$

-
and reminding asking what should i use instead of "echoo.com %DataString% >TMPDATA.$$$" ? :huh:


Yes, that is rather obviously the partition entry that is added.( I have no hex editor handy right now, but they should be 16 bytes, so you probably miss a 00 at the end).

echoo.com is used in the original batch to write the binary values calculated to the temporarary file and then the files are "merged".

You can use gsar to replace a sequence of 00's (the "right" ones, starting at offset 446 if I can remember right) in the "extracted" MBR with the correct binary values.

I don't remember right now which kind of data echoo.com uses and which gsar does :huh:, probably they are not the same and some further modifications need to be made to the batch

jaclaz

#13 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 26 September 2008 - 01:55 PM

but they should be 16 bytes, so you probably miss a 00 at the end).

you are right, there is 00 at the end,

as i couldnt use gsar (sorry, only a rookie), i am tryin to use another way and will post here if succeed :huh:

#14 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 26 September 2008 - 03:12 PM

I change places of post #6 and post #14 so it will be easier to find this useful post #14 for others.

Old post #6

Thanks a lot Shirin Zaban and a lot jaclaz

-
Mbrbatch works nicely with XPx86 :huh:.
-
mbrbatch.cmd here and in jaclaz page are different!?
-
A suggestion for x64:
why not include 64 bit versions of vdk.exe and vdk.sys in the package, http://oss.netfarm.it/win32/
they work fine (so far) (livexp project uses this x64 versions in wimpack script)
for my usage, i prepared 2 selfextracting archive; vdk_x64.exe, vdk_x86.exe ; both include vdk.exe and vdk.dll and both overwrites without asking to change x64-x86 versions easly

******
A problem with x64:
As a x64 user, i had a issue with mkimg.cmd (or dsfo.exe)
here are pictures
http://img513.images...3962/001tj9.png
http://img387.images...3451/002ih9.png
can there be a cure
or
is there another way you can suggest for 7th step written in tutorial



#15 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 September 2008 - 06:40 PM

Success :huh:


GOOD! :)


I hope i did all right way, thanks a lot for all help, now i can learn what i can do more easly by using this wonderful utility on my hostos :).


This is a (pardon me the pun :)) BINARY matter, it's either ON or OFF, 0 or 1, works or it does not. :)

This said, at first sight I do have some perplexities :huh:, meaning that there are "clean ON's" and "quick and dirty ON's" :):

:echooox64bypass
echo 01020304050607>TMPDATA.$$$
bpatcher.exe TMPDATA.$$$ 00 %Active%
bpatcher.exe TMPDATA.$$$ 01 %BHd%
bpatcher.exe TMPDATA.$$$ 02 %BSec%
bpatcher.exe TMPDATA.$$$ 03 %BCyl%
bpatcher.exe TMPDATA.$$$ 04 %Parttype%
bpatcher.exe TMPDATA.$$$ 05 %EHd%
bpatcher.exe TMPDATA.$$$ 06 %ESec%
bpatcher.exe TMPDATA.$$$ 07 %ECyl%
bpatcher.exe TMPDATA.$$$ 08 %StartLBA:~0,2%
bpatcher.exe TMPDATA.$$$ 09 %StartLBA:~2,2%
bpatcher.exe TMPDATA.$$$ 0A %StartLBA:~4,2%
bpatcher.exe TMPDATA.$$$ 0B %StartLBA:~6,2%
bpatcher.exe TMPDATA.$$$ 0C %SectorsLBA:~0,2%
bpatcher.exe TMPDATA.$$$ 0D %SectorsLBA:~2,2%
bpatcher.exe TMPDATA.$$$ 0E %SectorsLBA:~4,2%
bpatcher.exe TMPDATA.$$$ 0F %SectorsLBA:~6,2%


of three kinds:
1) using bpatcher you can patch directly the copy of the MBR extracted from the system file (you need not the TMPDATA.$$$)
2) either bpatcher can patch multiple bytes or it cannot (BINARY again):
if it can, you can do everything in one line:
bpatcher.exe TMPDATA.$$$ 00 %Active%%BHd%%BSec%%BCyl%%Parttype%%EHd%%ECyl%%StartLBA%%SectorsLBA%
if it cannot, ANY of these won't work:

bpatcher.exe TMPDATA.$$$ 08 %StartLBA:~0,2%
bpatcher.exe TMPDATA.$$$ 09 %StartLBA:~2,2%
bpatcher.exe TMPDATA.$$$ 0A %StartLBA:~4,2%
bpatcher.exe TMPDATA.$$$ 0B %StartLBA:~6,2%
bpatcher.exe TMPDATA.$$$ 0C %SectorsLBA:~0,2%
bpatcher.exe TMPDATA.$$$ 0D %SectorsLBA:~2,2%
bpatcher.exe TMPDATA.$$$ 0E %SectorsLBA:~4,2%
bpatcher.exe TMPDATA.$$$ 0F %SectorsLBA:~6,2%

3) VERY minor thing, but I would use:
echo 0123456789ABCD>TMPDATA.$$$
instead of
echo 01020304050607>TMPDATA.$$$
as it looks easier to the unexperienced eye.
(and before anyone with a REALLY unexperienced eye posts the question "WHY 14 bytes?", it's because ECHO adds CR+LF to the output, which makes them a round, nice 16 ;) )

Overall, VERY GOOD work! :)

jaclaz

#16 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 26 September 2008 - 07:52 PM

Overall, VERY GOOD work! :huh:

jaclaz


Nice to read that for a rookie from a master :)


I made some minor changes and added them to previos post (and uploaded), here is a mini list
echo 0123456789ABCD>TMPDATA.$$$
goto echooobpatbypass
:echooobpatbypass
VDK.EXE STOP
VDK.EXE REMOVE

ps: vdk.exe stop / remove for accidental X clicks to command screen :)

-

using bpatcher you can patch directly the copy of the MBR extracted from the system file

yes, but i want to make as less modification as possible so that is why i only modified echooo section. It is up to you master :) jacklazz to use it that way on next version
(ps: also same reason for not to delete all echooo section and instead using goto)
-
bpatcher cant patch multiple lines


I have question now about mbrbatch using fdisk/format a usb stick
i have a kingston usb stick, 4gb which is working now properly as bootable :)

before doing anything, i first backedup it with
dsfo \\.\PHYSICALDRIVE4 0 0 yUSBbackup.img
also after having trouble i successfully restored it with
dsfi \\.\PHYSICALDRIVE4 0 0 yUSBbackup.img

Here is what i do:
i followed explanations (hope not missing anyhing) on post #2,
-
exact size: 4127195136
-
using mkimg.cmd
http://img519.images...azirlamauz4.png
-
i followed instruction to copy image to usb, but usb malfunction (under windows i cant see what inside), so i restored back with my yUSBbackup.img

Here is picture of image file with beeblebrox (same when copied to usb)
http://img519.images...imajhalibs1.png

Here is picture of my usb stick which is working properly now:
http://img93.imagesh...isanhalint7.png

Where am i mistaken??

edit:
i also tried with host xpsp2x86 pc with original documents from shirin same result (0B + different size)
also tried with updating with mkimg003.zip and mbrbatch002.zip same result (0B + different size)
prepared a command line in my trials: mkimg yUSB.img 4127195136 255/63 0C /mks



edit last:
"if a master dont answer, than you should read moore" i say always to myself, after reading again and again, and tryin many things, answer is there which i missed.
BUT
first of all, The reason i was mistaken was, after doing changes on a usb stick especially on mbr, changes cant be seen correctly, so after making changes, one should plug out and plug in usb flash again and again :).
After i used this (all exlained by jaclazz in post #2):
mkimg yUSB.img 4127195136 255/63 0C /mks
i add NTLDR, NTDETECT.COM, boot.ini files
i used this
dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img
plug out (safely remove) - plug in usb flash
if this didnt work when tested as a bootable usb so:
MBRBATCH COPY 4 my_MBR.mbr
MBRBATCH UPATCH my_MBR.mbr
MBRBATCH WRITE my_MBR.mbr 4
plug out (safely remove) - plug in usb flash
and now it is bootable

sorry master :huh: jaclazz, it is hard to learn as a rookie, but i always try hard to learn :) , thanks a lot again for these wonderful utilites.

#17 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 27 September 2008 - 08:49 AM

Do not stress too much about your "rookie" status, you appear to be on the right path to "graduate" soon. :)

Next time I'll have time to put my hands on MKIMG/MBRBATCH I will add a check to avoid the "automagic" 0E to 06 (or 0C to 0B) conversion, see here:
http://www.boot-land...opic=3191&st=24
that you also experienced.

Or do you want to take this as "final exam"? :huh:

I am also pretty sure that there must be a "programmatical" way to "refresh" the MBR without disconnecting and re-connecting the stick, but haven't found the time to search for it/have no idea right now how it can be made. :huh:

:)

jaclaz

P.S.: Just to check if what you see in MBRBATCH, Beeblebrox or PTedit32 makes sense, you can use this spreadsheet:
http://www.boot-land...?showtopic=2959

#18 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 27 September 2008 - 11:45 PM

After experiencing that this wonderful utility works with vista32bit too (havent tested but i guess will work with vista64 too), i make some changes to post 14
only when one dont have dmadmin.exe or dmadmin.ex_, he/she should find this file from somewhere (ex: trials of 2k3 maybe) and put it in folder
Also
i experinced that copying ntldr, ntdetect.com, boot.ini to the .img file immediately after (not to usb later) created makes my usb bootable with and without int13 patch
so i put some lines to copy them to the .img and added this lines to post14
As
dsfi takes time and i am aware explorer.exe used to copy extra files, i put another line to copy extra files if exist (maybe livexp :> and some additional stuff) to .img so after explorer.exe starts
And
i used mkimg003.zip + mbrbatch002.zip for the package
All changes are written and upload made in post 14

As i still learning i see a loooong path of graduation, here is sth i noticed and asking, all 3 tested bootable flashdisk:
1a) This is prepared without hp patch
http://lancelot.winb...forehppatch.mbr
http://lancelot.winb...forehppatch.png
1b) This is prepared with hp patch
http://lancelot.winb...fterHPpatch.mbr
http://lancelot.winb...fterHPpatch.png
2) This is what i was using before
http://lancelot.winb...alisan_Hali.png
http://lancelot.winb...alisan_Hali.mbr

Between 1 and 2, besides Type 0C - 0B difference (as with fat16 06 - 0E ) there is numsector difference 8048502 - 8060865 guessing it is because of FAT32 and FAT32X , So my question is , which one is more appropriate to use with a 4gb flash disk, FAT32 or FAT32X ? and how?

Edit:
for 1a and 1b situations described above, i put 1.4gb files to .img file (with both xcopy and by using mouse-copy-paste) after .img file created and explorer opened folder. (first 3 files are ntldr ntdetect.com and boot.ini) , After dsfi, either most of or all of files on usb are unusable?! Maybe picture helps to clear what is going on:
http://img206.images...081/4897jh4.png

but, only adding 3 files (or 5) and creating with dsfi, everything back to normal and i can copy all files to usb normally. So maybe dsfi have sth missing? If so having an option to add lots of files by opening explorer.exe maybe a dangerous option orr the main problem lies under 1a-1b/2 difference???

#19 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 September 2008 - 03:01 PM

Between 1 and 2, besides Type 0C - 0B difference (as with fat16 06 - 0E ) there is numsector difference 8048502 - 8060865 guessing it is because of FAT32 and FAT32X , So my question is , which one is more appropriate to use with a 4gb flash disk, FAT32 or FAT32X ? and how?

No, one of the two is wrong, and one is right, the WHOLE point between CHS and LBA is that both addressess should be valid.
In other words on a properly formatted partition you can change 06 to 0E or 0C to 0B at will and NO problems should arise (as long you are within the 1024 cylinder CHS limit).
Since:
501*255*63=8048565
BUT you have 63 hidden sectors:
8048565-63=8048052
8048052 seems right, the other wrong.

But as said, whenever you are in doubt, play a bit with the spreadsheet.

The UPATCH only changes some bytes in the CODE part of the MBR:
http://www.boot-land...opic=2246&st=15
nothing in the DATA

Edit:
for 1a and 1b situations described above, i put 1.4gb files to .img file (with both xcopy and by using mouse-copy-paste) after .img file created and explorer opened folder. (first 3 files are ntldr ntdetect.com and boot.ini) , After dsfi, either most of or all of files on usb are unusable?! Maybe picture helps to clear what is going on:
http://img206.images...081/4897jh4.png

but, only adding 3 files (or 5) and creating with dsfi, everything back to normal and i can copy all files to usb normally. So maybe dsfi have sth missing? If so having an option to add lots of files by opening explorer.exe maybe a dangerous option orr the main problem lies under 1a-1b/2 difference???

It seems to me like a timing problem of some kind :huh:, first screenshot is definitely that of a corrupted filesystem, but cannot say, maybe you attempted to transfer the image with VDK running or whatever, I cannot understand from your posts what the heck you are doing (no offence intended :huh:).

I mean, you seem like making a lot of experiments in a semi-random pattern without specifying accurately the steps made, it's difficult to follow your reports. :)

jaclaz

#20 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 28 September 2008 - 03:27 PM

8048502 seems right, the other wrong.

:huh:

And thanks for spreadsheet (forgot to thank in previous posts) , i checked spreadsheet before with getting your result, i just want to ask for a last confirmation from master. Thanks a lot.

-

lot of experiments in a semi-random pattern without specifying accurately the steps made

sorry, as i go in conjunction to previous posts i miss to explain briefly:
To briefly clear the steps i go:

1) mkimg yUSB.img 4127195136 255/63 0C /mks
2) i add NTLDR, NTDETECT.COM, boot.ini files to .img
3) Than i add extra 1.4 GB files to .img
4) dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img
5) plug out (safely remove) - plug in usb flash
R)
Than result is:
http://img206.images...081/4897jh4.png

it is easly reproducable, to reproduce all i need it to copy 1.4 GB files to .img and than make dsfi. (reproducable with different pictures :>)
For me solution is: not to copy 1.4 GB files to .img :huh:, and only copy 3 or 5 files to .img which makes everything works good.

ps: i will read more about redist. now :)

#21 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 September 2008 - 03:49 PM

3) Than i add extra 1.4 GB files to .img
4) dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img


Yep, what happens between 3 and 4?

I mean, was VDK stopped?

Do you have anything like an anti-virus or whatever that may "sense" direct disk access for a lenghty period of time and prevent it?

While the transfer takes place, are there other programs running?

While the transfer takes place, are you working on the PC or (suggested :huh:) you go out and take a walk and a coffee?

Can you unmount and re-mount the image and see if the corruption is there before the transfer?

It is possible that it is a bug:
  • with VDK when a certain amount of data is transferred. (never reported AFAIK)
  • with dsfi when a certain amount of data is transferred. (never reported AFAIK)
  • with copying to it such a large amount of data that the sparse file has problems in "growing" (if using a sparse file)
  • with the USB driver or controller of the stick, the USB bus or whatever when a certain amount of data to be transferred.

Can you use another stick/drive?
A non USB media? (additional IDE/ATA or SATA HD)
Can you try with "intermediate" sizes, i.e. 0.7 Gb, if it works 1,15 Gbytes, if it doesn't 0,35 Gb and so on?
Can you try with a non-sparse file?
Can you try using another utility to transfer the image to the device?

jaclaz

#22 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 28 September 2008 - 05:42 PM

here are other answers to your question in previous post:

+Yep, what happens between 3 and 4? I mean, was VDK stopped?
-i close explorer, press a key in cmd screen and vdk stopped

+Do you have anything like an anti-virus or whatever that may "sense" direct disk access for a lenghty period of time and prevent it?
-no, i dont use av, i have a av which i only use to scan files with right click when i get files, i use no monitor. I have paragon part. manager 8.5 (no any acronis) installed but as far as i know it doesnt have sth like acronis snapman sys (i can easly zero mbr)

+While the transfer takes place, are there other programs running?
-opera, messenger :) which are irrelevant i guess.

+While the transfer takes place, are you working on the PC or (suggested ) you go out and take a walk and a coffee?
-i sometimes do that, dsfi a 4gb image to usb really takes time

+Can you try with "intermediate" sizes, i.e. 0.7 Gb, if it works 1,15 Gbytes, if it doesn't 0,35 Gb and so on?
-in a trial i copy 650 mb which worked fine, i dont know exact point between 650mb and 1.4GB, if you really want i can try, i hope not necessary, dsfi takes lots of time :)

+Can you use another stick/drive?
-i have another 1gb usb stick, but as 650mb worked, maybe i would get no problem with 1gb stick, and as it is obvious i cant copy 1.4gb files to 1gb stick to exact reproduce previous test

+Can you try using another utility to transfer the image to the device?
-if you instruct me yes

------------------------------------------
Sorry, tests and dsfi a 4 gb usb flash stick (well, maybe better to say cheapest=slowest flash stick is better) takes really big time (this message time - prev message time :)).
Before your post, i was making another trial with fsz and it worked fine.

briefly:
1) mkimg yUSB.img 4127195136 255/63 0C /fsz
2) i add NTLDR, NTDETECT.COM, boot.ini files to .img
3) Than i add extra 1.4 GB files to .img
4) dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img
5) plug out (safely remove) - plug in usb flash
Everything works fine :huh:



as problem happened because of using sparse file, here is an answer of your question:
+Can you unmount and re-mount the image and see if the corruption is there before the transfer?
1) mkimg yUSB.img 4127195136 255/63 0C /mks
2) i add NTLDR, NTDETECT.COM, boot.ini files to .img
3) Than i add extra 1.4 GB files to .img (than close exporer and press key in cmd window)
4) i try to re-mount the image with this command:
vdk.exe open * yUSB.img /rw
everything looks fine
5) VDK.EXE REMOVE
6) dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img
it worked again :)

so i try to reproduce the test in previous post, but it worked again so i couldnt reproduce (i reproduced it lots of times beofre),
with some doubts :huh: using mksparse remain in my mind but no problem for now,
as making dsfi tests takes loots of time, i will report here if i get the issue again and got an idea !

for now i will add 2 lines to mkimg.cmd (i know it looks a bit stupid, but this was only thing i changed during tests with mksparse that leads to a success)
VDK.EXE REMOVE
vdk.exe open * %Targetfile% /rw
VDK.EXE REMOVE


#23 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 September 2008 - 06:33 PM

as making dsfi tests takes loots of time, i will report here if i get the issue again and got an idea !


Since you are making a "brand new image", and you copy to it the files sequentially, you have the BEST POSSIBLE "defragged" image. :huh:

Thus, you do not need (as long as you use FAT16 or FAT32 as filesystem) to transfer the whole 4 Gb, you can use dsfi transferring only from 0 to the end of last file.

One could use some utility and a batch to find out where the end of last file is, but I guess that if you right click on the mounted drive and jolt down how much occupied space is on disk, and add some "slack" space just in case, this would be enough to save some time.

I mentioned other utilities also as usually they are faster, here are a couple of threads mentioning a number of them:
http://www.911cd.net...showtopic=16534
http://www.msfn.org/...re-t100299.html

Apart a number of bla-bla's it seems that noone has found the time to do some real "on the field experiment" about speed and functionalities, I would "bet" on selfimage which new version can skip blank sectors. :huh:

One could also use a "mixed" mode, dsfi just for the 63 hidden sectors, and driveimagexml for the "logical drive". :)

jaclaz

#24 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 06 October 2008 - 07:19 AM

Hi jaclaz

after giving a short break here are my findings,

i decide try to use another partition tool than dsfi to copy image faster,
also try to make a 0B - 0C fix

ps: disk 4 is my 4gb usbflash disk, disk 5 is created by vdk.

A)
1)
After using this command:
mkimg yUSB.img 4127195136 255/63 0C /mks
i came to "Press any key to unmount the image"
I close opened explorer

2)
Than i use this MBR_0C_fix.cmd file i prepare

del /q /f /a .\my_MBR_0C_fix.mbr

del /q /f /a .\my_MBR_0C_fix_patch.mbr

MBRBATCH COPY 5 my_MBR_0C_fix.mbr

copy my_MBR_0C_fix.mbr my_MBR_0C_fix_patch.mbr

bpatcher.exe my_MBR_0C_fix_patch.mbr 1C2 0C

MBRBATCH WRITE my_MBR_0C_fix_patch.mbr 5

*****a question at that point,
to add this batch to mkimg.cmd with a appropriate way i need help,
in mkimg.cmd , %Drive% is used for drive letter, what/how can i use drive number of image with mkimg.cmd, so i can add MBR_0C_fix.cmd inside mkimg.cmd ????
i guess i need a command to learn drive number by using %Drive% , but i failed, i hope you can help.

ps: i want to make 0B-0C fix mbr at that point so after image is dumped everthing finishes. (so i can unplug and plug usb only one time)

3)
I press a key so command windows close (image close, vdk uninstalled)

4)
Than i use
dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img
everthing is okey. (0C is there)



:cheers: using different utility
i try to use savepart, but i couldnt find "disc copy" feature with savepart (but i guess a disc copy can be done with 3 steps using savepart, i need to read more)
anyway, for a trial i use ghost32.exe (v11) which gives interesting result


B1)
i did steps 1 and 2 above
Than i use this command
ghost32.exe -clone,mode=copy,src=6,dst=5 -ib

note to others: drive numbers start from 1 with ghost, so instead of 5 and 4 i use 6 and 5

B2)
i) first this screen come warning for size
http://img162.images...56/snap4qj7.png
I click YES

ps: also with savepart sizes are different http://img50.imagesh...33/snap1zb7.png

ii) Than last confirmation screen http://img162.images...57/snap5oe9.png
so all done in 6 seconds. :confused1:

B3) as the 3rd step above I press a key so command windows close (image close, vdk uninstalled)


**Interestingly ghost change 0C to 0B !!!!!!
Simply i can say, using format change 0C to 0B, and using ghost diskcopy change 0C to 0B, so some utilities thinks that there should be a fix made from 0C to 0B, you know better !!??

Now my next stop is trying to use savepart (or anyother utility) instead of ghost or dsfi to make image dump free & faster. I hope you can help about disk number and i am sure you have ideas about the results.

#25 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 06 October 2008 - 08:41 AM

Why do you want to patch the mounted image (thus needing the drive number)? :cheers:

Won't it be much easier to patch the image once it has been unmounted (i.e. with VDK stopped)? :cheers:

This way you can use bpatcher (or gsar) directly on the image (and you already have the image name in a variable inside the batch). :confused1:
i.e.:
bpatcher.exe yUSB.img 1C2 0C
or
bpatcher.exe %Targetfile% 1C2 0C

jaclaz




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users