dfsf
This commit is contained in:
@@ -41,7 +41,8 @@ void Hook_InterceptConnect_my()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Proxied_VirtualProtectEx ) log_error( LOG_WARNING, "Using proxied VirtualProtectEx!\n" );
|
if( Proxied_VirtualProtectEx )
|
||||||
|
log_error( LOG_WARNING, "Hook_InterceptConnect_my(): Using proxied VirtualProtectEx!\n" );
|
||||||
|
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
DWORD old_protect = 0, old_protect_2 = 0;
|
DWORD old_protect = 0, old_protect_2 = 0;
|
||||||
@@ -63,6 +64,7 @@ void Hook_InterceptConnect_my()
|
|||||||
//ret = VirtualProtect( (void *)connect_orig, 6, PAGE_EXECUTE_WRITECOPY, &old_protect );
|
//ret = VirtualProtect( (void *)connect_orig, 6, PAGE_EXECUTE_WRITECOPY, &old_protect );
|
||||||
//ret = VirtualProtect( (void *)connect_orig, 6, PAGE_EXECUTE_READWRITE, &old_protect );
|
//ret = VirtualProtect( (void *)connect_orig, 6, PAGE_EXECUTE_READWRITE, &old_protect );
|
||||||
DWORD flProtect = g_hook_flag_allow_write;
|
DWORD flProtect = g_hook_flag_allow_write;
|
||||||
|
ret = 0;
|
||||||
if( Proxied_VirtualProtectEx )
|
if( Proxied_VirtualProtectEx )
|
||||||
ret = Proxy_VirtualProtectEx( (HANDLE)-1, (void *)connect_orig, 6, flProtect, &old_protect );
|
ret = Proxy_VirtualProtectEx( (HANDLE)-1, (void *)connect_orig, 6, flProtect, &old_protect );
|
||||||
else
|
else
|
||||||
@@ -70,6 +72,9 @@ void Hook_InterceptConnect_my()
|
|||||||
if( (ret != TRUE) )
|
if( (ret != TRUE) )
|
||||||
{
|
{
|
||||||
DWORD le = GetLastError();
|
DWORD le = GetLastError();
|
||||||
|
if( le == ERROR_ACCESS_DENIED )
|
||||||
|
log_error( LOG_ERROR, "Hook_InterceptConnect_my(): VirtialProtectEx() failed (allow write): (%d) ERROR_ACCESS_DENIED\n", le );
|
||||||
|
else
|
||||||
ErrorLogger_LogLastError( "Hook_InterceptConnect_my(): VirtialProtectEx() failed (allow write)", le );
|
ErrorLogger_LogLastError( "Hook_InterceptConnect_my(): VirtialProtectEx() failed (allow write)", le );
|
||||||
ErrorLogger_FlushLogFile();
|
ErrorLogger_FlushLogFile();
|
||||||
}
|
}
|
||||||
@@ -231,7 +236,8 @@ int __stdcall connect_hook_my( unsigned int sock, void *sockaddr, int addrlen )
|
|||||||
BOOL vp_ret = FALSE;
|
BOOL vp_ret = FALSE;
|
||||||
DWORD le = 0;
|
DWORD le = 0;
|
||||||
|
|
||||||
if( Proxied_VirtualProtectEx ) log_error( LOG_WARNING, "connect_hook_my(): Using proxied VirtualProtectEx!\n" );
|
if( Proxied_VirtualProtectEx )
|
||||||
|
log_error( LOG_WARNING, "connect_hook_my(): Using proxied VirtualProtectEx!\n" );
|
||||||
|
|
||||||
/*#ifdef _DEBUG
|
/*#ifdef _DEBUG
|
||||||
log_error( LOG_DEBUGDUMP, "connect_hook_my(): before restoring old code\n" );
|
log_error( LOG_DEBUGDUMP, "connect_hook_my(): before restoring old code\n" );
|
||||||
@@ -252,6 +258,9 @@ int __stdcall connect_hook_my( unsigned int sock, void *sockaddr, int addrlen )
|
|||||||
if( !vp_ret )
|
if( !vp_ret )
|
||||||
{
|
{
|
||||||
le = GetLastError();
|
le = GetLastError();
|
||||||
|
if( le == ERROR_ACCESS_DENIED )
|
||||||
|
log_error( LOG_ERROR, "connect_hook_my(): VirtualProtectEx() failed (allow write): (%d) ERROR_ACCESS_DENIED\n", le );
|
||||||
|
else
|
||||||
ErrorLogger_LogLastError( "connect_hook_my(): VirtualProtectEx() failed (allow write)", le );
|
ErrorLogger_LogLastError( "connect_hook_my(): VirtualProtectEx() failed (allow write)", le );
|
||||||
}
|
}
|
||||||
pc[0] = po[0]; pc[1] = po[1]; pc[2] = po[2];
|
pc[0] = po[0]; pc[1] = po[1]; pc[2] = po[2];
|
||||||
@@ -271,7 +280,7 @@ int __stdcall connect_hook_my( unsigned int sock, void *sockaddr, int addrlen )
|
|||||||
{
|
{
|
||||||
port = ((paddr->sin_port & 0x00FF) << 8) | ((paddr->sin_port & 0xFF00) >> 8);
|
port = ((paddr->sin_port & 0x00FF) << 8) | ((paddr->sin_port & 0xFF00) >> 8);
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
log_error( LOG_DEBUG, "\n hooked: connect_hook_my(): %d.%d.%d.%d:%d... ",
|
log_error( LOG_DEBUG, "\n hooked: connect_hook_my(): Requested connection to: %d.%d.%d.%d:%d... ",
|
||||||
(int)paddr->sin_addr.S_un.S_un_b.s_b1,
|
(int)paddr->sin_addr.S_un.S_un_b.s_b1,
|
||||||
(int)paddr->sin_addr.S_un.S_un_b.s_b2,
|
(int)paddr->sin_addr.S_un.S_un_b.s_b2,
|
||||||
(int)paddr->sin_addr.S_un.S_un_b.s_b3,
|
(int)paddr->sin_addr.S_un.S_un_b.s_b3,
|
||||||
|
Reference in New Issue
Block a user