In article <
TbmdnS_lXoI...@giganews.com>, John Reiser <
jrei...@comcast.net> wrote:
> > The executable code [before the up-to-four partition
> > entries] in the MBR [1st 512B sector] of the boot-device does:
>
> The code in the MBR does whatever it pleases.
> This enables MBR-resident malware.
>
> In general the code in the MBR finds and loads and transfers control
> to more (and longer) code. The location of the additional code varies.
> It can be a hard-coded list of absolute sector extents (starting sector #,
> length) on the same drive [might be sectors 2 through 63 immediately
> following the MBR], an implicit extent (such as the first two sectors
> of an ext2 filesystem, which are reserved for a boot block) on some
> partition that is marked with a 'boot' flag in the partition info, etc.
> With careful coding, (512 - 4*16 - 2)+1024 bytes of MBR+bootblock
> is enough to implement lookup by pathname on ext2, combined with loading
> a kernel and initrd (initial ramdisk). See:
>
http://bitwagon.com/ftp/e2boot4c.tgz
>
http://bitwagon.com/ftp/mbr03.tgz
>
OK thanks, I had a look at those.
But I don't, at this time, want to by-pass lilo/grub.
Even they & linux use the existing M$loth INT [19 ? is it?].
> [snip]
> > I'd like to find some script, which traces through [simulates
> > the asm-code] to move this process into the light out of
> > dark-art; ..
> > It could suitable/safetly be used to examine a USBstik?
>
> Use dd to get the block(s). Copy+Paste them into a binary Elf32 ET_REL file.
> [Pre-pend an Elf32_Ehdr onto the blocks.] Examine using gdb and "set arch i8086".
> --
OK thanks, I had a look at those.
But I don't, at this time, want to by-pass lilo/grub.
Even they & linux use the existing M$loth INT [19 ? is it?].
-----------------
I dissasembled the bytes decades ago.
Now I want to use clear-logic to evolve a debugging strategy
to show which 'stages' have succeeded.
A current fad of mine is opposing: klikA, klikB, klikC; explanations.
And even more so: random 'tips'.
We need an explanation: 1 -> 2 ->3.......N, for tasks which are
essentially 'serial'; which many tasks in life are.
This notion relates also to *nix-piping and to 'concatenative
programming', where, if it's OK at stage 7, you don't NEED to
be concerned/confused by the previous 6 stages.
I want a THEORETICAL essential understanding, [like a maths
theorem] and not a vague set of memories of how is actually
is/was. So eg., IF the BIOS allows selection between:
1. <a name representing sda>
2. <a name representing sdb>
3. <a name representing sdc>
THEN that stage can only take you to the MBR [1st sector]
of either of these 3 listed/selectable devices.
This selection of the MBR of 1 of N devices is before the
running and unkown to lilo/grub.
But lilo/grub must have 'marked' the specific MBR, to say
"this is where" you go next. And IIRC, with the old/classical
method, that could only be <which one of 4 partitions>.
Perhaps that's why I had to use a fd0 to boot ETHO at hdx40.
But we know that's WRONG!
I still didn't get an answer to by claim that since conventionaly
the first code in the MBR, looks for the first active partition;
IF `cfdisk` say, had set hda2 to active, while running hda3:
the previously first active partition; THEN on the next boot
hda3 would effectively be hidden/masked by hda2 been found
as active BEFORE hda3. And normal booting would have been
destroyed. Is this correct or not?
That's what a mean by [an attempt at] a logical/theoretical
claim vs. vague memories of how-it-actually-is/was.