SlideShare une entreprise Scribd logo
1  sur  10
Contents Of Boot Sector 
2 
3 
4 
1 
6 5 
7 
11 
8 
10 
9 
12 
13 14 15 
16 
17 
18 
Boot Parameters 
Disk Bootstrap 
Program 
SSiiddee 00,, TTrraacckk 00
Description 
Boot Parameters 
Jump Instruction 3 
360 
Kb 
1.2 
Mb 
1.44 
Mb 
No. 
of 
bytes 
EB3490 
MSDOS5.0 
System ID 8 
No. of bytes/sector 2 512 512 512 
No. of sectors/cluster 1 2 1 1 
No. of sectors in reserved area 2 1 1 1 
No. of copies of FAT 1 2 2 2 
Max. no. of root dir. entries 2 112 224 224 
Total no. of sectors 2 720 2400 2880 
Media descriptor 1 FD F9 F0 
No. of sectors/FAT 2 2 7 9 
No. of sectors/track 2 9 15 18 
No. of sides 2 2 2 2 
No. of hidden sectors 2 0 0 0
Reading Boot Sector 
No. of 
Description bytes 
Jump Instruction 
System ID 
Bytes/sector 
Sectors/cluster 
Sectors in 
reserved area 
Copies of FAT 
Max. root dir. entries 
Total no. of 
sectors Media 
descriptor 
Sectors/FAT 
Sectors/track 
Sides 
3821212212222 
main( ) 
{ 
struct boot 
{ 
char jump[ 3 ] ; 
char sysid[ 8 ] ; 
int bps ; 
c .h. ar spc ; 
char rest[ 482 ] ; 
} ; 
struct boot b ; 
printf ( ”Insert disk, 
Press any key ) ; 
getch( ) ; 
.a b. sread ( 0, 1, 0, &b ) ; 
} 
BBPP 
DDBBPP 
Side 0, 
Trk 0, 
Sec1 
Side 0, 
Trk 0, 
Sec1
# include ”dos.h” 
main( ) 
{ 
struct boot 
{ 
char jump[ 3 ] ; 
char sysid[ 8 ] ; 
int bps ; 
char spc ; 
. . 
} ; 
struct boot b ; 
absread ( 0, 1, 0, &b ) ; 
for ( i = 0 ; i <= 2 ; i++ ) 
printf ( ”%X”, ) ; 
b.jump[ i ] 
for ( i = 0 ; i <= 7 ; i++ ) 
printf ( ”%c”, b.sysid[ i ] 
) ; 
printf ( ”Bytes/sector = %d”, b.bps ) ; 
printf ( ”Sectors/cluster = %d”, b.spc ) ; 
} 
int i ; 
......CCoonntt
In General 
absread (drive no., no. of sectors to read, 
sector from where reading should begin, buffer ) 
absread ( 0, 1, 0, &b ) ; ; 
ROM - BIOS DOS 
S0, T0, S1 
Every sector referred using 
side, track, sector 
Drive A - 0 
Drive B - 1 
Drive C - 128 
D. r i v e D . - 1 2 9. . . . 
LSN 0 
LSN 36 
Every sector referred using 
LSN 
Drive A - 0 
Drive B - 1 
Drive C - 2 
D. r i v e D . - 3. . . . 
S0, T1, S1
What Is 
It? Description 
1.44 Mb Disk 
Jump Instruction 
System ID 
Bytes/sector 
Sectors/cluster 
Sectors in 
reserved area 
Copies of FAT 
Max. root dir. entries 
Total no. of 
sectors Media 
descriptor 
Sectors/FAT 
Sectors/track 
Sides 
Obtained 
Values 
Typical 
Values 
EB3490 
IBM 3.3 
512 
1 
1 
2 
224 
2880 
F0 
9 
18 
2 
0 
102 
…. 
20480 
0 
1 
-24 
0 
2048 
7 
-2 
0 
0 
8 
BP 
DBS 
Virus
BBPP 
DDBBSS 
Anti-Viral 
LLSSNN 5500 
# include ”dos.h” 
char a[ 512 ] ; 
printf ( ”Insert infected disk, Press any key” ) ; 
absread ( 0, 1, 50, a ) ; 
0, 1, 0, a ) ; 
} 
((V ( ( 
main( ) 
{ 
getch( ) ; 
abswrite (
Better... 
#include ”dos.h” 
main( ) 
{ 
char a[ 512 ] ; char ch = ’y’ ; 
char *names[ ] = { ”O Jerusalem”, ”Yankee Doodle”, 
”Robinson Cruso”, ”Eddie Murphy”, ... } ; 
printf ( ”Insert uninfected disk, Press any key” ) ; 
getch( ) ; 
absread ( 0, 1, 0, a ) ; 
while ( ch = = ’y’ ) 
{ 
printf ( ”Insert infected disk, Press any key” ) ; 
getch( ) ; 
abswrite ( 0, 1, 0, a ) ; 
printf ( ”Another disk y/n” ) ; 
} ch = getche( ) ; 
}
Directory Sector 
DDiirreeccttoorryy 
SSeevveerraall eennttrriieess,, eeaacchh ooff 3322--bbyytteess 
Description Size 
Filename 
Extension 
Attribute 
Reserved for Future use 
Time 
Date 
Starting Cluster number 
Size 
8 bytes 
3 bytes 
1 byte 
10 bytes 
2 bytes 
2 bytes 
2 bytes 
4 bytes 
( (
# include ”dos.h” 
main( ) 
{ 
Printing Directory 
struct entry 
{ 
char n[ 8 ] ; char ext[ 3 ] ; 
char unused[ 17 ] ; 
} ; long int size ; 
struct entry e[ 1 6 ] ; 
printf ( ”Insert disk, Press any key” ) ; getch( ) ; 
absread ( 0, 1, 19, e ) ; 
for ( i = 0 ; i <= 15 ; i++ ) 
{ 
for ( j = 0 ; j <= 7 ; j++ ) 
printf ( ”%c”, e[ i ].n[ j ] ) ; 
for ( j = 0 ; j <= 2 ; j++ ) 
printf ( ”%c”, e[ i ].ext[ j ] ) ; 
} 
} 
printf ( ”%ld”, e[ i ].size ) ;

Contenu connexe

Tendances

How to recover malare assembly codes
How to recover malare assembly codesHow to recover malare assembly codes
How to recover malare assembly codes
FACE
 
Making Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in MeteorMaking Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in Meteor
yaliceme
 

Tendances (20)

PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
Nvvp streams-2
Nvvp streams-2Nvvp streams-2
Nvvp streams-2
 
No more (unsecure) secrets, Marty
No more (unsecure) secrets, MartyNo more (unsecure) secrets, Marty
No more (unsecure) secrets, Marty
 
Docker 基本概念與指令操作
Docker  基本概念與指令操作Docker  基本概念與指令操作
Docker 基本概念與指令操作
 
Build your own private openstack cloud
Build your own private openstack cloudBuild your own private openstack cloud
Build your own private openstack cloud
 
使用 CLI 管理 OpenStack 平台
使用 CLI 管理 OpenStack 平台使用 CLI 管理 OpenStack 平台
使用 CLI 管理 OpenStack 平台
 
How to install
How to installHow to install
How to install
 
How to recover malare assembly codes
How to recover malare assembly codesHow to recover malare assembly codes
How to recover malare assembly codes
 
The Ring programming language version 1.6 book - Part 28 of 189
The Ring programming language version 1.6 book - Part 28 of 189The Ring programming language version 1.6 book - Part 28 of 189
The Ring programming language version 1.6 book - Part 28 of 189
 
Kubernetes Tutorial
Kubernetes TutorialKubernetes Tutorial
Kubernetes Tutorial
 
Making Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in MeteorMaking Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in Meteor
 
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
 
Hearthstone: an analysis of game network protocols - Marco Cuciniello, Andrea...
Hearthstone: an analysis of game network protocols - Marco Cuciniello, Andrea...Hearthstone: an analysis of game network protocols - Marco Cuciniello, Andrea...
Hearthstone: an analysis of game network protocols - Marco Cuciniello, Andrea...
 
Cotap Tech Talks: Keith Lazuka, Digital Communication using Sound and Swift
Cotap Tech Talks: Keith Lazuka, Digital Communication using Sound and SwiftCotap Tech Talks: Keith Lazuka, Digital Communication using Sound and Swift
Cotap Tech Talks: Keith Lazuka, Digital Communication using Sound and Swift
 
Lập trình Python cơ bản
Lập trình Python cơ bảnLập trình Python cơ bản
Lập trình Python cơ bản
 
TCP/IP Exercises
TCP/IP ExercisesTCP/IP Exercises
TCP/IP Exercises
 
Log
LogLog
Log
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in Elixir
 
DPAPI AND DPAPI-NG: Decryption toolkit. Black Hat 2017
DPAPI AND DPAPI-NG: Decryption toolkit. Black Hat 2017DPAPI AND DPAPI-NG: Decryption toolkit. Black Hat 2017
DPAPI AND DPAPI-NG: Decryption toolkit. Black Hat 2017
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
 

En vedette (17)

Vcs5
Vcs5Vcs5
Vcs5
 
Vcs20
Vcs20Vcs20
Vcs20
 
Vcs14
Vcs14Vcs14
Vcs14
 
Vcs16
Vcs16Vcs16
Vcs16
 
Vcs21
Vcs21Vcs21
Vcs21
 
Vcs6
Vcs6Vcs6
Vcs6
 
Vcs28
Vcs28Vcs28
Vcs28
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
 
ELEMENTARY DATASTRUCTURES
ELEMENTARY DATASTRUCTURESELEMENTARY DATASTRUCTURES
ELEMENTARY DATASTRUCTURES
 
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDYDATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
Vcs19
Vcs19Vcs19
Vcs19
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDYAVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 

Similaire à Vcs24

20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs
Computer Science Club
 
I understand
I understandI understand
I understand
samaria1
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
 
C Dos Bas
C Dos BasC Dos Bas
C Dos Bas
CTIN
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
Teddy Hsiung
 

Similaire à Vcs24 (20)

Free bsd visually
Free bsd visuallyFree bsd visually
Free bsd visually
 
Roll your own toy unix clone os
Roll your own toy unix clone osRoll your own toy unix clone os
Roll your own toy unix clone os
 
Swug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathSwug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainath
 
20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs
 
Booy Up
Booy UpBooy Up
Booy Up
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp full
 
My bitmap
My bitmapMy bitmap
My bitmap
 
I understand
I understandI understand
I understand
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
Kernel-Level Programming: Entering Ring Naught
Kernel-Level Programming: Entering Ring NaughtKernel-Level Programming: Entering Ring Naught
Kernel-Level Programming: Entering Ring Naught
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
Log
LogLog
Log
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
C Dos Bas
C Dos BasC Dos Bas
C Dos Bas
 
Log
LogLog
Log
 
Log
LogLog
Log
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
 
Mshd
MshdMshd
Mshd
 

Plus de Malikireddy Bramhananda Reddy (15)

M v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notesM v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notes
 
B-TREE PREPARED BY M V BRAHMANANDA REDDY
B-TREE PREPARED BY M V BRAHMANANDA REDDYB-TREE PREPARED BY M V BRAHMANANDA REDDY
B-TREE PREPARED BY M V BRAHMANANDA REDDY
 
DATASTRUCTURES UNIT-1
DATASTRUCTURES UNIT-1DATASTRUCTURES UNIT-1
DATASTRUCTURES UNIT-1
 
Data representation UNIT-1
Data representation UNIT-1Data representation UNIT-1
Data representation UNIT-1
 
C SLIDES PREPARED BY M V B REDDY
C SLIDES PREPARED BY  M V B REDDYC SLIDES PREPARED BY  M V B REDDY
C SLIDES PREPARED BY M V B REDDY
 
C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
Vcs29
Vcs29Vcs29
Vcs29
 
Vcs26
Vcs26Vcs26
Vcs26
 
Vcs23
Vcs23Vcs23
Vcs23
 
Vcs22
Vcs22Vcs22
Vcs22
 
Vcs17
Vcs17Vcs17
Vcs17
 
Vcs15
Vcs15Vcs15
Vcs15
 
Vcs12
Vcs12Vcs12
Vcs12
 
Vcs8
Vcs8Vcs8
Vcs8
 

Vcs24

  • 1. Contents Of Boot Sector 2 3 4 1 6 5 7 11 8 10 9 12 13 14 15 16 17 18 Boot Parameters Disk Bootstrap Program SSiiddee 00,, TTrraacckk 00
  • 2. Description Boot Parameters Jump Instruction 3 360 Kb 1.2 Mb 1.44 Mb No. of bytes EB3490 MSDOS5.0 System ID 8 No. of bytes/sector 2 512 512 512 No. of sectors/cluster 1 2 1 1 No. of sectors in reserved area 2 1 1 1 No. of copies of FAT 1 2 2 2 Max. no. of root dir. entries 2 112 224 224 Total no. of sectors 2 720 2400 2880 Media descriptor 1 FD F9 F0 No. of sectors/FAT 2 2 7 9 No. of sectors/track 2 9 15 18 No. of sides 2 2 2 2 No. of hidden sectors 2 0 0 0
  • 3. Reading Boot Sector No. of Description bytes Jump Instruction System ID Bytes/sector Sectors/cluster Sectors in reserved area Copies of FAT Max. root dir. entries Total no. of sectors Media descriptor Sectors/FAT Sectors/track Sides 3821212212222 main( ) { struct boot { char jump[ 3 ] ; char sysid[ 8 ] ; int bps ; c .h. ar spc ; char rest[ 482 ] ; } ; struct boot b ; printf ( ”Insert disk, Press any key ) ; getch( ) ; .a b. sread ( 0, 1, 0, &b ) ; } BBPP DDBBPP Side 0, Trk 0, Sec1 Side 0, Trk 0, Sec1
  • 4. # include ”dos.h” main( ) { struct boot { char jump[ 3 ] ; char sysid[ 8 ] ; int bps ; char spc ; . . } ; struct boot b ; absread ( 0, 1, 0, &b ) ; for ( i = 0 ; i <= 2 ; i++ ) printf ( ”%X”, ) ; b.jump[ i ] for ( i = 0 ; i <= 7 ; i++ ) printf ( ”%c”, b.sysid[ i ] ) ; printf ( ”Bytes/sector = %d”, b.bps ) ; printf ( ”Sectors/cluster = %d”, b.spc ) ; } int i ; ......CCoonntt
  • 5. In General absread (drive no., no. of sectors to read, sector from where reading should begin, buffer ) absread ( 0, 1, 0, &b ) ; ; ROM - BIOS DOS S0, T0, S1 Every sector referred using side, track, sector Drive A - 0 Drive B - 1 Drive C - 128 D. r i v e D . - 1 2 9. . . . LSN 0 LSN 36 Every sector referred using LSN Drive A - 0 Drive B - 1 Drive C - 2 D. r i v e D . - 3. . . . S0, T1, S1
  • 6. What Is It? Description 1.44 Mb Disk Jump Instruction System ID Bytes/sector Sectors/cluster Sectors in reserved area Copies of FAT Max. root dir. entries Total no. of sectors Media descriptor Sectors/FAT Sectors/track Sides Obtained Values Typical Values EB3490 IBM 3.3 512 1 1 2 224 2880 F0 9 18 2 0 102 …. 20480 0 1 -24 0 2048 7 -2 0 0 8 BP DBS Virus
  • 7. BBPP DDBBSS Anti-Viral LLSSNN 5500 # include ”dos.h” char a[ 512 ] ; printf ( ”Insert infected disk, Press any key” ) ; absread ( 0, 1, 50, a ) ; 0, 1, 0, a ) ; } ((V ( ( main( ) { getch( ) ; abswrite (
  • 8. Better... #include ”dos.h” main( ) { char a[ 512 ] ; char ch = ’y’ ; char *names[ ] = { ”O Jerusalem”, ”Yankee Doodle”, ”Robinson Cruso”, ”Eddie Murphy”, ... } ; printf ( ”Insert uninfected disk, Press any key” ) ; getch( ) ; absread ( 0, 1, 0, a ) ; while ( ch = = ’y’ ) { printf ( ”Insert infected disk, Press any key” ) ; getch( ) ; abswrite ( 0, 1, 0, a ) ; printf ( ”Another disk y/n” ) ; } ch = getche( ) ; }
  • 9. Directory Sector DDiirreeccttoorryy SSeevveerraall eennttrriieess,, eeaacchh ooff 3322--bbyytteess Description Size Filename Extension Attribute Reserved for Future use Time Date Starting Cluster number Size 8 bytes 3 bytes 1 byte 10 bytes 2 bytes 2 bytes 2 bytes 4 bytes ( (
  • 10. # include ”dos.h” main( ) { Printing Directory struct entry { char n[ 8 ] ; char ext[ 3 ] ; char unused[ 17 ] ; } ; long int size ; struct entry e[ 1 6 ] ; printf ( ”Insert disk, Press any key” ) ; getch( ) ; absread ( 0, 1, 19, e ) ; for ( i = 0 ; i <= 15 ; i++ ) { for ( j = 0 ; j <= 7 ; j++ ) printf ( ”%c”, e[ i ].n[ j ] ) ; for ( j = 0 ; j <= 2 ; j++ ) printf ( ”%c”, e[ i ].ext[ j ] ) ; } } printf ( ”%ld”, e[ i ].size ) ;