Command & Conquer™ Remastered Collection

Command & Conquer™ Remastered Collection

Statistiken ansehen:
So if the mods are arbitrary C++ code
What's to stop someone from compiling a mod DLL with malicious code in it? Does the mod launcher do a check to make sure there aren't any unexpected security concerns? For example what's to stop someone from making a mod that uses the C/C++ file/filesystem class to delete system32 when you lose a match?
< >
Beiträge 115 von 15
Internet 101: Only download files from trusted sources. Applies to everything, not just C&C mods.
Roman 29. Juni 2020 um 20:38 
Ursprünglich geschrieben von Snufflegrunt:
Internet 101: Only download files from trusted sources. Applies to everything, not just C&C mods.

The difference is normally mods on Steam Workshop would typically be some kind of file format for mods which doesn't fully expose an entire programming language letting you do pretty much anything and then compile it into a closed source DLL file... So you could download a mod that seems trusted enough on Steam Workshop but it turns out it actually has some secret backdoor that you don't really notice. The system32 example was an extreme case where obviously you'd notice it and obviously anyone who used it would rate it 1 star and get it removed from Steam workshop. But some other cases could go undetected before it's too late...
Uh, that's not cool and not something that I entirely clocked onto. Thanks.
Empiro 30. Juni 2020 um 1:10 
I'm not sure how the mod support works for C&C, but all modern operating systems support security features like capabilities. This can prevent the code from being able to do things like read /write arbitrary files, or call library functions.
Ursprünglich geschrieben von Empiro:
I'm not sure how the mod support works for C&C, but all modern operating systems support security features like capabilities. This can prevent the code from being able to do things like read /write arbitrary files, or call library functions.
I'm not a competent enough programmer to really know what I'm talking about here, but if the code is run through the game, doesn't it already have permission from the OS to do almost whatever it wants beyond write to C:\?

Ugh, I'm going to need to make the Linux jump on my desktop soon. Wishing Nvidia would take their Linux drivers seriously...
Empiro 30. Juni 2020 um 13:42 
Yes and no -- the game itself has limited permissions (so it can't actually delete everything). There's also various techniques to further limit what a mod can do. Read up on Native Client to see how you can even safely run machine code downloaded from the internet in a safe way.

I'm not sure how C&C implements mods, but at the least, I'd say that the C&C binary itself won't run with very high privileges, which limits the damage it can do (though potentially it could still mess up your saved games).
CobraA1 30. Juni 2020 um 16:11 
Ursprünglich geschrieben von Roman:
What's to stop someone from compiling a mod DLL with malicious code in it? Does the mod launcher do a check to make sure there aren't any unexpected security concerns? For example what's to stop someone from making a mod that uses the C/C++ file/filesystem class to delete system32 when you lose a match?

It probably won't be able to do anything an administrator can do (unless it also contains an privilege elevation exploit), but malware is theoretically possible. More along the lines of randsomware, running a botnet, or identity theft.

Ursprünglich geschrieben von Snufflegrunt:
Ursprünglich geschrieben von Empiro:
I'm not sure how the mod support works for C&C, but all modern operating systems support security features like capabilities. This can prevent the code from being able to do things like read /write arbitrary files, or call library functions.
I'm not a competent enough programmer to really know what I'm talking about here, but if the code is run through the game, doesn't it already have permission from the OS to do almost whatever it wants beyond write to C:\?

Ugh, I'm going to need to make the Linux jump on my desktop soon. Wishing Nvidia would take their Linux drivers seriously...

Unless you're running Steam as an administrator (which I don't advise), any .dlls would be running code with the same privileges as a standard user, and you'd receive a UAC prompt if it tries to overstep those boundaries.

Linux would essentially be the same - it would run as a standard user.
CobraA1 30. Juni 2020 um 16:22 
. . . and I should note that Linux has its own form of dynamic link libraries and doesn't support DLLs. Chances are if you're running the game on Linux, you're already running it in some form of virtualization / emulation. If you want to run C&C in Linux I'd definitely recommend doing some research, because it doesn't natively support Linux.
Roman 30. Juni 2020 um 18:21 
Rather than having mod makers compile their mods to DLL files, they should instead find a way to take advantage of something like .patch or .diff files where you modify the source code, create a .patch file, and that's your mod. When the game detects that patch file included in your mod folder, it automatically compiles the DLL itself and switches to it. The benefit there is since a .patch file is easily human readable, you already know what's all in the mod making the mod open source. Also it makes the mod more flexible if the devs patch the game because as long as the patch file can apply cleanly it should work (like if the official patch didn't change any of the same code as the mod).
Zuletzt bearbeitet von Roman; 30. Juni 2020 um 18:22
idk wtf ur saying
CobraA1 30. Juni 2020 um 19:42 
Ursprünglich geschrieben von Roman:
Rather than having mod makers compile their mods to DLL files, they should instead find a way to take advantage of something like .patch or .diff files where you modify the source code, create a .patch file, and that's your mod. When the game detects that patch file included in your mod folder, it automatically compiles the DLL itself and switches to it. The benefit there is since a .patch file is easily human readable, you already know what's all in the mod making the mod open source. Also it makes the mod more flexible if the devs patch the game because as long as the patch file can apply cleanly it should work (like if the official patch didn't change any of the same code as the mod).

For the DLL that the game currently uses, it's a Visual Studio solution, so you do need Visual Studio and the appropriate SDK. That's a bit much to include with the game.

Also you're asking people to read code just to see if it's safe. I'd say that less than 1% of people will have the knowledge to understand what they're looking at.

. . . and I should note that the license of the DLL does state that any modifications need to be open source. That's the nature of the GPL license they decided to go with.

In my opinion, a better idea would be to add a scripting language like Lua to the game, which would allow for increased flexibility over the INI files and would run in a safer, sandboxed environment. It would be a lot of development work, though.
Ursprünglich geschrieben von CobraA1:
. . . and I should note that Linux has its own form of dynamic link libraries and doesn't support DLLs. Chances are if you're running the game on Linux, you're already running it in some form of virtualization / emulation. If you want to run C&C in Linux I'd definitely recommend doing some research, because it doesn't natively support Linux.
It runs perfectly fine with Proton, which is neither virtualisation or emulation.

There’s not a lot of malware out there targeting Linux, in this case especially since it concerns DLLs as you say.
Ursprünglich geschrieben von Snufflegrunt:
Ursprünglich geschrieben von CobraA1:
. . . and I should note that Linux has its own form of dynamic link libraries and doesn't support DLLs. Chances are if you're running the game on Linux, you're already running it in some form of virtualization / emulation. If you want to run C&C in Linux I'd definitely recommend doing some research, because it doesn't natively support Linux.
It runs perfectly fine with Proton, which is neither virtualisation or emulation.

There’s not a lot of malware out there targeting Linux, in this case especially since it concerns DLLs as you say.

For lack of a better term, I would probably call it a form of virtualization. There's no great terms for things like Wine and Proton, which translate various calls between the OSes. 🤷‍♂️
The correct term is "compatibility layer". It's got nothing to do with virtualisation or emulation.
Ursprünglich geschrieben von Snufflegrunt:
The correct term is "compatibility layer". It's got nothing to do with virtualisation or emulation.

Fair enough.
< >
Beiträge 115 von 15
Pro Seite: 1530 50

Geschrieben am: 29. Juni 2020 um 20:23
Beiträge: 15