1

I am new here and I have a question for you guys

(C++) I will try to describe my situation with some details so that you can understand this better. This might be long(er) but it might be necessary to explain this to someone who doesn't know how this (scripthook) works

I am playing GTA 5 and there's a library file made by unofficial person called ScriptHookV.dll. It's main purpose is to enable modding, it hooks to the game and allows us (modders) to call the game's native functions, such as: VEHICLE::VEHICLE_CREATE, PLAYER::PLAYER_SET_WANTED_LEVEL, and so on. ( full list here: http://www.dev-c.com/nativedb/ )

However, this modding works in a way that you download sdk from ( http://www.dev-c.com/gtav/scripthookv/ ) and you can use sdk to make your own mod, it provides those native functions so you can use and compile it.

When it gets compiled it gets compiled with .asi extension (actually its a dll renamed to asi) and you need to place it in gta 5 main folder and when you launch the game, scripthookv.dll and other file called dsound8.dll will take care of loading that .asi file

However, as you see what I've described, it works in a way that scripthook file itself loads .asi files into the game and executes their code by itself. And what i'm trying to do is i would like to have my own program from which i can use ScriptHookV.dll 's native functions to manipulate gta 5 singleplayer, but i don't have the source code of that dll.

So I am wondering what to do now..

TL;DR: I want to manipulate GTA 5 singleplayer with functions that ScriptHookV.dll provides by using my own program, but I don't have source code of that dll

4
  • How will your program will be implemented as a DLL or standalone executable?
    – PhoeniX
    Commented Jun 29, 2017 at 16:57
  • standalone executable
    – 782458
    Commented Jun 29, 2017 at 17:00
  • can you give an example of such manipulation and why it needs to be external program and not a script?
    – PhoeniX
    Commented Jun 29, 2017 at 17:21
  • i'll explain usage example as it's quicker, regularly scripthook does the job of loading mods and stuff, but i don't want to make a mod, they always depend on the scripthook and they must be in gta 5 folder, a standalone exe would be better because you can manipulate gta 5 from outside of it's folder and it's easier in my opinion. I am aware that both exe and script would run pretty similar (as both use scripthook dll functions) but i would like to do it in a standalone exe instead because i prefer it more and i think its better ^^ and this would be good for me, learning how to do stuff
    – 782458
    Commented Jun 29, 2017 at 17:57

1 Answer 1

2

First of all, you do not need the source of the ScriptHookV.dll as SDK provided all the needed API interface functions that you need for the modding (look in inc dir).

I did not go deeply into ScriptHookV.dll design but you will not be able to manipulate the game externally without having presence (DLL, shell code) inside its address space.

In any case, you would need some sort of Client/Server implementation:

  1. Server will be the asi file or any other dll which must be in game's address space and open for example some Pipe server.
  2. Client side will be you application, connected to the created pipe.

In this way you will either need to implement your own scripting language or protocol for client/server communication or pass through the pipe precompiled script for the server to execute in context of the game.

From your comments, to do it from the outside app look like over-engineering and not really stable.

10
  • As far as i know, ScriptHookV should be working by manipulating memory in order to do a task, e.g create a vehicle, paint a car, make player invincible, etc. You've said that externally editing GTA 5 would be unstable, why is that? You can edit game's memory from outside the same as from within gta 5 folder I guess I could even externally completely edit memory myself to do my own functions, but that sounds too complicated for my skill level. But, couldn't I somehow insert scripthook in the game with my program and execute scripthook's provided functions from my program?
    – 782458
    Commented Jun 29, 2017 at 18:42
  • Even if you load manually scripthook in the game from remote process, you will still need some pluming to make it work with your external application.
    – PhoeniX
    Commented Jun 29, 2017 at 18:51
  • well, I would like to do it in that way if it's possible. Of course if you know some better method of achieving this, please tell me. I am still buzzing around not being sure where to start, i already know how to inject dll into the game process, but i don't know where to go from there also if there's a better method of doing this, i'd be interested to hear could you please help me out?
    – 782458
    Commented Jun 29, 2017 at 21:30
  • please help me...
    – 782458
    Commented Jul 1, 2017 at 12:30
  • Can you provide the most very basic thing that you want to do with your program? You can write it on pastebin.com
    – PhoeniX
    Commented Jul 1, 2017 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.