HOME FORUMS MEMBERS RECENT POSTS LOG IN  
× Авторизация
Имя пользователя:
Пароль:
Нет аккаунта? Регистрация
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ ЧАТ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > Общие вопросы программирования
   
Ответ
 
Опции темы Поиск в этой теме Опции просмотра

  #1  
Старый 18.11.2023, 18:23
SafeModeOfficial
Новичок
Регистрация: 27.03.2022
Сообщений: 10
С нами: 2176865

Репутация: 1
По умолчанию

Приветствую всех. Хочу написать .asi для блокировки конкретного айпи, чтобы gta_sa.exe не могла до нее добраться. Прошу о помощи и советах как начать. (Это будет моим первым проектом)
 
Ответить с цитированием

  #2  
Старый 27.11.2023, 04:22
F0RQU1N and
Познавший АНТИЧАТ
Регистрация: 29.09.2018
Сообщений: 1,292
С нами: 4012500

Репутация: 138


По умолчанию

Похукай функи из винсока по типу getaddrinfo, gethostbyname
 
Ответить с цитированием

  #3  
Старый 29.11.2023, 01:05
atomlin
Постоянный
Регистрация: 11.01.2019
Сообщений: 585
С нами: 3862210

Репутация: 118


По умолчанию

Хукнуть отправку подключения к серверу (RakPeer::SendConnectionRequest( const char* host, unsigned short remotePort, char* passwordData, int passwordDataLength ))

(Можно хукнуть и socketlayer, но тогда будет ломаться connectfix)

(Ниже offset под r1)

C++:





Код:
#include 
#include 
#include "Windows.h"
uintptr_t dwSAMP
=
0xFF
;
void
*
SetCallHook
(
uintptr_t HookAddress
,
void
*
DetourFunction
)
{
uintptr_t OriginalFunction
=
*
reinterpret_cast

(
HookAddress
+
1
)
+
HookAddress
+
5
;
DWORD oldProt
;
VirtualProtect
(
reinterpret_cast

(
HookAddress
+
1
)
,
sizeof
(
uintptr_t
)
,
PAGE_READWRITE
,
&
oldProt
)
;
*
reinterpret_cast

(
HookAddress
+
1
)
=
reinterpret_cast

(
DetourFunction
)
-
HookAddress
-
5
;
VirtualProtect
(
reinterpret_cast

(
HookAddress
+
1
)
,
sizeof
(
uintptr_t
)
,
oldProt
,
&
oldProt
)
;
return
reinterpret_cast

(
OriginalFunction
)
;
}
using
SendConnectionRequest
=
bool
(
__fastcall
*
)
(
void
*
,
void
*
,
const
char
*
,
unsigned
short
,
char
*
,
int
)
;
SendConnectionRequest pSendConnectionRequest
=
nullptr
;
int
__fastcall
ConnectionHook
(
void
*
EDX
,
void
*
thats
,
const
char
*
host
,
unsigned
short
remotePort
,
char
*
passwordData
,
int
passwordDataLength
)
{
if
(
!
strncmp
(
host
,
"127.0.0.1"
,
9
)
)
return
0
;
return
pSendConnectionRequest
(
EDX
,
thats
,
host
,
remotePort
,
passwordData
,
passwordDataLength
)
;
}
void
Hooking
(
)
{
pSendConnectionRequest
=
reinterpret_cast

(
SetCallHook
(
dwSAMP
+
0x3CB16
,
&
ConnectionHook
)
)
;
}
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD ul_reason_for_call
,
LPVOID lpReserved
)
{
switch
(
ul_reason_for_call
)
{
case
DLL_PROCESS_ATTACH
:
{
dwSAMP
=
reinterpret_cast

(
GetModuleHandleA
(
"samp.dll"
)
)
;
std
::
thread
(
Hooking
)
.
detach
(
)
;
break
;
}
}
return
TRUE
;
}
 
Ответить с цитированием

  #4  
Старый 26.12.2023, 18:13
SafeModeOfficial
Новичок
Регистрация: 27.03.2022
Сообщений: 10
С нами: 2176865

Репутация: 1
По умолчанию

Цитата:
Сообщение от atomlin  

Хукнуть отправку подключения к серверу (RakPeer::SendConnectionRequest( const char* host, unsigned short remotePort, char* passwordData, int passwordDataLength ))
(Можно хукнуть и socketlayer, но тогда будет ломаться connectfix)
(Ниже offset под r1)

C++:





Код:
#include 
#include 
#include "Windows.h"
uintptr_t dwSAMP
=
0xFF
;
void
*
SetCallHook
(
uintptr_t HookAddress
,
void
*
DetourFunction
)
{
uintptr_t OriginalFunction
=
*
reinterpret_cast

(
HookAddress
+
1
)
+
HookAddress
+
5
;
DWORD oldProt
;
VirtualProtect
(
reinterpret_cast

(
HookAddress
+
1
)
,
sizeof
(
uintptr_t
)
,
PAGE_READWRITE
,
&
oldProt
)
;
*
reinterpret_cast

(
HookAddress
+
1
)
=
reinterpret_cast

(
DetourFunction
)
-
HookAddress
-
5
;
VirtualProtect
(
reinterpret_cast

(
HookAddress
+
1
)
,
sizeof
(
uintptr_t
)
,
oldProt
,
&
oldProt
)
;
return
reinterpret_cast

(
OriginalFunction
)
;
}
using
SendConnectionRequest
=
bool
(
__fastcall
*
)
(
void
*
,
void
*
,
const
char
*
,
unsigned
short
,
char
*
,
int
)
;
SendConnectionRequest pSendConnectionRequest
=
nullptr
;
int
__fastcall
ConnectionHook
(
void
*
EDX
,
void
*
thats
,
const
char
*
host
,
unsigned
short
remotePort
,
char
*
passwordData
,
int
passwordDataLength
)
{
if
(
!
strncmp
(
host
,
"127.0.0.1"
,
9
)
)
return
0
;
return
pSendConnectionRequest
(
EDX
,
thats
,
host
,
remotePort
,
passwordData
,
passwordDataLength
)
;
}
void
Hooking
(
)
{
pSendConnectionRequest
=
reinterpret_cast

(
SetCallHook
(
dwSAMP
+
0x3CB16
,
&
ConnectionHook
)
)
;
}
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD ul_reason_for_call
,
LPVOID lpReserved
)
{
switch
(
ul_reason_for_call
)
{
case
DLL_PROCESS_ATTACH
:
{
dwSAMP
=
reinterpret_cast

(
GetModuleHandleA
(
"samp.dll"
)
)
;
std
::
thread
(
Hooking
)
.
detach
(
)
;
break
;
}
}
return
TRUE
;
}

Как я понял он провеяет айпи хоста, и если он соотвествует, то полностью блокирует все подключения?
 
Ответить с цитированием
Ответ





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.

×

Внести депозит

Введите сумму USDT:

Принимается только USDT TRC20. Fake/Flash USDT не засчитывается.

×

Вывести депозит

Сумма USDT:

Ваш USDT TRC20 кошелек:

Заявка будет отправлена администратору.