Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void readRoot()
- {
- int counter = 0;
- TMachineSignalState OldState;
- MachineFileSeek(fd, 512 * bpb->FirstRootSector, 0, MyMachineFileCallback, threads[curThreadID]);
- for (int i = 0; i < (bpb->RootEntCnt / 16); i++)
- {
- // cout<<"i: "<<i<<endl;
- uint8_t* sharedLocation;
- void* buff;
- VMMemoryPoolAllocate(memPools[1]->PoolID, 512, &buff); MachineSuspendSignals(&OldState);
- MachineFileRead(fd, buff, 512, MyMachineFileCallback, threads[curThreadID]);
- threads[curThreadID]->state = VM_THREAD_STATE_WAITING;
- Schedule();
- MachineResumeSignals(&OldState);
- sharedLocation = (uint8_t*)buff;
- int innerOffset = 0;
- for (int i = 0; i < 16; i++)
- {
- //cout<<"what"<<endl;
- Root* rootEntry = new Root;
- counter = 0;
- for (int i = 0 + innerOffset; i < 11 + innerOffset; i++)
- {
- rootEntry->dir_Name[counter] = sharedLocation[i];
- counter++;
- }
- rootEntry->dir_Attr = sharedLocation[11 + innerOffset];
- rootEntry->dir_NTRes = sharedLocation[12 + innerOffset];
- rootEntry->dir_CrtTimeTenth = sharedLocation[13 + innerOffset];
- counter = 0;
- for (int i = 14 + innerOffset; i < 16 + innerOffset; i++)
- {
- rootEntry->dir_CrtTime[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 16 + innerOffset; i < 18 + innerOffset; i++)
- {
- rootEntry->dir_CrtDate[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 18 + innerOffset; i < 20 + innerOffset; i++)
- {
- rootEntry->dir_LstAccDate[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 20 + innerOffset; i < 22 + innerOffset; i++)
- {
- rootEntry->dir_FstClusHI[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 22 + innerOffset; i < 24 + innerOffset; i++)
- {
- rootEntry->dir_WrtTime[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 24 + innerOffset; i < 26 + innerOffset; i++)
- {
- rootEntry->dir_WrtDate[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 26 + innerOffset; i < 28 + innerOffset; i++)
- {
- rootEntry->dir_FstClusLO[counter] = sharedLocation[i];
- counter++;
- }
- counter = 0;
- for (int i = 28 + innerOffset; i < 32 + innerOffset; i++)
- {
- rootEntry->dir_FileSize[counter] = sharedLocation[i];
- counter++;
- }
- innerOffset += 32;
- rootVector.push_back(rootEntry);
- }
- }
- cout<<rootVector[0]<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement