Contents
3. feedback ¶
- 교 ZeroPage 되는만 4F(ThreeFs + Future Action Plan) 맞게 feedback 다.
- Facts, Feelings, Findings, Future Action Plan. , , 느낀 , 깨달 , 로 .
- 를 들 난 가를 먹 것 대 기를 다면 : "난 강남 가 나 5만는 가를 먹다.() 기대를 뜩 는데 로 다.(느낌) 강남 땅값 값만 보고 라 기대면 된다는 것 다.(깨달) 다는 미리 보고 높 가 가봐겠다.(로 )"
- 것보다 더 게 겠? 믿게
- 것보다 더 게 겠? 믿게
- Facts, Feelings, Findings, Future Action Plan. , , 느낀 , 깨달 , 로 .
- feedback 대 게 .
- 반드 ZeroWiki . 를 만드는 것 다.
- 러들 배 내 리. 과가 더 다.
- 반드 ZeroWiki . 를 만드는 것 다.
- 고로 ZeroWiki는 MoniWiki Engine 며 Google Chrome나 Mozila Firefox, Safari보다는 Internet Explorer 가 돌가는 것 같다.
4.1.2. 내 ¶
- wiki를 는, 떻게 는 대 배다.
- gcc 개발경 구는 법 보다.
1) https://www.virtualbox.org 맞는 VirtualBux를
2) http://ftp.daum.net -> Ubuntu-releases -> 11.10 -> ubuntu-11.10-deskto-amd64.iso 다
3) Virtualbox -> 로 만들기 -> : Linux : Ubuntu -> 메모리1024MB로 고 나머 디
4) 만들 ubuntu -> 미디로 ISO ->
( 되는 것 : 글 배를 국(101/104 )로 됨!)
- gcc로 hello world를 보다.
1) gcc 검 &
2) 는 경로 문 만들기 (는 .c로 )
3) 당 문 드
4) terminal -> .c 는 경로로 동 (ls cd를 다.)
5) gcc로 다. (gcc 명.c -o 는명 -std=c99) 당 가로 러 다.
6) 된 다. (./명)
- w3schools를 개다. (www.w3schools.com)
- 대 기다.
- 문, 관리, 리 감 나겠만 부 관 들는것 다.
- 문, 관리, 리 감 나겠만 부 관 들는것 다.
4.1.3. ¶
- wiki 법 기
1) 기 만들기 - 로그 로 검 를 면 됩다. 기본 로과 고말 .
2) 기 - 래 고란 러 기를 남겨면됩다. feedback 목 고.
- gcc 개발경 구기
1) virtual box로 linux hello world 고 린 강 메로 보내.
4.1.5. 기 ¶
4.2.2. 내 ¶
- 대 기 나다.
1) gcc 려다. - gcc 대부 리 것 라 게 보를 공는 것 목다. 그냥 되
- 대 단 보다.
1) 리가 는 방로 를 목 보내는 것 럼 동는 다.
2) 로 대 보다.
- app : 리가 로 는 를 공는 다. http, smtp, ftp 다.3) 만 리가 모든것 반드 로그램 는것 닙다.
- transport : 데를 떻게 보낼 결는 다. 데를 떻게 묶 보낼, 류리는 떻게 대 결다. TCP/UDP 다.
- ip : , 발 목까 데 묶() 달는 다. 라가 다.
- link : 노드 노드 데를 고는 다. , 브릿 됩다.
- physical : 들 물리로 동는 다. 경 다 블, 무 경 공기가 매가 되겠.
- 런 기능들 단로 나 는, 구내 떤 몰라 그 기능 록 기 다.4) 그럼 무가?
- , 로그래밍 당 들 동리를 모르더라 떤 기능 는만 면 게 로그래밍 다.
- (Internet socket, socket' network socket 라고 부르기 다) 로 결되 는 객다.5) http://forum.falinux.com/zbxe/?document_srl=441104 를 고.
로그램들 고, 로 데를 교다. - wikipedia- 는 고 :P 단 명면 라가 byte stream 고 는 것 력 듯 는 것다.
력 구 fopen() connect() read()/write() read()/write() close() close()
4.2.3. ¶
- c로 기
1) 를 고 라 드를 봅다.
2) 구 라 보내 메를 대문로 바꿔 다 라게 보내는 것다.
3) 난가 다 높 므로 구 다. 보고 날 다 기 나보겠다.
4) 리 경 gcc를 봅다.
5) 려 나 댓글 .
4.2.5. 기 ¶
- 반 내 보 고 는군 =_=ㅋ 밌겠 ㅋㅋ - 김
- 로그래밍 다. 대 는 구들게 떻게 개념 려나 많 고민고 결과는 fail던 것 같다. 론 부 는 강나 나 멘 는 것 같다..... 그리고 될 것 같.. 대 끝나고 바로 가 꾸벅꾸벅 다. 대를 들만 돌 던라. -
- C로 로그래밍 보 미듯ㅋㅋ - 기
- 반 빡 ㅋㅋㅋㅋ 가르기 들겠다… 난감땐 맨땅 딩는 것 그것 공돌 길라고 둘러대는 게 듯… - 김경
- 면 들 가 가능 로 리된 다. - 김
- ... 되... -
- 고 2만 과 료를 로 명다.(?) - 김
- 고 2만 과 료를 로 명다.(?) - 김
- ... 되... -
- 로그래밍 대 배다. 내 따라가 못 것 두려 많 는데 님 명 내 다. 날 격 딸 때 보던 단들 막 나까 기다. 다 까 복 될 것 같다. 그리고 님 강 노가 굉 났다. - 권기
4.3.2. 내 ¶
- 난 내 대 기 다.
1) 복 떻게 결나?
- 경 구 기때문 라 로 경2) 나 라가 다 결 는 경는 떻게 될까?
를 를 공다.- 같면 나 다 라가 결는 대 다.
- 다. 보3) 라를 따로두 무 다. 떻게 방법 까?
- thread를 라를 리 는4) 나 라 다 결되기는 무 다.
concurrent 로그래밍 다부 겠다.
- 방 off-line 경 메 과 령 가능록
를 두 push로 메를 고 다. 를 C2DM라고 다.
- Thread 대 보다.
- thread가 떤 것 는 떻게 는 단 개다.
다 떻게 로그래밍 것 같 보겠다.
4.3.3. ¶
- 다 라가 나 결 는 뮬
- terminal 러개 보.
- 나 라가 다 결 는 경 봅다.
- 난 는 라가 만 메를 고 는데, 로 록 구봅다.
- 라 while문만 가면 단 것 같다.
4.3.5. 기 ¶
4.4.2. 내 ¶
- 대 기 다.
1) 권기 라 메가 만 보내는 때문 멘붕
-> 메를 만 고 close려 긴 결과다.2) 나 라가 다 결 는 경
-> 보는게 는데 다들 당 될 것로 고 보 .3) 늦 데로
-> 말 강가 무 바빠 데를 못는동 가 발
깐 개던 thread로그래밍 김 thread로 는 것 고 로그래밍 . 강 멘붕
- concurrent 로그래밍 대 배다.
1) thread 로그래밍
- thread 동 리 thread를 떻게 는, 료를 떻게 는 대 배다.
- 내 링를 . http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Thread/Beginning/WhatThread
4.6.2. 내 ¶
- NTFS 대 략게 명다.
- 드
// 더 : ntfs.h #pragma once #define _WIN32_WINNT 0x0500 #include <windows.h> #include <winioctl.h> #include <stdio.h> typedef BOOLEAN TF; typedef UCHAR U8; typedef USHORT U16; typedef ULONG U32; typedef ULONGLONG U64; typedef struct { U32 Type; U16 UsaOffset; U16 UsaCount; U64 Usn; } NTFS_RECORD_HEADER, *PNTFS_RECORD_HEADER; typedef struct { NTFS_RECORD_HEADER Ntfs; U16 SequenceNumber; U16 LinkCount; U16 AttributeOffset; U16 Flags; // inUse 0x0001 Directory 0x0002 U32 BytesInUse; U32 BytesAllocated; U64 BaseFileRecord; U16 NextAttributeNumber; } FILE_RECORD_HEADR, *PFILE_RECORD_HEADER; // Standard Attribute typedef enum { AttributeStandardInformation = 0x10, AttributeAttributeList = 0x20, AttributeFileName = 0x30, AttributeObjectId = 0x40, AttributeSecurityDesciptor = 0x50, AttributeVolumeName = 0x60, AttributeVolumeInformation = 0x70, AttributeData = 0x80, AttributeIndexRoot = 0x90, AttributeIndexAllocation = 0xA0, AttributeBitmap = 0xB0, AttributeReparsePoint = 0xC0, AttributeEAInformation = 0xD0, AttributeEA = 0xE0, AttributePropertySet = 0xF0, AttributeLoggedUtilityStream = 0x100 } ATTRIBUTE_TYPE, *PATTRIBUTE_TYPE; typedef struct { ATTRIBUTE_TYPE AttributeType; U32 Length; TF Nonresident; U8 NameLength; U16 NameOffset; U16 Flags; U16 AttributeNumber; } ATTRIBUTE, *PATTRIBUTE; typedef struct { ATTRIBUTE Attribute; U32 ValueLength; U16 ValueOffset; U16 Flags; } RESIDENT_ATTRIBUTE,*PRESIDENT_ATTRIBUTE; #pragma pack(push, 1) typedef struct { U8 Jump[3]; U8 Format[8]; U16 BytesPerSector; //당 바 U8 SectorsPerCluster; //당 러 U16 BootSectors; U8 Mbz1; U16 Mbz2; U16 Reserved1; U8 MediaType; U16 Mbz3; U16 SectorsPerTrack; U16 NumberOfHeads; U32 PartitionOffset; U32 Reserved2[2]; U64 TotalSectors; //디 . U64 MftStartLcn; //MFT가 되는 . U64 Mft2StartLcn; // MFT Mirror 부 되는 U32 ClustersPerFileRecord; // 드당 러 U32 ClustersPerIndexBlock; // 블럭당 러 U64 VolumeSerialNumber; U8 Code[0x1AE]; U16 BootSignature; } BOOT_BLOCK, *PBOOT_BLOCK; #pragma pack(pop)
- main.cpp
#include "ntfs.h" U32 BytesPerFileRecord; BOOT_BLOCK boot_block; HANDLE hVolume; U32 cnt; CHAR drive[] = "\\\\.\\C:"; PFILE_RECORD_HEADER MFT; void ReadSector(U64 sector, U32 count, void* buffer); void LoadMFT(); void main() { hVolume = CreateFile(drive, GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE, 0,OPEN_EXISTING, 0, 0); ReadFile(hVolume, &boot_block, sizeof(boot_block), &cnt, 0); printf("======My FILE SYSTEM INFO==========\n"); printf("File System : %s \n",boot_block.Format); printf("Total Sectors : %u \n",boot_block.TotalSectors); printf("Sector per Bytes : %u \n",boot_block.BytesPerSector); printf("Cluster per Sectors : %u\n",boot_block.SectorsPerCluster); printf("Clusters Per FileRecord : %u\n",boot_block.ClustersPerFileRecord); printf("Clusters Per IndexBlock : %u\n",boot_block.ClustersPerIndexBlock); } void LoadMFT() { BytesPerFileRecord = boot_block.ClustersPerFileRecord < 0x80? boot_block.ClustersPerFileRecord* boot_block.SectorsPerCluster* boot_block.BytesPerSector : 1 << (0x100 - boot_block.ClustersPerFileRecord); MFT = PFILE_RECORD_HEADER(new U8[BytesPerFileRecord]); ReadSector(boot_block.MftStartLcn * boot_block.SectorsPerCluster, BytesPerFileRecord / boot_block.BytesPerSector, MFT); printf("buffer : %s\n", MFT+0x27); } void ReadSector(U64 sector, U32 count, void* buffer) { ULARGE_INTEGER offset; OVERLAPPED overlap = {0}; U32 n; offset.QuadPart = sector * boot_block.BytesPerSector; overlap.Offset = offset.LowPart; overlap.OffsetHigh = offset.HighPart; ReadFile(hVolume, buffer, count * boot_block.BytesPerSector, &n, &overlap); }
4.6.3. ¶
- http://forensic-proof.com/ mft 대 보.
4.8.5. 기 ¶
- CreateFile를 보다. - 김
고
- 배께 fopen로 는 것과 다를바가 다고 fopen로 고, fread로 보는데 결과가 같다. - 김
- fopen 경 Standard데 같 input 때, 리 다르게 동 궁다. - 김
- 료 16법 릿가 깔리는군. ;ㅅ; - 김
- 값 는데 값 나 검보 MFT Little Endian 는 군. - 김
- ReadFile overlap 법 나는 곳 기 듭다 ;ㅅ;
ReadFile 를 만 기던데 ReadSector는 긴 부 단로 는 가? 면 부 다 는가? - 김
- 를 반복 보는데 는 가 같 보, 부부 단를 는 것군. - 김
- 를 반복 보는데 는 가 같 보, 부부 단를 는 것군. - 김
- 들 는데 공다.(2012/04/13/01:44)- 김
- 기 고
- CreateFile 문 LPCWSTR로 변되 는 문가 기는 경는 CreateFileA를 보.
내 http://stackoverflow.com/questions/3783842/converting-a-string-to-lpcwstr-for-createfile-to-address-a-serial-port
4.9.2. 내 ¶
#include "ntfs.h" U32 BytesPerFileRecord; BOOT_BLOCK boot_block; HANDLE hVolume; U32 cnt; CHAR drive[] = "\\\\.\\C:"; //WCHAR drive[] = TEXT("\\\\.\\C:"); PFILE_RECORD_HEADER MFT; void ReadSector(U64 sector, U32 count, void* buffer); void LoadMFT(); void main() { hVolume = CreateFile(drive, GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE, 0,OPEN_EXISTING, 0, 0); ReadFile(hVolume, &boot_block, sizeof(boot_block), &cnt, 0); // FILE *fp=fopen(drive,"rb"); // fread((void*)&boot_block,sizeof(boot_block),1,fp); printf("======My FILE SYSTEM INFO==========\n"); printf("File System : %s \n",boot_block.Format); printf("Total Sectors : %u \n",boot_block.TotalSectors); printf("Sector per Bytes : %u \n",boot_block.BytesPerSector); printf("Cluster per Sectors : %u\n",boot_block.SectorsPerCluster); printf("Clusters Per FileRecord : %u\n",boot_block.ClustersPerFileRecord); printf("Clusters Per IndexBlock : %u\n",boot_block.ClustersPerIndexBlock); printf("\n\n"); LoadMFT(); } void LoadMFT() { int i; BytesPerFileRecord = boot_block.ClustersPerFileRecord < 0x80? boot_block.ClustersPerFileRecord* boot_block.SectorsPerCluster* boot_block.BytesPerSector : 1 << (0x100 - boot_block.ClustersPerFileRecord); MFT = PFILE_RECORD_HEADER(new U8[BytesPerFileRecord]); ReadSector(boot_block.MftStartLcn * boot_block.SectorsPerCluster, BytesPerFileRecord / boot_block.BytesPerSector, MFT); printf("$MFT's Signaturer : %s\n", MFT);//+0x27); printf("Offset to fixup array : 0x%02x%02x\n", *((unsigned char*)MFT+5),*((unsigned char*)MFT+4)); printf("Number of this MFT Entry : 0x%02x%02x%02x%02x\n" , *((unsigned char*)MFT+47),*((unsigned char*)MFT+46),*((unsigned char*)MFT+45),*((unsigned char*)MFT+44)); printf("Offset to first attribute : 0x%02x%02x \n" , *((unsigned char*)MFT+21),*((unsigned char*)MFT+20)); i=((int)(*((unsigned char*)MFT+21))<<8)+*((unsigned char*)MFT+20);//Offset로 동 printf("First Attribute : 0x%02x%02x%02x%02x\n",*((unsigned char*)MFT+i+3),*((unsigned char*)MFT+i+2),*((unsigned char*)MFT+i+1),*((unsigned char*)MFT+i)); i+=4;//값 4바 동 printf("First Attribute Size : 0x%02x%02x%02x%02x\n",*((unsigned char*)MFT+i+3),*((unsigned char*)MFT+i+2),*((unsigned char*)MFT+i+1),*((unsigned char*)MFT+i)); printf("\n"); i= i+ ((int)(*((unsigned char*)MFT+i+3))<<24)+ ((int)(*((unsigned char*)MFT+i+2))<<16)+ ((int)(*((unsigned char*)MFT+i+1))<<8)+ *((unsigned char*)MFT+i) -4;//를 기 4바를 다. printf("Second Attribute : 0x%02x%02x%02x%02x\n",*((unsigned char*)MFT+i+3),*((unsigned char*)MFT+i+2),*((unsigned char*)MFT+i+1),*((unsigned char*)MFT+i)); i+=4;//값 4바 동 printf("Second Attribute Size : 0x%02x%02x%02x%02x\n",*((unsigned char*)MFT+i+3),*((unsigned char*)MFT+i+2),*((unsigned char*)MFT+i+1),*((unsigned char*)MFT+i)); printf("\n"); i= i+ ((int)(*((unsigned char*)MFT+i+3))<<24)+ ((int)(*((unsigned char*)MFT+i+2))<<16)+ ((int)(*((unsigned char*)MFT+i+1))<<8)+ *((unsigned char*)MFT+i) -4;//를 기 4바를 다. printf("Third Attribute : 0x%02x%02x%02x%02x\n",*((unsigned char*)MFT+i+3),*((unsigned char*)MFT+i+2),*((unsigned char*)MFT+i+1),*((unsigned char*)MFT+i)); i+=4;//값 4바 동 printf("Third Attribute Size : 0x%02x%02x%02x%02x\n",*((unsigned char*)MFT+i+3),*((unsigned char*)MFT+i+2),*((unsigned char*)MFT+i+1),*((unsigned char*)MFT+i)); printf("\n"); /* ReadSector(boot_block.Mft2StartLcn * boot_block.SectorsPerCluster, BytesPerFileRecord / boot_block.BytesPerSector, MFT); printf("$MFT Mirr's Signaturer : %s\n", MFT);//+0x27); printf("Offset to fixup array : 0x%02x%02x\n", *((unsigned char*)MFT+5),*((unsigned char*)MFT+4)); printf("Number of this MFT Entry : 0x%02x%02x%02x%02x\n" , *((unsigned char*)MFT+47),*((unsigned char*)MFT+46),*((unsigned char*)MFT+45),*((unsigned char*)MFT+44)); printf("\n"); //*/ printf("MftStartLcn : %d\n",boot_block.MftStartLcn); printf("Mft2StartLcn : %d\n",boot_block.Mft2StartLcn); } void ReadSector(U64 sector, U32 count, void* buffer) { ULARGE_INTEGER offset; OVERLAPPED overlap = {0}; U32 n; offset.QuadPart = sector * boot_block.BytesPerSector; overlap.Offset = offset.LowPart; overlap.OffsetHigh = offset.HighPart; ReadFile(hVolume, buffer, count * boot_block.BytesPerSector, &n, &overlap); }
4.9.5. 기 ¶
- 뒤 는 는 고, 리디 빅디로 변는 는 군.
라브러리를 구다.
htons, htonl
- HxD라는 디가 다. 4기가 바 고 대 8 바까 다고 다. 그리고 가 리.
http://mh-nexus.de/en/hxd/ - 권기
- Code jam로 더 ... - 김
- 공 는 라 료 다. 4bit unsigned 부 3byte,7byte unsigned 까 .ㅠㅜ - 김
4.10.2. 내 ¶
#include "ntfs.h" U32 BytesPerFileRecord; BOOT_BLOCK boot_block; HANDLE hVolume; U32 cnt; CHAR drive[] = "\\\\.\\C:"; //WCHAR drive[] = TEXT("\\\\.\\C:"); PFILE_RECORD_HEADER MFT; void ReadSector(U64 sector, U32 count, void* buffer); void LoadMFT(); unsigned int LoadAttribute(int i); unsigned __int64 htonll(unsigned __int64); unsigned int htonl(unsigned int); //unsigned short htons(unsigned short); void main() { hVolume = CreateFile(drive, GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE, 0,OPEN_EXISTING, 0, 0); ReadFile(hVolume, &boot_block, sizeof(boot_block), &cnt, 0); // FILE *fp=fopen(drive,"rb"); // fread((void*)&boot_block,sizeof(boot_block),1,fp); printf("======My FILE SYSTEM INFO==========\n"); printf("File System : %s \n",boot_block.Format); printf("Total Sectors : %u \n",boot_block.TotalSectors); printf("Sector per Bytes : %u \n",boot_block.BytesPerSector); printf("Cluster per Sectors : %u\n",boot_block.SectorsPerCluster); printf("Clusters Per FileRecord : %u\n",boot_block.ClustersPerFileRecord); printf("Clusters Per IndexBlock : %u\n",boot_block.ClustersPerIndexBlock); printf("\n\n"); LoadMFT(); system("pause"); } void LoadMFT() { int point; unsigned __int64 num; BytesPerFileRecord = boot_block.ClustersPerFileRecord < 0x80? boot_block.ClustersPerFileRecord* boot_block.SectorsPerCluster* boot_block.BytesPerSector : 1 << (0x100 - boot_block.ClustersPerFileRecord); MFT = PFILE_RECORD_HEADER(new U8[BytesPerFileRecord]); printf("MftStartLcn : %016x\n",boot_block.MftStartLcn); printf("Mft2StartLcn : %016x\n",boot_block.Mft2StartLcn); printf("\n"); //0 대 값 대면 다른 MFT entry를 볼 . ReadSector((boot_block.MftStartLcn+0) * boot_block.SectorsPerCluster, BytesPerFileRecord / boot_block.BytesPerSector, MFT); printf("MFT's Signaturer : %s\n", MFT);//+0x27); printf("Offset to fixup array : 0x%02x%02x\n", *((unsigned char*)MFT+5),*((unsigned char*)MFT+4)); printf("Number of this MFT Entry : 0x%02x%02x%02x%02x\n" , *((unsigned char*)MFT+47),*((unsigned char*)MFT+46),*((unsigned char*)MFT+45),*((unsigned char*)MFT+44)); printf("Offset to first attribute : 0x%02x%02x \n" , *((unsigned char*)MFT+21),*((unsigned char*)MFT+20)); printf("\n"); point=((int)(*((unsigned char*)MFT+21))<<8)+*((unsigned char*)MFT+20);//Offset로 동 printf("Attribute List Start\n\n"); while(htonl(*((unsigned int*)((unsigned char*)MFT+point)))!=0xFFFFFFFF) point+=LoadAttribute(point); printf("Attribute List End\n"); printf("\n"); } unsigned int LoadAttribute(int point) { int i=0,j=0,k=0; int HeaderSize; /* *((unsigned char*)MFT+i+9) = Attribute Name Size Resident=24 / Non-resident=64 */ if(*((unsigned char*)MFT+point+8)) HeaderSize=64+*((unsigned char*)MFT+point+9); else HeaderSize=24+*((unsigned char*)MFT+point+9); switch(htonl(*((unsigned int*)((unsigned char*)MFT+point)))) { case 0x10://$STANDARD_INFORMATION printf("Attribute type : Standard Information\n"); break; case 0x20://$ATTRIBUTE_LIST printf("Attribute type : Attribute List\n"); break; case 0x30://$FILE_NAME printf("Attribute type : File Name\n"); printf("File Name Size : %d\n",*((unsigned char*)MFT+point+HeaderSize+64)); printf("File NameSpace : "); switch(*((unsigned char*)MFT+point+HeaderSize+65)) { case 0: printf("POSIX\n"); break; case 1: printf("Win32\n"); break; case 2: printf("DOS\n"); break; case 3: printf("Win32 & DOS\n"); break; } printf("File Name : "); for(j=0;j<2**((unsigned char*)MFT+point+HeaderSize+64);j++) printf("%c",*((unsigned char*)MFT+point+HeaderSize+66+j)); printf("\n"); break; case 0x40://$ printf("Attribute type : \n"); break; case 0x50://$SECURITY_DESCRIPTOR printf("Attribute type : Security Descriptor\n"); break; case 0x60://$ printf("Attribute type : \n"); break; case 0x70://$ printf("Attribute type : \n"); break; case 0x80://$DATA printf("Attribute type : Data\n"); //__int64는 메모리 little endian로 됨. 가 가만... printf("Run List Start VCN : %I64d\n",*((unsigned __int64*)((unsigned char*)MFT+point+16))); printf("Run List End VCN : %I64d\n",*((unsigned __int64*)((unsigned char*)MFT+point+24))); printf("Run List Start Offset : 0x%02x%02x\n",*((unsigned char*)MFT+point+33),*((unsigned char*)MFT+point+32)); // printf("Cluster Size : %I64d\n",*((unsigned __int64*)((unsigned char*)MFT+point+40))); // printf("Attribute Size : %I64d\n",*((unsigned __int64*)((unsigned char*)MFT+point+48))); // printf("real Size : %I64d\n",*((unsigned __int64*)((unsigned char*)MFT+point+56))); i=(int)*((unsigned char*)MFT+point+33)+*((unsigned char*)MFT+point+32); for(j=0;j<(*((unsigned char*)MFT+point+i)&0x0F);j++)//*((unsigned __int64*)((unsigned char*)MFT+point+24));j++) { printf("Cluster %d lenth : 0x",j); for(k=0;k<(*((unsigned char*)MFT+point+i)&0x0F);k++) printf("%02x",*((unsigned char*)MFT+point+i+(*((unsigned char*)MFT+point+i)&0x0F)-k)); printf("\n"); printf("Cluster %d offset : 0x",j); for(;k<(*((unsigned char*)MFT+point+i)&0x0F)+((*((unsigned char*)MFT+point+i)&0xF0)>>4);k++) printf("%02x",*((unsigned char*)MFT+point+i +(*((unsigned char*)MFT+point+i)&0x0F)+((*((unsigned char*)MFT+point+i)&0xF0)>>4) -k+(*((unsigned char*)MFT+point+i)&0x0F))); printf("\n"); i+=(*((unsigned char*)MFT+point+i)&0x0F)+((*((unsigned char*)MFT+point+i)&0xF0)>>4)+1; } break; case 0xB0: printf("Attribute type : Bitmap\n"); break; } printf("\n"); return htonl(*((unsigned int*)((unsigned char*)MFT+point+4))); } void ReadSector(U64 sector, U32 count, void* buffer) { ULARGE_INTEGER offset; OVERLAPPED overlap = {0}; U32 n; offset.QuadPart = sector * boot_block.BytesPerSector; overlap.Offset = offset.LowPart; overlap.OffsetHigh = offset.HighPart; ReadFile(hVolume, buffer, count * boot_block.BytesPerSector, &n, &overlap); } unsigned __int64 htonll(unsigned __int64 LittleEndian) { unsigned __int64 BigEndian; int i; LittleEndian>>=16; BigEndian=0; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+7))<<54; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+6))<<48; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+5))<<40; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+4))<<32; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+3))<<24; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+2))<<16; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+1))<<8; BigEndian+=(unsigned __int64)(*((unsigned char*)&LittleEndian+0)); return BigEndian; } unsigned int htonl(unsigned int LittleEndian) { unsigned int BigEndian; BigEndian= ((unsigned int)(*((unsigned char*)&LittleEndian+3))<<24)+ ((unsigned int)(*((unsigned char*)&LittleEndian+2))<<16)+ ((unsigned int)(*((unsigned char*)&LittleEndian+1))<<8)+ *((unsigned char*)&LittleEndian) ; return BigEndian; } /* unsigned short htons(unsigned short LittleEndian) { unsigned short BigEndian; BigEndian= ((unsigned short)(*((unsigned char*)&LittleEndian+1))<<8)+ *((unsigned char*)&LittleEndian) ; return BigEndian; } /*/
4.10.5. 기 ¶
- 멘붕, 는 그냥 기 길까 고민 ...- 김
- (보 MS 반, micro second 단라)
- (보 MS 반, micro second 단라)
- http://ezbeat.tistory.com/124
멧 변 API - 김
- http://lioler.blog.me/20051109234
NFTS 명 - 김
-
래 , 는 늘리는 . ( 기본 보, , data 기 가능)
김/MTFREADER - 김