Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 18.221.167.11
66 Domain
8.0.30
amvm
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
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
opt /
python35 /
lib /
python3.5 /
ctypes /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
399
B
-rw-r--r--
__main__.py
68
B
-rw-r--r--
test_anon.py
2
KB
-rw-r--r--
test_array_in_pointer.py
1.7
KB
-rw-r--r--
test_arrays.py
5.64
KB
-rw-r--r--
test_as_parameter.py
6.61
KB
-rw-r--r--
test_bitfields.py
9.84
KB
-rw-r--r--
test_buffers.py
2.23
KB
-rw-r--r--
test_bytes.py
1.88
KB
-rw-r--r--
test_byteswap.py
11.14
KB
-rw-r--r--
test_callbacks.py
9.31
KB
-rw-r--r--
test_cast.py
3.11
KB
-rw-r--r--
test_cfuncs.py
7.5
KB
-rw-r--r--
test_checkretval.py
968
B
-rw-r--r--
test_delattr.py
533
B
-rw-r--r--
test_errno.py
2.25
KB
-rw-r--r--
test_find.py
2.1
KB
-rw-r--r--
test_frombuffer.py
4.59
KB
-rw-r--r--
test_funcptr.py
3.82
KB
-rw-r--r--
test_functions.py
12.26
KB
-rw-r--r--
test_incomplete.py
1023
B
-rw-r--r--
test_init.py
1.01
KB
-rw-r--r--
test_internals.py
2.57
KB
-rw-r--r--
test_keeprefs.py
3.96
KB
-rw-r--r--
test_libc.py
1005
B
-rw-r--r--
test_loading.py
4.52
KB
-rw-r--r--
test_macholib.py
1.79
KB
-rw-r--r--
test_memfunctions.py
3.22
KB
-rw-r--r--
test_numbers.py
9.07
KB
-rw-r--r--
test_objects.py
1.64
KB
-rw-r--r--
test_parameters.py
6.05
KB
-rw-r--r--
test_pep3118.py
7.65
KB
-rw-r--r--
test_pickling.py
2.17
KB
-rw-r--r--
test_pointers.py
6.95
KB
-rw-r--r--
test_prototypes.py
6.68
KB
-rw-r--r--
test_python_api.py
2.8
KB
-rw-r--r--
test_random_things.py
2.76
KB
-rw-r--r--
test_refcounts.py
2.52
KB
-rw-r--r--
test_repr.py
842
B
-rw-r--r--
test_returnfuncptrs.py
2.83
KB
-rw-r--r--
test_simplesubclasses.py
1.26
KB
-rw-r--r--
test_sizes.py
815
B
-rw-r--r--
test_slicing.py
5.88
KB
-rw-r--r--
test_stringptr.py
2.48
KB
-rw-r--r--
test_strings.py
6.97
KB
-rw-r--r--
test_struct_fields.py
1.47
KB
-rw-r--r--
test_structures.py
16.24
KB
-rw-r--r--
test_unaligned_structures.py
1.19
KB
-rw-r--r--
test_unicode.py
1.72
KB
-rw-r--r--
test_values.py
3.75
KB
-rw-r--r--
test_varsize_struct.py
1.8
KB
-rw-r--r--
test_win32.py
5.16
KB
-rw-r--r--
test_wintypes.py
1.43
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_pep3118.py
import unittest from ctypes import * import re, struct, sys if sys.byteorder == "little": THIS_ENDIAN = "<" OTHER_ENDIAN = ">" else: THIS_ENDIAN = ">" OTHER_ENDIAN = "<" def normalize(format): # Remove current endian specifier and white space from a format # string if format is None: return "" format = format.replace(OTHER_ENDIAN, THIS_ENDIAN) return re.sub(r"\s", "", format) class Test(unittest.TestCase): def test_native_types(self): for tp, fmt, shape, itemtp in native_types: ob = tp() v = memoryview(ob) try: self.assertEqual(normalize(v.format), normalize(fmt)) if shape: self.assertEqual(len(v), shape[0]) else: self.assertEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.assertEqual(v.itemsize, sizeof(itemtp)) self.assertEqual(v.shape, shape) # XXX Issue #12851: PyCData_NewGetBuffer() must provide strides # if requested. memoryview currently reconstructs missing # stride information, so this assert will fail. # self.assertEqual(v.strides, ()) # they are always read/write self.assertFalse(v.readonly) if v.shape: n = 1 for dim in v.shape: n = n * dim self.assertEqual(n * v.itemsize, len(v.tobytes())) except: # so that we can see the failing type print(tp) raise def test_endian_types(self): for tp, fmt, shape, itemtp in endian_types: ob = tp() v = memoryview(ob) try: self.assertEqual(v.format, fmt) if shape: self.assertEqual(len(v), shape[0]) else: self.assertEqual(len(v) * sizeof(itemtp), sizeof(ob)) self.assertEqual(v.itemsize, sizeof(itemtp)) self.assertEqual(v.shape, shape) # XXX Issue #12851 # self.assertEqual(v.strides, ()) # they are always read/write self.assertFalse(v.readonly) if v.shape: n = 1 for dim in v.shape: n = n * dim self.assertEqual(n, len(v)) except: # so that we can see the failing type print(tp) raise # define some structure classes class Point(Structure): _fields_ = [("x", c_long), ("y", c_long)] class PackedPoint(Structure): _pack_ = 2 _fields_ = [("x", c_long), ("y", c_long)] class Point2(Structure): pass Point2._fields_ = [("x", c_long), ("y", c_long)] class EmptyStruct(Structure): _fields_ = [] class aUnion(Union): _fields_ = [("a", c_int)] class StructWithArrays(Structure): _fields_ = [("x", c_long * 3 * 2), ("y", Point * 4)] class Incomplete(Structure): pass class Complete(Structure): pass PComplete = POINTER(Complete) Complete._fields_ = [("a", c_long)] ################################################################ # # This table contains format strings as they look on little endian # machines. The test replaces '<' with '>' on big endian machines. # native_types = [ # type format shape calc itemsize ## simple types (c_char, "<c", (), c_char), (c_byte, "<b", (), c_byte), (c_ubyte, "<B", (), c_ubyte), (c_short, "<h", (), c_short), (c_ushort, "<H", (), c_ushort), # c_int and c_uint may be aliases to c_long #(c_int, "<i", (), c_int), #(c_uint, "<I", (), c_uint), (c_long, "<l", (), c_long), (c_ulong, "<L", (), c_ulong), # c_longlong and c_ulonglong are aliases on 64-bit platforms #(c_longlong, "<q", None, c_longlong), #(c_ulonglong, "<Q", None, c_ulonglong), (c_float, "<f", (), c_float), (c_double, "<d", (), c_double), # c_longdouble may be an alias to c_double (c_bool, "<?", (), c_bool), (py_object, "<O", (), py_object), ## pointers (POINTER(c_byte), "&<b", (), POINTER(c_byte)), (POINTER(POINTER(c_long)), "&&<l", (), POINTER(POINTER(c_long))), ## arrays and pointers (c_double * 4, "<d", (4,), c_double), (c_float * 4 * 3 * 2, "<f", (2,3,4), c_float), (POINTER(c_short) * 2, "&<h", (2,), POINTER(c_short)), (POINTER(c_short) * 2 * 3, "&<h", (3,2,), POINTER(c_short)), (POINTER(c_short * 2), "&(2)<h", (), POINTER(c_short)), ## structures and unions (Point, "T{<l:x:<l:y:}", (), Point), # packed structures do not implement the pep (PackedPoint, "B", (), PackedPoint), (Point2, "T{<l:x:<l:y:}", (), Point2), (EmptyStruct, "T{}", (), EmptyStruct), # the pep does't support unions (aUnion, "B", (), aUnion), # structure with sub-arrays (StructWithArrays, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (), StructWithArrays), (StructWithArrays * 3, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (3,), StructWithArrays), ## pointer to incomplete structure (Incomplete, "B", (), Incomplete), (POINTER(Incomplete), "&B", (), POINTER(Incomplete)), # 'Complete' is a structure that starts incomplete, but is completed after the # pointer type to it has been created. (Complete, "T{<l:a:}", (), Complete), # Unfortunately the pointer format string is not fixed... (POINTER(Complete), "&B", (), POINTER(Complete)), ## other # function signatures are not implemented (CFUNCTYPE(None), "X{}", (), CFUNCTYPE(None)), ] class BEPoint(BigEndianStructure): _fields_ = [("x", c_long), ("y", c_long)] class LEPoint(LittleEndianStructure): _fields_ = [("x", c_long), ("y", c_long)] ################################################################ # # This table contains format strings as they really look, on both big # and little endian machines. # endian_types = [ (BEPoint, "T{>l:x:>l:y:}", (), BEPoint), (LEPoint, "T{<l:x:<l:y:}", (), LEPoint), (POINTER(BEPoint), "&T{>l:x:>l:y:}", (), POINTER(BEPoint)), (POINTER(LEPoint), "&T{<l:x:<l:y:}", (), POINTER(LEPoint)), ] if __name__ == "__main__": unittest.main()
Close