nogardilaref wrote:"file" (file://..) is a standard scheme for opening local files, and is handled by the OS itself, and not the browser, although you can also use it from the browser.
The only reason things like "http://" and "https://" open your browser automatically, is because the browsers register themselves to be the ones responsible for those schemes.
This is also why "unreal://" opens UT, as long as UT is properly installed, including the entries in the Windows registry.
Having that said, yeah, this stuff allows you to open anything, because it's really meant to open anything.
UT by design is also meant for you to be able to leave the game to visit websites, as shown by the fact that it has support for hyperlinks which is demonstrable by the very first tab that is opened when you mean to play a multiplayer game (the message from Epic games directing you to their newer forums/sites).
From there, it becomes rather clear why it can execute things like bat files and the like as well, since by simply "calling" file:///something, that something being a bat file or another kind of executable that the OS simply executes by omission, then it's just executed.
This of course breaks the sandbox nature of Unreal Engine, and is around things like these that we're able to have stuff like NPLoader to download and use remote .dll files I believe (I don't know myself how NPLoader works, but I didn't actively look for an explanation either).
Which means servers could easily inject malware into your system this way as well.
So I guess it would work on linux also, even cause Unreal Engine is supported on it so...
Also, did you see
this? That means we can write external scripts from scratch and running them using Unreal for the whole process.
Since ClientTravel() doesn't let you pass arguments when executing a program, I am currently trying to understand how the function ExecuteLocalLogBatcher(), from within StatLog.uc, works, since I noticed there are these two variables:
Code: Select all
var() globalconfig string LocalBatcherURL; // Batcher URL.
var() globalconfig string LocalBatcherParams; // Batcher command line parameters.
Also, there's this other function:
Code: Select all
native static function BrowseRelativeLocalURL(string URL);
Which I suppose does exactly the same of ClientTravel(), but I didn't test it. (EDIT: I just tested it and the answer is yes)
This one is also interesting:
Code: Select all
native final static function BatchLocal();
And this one is funny:
Code: Select all
function LogEventString( string EventString )
{
Log( EventString );
}
Very useful lol. (Of course it could be useful if you would decide to log event strings in a different way).
EDIT: Looks like I was right thinking that it would have used the batch(of course XD), I tried using Level.Game.LocalLog.ExecuteLocalLogBatcher(), but before doing it I changed these two globalconfig lines:
Code: Select all
LocalBatcherURL=../NetGamesUSA.com/ngStats/ngStatsUT.exe
LocalBatcherParams=IThoughtIShouldHaveCensoredThis?
LocalLogDir=../Logs
into these:
Code: Select all
LocalBatcherURL=testexe.bat
LocalBatcherParams=test
LocalLogDir=.
But it wasn't successful, also this is the log it wrote:
Code: Select all
Log: CreateProc testexe.bat ./Unreal.ngLog.2017.12.09.14.54.47.7777.log
Just, the file "Unreal.ngLog.2017.12.09.14.54.47.7777.log" was written in the System folder.
The static function "BatchLocal()" tho, doesn't create that log file.