Question No Sandbox [PSA For SDV mods]

SomeoneEls

Farmer
[TLDR]
For anyone that doesnt know what a sandbox is, just know that if SDV does NOT have a sandbox, any mod can be a VIRUS.
If it does have a sandbox, tell me under this post pls :D
If windows defender pops up, be safe, don't run it.
Just be safe... We probably need some sort of verification? Maybe?
[TLDR]


Hi there! Just wanted to tell ya all that the current SDV mod structure does not use any sandbox that I know of.
If there is one, tell me.
But by experience, I can access your username on your computer. I did this originally as a secret thank you note to anyone that uses the Chaosmod,
but looking at it, there might be more.. bad applications.
That and I can use unsafe operations like goto. I know what I'm doing, and I don't mess around with pointers, but messing around with system memory could be verrrry bad.

Other things that are more technical:
This is probably not available via json mods, only C#.
Not for content patcher either.

My goto usage is because I got stuck in a ton of nesting in my code and I needed to get out, somehow.
So, instead of setting a ton of flags, I just use a goto instead.

So yeah. Just be careful, and if windows defender pops up or something, please think twice.
 

Lenora Rose

Farmer
Generally if you get your mods from a reputable site, like Nexus, they also do virus checking and people would report fast if something popular or appealing contained something new and malicious. And in Github if you know enough to know what is bad (as in mean/dangerous, not unskilled) you can look at the code itself.

But, I mean, anything downloaded straight to your computer has the potential to contain a virus. A certain amount of caution is always warranted.
 

Lenora Rose

Farmer
[TLDR]
For anyone that doesnt know what a sandbox is, just know that if SDV does NOT have a sandbox, any mod can be a VIRUS.
If it does have a sandbox, tell me under this post pls :D
If windows defender pops up, be safe, don't run it.
Just be safe... We probably need some sort of verification? Maybe?
[TLDR]


Hi there! Just wanted to tell ya all that the current SDV mod structure does not use any sandbox that I know of.
If there is one, tell me.
But by experience, I can access your username on your computer. I did this originally as a secret thank you note to anyone that uses the Chaosmod,
but looking at it, there might be more.. bad applications.
That and I can use unsafe operations like goto. I know what I'm doing, and I don't mess around with pointers, but messing around with system memory could be verrrry bad.

Other things that are more technical:
This is probably not available via json mods, only C#.
Not for content patcher either.

My goto usage is because I got stuck in a ton of nesting in my code and I needed to get out, somehow.
So, instead of setting a ton of flags, I just use a goto instead.

So yeah. Just be careful, and if windows defender pops up or something, please think twice.

Related question, though; for a mod with a dll file, how safe is it to unpack/repack? I've done that with xnb, including the base game. But the same unpacker won't work, of course.

I'm wanting to look into the bits so I can tweak one of my own mods to account for whether another player has both mods, as it creates a scenario that would alter some of my listed lines of dialogue.
 

SomeoneEls

Farmer
Related question, though; for a mod with a dll file, how safe is it to unpack/repack? I've done that with xnb, including the base game. But the same unpacker won't work, of course.

I'm wanting to look into the bits so I can tweak one of my own mods to account for whether another player has both mods, as it creates a scenario that would alter some of my listed lines of dialogue.
TLDR: Usually, it should be fine to decomp using DNSpy(reccomended) or Ghidra(if DNSpy wont work, HEAVY REVERSE ENGINEERING).

DLL files can be in many diffrent langs. Since SDV is in C#, the DLL file you made is probably in MSIL, which is an intermediate lang.



If the DLL is in a intermediate lang (MSIL, Python byte code, Java byte code):

Should be able to edit in DNspy (if the DLL is in MSIL), or Ghidra(please dont do this).

If the DLL is in a low level lang:

If you edit in Ghidra, that version of the DLL will only work on your arch of pc.
For example, if my comp arch is x86-x64 Windows and I try to run it on x86-x64 Linux, it probably will fail.
The DLL in general would only probably work in that comp arch of computer in the first place, but its nice to check.
...also very hard.

To find your comp arch, look at your device info in settings (might have to google a bit, look at the processor for your PC if difficult.)


You can find DNspy and Ghidra on Github. BUT only decomp if you are allowed to decomp. Some people/orgs don't want you to do that.

Tips for DNspy:

Since it is your own code, you should be able to search up the method you want to change easily. Just put the name of your method or whatever in the search button at the top. ( the little magnifying glass)

You can modify via c# code, MSIL, or Hex. If c# wont compile or stay the same, just change via MSIL.
Right click the code to get to if you want to modify via MSIL or C#.

You can switch from (MS)IL and C# view from the top in the drop down window.

Save by File -> Save module

Tips for Ghidra:

I wish I had some.

Currently, I don't know that much to give an idea on it, so google. Lotta google. I don't think you can add statements, but you can add functions, somehow? I need more research agh...
If you want to go through reverse engineering, here is some docs I found. https://www.ghidradocs.com/
 
Top