Created
September 21, 2021 03:38
-
-
Save hyuunnn/4b8b4f5953b730b026020b17a99a63c9 to your computer and use it in GitHub Desktop.
IconLayouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from winreg import * | |
class IconLayouts: | |
def __init__(self): | |
self.idx = 0x18 | |
self.data = self.get_reg_data() | |
def parse_data(self, size): | |
result = self.data[self.idx:self.idx+size] | |
self.idx += size | |
return result | |
def get_reg_data(self): | |
q = OpenKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\Shell\\Bags\\1\\Desktop") | |
return QueryValueEx(q, "IconLayouts")[0] | |
def get_count(self): | |
return int.from_bytes(self.parse_data(8), 'little') | |
def get_length(self): | |
return int.from_bytes(self.parse_data(8), 'little') | |
def get_data(self, size): | |
return self.parse_data(size) | |
if __name__ == "__main__": | |
iconlayouts = IconLayouts() | |
for i in range(0, iconlayouts.get_count()): | |
print(iconlayouts.get_data(iconlayouts.get_length()*2).decode("utf-16")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment