Win32 API Imports

On viernes, 3 de septiembre de 2010 0 comentarios

Taken from SporeCheat
credits: msdn, pinvoke

Imports System.Threading
Imports System


Module APIFunctions

_
Public Enum PAGE_PROTECTION As UInt32
page_execute = &H10
page_execute_read = &H20
page_execute_readwrite = &H40
page_execute_writecopy = &H80
End Enum

_
Public Enum PAGE_ALLOCATION As UInt32
mem_commit = &H1000
mem_reserve = &H2000
mem_reset = &H80000
End Enum

_
Public Enum PAGE_DEALLOCATION As UInt32
mem_decommit = &H4000
mem_release = &H8000
End Enum

_
Public Enum MESSAGEBOX_TYPE As UInt32
mb_ok = 0
mb_okcancel = 1
mb_abortretryignore = 2
mb_yesnocancel = 3
End Enum


_
Public Enum THREAD_CREATION_FLAGS As UInt32
zero = &H0
create_suspended = &H4
STACK_SIZE_PARAM_IS_A_RESERVATION = &H10000
End Enum

_
Public Enum PROCESS_ACCESS As UInt32
PROCESS_ALL_ACCESS = &H1F0FFF
PROCESS_CREATE_THREAD = &H2
PROCESS_DUP_HANDLE = &H40
PROCESS_QUERY_INFORMATION = &H400
PROCESS_SET_INFORMATION = &H200
PROCESS_TERMINATE = &H1
PROCESS_VM_OPERATION = &H8
PROCESS_VM_READ = &H10
PROCESS_VM_WRITE = &H20
SYNCHRONIZE = &H100000
End Enum



Class User32

Public Declare Auto Function FindWindow Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr

Public Declare Auto Function MessageBox Lib "user32" _
(ByVal hWnd As IntPtr, ByVal lpText As String, ByVal lpCaption As String, ByVal MESSAGEBOX_TYPE As UInteger) As Integer




End Class

Class Kernel32

Public Declare Auto Function WriteProcessMemory Lib "kernel32" _
(ByVal hProc As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal nSize As UIntPtr, ByRef lpNumberOfBytesWritten As IntPtr) As Boolean

Public Declare Auto Function VirtualProtectEx Lib "kernel32" _
(ByVal hProc As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As UInteger, ByVal PAGE_PROTECTION As UInteger, ByVal lpflOldProtect As UInteger) As Boolean

Public Declare Auto Function VirtualAllocEx Lib "kernel32" _
(ByVal hProc As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As ULong, ByVal PAGE_ALLOCATION As UInteger, ByVal PAGE_PROTECTION As UInteger) As IntPtr

Public Declare Auto Function VirtualFreeEx Lib "kernel32" _
(ByVal hProc As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As ULong, ByVal PAGE_DEALLOCATION As UInteger) As Boolean

Public Declare Auto Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As PROCESS_ACCESS, ByVal InheritHandle As Integer, ByVal dwProcessId As UInteger) As IntPtr

Public Declare Ansi Function GetProcAddress Lib "kernel32" _
(ByVal hModule As IntPtr, ByVal lpProcName As String) As IntPtr

Public Declare Auto Function GetModuleHandle Lib "kernel32" _
(ByVal lpModuleName As String) As IntPtr

Public Declare Auto Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
(ByVal lpLibFileName As String) As IntPtr

Public Declare Auto Function FreeLibrary Lib "kernel32" _
(ByVal lpLibFileName As Long) As IntPtr

Public Declare Auto Function CreateRemoteThread Lib "kernel32" _
(ByVal ProcessHandle As IntPtr, ByVal lpThreadAttributes As IntPtr, ByVal dwStackSize As UInteger, ByVal lpStartAddress As IntPtr, ByVal lpParamater As IntPtr, ByVal dwCreationFlags As UInteger, ByVal lpThreadID As IntPtr) As IntPtr

End Class


End Module

0 comentarios:

Publicar un comentario