mirror of
				https://notabug.org/scuti/lib3ddevil1
				synced 2025-05-31 14:11:42 +05:30 
			
		
		
		
	Added struct for PldHeader and related function
This commit is contained in:
		
							
								
								
									
										21
									
								
								bindings/py3devil1.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								bindings/py3devil1.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | import ctypes | ||||||
|  |  | ||||||
|  | class PldHeader(ctypes.Structure): | ||||||
|  |     _fields_ = [ | ||||||
|  |         ("numOffset", ctypes.c_int), | ||||||
|  |         ("offsets", ctypes.POINTER(ctypes.c_int)) | ||||||
|  |     ] | ||||||
|  |  | ||||||
|  | class Devil1FN_PLD(ctypes.Structure): | ||||||
|  |     _fields_ = [ | ||||||
|  |         ("getheader"   , ctypes.CFUNCTYPE(bool, ctypes.POINTER(PldHeader), ctypes.c_char_p)), | ||||||
|  |         ("sizeofsector", ctypes.CFUNCTYPE(int,  ctypes.POINTER(PldHeader), ctypes.c_int)), | ||||||
|  |         ("printheader" , ctypes.CFUNCTYPE(None, ctypes.POINTER(PldHeader))) | ||||||
|  |     ] | ||||||
|  |  | ||||||
|  | def main(): | ||||||
|  |     libc = cdll.LoadLibrary('./libdevil1pld.so') | ||||||
|  |     if (lib): | ||||||
|  |         print("OK") | ||||||
|  |         with open("pl01.pld", "rb") as f: | ||||||
|  |             data = f.read() | ||||||
		Reference in New Issue
	
	Block a user