ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby (https://forum.antichat.xyz/forumdisplay.php?f=24)
-   -   [ASI] Custom "GTA SA USER FILES" folder (https://forum.antichat.xyz/showthread.php?t=1319319)

D3.Pheonix 28.11.2017 21:36

Задался этим вопросом, нашёл где-то код от DK22pac. Плагин позволяет хранить папку User Files в любом месте

Может кому-то понадобится

C++:





Код:

#include "plugin.h"
#include
class
MyDocumentsDir
{
public
:
static
void
SetDocumentsDir
(
)
{
const
char
*
documentsDir
=
"D:\\My Documents\\Hello World - My GTA SA Documents"
;
std
::
experimental
::
filesystem
::
create_directories
(
documentsDir
)
;
strcpy
(
reinterpret_cast

(
0xC92368
)
,
documentsDir
)
;
}
MyDocumentsDir
(
)
{
// skip registry checks
plugin
::
patch
::
SetUInt
(
0x744FD1
,
0x9014C483
)
;
plugin
::
patch
::
Nop
(
0x744FD5
,
10
)
;
plugin
::
patch
::
SetUInt
(
0x745001
,
0x9018C483
)
;
plugin
::
patch
::
Nop
(
0x745005
,
10
)
;
plugin
::
patch
::
SetUInt
(
0x745018
,
0x9004C483
)
;
plugin
::
patch
::
Nop
(
0x74501C
,
16
)
;
// set documents path
plugin
::
patch
::
RedirectCall
(
0x74503E
,
SetDocumentsDir
)
;
plugin
::
patch
::
Nop
(
0x745048
,
2
)
;
}
}
myDocumentsDir
;


imring 28.11.2017 21:53

Как компилировать плагин?

Я же пишу lua скрипты, а не ASI

iAmerican 29.11.2017 00:36

Как этот участок кода кому то поможет? Докладывай остальные файлы(проект).

D3.Pheonix 29.11.2017 01:27

Цитата:

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

Как этот участок кода кому то поможет? Докладывай остальные файлы(проект).

Мне ж помог ? Выше написал, что просто скомпилировал код с помощью Plugin SDK. Там даже мозги не нужны

Цитата:

Сообщение от Спойлер

Вот полный код

C++:





Код:

#include "plugin.h"
#include
using
namespace
plugin
;
class
PluginSdkProject3
{
public
:
PluginSdkProject3
(
)
{
#include "plugin.h"
class
MyDocumentsDir
{
public
:
static
void
SetDocumentsDir
(
)
{
const
char
*
documentsDir
=
"D:\\My Documents\\Hello World - My GTA SA Documents"
;
std
::
experimental
::
filesystem
::
create_directories
(
documentsDir
)
;
strcpy
(
reinterpret_cast

(
0xC92368
)
,
documentsDir
)
;
}
MyDocumentsDir
(
)
{
// skip registry checks
plugin
::
patch
::
SetUInt
(
0x744FD1
,
0x9014C483
)
;
plugin
::
patch
::
Nop
(
0x744FD5
,
10
)
;
plugin
::
patch
::
SetUInt
(
0x745001
,
0x9018C483
)
;
plugin
::
patch
::
Nop
(
0x745005
,
10
)
;
plugin
::
patch
::
SetUInt
(
0x745018
,
0x9004C483
)
;
plugin
::
patch
::
Nop
(
0x74501C
,
16
)
;
// set documents path
plugin
::
patch
::
RedirectCall
(
0x74503E
,
SetDocumentsDir
)
;
plugin
::
patch
::
Nop
(
0x745048
,
2
)
;
}
}
myDocumentsDir
;
}
}
pluginSdkProject3
;





Сэнд 29.11.2017 01:50

в плагин сдк есть уже хук д3д9?

D3.Pheonix 29.11.2017 02:06

Цитата:

Сообщение от Сэнд

в плагин сдк есть уже хук д3д9?

В душе не е.у. Смотри сам GitHub - DK22Pac/plugin-sdk: An SDK for developing ASI/CLEO plugins for GTA San Andreas, GTA Vice City and GTA III(https://github.com/DK22Pac/plugin-sdk)


Время: 00:58