Public Type DWORD bytes(1 To 4) As Byte End Type Public Function Dbl_DWORD(DW As DWORD) As Double Dim i As Integer Dim tmp As String For i = 1 To 4 Dbl_DWORD = Dbl_DWORD + CDbl(DW.bytes(i)) * (2 ^ (8 * (i - 1))) Next End Function Public Function Hex_DWORD(DW As DWORD) As String Dim i As Integer Dim tmp As String For i = 1 To 4 tmp = Hex(DW.bytes(i)) tmp = String(2 - Len(tmp), "0") & tmp Hex_DWORD = tmp & Hex_DWORD Next End Function
.minor_version 3E .major_version 3 .order FFFE .sector_shift 9 .mini_sector_shift 6 .number_of_directory_sectors 0 .number_of_fat_sectors 2 .first_directory_sector_location DC .transaction_signature_number 0 .mini_stream_cutoff_size 1000 .first_mini_fat_sector_location FFFFFFFE .number_of_mini_fat_sectors 0 .first_mini_difat_sector_location FFFFFFFE .number_of_difat_sectors 0 .DIFat(1 to 109) : (1) DA DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF (10) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF (20) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF (30) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF (40) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF (50) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF (60) FF FF FF FF FF FF FF FF FF FF FF FF FF
.first_directory_sector_location DC
.number_of_directory_sectors 0
.first_mini_difat_sector_location FFFFFFFE= ENDOFCHAIN
.number_of_fat_sectors 2
.first_mini_fat_sector_location FFFFFFFE
.DIFat(1 to 109) :
(1) DA DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF
(10) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
.minor_version 3E .major_version 3 .order FFFE .sector_shift 9 .mini_sector_shift 6 .number_of_directory_sectors 0 .number_of_fat_sectors 3 .first_directory_sector_location 1 .transaction_signature_number 0 .mini_stream_cutoff_size 1000 .first_mini_fat_sector_location 2 .number_of_mini_fat_sectors 3 .first_mini_difat_sector_location FFFFFFFE .number_of_difat_sectors 0 .DIFAT(1 To 109) : (1) 0000 007F 00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (11) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (21) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (31) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (41) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (51) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (61) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
.minor_version 3E .major_version 3 .order FFFE .sector_shift 9 .mini_sector_shift 6 .number_of_directory_sectors 0 .number_of_fat_sectors 1 .first_directory_sector_location 1 .transaction_signature_number 0 .mini_stream_cutoff_size 1000 .first_mini_fat_sector_location 1F .number_of_mini_fat_sectors 2 .first_mini_difat_sector_location FFFFFFFE .number_of_difat_sectors 0 .DIFAT(1 To 109) : (0) 0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (11) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (21) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (31) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (41) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (51) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF (61) FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
Dim header As t_HEADER Dim canal As Byte Dim r As Long canal = FreeFile Ouvrire = "Ouverture du fichier" Open file For Binary Access Read As #canal Get #canal, , header Close #canal With header Debug.Print Left$(".minor_version" & String(34, " "), 34); Hex(.minor_version) Debug.Print Left$(".major_version" & String(34, " "), 34); Hex(.major_version) Debug.Print Left$(".order" & String(34, " "), 34); Hex(.order) Debug.Print Left$(".sector_shift" & String(34, " "), 34); Hex(.sector_shift) Debug.Print Left$(".mini_sector_shift" & String(34, " "), 34); Hex(.mini_sector_shift) Debug.Print Left$(".number_of_directory_sectors" & String(34, " "), 34); Hex(.number_of_directory_sectors) Debug.Print Left$(".number_of_fat_sectors" & String(34, " "), 34); Hex(.number_of_fat_sectors) Debug.Print Left$(".first_directory_sector_location" & String(34, " "), 34); Hex(.first_directory_sector_location) Debug.Print Left$(".transaction_signature_number" & String(34, " "), 34); Hex(.transaction_signature_number) Debug.Print Left$(".mini_stream_cutoff_size" & String(34, " "), 34); Hex(.mini_stream_cutoff_size) Debug.Print Left$(".first_mini_fat_sector_location" & String(34, " "), 34); Hex(.first_mini_fat_sector_location) Debug.Print Left$(".number_of_mini_fat_sectors" & String(34, " "), 34); Hex(.number_of_mini_fat_sectors) Debug.Print Left$(".first_mini_difat_sector_location" & String(34, " "), 34); Hex(.first_mini_difat_sector_location) Debug.Print Left$(".number_of_difat_sectors" & String(34, " "), 34); Hex(.number_of_difat_sectors) Debug.Print ".DIFAT(1 To 109) :" Debug.Print "(1)", For r = 1 To 109 Debug.Print Right$("0000" & Hex(.DIFAT(r)), 4) & " "; If r Mod 16 = 0 Then Debug.Print Debug.Print "("; Hex(r + 1); ")", End If Next r Debug.Print End With
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question.number_of_directory_sectors 0
.first_directory_sector_location 1
'Le Directory Entry Public Type t_DENTRY Directory_Entry_Name(1 To 32) As Integer ' nul terminated string UTF-16 (2 octets par caractère) Directory_Entry_Name_Length As Integer ' longueur de la chaine de caractère (comprenant le '\n') Object_Type As Byte ' type d'objet Color_Flag As Byte ' Left_Sibling_ID As Long ' Right_Sibling_ID As Long ' Child_ID As Long ' clsid(1 To 16) As Byte ' doivent être 0 State_Bits As Long ' doit être 0 Creation_Time As Date Modified_Time As Date Starting_Sector_Location As Long Stream_Size As Double End Type 'Les types d'objets Public Const to_Unknown_or_unallocated = 0 Public Const to_Storage_Object = 1 Public Const to_Stream_Object = 2 Public Const to_Root_Storage_Object = 5 'les color flags Public Const cf_red = 0 Public Const cf_black = 1
'Directory Entry Ouvrire = "Lecture du Directory Entry" Dim directory_entry() As t_DENTRY ReDim directory_entry(1 To (2 ^ header.sector_shift) / 128) Dim i As Integer For i = 1 To UBound(directory_entry) Get #canal, _ (header.first_directory_sector_location + 1) * (2 ^ header.sector_shift) + 1 + ((i - 1) * 128), _ directory_entry(i) Debug.Print "entry name " & i & " = '" & UTF_16(directory_entry(i).Directory_Entry_Name, directory_entry(i).Directory_Entry_Name_Length) & "'" Next
entry name 1 = 'Root Entry'
entry name 2 = 'Workbook'
entry name 3 = '_VBA_PROJECT_CUR'
entry name 4 = 'Ctls'