Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自己玩的私服pvf解包失败 #16

Open
MrGuoRanDuo opened this issue Jul 23, 2024 · 0 comments
Open

自己玩的私服pvf解包失败 #16

MrGuoRanDuo opened this issue Jul 23, 2024 · 0 comments

Comments

@MrGuoRanDuo
Copy link

MrGuoRanDuo commented Jul 23, 2024

dnfpkgtool/pvfReader.py:31
fileLength_bytes = pvfHeader.get_Header_Tree_Bytes(4)
fileCrc32_bytes = pvfHeader.get_Header_Tree_Bytes(4)
relativeOffset_bytes = pvfHeader.get_Header_Tree_Bytes(4)
leaf = {
'index': index,
'fn': unpack('I', fn_bytes)[0], 'fn_bytes': fn_bytes,
'filePathLength': unpack('I', filePathLength_bytes)[0],
'filePathLength_bytes': filePathLength_bytes,
'filePath': filePath_bytes.decode(errors='replace').lower(), # 全部转换为小写
'filePath_bytes': filePath_bytes,
'fileLength': (unpack('I', fileLength_bytes)[0] + 3) & 0xFFFFFFFC,
'fileLength_bytes': fileLength_bytes,
'fileCrc32': unpack('I', fileCrc32_bytes)[0], 'fileCrc32_bytes': fileCrc32_bytes,
'relativeOffset': unpack('I', relativeOffset_bytes)[0],
'content': b'',
}

主要是fileLength_bytes fileCrc32_bytes relativeOffset_bytes 全都是空值导致报错
这种是不是我这个私服服主加密了导致的
File "C:\D\Dev\python\pvf\dnfpkgtool\pvfReader.py", line 320, in load_Leafs
'fileLength': (unpack('I', fileLength_bytes)[0] + 3) & 0xFFFFFFFC,
struct.error: unpack requires a buffer of 4 bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant