#![allow(non_snake_case, non_camel_case_types)]
use super::structs::{LDR_DATA_TABLE_ENTRY, URL_COMPONENTSA};
use super::types::{BOOL, DWORD, FARPROC, HANDLE, HINTERNET, HMODULE, LPCSTR, LPCWSTR, LPDWORD, LPVOID, LPWSTR, NTSTATUS, PCSTR};
use core::ffi::{c_ushort, c_void};
pub type LoadLibraryA_t = unsafe extern "system" fn(lib: PCSTR) -> HMODULE;
pub type CreateThread_t = unsafe extern "system" fn(
lpThreadSecurityAttributes: *mut c_void,
dwStackSize: usize,
lpStartAddress: unsafe extern "system" fn(*mut c_void) -> u32,
lpParameter: *mut c_void,
dwCreationflags: u32,
lpThreadId: *mut u32,
) -> HANDLE;
pub type GetProcAddress_t = unsafe extern "system" fn(hmod: HMODULE, procname: PCSTR) -> FARPROC;
pub type GetModuleHandleA_t = unsafe extern "system" fn(lpModuleName: LPCSTR) -> HMODULE;
pub type VirtualAlloc_t = unsafe extern "system" fn(
addr: *const c_void,
size: usize,
alloc_type: u32,
protect: u32,
) -> HANDLE;
pub type VirtualProtect_t = unsafe extern "system" fn(
addr: *const c_void,
size: usize,
new_protect: u32,
old_protect: *mut u32,
) -> BOOL;
pub type VirtualFree_t =
unsafe extern "system" fn(addr: *mut c_void, size: usize, free_type: u32) -> BOOL;
pub type ExitThread_t = unsafe extern "system" fn(code: u32) -> !;
pub type ExitProcess_t = unsafe extern "system" fn(code: u32) -> !;
pub type FlushInstructionCache_t =
unsafe extern "system" fn(hproc: HANDLE, base_addr: *const c_void, size: usize) -> BOOL;
pub type RtlDecompressBuffer_t = unsafe extern "system" fn(
CompressionFormat: u16,
UncompressedBuffer: *mut u8,
UncompressedBufferSize: usize,
CompressedBuffer: *const u8,
CompressedBufferSize: usize,
FinalUncompressedSize: *mut usize,
) -> u32;
pub type DllMain_t =
unsafe extern "system" fn(module: HMODULE, reason: u32, reserved: *mut c_void) -> BOOL;
pub type IntMainArgs = unsafe extern "C" fn(argc: i32, argv: *mut *mut u8) -> i32;
pub type IntMainVoid = unsafe extern "system" fn() -> i32;
pub type GetLastError_t = unsafe extern "system" fn() -> DWORD;
pub type GetProcessHeap_t = unsafe extern "system" fn() -> HANDLE;
pub type HeapAlloc_t =
unsafe extern "system" fn(h_heap: HANDLE, flags: DWORD, size: usize) -> LPVOID;
pub type HeapReAlloc_t =
unsafe extern "system" fn(h_heap: HANDLE, flags: DWORD, mem: LPVOID, size: usize) -> LPVOID;
pub type HeapFree_t = unsafe extern "system" fn(h_heap: HANDLE, flags: DWORD, mem: LPVOID) -> BOOL;
pub type HeapValidate_t =
unsafe extern "system" fn(hHeap: HANDLE, dwFlags: u32, lpMem: *mut c_void) -> i32;
pub type InternetCrackUrlA_t = unsafe extern "system" fn(
lpszUrl: LPCSTR,
dwUrlLength: DWORD,
dwFlags: DWORD,
lpUrlComponents: *mut URL_COMPONENTSA,
) -> BOOL;
pub type InternetOpenA_t = unsafe extern "system" fn(
lpszAgent: LPCSTR,
dwAccessType: DWORD,
lpszProxy: LPCSTR,
lpszProxyBypass: LPCSTR,
dwFlags: DWORD,
) -> HINTERNET;
pub type InternetConnectA_t = unsafe extern "system" fn(
hInternet: HINTERNET,
lpszServerName: LPCSTR,
nServerPort: c_ushort,
lpszUserName: LPCSTR,
lpszPassword: LPCSTR,
dwService: DWORD,
dwFlags: DWORD,
dwContext: DWORD,
) -> HINTERNET;
pub type InternetSetOptionA_t = unsafe extern "system" fn(
hInternet: HINTERNET,
dwOption: DWORD,
lpBuffer: LPVOID,
dwBufferLength: DWORD,
) -> BOOL;
pub type InternetReadFile_t = unsafe extern "system" fn(
hFile: HINTERNET,
lpBuffer: LPVOID,
dwNumberOfBytesToRead: DWORD,
lpdwNumberOfBytesRead: LPDWORD,
) -> BOOL;
pub type InternetCloseHandle_t = unsafe extern "system" fn(hInternet: HINTERNET) -> BOOL;
pub type InternetQueryDataAvailable_t = unsafe extern "system" fn(
hFile: HINTERNET,
lpdwNumberOfBytesAvailable: LPDWORD,
dwFlags: DWORD,
dwContext: DWORD,
) -> BOOL;
pub type HttpOpenRequestA_t = unsafe extern "system" fn(
hConnect: HINTERNET,
lpszVerb: LPCSTR,
lpszObjectName: LPCSTR,
lpszVersion: LPCSTR,
lpszReferrer: LPCSTR,
lplpszAcceptTypes: *const LPCSTR,
dwFlags: DWORD,
dwContext: DWORD,
) -> HINTERNET;
pub type HttpSendRequestA_t = unsafe extern "system" fn(
hRequest: HINTERNET,
lpszHeaders: LPCSTR,
dwHeadersLength: DWORD,
lpOptional: LPVOID,
dwOptionalLength: DWORD,
) -> BOOL;
pub type HttpQueryInfoA_t = unsafe extern "system" fn(
hRequest: HINTERNET,
dwInfoLevel: DWORD,
lpBuffer: LPVOID,
lpdwBufferLength: LPDWORD,
lpdwIndex: LPDWORD,
) -> BOOL;
pub type GetStdHandle_t = unsafe extern "system" fn(nStdHandle: DWORD) -> HANDLE;
pub type WriteConsoleA_t = unsafe extern "system" fn(
hConsoleOutput: HANDLE,
lpBuffer: *const c_void,
nNumberOfCharsToWrite: DWORD,
lpNumberOfCharsWritten: LPDWORD,
lpReserved: LPVOID,
) -> BOOL;
pub type AllocConsole_t = unsafe extern "system" fn() -> BOOL;
#[allow(unused)]
pub type GetCommandLineW_t = unsafe extern "system" fn() -> LPWSTR;
#[allow(unused)]
pub type CommandLineToArgvW_t =
unsafe extern "system" fn(lpCmdLine: LPCWSTR, pNumArgs: *mut i32) -> LPWSTR;
pub type TlsAlloc_t = unsafe extern "system" fn() -> DWORD;
pub type TlsSetValue_t = unsafe extern "system" fn(dwTlsIndex: DWORD, lpTlsValue: LPVOID) -> BOOL;
pub type TlsGetValue_t = unsafe extern "system" fn(dwTlsIndex: DWORD) -> LPVOID;
pub type LdrpReleaseTlsEntry_t =
unsafe extern "system" fn(entry: *mut LDR_DATA_TABLE_ENTRY, unk: *mut c_void) -> NTSTATUS;
pub type RtlCompareMemory_t = unsafe extern "system" fn(source1: *const c_void, source2: *const c_void, length: usize) -> u64;
pub type LdrpHandleTlsData_t = unsafe extern "system" fn(entry: *mut LDR_DATA_TABLE_ENTRY);
pub type VirtualLock_t = unsafe extern "system" fn(lpaddress: LPVOID, size: usize) -> BOOL;