Skip to content

最近在研究数据恢复,参考您的项目代码遇到一些问题有点困惑 #4

Description

@HanXin9527

首先是扫描C盘(U盘都没啥事,就C盘出线了这个问题)获取文件大小的函数 CNtfsFileSystem::GetFileSize(UCHAR *prmMFTRecord) 中
解析0x20属性,某些文件会在GetAttrFromAttributeList中死循环,这个是文件损坏原因造成的么,还是什么导致的,这里我调试发现while条件中会始终成立,参数都没有变化,szAttrValue每次循环都是一样的值,导致在处理某个文件信息时候整个while死循环了
while(tmpOffset=this->GetAttrFromAttributeList(ATTR_DATA,tmpOffset,szAttrList,szAttrValue))
{
UINT16 tmpLen = (UINT16)(szAttrValue+4);
UINT64 seqNum = (UINT64)(szAttrValue + 0x10);
if(this->GetExtendMFTAttrValue(seqNum,ATTR_DATA,szExtendMFTAttrValue))
{
tmpResult += (UINT64)&szExtendMFTAttrValue[0x30];
}
}

然后就是在CNtfsFileSystem::GetDataRunList函数中
//buff[off] 低四位记录后面几个字节为长度 , 高4位记录几个字节为起始簇号
//先计算长度
for (;;)
{
index_alloc_size = 0;
for (j = 0; j < prmBuf[bufOffset] % 16; j++)
{
index_alloc_size = index_alloc_size + prmBuf[bufOffset + 1 + j] * (UINT64)pow((long double)256, j);
}

for (j = 0; j < prmBuf[bufOffset] % 16; j++)这个循环,prmBuf[bufOffset]超出了内存限制,我在内存中查看内存是??没有初始化,这个堆栈代码看了好久,猪脑过载了,也没发现是什么导致的,哈哈2025年了,不知道作者还能不能看到帮忙解答一些困惑

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions