57 lines
2.2 KiB
C
57 lines
2.2 KiB
C
#ifndef H_NET_HOOK
|
|
#define H_NET_HOOK
|
|
|
|
#include "net_hook_defs.h"
|
|
|
|
/** Validates istructure alignment. returns true on OK **/
|
|
bool Hook_ValidateAlign();
|
|
|
|
// my method
|
|
void Hook_InterceptConnect_my();
|
|
void Hook_RestoreConnect_my();
|
|
bool Hook_ValidateInterception_my();
|
|
bool Hook_IsWinsockConnectOrig();
|
|
bool Hook_CheckVirtualProtect();
|
|
|
|
// checking hooks
|
|
extern const unsigned char original_ws2_32_connect_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_recv_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_send_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_WSAConnect_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_WSARecv_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_WSASend_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_listen_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_accept_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_WSAAccept_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_socket_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_WSASocketA_6_bytes[6];
|
|
extern const unsigned char original_ws2_32_WSASocketW_6_bytes[6];
|
|
extern const unsigned char original_vpex_6_bytes[6];
|
|
extern const unsigned char l2walker_connect_6_bytes[6];
|
|
// ^^ orig_bytes
|
|
bool Hook_check_func_prolog( LPCWSTR dllName, LPCSTR funcName, const unsigned char *orig_bytes );
|
|
|
|
int __stdcall connect_hook_my( unsigned int sock, void *sockaddr, int addrlen );
|
|
int __stdcall connect_nohook_my( unsigned int sock, void *sockaddr, int addrlen );
|
|
|
|
// method of DistortNeo
|
|
void Hook_InterceptConnect_Dis();
|
|
int __stdcall connect_hook_Dis( unsigned int sock, void *sockaddr, int addrlen );
|
|
|
|
/** Connects socket to specified address
|
|
** returns -1 on error/timeout, 0 on error */
|
|
int connect_l2packets_my( unsigned int sock, const char *ip, unsigned short port );
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Ôóíêöèÿ ñòàâèò JMP-õóê â ôóíêöèþ
|
|
//
|
|
// old_ptr - àäðåñ ñòàðîé ôóíêöèè
|
|
// new_ptr - àäðåñ íîâîé ôóíêöèè
|
|
// jmp_ptr - óêàçàòåëü íà ïåðåìåííóþ, â êîòîðóþ çàïèøåòñÿ àäðåñ ïåðåõîäà
|
|
//
|
|
void Hook_InterceptCall( DWORD old_ptr, DWORD new_ptr, DWORD *jmp_ptr );
|
|
|
|
#endif
|