Hello dear guest!

Why not join our boot disk community? So do it. Life's short.

5 Pages V   1 2 3 > »   
Reply to this topic
 Managing MBR's by jaclaz MBRBatch Release 0.01 ALPHA
post Jun 22 2008, 03:16 PM
Post #1
Shirin Zaban
Frequent Member   ***
Group: Tutorial Writer

  Joined: 15-February 08 From: Tehran

Posts: 212
Thank(s): 210


Iran


=============================================================================
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.net/forums/?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 thumbnail(s)
Attached Image
 

Attached File(s)
Attached File  MBRBatch.zip ( 155.96K ) Number of downloads: 183
 


--------------------
5 user(s) said "Thank you!" to Shirin Zaban for this fantastic post:
benxhi, ispy, Lancelot, NeTTecH, Nuno Brito
+Quote Post
post Jun 22 2008, 04:32 PM
Post #2
jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06
Posts: 5,132
Thank(s): 354


Italy


Very good! smile.gif

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:
CODE
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:
QUOTE
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):

QUOTE
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:
CODE
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.net/forums/?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:
CODE
dsfi \\.\PHYSICALDRIVE1 0 0 K:\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.com/ref/hdd/bios/modesECHS-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:
CODE
MBRBATCH COPY 1 my_MBR.mbr

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

CODE
MBRBATCH UPATCH my_MBR.mbr

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

CODE
MBRBATCH WRITE my_MBR.mbr 1

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


Have fun.

cheers.gif

jaclaz


--------------------

Light Blue Ribbon Campaign for Freedom of Skin
2 user(s) said "Thank you!" to jaclaz for this fantastic post:
ispy, Lancelot
+Quote Post
post Jun 22 2008, 08:20 PM
Post #3
Shirin Zaban
Frequent Member   ***
Group: Tutorial Writer

  Joined: 15-February 08 From: Tehran

Posts: 212
Thank(s): 210


Iran


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

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


--------------------
+Quote Post
post Jun 23 2008, 07:05 AM
Post #4
jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06
Posts: 5,132
Thank(s): 354


Italy


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

CODE
mksparse test.dat 1G


Now run:
CODE
dir test.dat


You will get:
CODE
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


--------------------

Light Blue Ribbon Campaign for Freedom of Skin
1 user(s) said "Thank you!" to jaclaz for this fantastic post:
Shirin Zaban
+Quote Post
post Jun 23 2008, 09:53 AM
Post #5
Shirin Zaban
Frequent Member   ***
Group: Tutorial Writer

  Joined: 15-February 08 From: Tehran

Posts: 212
Thank(s): 210


Iran


[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


--------------------
+Quote Post
post Sep 24 2008, 07:39 PM
Post #6
Lancelot
Platinum Member   ******
Group: .script developer

  Joined: 8-May 08 From: Turkiye/Izmir

Posts: 2,645
Thank(s): 241


Turkiye


Success smile.gif
****All useful info from post #6 to post #44 are gathered together in this post so now MBRBatch works better smile.gif

(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 smile.gif) 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 jaclazz
2) mbrbatch.cmd - i used mbrbatch002.zip of jaclazz

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 jaclazz
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 jaclazz
@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 Shring 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 smile.gif.


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 )
CODE

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


***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

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

first this screen come warning for size
http://img162.imageshack.us/img162/8256/snap4qj7.png
Click YES
Than last confirmation screen http://img162.imageshack.us/img162/6657/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 jacklazz 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.imageshack.us/img519/9374/snap1buu6.png
3)
I open command prompt and wrote:
CODE
dsfo \\.\PHYSICALDRIVE4 0 0 NUL

and result is: http://img374.imageshack.us/img374/6134/snap2qf1.png
so here is what i need: 4127195136
4)
I wrote this lines to command prompt
CODE
mkimg yUSB.img 4127195136 255/63 0C /mks

http://img521.imageshack.us/img521/8853/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.imageshack.us/img122/7137/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.imageshack.us/img122/3313/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.imageshack.us/img122/2048/snap6nx8.png
6)
Now all you have to do is to copy the image to the USB stick by using this command
CODE
dsfi \\.\PHYSICALDRIVE4 0 0 yUSB.img

and wait for a while than you will see this screen
http://img387.imageshack.us/img387/617/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.


--------------------
+Quote Post
post Sep 25 2008, 09:17 AM
Post #7
jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06
Posts: 5,132
Thank(s): 354


Italy


@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 wink.gif) search program and scan your installed system files for the byte sequences that a MBR starts with, this should be enough:
CODE
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.pcministry.com/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.net/forums/?showtopic=3191&st=11
or
MKIMG 0.03 "G"
(I trust Galapo enough to "bless" his modified version smile.gif)
http://www.boot-land.net/forums/?showtopic=3191&st=12
MBRBATCH 0.02
http://www.boot-land.net/forums/?showtopic=3191&st=4

jaclaz


--------------------

Light Blue Ribbon Campaign for Freedom of Skin
+Quote Post
post Sep 25 2008, 02:43 PM
Post #8
Lancelot
Platinum Member   ******
Group: .script developer

  Joined: 8-May 08 From: Turkiye/Izmir

Posts: 2,645
Thank(s): 241


Turkiye


CODE
33 C0 8E D0 BC 00

is in
dmadmin.exe
http://img360.imageshack.us/img360/3816/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 smile.gif


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

http://img515.imageshack.us/img515/7801/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.winimage.com/viewtopic.php?t=2640 i got DumpHex.exe (read), for only info, DumpHex.exe reads with x64


--------------------
+Quote Post
post Sep 25 2008, 05:54 PM
Post #9
jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06
Posts: 5,132
Thank(s): 354


Italy


Hmmm, dubbio.gif LOTS of questions, I don't think I have ALL answers in my hat wink.gif (nor up my sleeve) cool.gif.

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


It seems like the %Offset% is 0. w00t.gif

Try adding the bolded lines:
QUOTE
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. unsure.gif

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. dubbio.gif

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? unsure.gif

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

what is the part that is not clear? unsure.gif

jaclaz


--------------------

Light Blue Ribbon Campaign for Freedom of Skin
+Quote Post
post Sep 25 2008, 09:23 PM
Post #10
Lancelot
Platinum Member   ******
Group: .script developer

  Joined: 8-May 08 From: Turkiye/Izmir

Posts: 2,645
Thank(s): 241


Turkiye


Sorry for late answer,

-
with codes you gave here is a picture i guess you want
http://img378.imageshack.us/img378/5055/200809260001vp7.png

-
as the file 30.$$$ i sent before is "garbage" smile.gif
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 smile.gif
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?

-
QUOTE
what is the part that is not clear?

i am learning rookie jaclaz smile.gif

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


--------------------
+Quote Post

5 Pages V   1 2 3 > » 
Reply to this topic
1 User(s) are reading this topic ()

Members Who Viewed Topic Today ()


Your Ad Here

Collapse

  Topic Replies Topic Starter Views Last Action
No new Topic has attachmentsMBRBatch 0.01 ALPHA
[Release]
41 jaclaz 12,156 Today, 05:44 PM
Last post by: diddy
No new jaclaz's RANTS about Winbuilder
You were waiting for it... now it's here
20 jaclaz 2,600 30th July 2008 - 03:45 PM
Last post by: jaclaz
No New Posts Bye for a week!
8 psc 1,418 20th July 2008 - 09:34 AM
Last post by: Max_Real Qnx
No New Posts Bye
9 psc 2,094 15th March 2008 - 02:12 PM
Last post by: MedEvil
No new Jaclaz A Friend of mine...
26 ispy 4,902 23rd February 2008 - 10:20 AM
Last post by: ispy



Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum