Presentation is loading. Please wait.

Presentation is loading. Please wait.

00000000 50 4B 03 04 14 00 00 00 08 00 E2 BD 62 45 22 F2 PK..........bE". 00000010 B9 72 16 00 00 00 17 00 00 00 08 00 00 00 46 69.r............Fi.

Similar presentations


Presentation on theme: "00000000 50 4B 03 04 14 00 00 00 08 00 E2 BD 62 45 22 F2 PK..........bE". 00000010 B9 72 16 00 00 00 17 00 00 00 08 00 00 00 46 69.r............Fi."— Presentation transcript:

1

2

3

4

5 B E2 BD F2 PK bE" B r Fi C 65 2E CB CC 49 0D C9 28 4A 4D 75 le.txts..I..(JMu CE CF 2B 49 CD 2B 29 E6 E B I.+)...A.PK E2 BD F2 B bE"..r C 65 2E File.t B xtPK C <..... This is a single file inside of zip.

6 B E2 BD F2 PK bE" B r Fi C 65 2E CB CC 49 0D C9 28 4A 4D 75 le.txts..I..(JMu CE CF 2B 49 CD 2B 29 E6 E B I.+)...A.PK E2 BD F2 B bE"..r C 65 2E File.t B xtPK C <..... Local File Header – Each file in the zip gets a local File Data – The Compressed/Encrypted Contents Of The File Central Directory – Summarizes Local File Descriptors And Contains Additional Info

7 B A9 98 6B 45 FB 98 PK kE A Fi C E C 65 4F 6E F le1.txtFileOneCo E E D 0A 50 4B ntents!!!..PK A4 98 6B DF 9A kEc..E C E File2.t C F 43 6F 6E E 74 xtFileTwoContent D 0A 50 4B s!!!..PK E2 BD F2 B bE"..r C E CB CC....File3.txts A0 49 0D C9 28 4A 4D 75 CE CF 2B 49 CD 2B 29 E6 E5 I..(JMu..+I.+) B B A9.A.PK C0 98 6B 45 FB kE..A D E C E B File1.txtPK F A4 98 6B DF 9A kEc..E B C E ;...File2.tx B E2 BD 62 tPK b F2 B E"..r v...F C E B ile3.txtPK A B Zip File with 3 Files

8

9 SignatureVersionFlags Compression method File modification time File modification date CRC-32 checksum Compressed size Uncompressed size File name length Extra field length File name 0x04034b50 (read as a little-endian number) Major Ver. 2.0 (14 HEX = 20 Decimal/10) Minor Ver. 0 None 08: deflated 23:47:02 SEE NEXT SLIDE 11/2/2014 SEE NEXT SLIDE 0x72B9F checksum 16 = 22 bytes 17 = 23 bytes 8 chars F i l e. t x t N/A “File.txt”

10 E2 BD E2 BD = BD E2 little endian BD E2 = 10111(23) (47) 00010(2) = 23:47: = little endian = (34) 1011(11) 00010(2) = 11/2/ (34)represents the years since 1980

11 Local File1 Header File 1 Data Local File2 Header File 2 Data Local File 3 Header File3 Data... Local File N Header File N Data Central Directory

12

13

14 000000B B A9.A.PK C0 98 6B 45 FB kE..A D E C E B File1.txtPK F A4 98 6B DF 9A kEc..E B C E ;...File2.tx B E2 BD 62 tPK b F2 B E"..r v...F C E B ile3.txtPK A B File header 1 File header 2 File header 3 End of Central Directory Record

15 Just as before, not all fields are required.

16

17 Signature The signature of end of central directory record. This is always '\x50\x4b\x05\x06'. Disk Number The number of this disk (containing the end of central directory record) Disk # w/cd Number of the disk on which the central directory starts Disk entries The number of central directory entries on this disk Total entries Total number of entries in the central directory. Central directory size Size of the central directory in bytes Offset of cd wrt to starting disk Offset of the start of the central directory on the disk on which the central directory starts Comment len The length of the following comment field ZIP file comment Optional comment for the Zip file

18 File names all in a row? Reminds me of Local File Headers File names followed by “PK” all in a row? Looks like Central Directory File Headers to me.

19

20

21

22 BOTH HEADERS!

23

24

25

26

27

28 Signature The signature of end of central directory record. This is always '\x50\x4b\x05\x06'. Disk Number Needs to be 00 because this is the only/first central directory for this archive. Disk # w/cd Needs to be 00 because this is the only/first central directory for this archive. Disk entries This needs to be set 01 because there is only one central directory for this archive. Total entries Total number of entries in the central directory is 01 because we only have one file Central directory size The central directory header is 88(58 in HEX) bytes long. Offset of cd wrt to starting disk Local Header (72 bytes) + File Data (541 bytes) = 613 (265 HEX) (0x6502) Little Endian Comment len No comment needed 00

29 Add End of central directory record to the end of the new file and save! Also cross fingers

30

31

32 3 Local File Headers & File Data but NO CD

33

34

35


Download ppt "00000000 50 4B 03 04 14 00 00 00 08 00 E2 BD 62 45 22 F2 PK..........bE". 00000010 B9 72 16 00 00 00 17 00 00 00 08 00 00 00 46 69.r............Fi."

Similar presentations


Ads by Google