home   |   contact
   
profile services projects tutorials
 
     
  home :: tutorials :: pc booting       
 
introduction
css printer formating
system booting
link edit (ld)
buffer overrun
   print this page
  email this page
> login

 MBR assembly code (lilo)

The following is a disassembly of the MBR on my debian machine. This is the first stage of the lilo boot.

00000000 FA cli
00000001 EB20 jmp short 0x23
00000003 01B5014C494C add [ebp+0x4c494c01],esi
00000009 4F dec edi
0000000A 16 push ss
0000000B 054C6B3F41 add eax,0x413f6b4c
00000010 0000 add [eax],al
00000012 0000 add [eax],al
00000014 E80F4F4036 call 0x36404f28
00000019 B836B88080 mov eax,0x8080b836
0000001E 60 pusha
0000001F 55 push ebp
00000020 C01300 rcl byte [ebx],0x0
00000023 B8C0078ED0 mov eax,0xd08e07c0
00000028 BC0008FB52 mov esp,0x52fb0800
0000002D 53 push ebx
0000002E 06 push es
0000002F 56 push esi
00000030 FC cld
00000031 8ED8 mov ds,ax
00000033 31ED xor ebp,ebp
00000035 60 pusha
00000036 B80012B336 mov eax,0x36b31200
0000003B CD10 int 0x10
0000003D 61 popa
0000003E B00D mov al,0xd
00000040 E86801B00A call 0xab001ad
00000045 E86301B04C call 0x4cb001ad
0000004A E85E01601E call 0x1e6001ad
0000004F 07 pop es
00000050 80FAFE cmp dl,0xfe
00000053 7502 jnz 0x57
00000055 88F2 mov dl,dh
00000057 BB00028A76 mov ebx,0x768a0200
0000005C 1D89D080E4 sbb eax,0xe480d089
00000061 8030E0 xor byte [eax],0xe0
00000064 780A js 0x70
00000066 3C10 cmp al,0x10
00000068 7306 jnc 0x70
0000006A F6461C40 test byte [esi+0x1c],0x40
0000006E 752C jnz 0x9c
00000070 88F2 mov dl,dh
00000072 668B7E18 mov di,[esi+0x18]
00000076 6609FF or di,di
00000079 7421 jz 0x9c
0000007B 52 push edx
0000007C B408 mov ah,0x8
0000007E B280 mov dl,0x80
00000080 CD13 int 0x13
00000082 7255 jc 0xd9
00000084 92 xchg eax,edx
00000085 98 cwde
00000086 91 xchg eax,ecx
00000087 BA7F004266 mov edx,0x6642007f
0000008C 31C0 xor eax,eax
0000008E 40 inc eax
0000008F E87100663B call 0x3b660105
00000094 BFB8017403 mov edi,0x37401b8
00000099 E2EF loop 0x8a
0000009B 5A pop edx
0000009C 53 push ebx
0000009D 8A761E mov dh,[esi+0x1e]
000000A0 BE1F00E84B mov esi,0x4be8001f
000000A5 00B49966817FFC add [ecx+ebx*4+0xfc7f8166],dh
000000AC 4C dec esp
000000AD 49 dec ecx
000000AE 4C dec esp
000000AF 4F dec edi
000000B0 7527 jnz 0xd9
000000B2 5E pop esi
000000B3 6880080731 push dword 0x31070880
000000B8 DBE8 fucomi st0
000000BA 350075FBBE xor eax,0xbefb7500
000000BF 06 push es
000000C0 0089F7B90A00 add [ecx+0xab9f7],cl
000000C6 F3A6 repe cmpsb
000000C8 750D jnz 0xd7
000000CA B002 mov al,0x2
000000CC AE scasb
000000CD 7508 jnz 0xd7
000000CF 06 push es
000000D0 55 push ebp
000000D1 B049 mov al,0x49
000000D3 E8D500CBB4 call 0xb4cb01ad
000000D8 9AB020E8CD00E8 call 0xe800:0xcde820b0
000000DF BA00FE4E00 mov edx,0x4efe00
000000E4 7408 jz 0xee
000000E6 BCE8076160 mov esp,0x606107e8
000000EB E960FFF4EB jmp 0xebf50050
000000F0 FD std
000000F1 66AD lodsw
000000F3 6609C0 or ax,ax
000000F6 740A jz 0x102
000000F8 66034610 add ax,[esi+0x10]
000000FC E8040080C7 call 0xc7800105
00000101 02C3 add al,bl
00000103 60 pusha
00000104 55 push ebp
00000105 55 push ebp
00000106 6650 push ax
00000108 06 push es
00000109 53 push ebx
0000010A 6A01 push byte +0x1
0000010C 6A10 push byte +0x10
0000010E 89E6 mov esi,esp
00000110 53 push ebx
00000111 F6C660 test dh,0x60
00000114 7458 jz 0x16e
00000116 F6C620 test dh,0x20
00000119 7414 jz 0x12f
0000011B BBAA55B441 mov ebx,0x41b455aa
00000120 CD13 int 0x13
00000122 720B jc 0x12f
00000124 81FB55AA7505 cmp ebx,0x575aa55
0000012A F6C101 test cl,0x1
0000012D 754A jnz 0x179
0000012F 52 push edx
00000130 06 push es
00000131 B408 mov ah,0x8
00000133 CD13 int 0x13
00000135 07 pop es
00000136 7258 jc 0x190
00000138 51 push ecx
00000139 C0E906 shr cl,0x6
0000013C 86E9 xchg ch,cl
0000013E 89CF mov edi,ecx
00000140 59 pop ecx
00000141 C1EA08 shr edx,0x8
00000144 92 xchg eax,edx
00000145 40 inc eax
00000146 83E13F and ecx,byte +0x3f
00000149 F7E1 mul ecx
0000014B 93 xchg eax,ebx
0000014C 8B44088B mov eax,[eax+ecx-0x75]
00000150 54 push esp
00000151 0A39 or bh,[ecx]
00000153 DA7338 fidiv dword [ebx+0x38]
00000156 F7F3 div ebx
00000158 39F8 cmp eax,edi
0000015A 7732 ja 0x18e
0000015C C0E406 shl ah,0x6
0000015F 86E0 xchg ah,al
00000161 92 xchg eax,edx
00000162 F6F1 div cl
00000164 08E2 or dl,ah
00000166 89D1 mov ecx,edx
00000168 41 inc ecx
00000169 5A pop edx
0000016A 88C6 mov dh,al
0000016C EB06 jmp short 0x174
0000016E 6650 push ax
00000170 59 pop ecx
00000171 58 pop eax
00000172 88E6 mov dh,ah
00000174 B80102EB02 mov eax,0x2eb0201
00000179 B442 mov ah,0x42
0000017B 5B pop ebx
0000017C BD050060CD mov ebp,0xcd600005
00000181 13730F adc esi,[ebx+0xf]
00000184 4D dec ebp
00000185 7409 jz 0x190
00000187 31C0 xor eax,eax
00000189 CD13 int 0x13
0000018B 61 popa
0000018C EBF1 jmp short 0x17f
0000018E B440 mov ah,0x40
00000190 E946FF8864 jmp 0x648900db
00000195 1F pop ds
00000196 8D641061 lea esp,[eax+edx+0x61]
0000019A C3 ret
0000019B C1C004 rol eax,0x4
0000019E E80300C1C0 call 0xc0c101a6
000001A3 0424 add al,0x24
000001A5 0F db 0x0F
000001A6 27 daa
000001A7 04F0 add al,0xf0
000001A9 1440 adc al,0x40
000001AB 60 pusha
000001AC BB0700B40E mov ebx,0xeb40007
000001B1 CD10 int 0x10
000001B3 61 popa
000001B4 C3 ret
000001B5 00446336 add [ebx+0x36],al
000001B9 B836B80000 mov eax,0xb836

# partition table in here

000001FE 55 push ebp
000001FF AA stosb



FlexFWD

FlexFWD is a social fitness logging tool. Connect with friends and follow athletes. Log: crossfit, running, swimming, or cycling. With mobile applications for the iPhone and Android devices, FlexFWD also integrates with your Nike+ and Garmin devices. This is the Utimate site for tracking and comparing your fitness restults to your friends and family. Click here to visit the project.



december project

The december project is a distributed internet backup project that I have been working on. This project is a distubuted cloud style backup system with error correction codes built in.


one2one

One2one is an opensource project that I started at source forge. One2one is a database transformation tool. The tool allows for easy transformation of data from one source to another. Take general data descriptions and map them into complex table hierarchies of any major database vendors. Click here to goto sourceforge and download the project code.

 
  Copyright © corey auger 2004