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

Error- unpack requires a buffer of 16 bytes #12

Open
milindsolage opened this issue Feb 22, 2023 · 5 comments
Open

Error- unpack requires a buffer of 16 bytes #12

milindsolage opened this issue Feb 22, 2023 · 5 comments
Assignees

Comments

@milindsolage
Copy link

Trying to execute this on a sample onenote file and it errors out.
self.uintMagic, self.FileNodeListID, self.nFragmentSequence = struct.unpack('<8sII', file.read(16))
struct.error: unpack requires a buffer of 16 bytes

OS- Windows2019 with latest version of Python.

@DissectMalware
Copy link
Owner

Can you share the file with me? without the file I am not able to debug and see what the problem is.

If it is on VT or any other public repository you can just give me the sha256...

You can also DM me on Twitter if you do not want to share the details here

https://twitter.com/DissectMalware

@DissectMalware DissectMalware self-assigned this Feb 22, 2023
@milindsolage
Copy link
Author

  1. This is not on VT, just a random onenote file. This was just a very large One note file with size ~134MB size. Has multiple word docs, ppts and other files embedded in it. Unfortunately, I cannot share this file.
  2. Tried couple of other small one note files a) with word doc and excel embedded and it emitted the png screenshot and the actual doc and excel file in it. b) when there are no embedded files, it does not emit anything in output.
  3. The output is always verbose. Consider adding /v flag to not output verbose.
  4. Consider adding an output log file with json format to be able to parse the output programmatically. And add exit codes to determine success\error while unpacking.

@DissectMalware
Copy link
Owner

Make sense as I have not covered all filenode types. If the program cannot parse a filenode, it might result in jumping to a location in file that does not exist so read function returns zero bytes instead of 16 for example.

regarding other points, I will try to address them in next PR.

@Matmaus
Copy link

Matmaus commented Mar 13, 2023

Hi, this sample is raising the same exception. Maybe it could help.

@DissectMalware
Copy link
Owner

Thank you for sharing the sample, will check soon

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

3 participants