Aded new generated ctypes_generation

This commit is contained in:
hakril
2020-01-26 15:55:21 +01:00
parent d20083c57c
commit b490130585
9 changed files with 9380 additions and 8365 deletions
+4 -1
View File
@@ -20,13 +20,16 @@ class PSID(_INITIAL_PSID): # _INITIAL_PSID -> PVOID
@classmethod
def from_string(cls, strsid):
self = cls()
if not isinstance(strsid, bytes):
strsid = strsid.encode("ascii")
# Pass to ConvertStringSidToSidW ?
windows.winproxy.ConvertStringSidToSidA(strsid, self)
return self
def to_string(self):
sid_str = LPCSTR()
windows.winproxy.ConvertSidToStringSidA(self, sid_str)
result = sid_str.value
result = sid_str.value.decode("ascii") # ConvertSidToStringSidW ?
windows.winproxy.LocalFree(sid_str)
return result
+7 -2
View File
@@ -1,6 +1,6 @@
import sys
if sys.version_info.major == 3:
if sys.version_info.major >= 3:
long = int
@@ -14,7 +14,12 @@ class Flag(long):
def __repr__(self):
return "{0}({1:#x})".format(self.name, self)
__str__ = __repr__
# Custom __str__ removed for multiple reason
# Main one -> it breaks the json encoding of structure with flags :)
# Moving to a new politic -> if people want the name in a string use {x!r}
# The __str__ of security descriptor & guid will change soon as well :)
# __str__ = __repr__
# Fix pickling with protocol 2
def __getnewargs__(self, *args):
+1 -1
View File
@@ -1,4 +1,4 @@
from winstructs import *
from .winstructs import *
import functools
import ctypes
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
import ctypes
from flag import Flag
from .flag import Flag
class NtStatusException(WindowsError):
ALL_STATUS = {}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long