程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> 關於C語言 >> C語言實現GPT頭和分區表的讀取(gcc)

C語言實現GPT頭和分區表的讀取(gcc)

編輯:關於C語言

#include <stdio.h><stdlib.h><stdint.h><.h><unistd.h><fcntl.h>

 LOGICAL_BLOCK_SIZE    512 *  * signature[ reserved1[  uint32_t crc32_tab[] = { , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,  uint32_t __efi_crc32(  *buf,  unsigned  *s == (i = ; i < len; i++= crc32_tab[(crc32val ^ s[i]) & ] ^ (crc32val >>   *buf,  (__efi_crc32(buf, len, ~) ^ ~*= (PSTR) malloc(= == *((uint32_t *+= sprintf(p, += = *((uint16_t *+= sprintf(p, += = *((uint16_t *+= sprintf(p, +=  (i = ; i < ; i++ (i == ) *p++ = *p++ = hex[data[i] >> *p++ = hex[data[i] & ] = *utf16_to_wchar(uint16_t *str,  i = *buf = (wchar_t *) malloc((len + ) *  (; i < len; i++== L print_legacy_mbr(&mbr, ,  (read(fd, &mbr, (legacy_mbr)) == -);  -&empty, , * i =  (; i < ; i++= & (!memcmp(p, &empty, (mbr_part_entry))) 
                ->status, p->start_head, p->start_sector, p->->end_head, p->end_sector, p->->  print_gpt_header( fd, gpt_header *,  (read(fd, gpt, (gpt_header)) == -);  - sz[->signature, ] = , gpt->, gpt->, gpt->, gpt->, gpt->, gpt->, gpt->= uuid_to_str(gpt->, gpt->, gpt->, gpt->, gpt->= gpt->->crc_header =  (crc32(gpt, gpt->header_size) !=->crc_header =  print_gpt_partitions( fd,  gpt_header * entries_size = gpt->entry_count * gpt->= (read(fd, buf, entries_size) == -);  -**gentry = (partition_entry *&gentry_empty, ,  i =  (; i < gpt->entry_count; i++ (!memcmp(gentry, &gentry_empty, = utf16_to_wchar(gentry->name, = uuid_to_str(gentry->= uuid_to_str(gentry->->lba_first, gentry->lba_last, gentry->++ (crc32(buf, entries_size) != gpt-> 
 main( exitCode = isAlternate =  (argc < = argv[ (argc > ) isAlternate =  fd = (fd == -);  (lseek(fd, - * LOGICAL_BLOCK_SIZE, SEEK_END) == -); exitCode = EXIT_FAILURE; = EXIT_FAILURE;  (print_gpt_header(fd, &= EXIT_FAILURE;  (lseek(fd, - * (header.entry_count * header.entry_size + LOGICAL_BLOCK_SIZE), SEEK_END) == -); exitCode = EXIT_FAILURE;   (lseek(fd, LOGICAL_BLOCK_SIZE * header.lba_entry_start, SEEK_SET) == -); exitCode = EXIT_FAILURE; &

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved