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

Duplicated keys yielded by recurse_subkeys #107

Closed
Wenzel opened this issue Nov 1, 2020 · 4 comments · Fixed by #117
Closed

Duplicated keys yielded by recurse_subkeys #107

Wenzel opened this issue Nov 1, 2020 · 4 comments · Fixed by #117

Comments

@Wenzel
Copy link

Wenzel commented Nov 1, 2020

Hi,

thanks for your library, it looks very easy to use and integrate into larger python applications.
I'm facing an issue with duplicated keys yielded by the recurse_subkeys method.

example, a JSON output obtained with registry-dump -v SYSTEM -o system.json:

{
  "subkey_name": "CertStore",
  "path": "\\ControlSet001\\Control\\AppID\\CertStore",
  "timestamp": "2009-07-14T04:54:39.318948+00:00",
  "values_count": 0,
  "values": [],
  "actual_path": null
}
{
  "subkey_name": "AppID",
  "path": "\\ControlSet001\\Control\\AppID",
  "timestamp": "2009-07-14T04:54:39.318948+00:00",
  "values_count": 0,
  "values": [],
  "actual_path": null
}
{
  "subkey_name": "AppID",
  "path": "\\ControlSet001\\Control\\AppID",
  "timestamp": "2009-07-14T04:54:39.318948+00:00",
  "values_count": 0,
  "values": [],
  "actual_path": null
}

The AppID keys are exactly the same

I don't know how many keys are duplicated, but there seems to be plenty:

...
    {
      "name": "BrokenVideo",
      "value": "2805000000000000000000000000000000000000000000000000000001000000010001002800000000010000000000000000000000000000ec02000000000000",
      "value_type": "REG_RESOURCE_REQUIREMENTS_LIST",
      "is_corrupted": false
    },
    {
      "name": "PCStandard",
      "value": "0801000000000000000000000000000000000000000000000000000001000000010001000700000000010000000000000000000000000000f802000000000000",
      "value_type": "REG_RESOURCE_REQUIREMENTS_LIST",
      "is_corrupted": false
    }
  ],
  "actual_path": null
}
{
  "subkey_name": "Arbiters",
  "path": "\\ControlSet001\\Control\\Arbiters",
  "timestamp": "2009-07-14T04:49:01.365188+00:00",
  "values_count": 0,
  "values": [],
  "actual_path": null
}
{
  "subkey_name": "Arbiters",
  "path": "\\ControlSet001\\Control\\Arbiters",
  "timestamp": "2009-07-14T04:49:01.365188+00:00",
  "values_count": 0,
  "values": [],
  "actual_path": null
}
{
  "subkey_name": "FilesNotToBackup",
  "path": "\\ControlSet001\\Control\\BackupRestore\\FilesNotToBackup",
  "timestamp": "2019-10-16T02:43:11.468800+00:00",
  "values_count": 22,
  "values": [
    {
      "name": "WER",
      "value": [
...

I used the latest release available in PyPI: 1.7.0

Here is a hive you can play with to repro:
https://www.dropbox.com/s/pexash635lguuuk/SYSTEM?dl=0

Could you take a look ?

Thanks !

@Wenzel Wenzel changed the title Duplicated key yielded by recurse_subkeys Duplicated keys yielded by recurse_subkeys Nov 1, 2020
@tincho9
Copy link
Collaborator

tincho9 commented Nov 8, 2020

Thanks, I'll take a look soon and let you know.

@tincho9
Copy link
Collaborator

tincho9 commented Dec 6, 2020

This PR should fix it. Do you want to check it before I merge?

@Wenzel
Copy link
Author

Wenzel commented Dec 6, 2020

I just tested your changes and it looks good to me.
Regarding the PR, i'm not a professional Python developer, just an amateur, so I doubt to have any meaningful feedback for you.

Thank you very much for the bug fix !
Do you plan to make another release on PyPI ?
I'm also managing a python app, released via Github Action:
https://github.com/Wenzel/checksec.py

The release is done when a tag is pushed:
https://github.com/Wenzel/checksec.py/blob/master/.github/workflows/ci.yml#L123

Maybe it will help

Edit: I've just seen that you already have a CICD to deploy on PyPI ;)

Thanks o/

@tincho9
Copy link
Collaborator

tincho9 commented Dec 6, 2020

I'll make a release now, Just wanted to be sure that this fix works for you :)
Have a nice day!

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

Successfully merging a pull request may close this issue.

2 participants