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

  #1  
Старый 04.08.2024, 01:13
Mattioli
Познающий
Регистрация: 08.04.2021
Сообщений: 45
С нами: 2685259

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

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
 
Ответить с цитированием

  #2  
Старый 04.08.2024, 10:38
вайега52
Флудер
Регистрация: 19.06.2022
Сообщений: 2,997
С нами: 2055431

Репутация: 3


По умолчанию

Цитата:
Сообщение от 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
 
Ответить с цитированием
Ответ





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


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




ANTICHAT ™ © 2001- Antichat Kft.