ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   Помогите освободить все загруженные CLEO из C++ (https://forum.antichat.xyz/showthread.php?t=1517656)

Mattioli 04.08.2024 01:13

RU: Здравствуйте, люди из Blast.HK, я пытаюсь создать способ выполнения функции `destroyScmThread(uint thread)` на C++ для освобождения файлов CLEO.

EN: Hello people from Blast.HK, I am trying to create a way to execute `destroyScmThread(uint thread)` from C++ to unload CLEO files.

Original LUA code:

Free cleos memory:





Код:

local
function
findCleoScript
(
arg
)
for
file
in
require
(
"lfs"
)
.
dir
(
getGameDirectory
(
)
..
"/cleo"
)
do
if
file
:
match
(
arg
)
and
file
:
match
(
".cs"
)
then
return
file
end
end
return
"Unknown"
end
local
function
unloadCleoScripts
(
)
local
memory
=
require
(
"memory"
)
local
scripts
=
{
}
local
address
=
memory
.
getint32
(
11056172
,
false
)
while
address
>
0
do
wait
(
0
)
if
memory
.
getint32
(
address
+
16
,
false
)
>
0
then
local
name
=
memory
.
tostring
(
address
+
8
,
8
)
:
match
(
"[%w]*[%p%w]*"
)
if
name
then
local
dir
=
findCleoScript
(
name
)
scripts
[
#
scripts
+
1
]
=
{
name
=
name
,
address
=
string
.
format
(
"0x%x"
,
address
)
,
dir
=
dir
}
end
end
address
=
memory
.
getint32
(
address
,
false
)
end
for
_
,
script
in
ipairs
(
scripts
)
do
destroyScmThread
(
scripts
[
idx
]
.
address
)
end
end


вайега52 04.08.2024 10:38

Цитата:

Сообщение от Mattioli

RU: Здравствуйте, люди из Blast.HK, я пытаюсь создать способ выполнения функции `destroyScmThread(uint thread)` на C++ для освобождения файлов CLEO.

EN: Hello people from Blast.HK, I am trying to create a way to execute `destroyScmThread(uint thread)` from C++ to unload CLEO files.

Original LUA code:

Free cleos memory:





Код:

local
function
findCleoScript
(
arg
)
for
file
in
require
(
"lfs"
)
.
dir
(
getGameDirectory
(
)
..
"/cleo"
)
do
if
file
:
match
(
arg
)
and
file
:
match
(
".cs"
)
then
return
file
end
end
return
"Unknown"
end
local
function
unloadCleoScripts
(
)
local
memory
=
require
(
"memory"
)
local
scripts
=
{
}
local
address
=
memory
.
getint32
(
11056172
,
false
)
while
address
>
0
do
wait
(
0
)
if
memory
.
getint32
(
address
+
16
,
false
)
>
0
then
local
name
=
memory
.
tostring
(
address
+
8
,
8
)
:
match
(
"[%w]*[%p%w]*"
)
if
name
then
local
dir
=
findCleoScript
(
name
)
scripts
[
#
scripts
+
1
]
=
{
name
=
name
,
address
=
string
.
format
(
"0x%x"
,
address
)
,
dir
=
dir
}
end
end
address
=
memory
.
getint32
(
address
,
false
)
end
for
_
,
script
in
ipairs
(
scripts
)
do
destroyScmThread
(
scripts
[
idx
]
.
address
)
end
end



Можешь воспользоваться PluginSDK для вызова игрового опкода:
Код:

0C6E
https://www.blast.hk/threads/189214/post-1518566


Время: 20:01