-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
126 lines (97 loc) · 2.8 KB
/
main.cpp
File metadata and controls
126 lines (97 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include "main.h"
uintptr_t g_libSAMP = 0;
static int iServer;
static const char* primanka;
//#define BLACKRUSSIA
//void (*CNetGame__CNetGame)(uintptr_t thiz, const char *address, int port, const char *nick, const char *pass);
//void CNetGame__CNetGame_hook(uintptr_t thiz, const char *address, int port, const char *nick, const char *pass)
//{
// address = WEIKTON("127.0.0.1");
// port = 7777;
// return CNetGame__CNetGame(thiz, address, port, nick, pass);
//}
void (*CNetGame__CNetGame)(char *a1, const char *a2, int a3, const char *a4, int a5);
void CNetGame__CNetGame_hook(char *a1, const char *a2, int a3, const char *a4, int a5)
{
Log("a1 -> %s", a1);
Log("a2 -> %s", a2);
a2 = WEIKTON("127.0.0.1");
Log("a2 ->-> %s", a2);
Log("a3 -> %d", a3);
a3 = 7777;
Log("a3 ->-> %d", a3);
Log("a4 -> %s", a4);
Log("a5 -> %d", a5);
CNetGame__CNetGame(a1, a2, a3, a4, a5);
}
void (*SetServer)(uintptr_t *a1);
void SetServer_hook(uintptr_t* a1)
{
// Log("%d", a1);
return;
}
void (*Pizda)(uintptr_t *a1);
void Pizda_hook(uintptr_t* a1)
{
// Log("%d", a1);
return;
}
void kill()
{
Log(WEIKTON("Load plugin..."));
ARMHook::installHook(g_libSAMP + 0x0, (uintptr_t)CNetGame__CNetGame_hook, (uintptr_t*)&CNetGame__CNetGame);
#ifdef BLACKRUSSIA
// use with rizone plugin for more exp
// rizone X kingrussia X brhallowen
ARMHook::installHook(g_libSAMP + 0x07DE34, (uintptr_t)SetServer_hook, (uintptr_t*)&SetServer);
ARMHook::installHook(g_libSAMP + 0x0883D0, (uintptr_t)Pizda_hook, (uintptr_t*)&Pizda);
#endif
Log(WEIKTON("\nPlugin loaded. Thanks: https://t.me/weikton\n"));
}
void *InitialiseThread(void *p)
{
kill();
pthread_exit(0);
}
jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
g_libSAMP = ARMHook::getLibraryAddress(WEIKTON("libsamp.so"));
// g_libSAMP = ARMHook::getLibraryAddress(WEIKTON("libclient.so"));
if(g_libSAMP)
// это надо заменить на CHook
{
srand(time(0));
uintptr_t memlib_start = (g_libSAMP + 0x174D4);
uintptr_t size = 0x1234A;
ARMHook::InitialiseTrampolines(memlib_start, size);
pthread_t thread;
pthread_create(&thread, 0, InitialiseThread, 0);
}
primanka = "xule ti tut zabil uebishe, kiss my ass, by t.me/weikton";
return JNI_VERSION_1_6;
}
uint32_t GetTickCount()
{
struct timeval tv;
gettimeofday(&tv, nullptr);
return (tv.tv_sec*1000 + tv.tv_usec / 1000);
}
void Log(const char* format, ...)
{
char info[512] = {0};
va_list arg;
va_start(arg, format);
vsnprintf(info, sizeof(info), format, arg);
va_end(arg);
char path[0xFF] = {0};
FILE* fileLog = nullptr;
sprintf(path, "/storage/emulated/0/netkill.log");
fileLog = fopen(path, "a");
if(fileLog == nullptr)
{
return;
}
fprintf(fileLog, "%s\n", info);
fflush(fileLog);
fclose(fileLog);
}