Would it be possible to embed Webkit/Gecko DLLs in a UT mod?

Discussions about Coding and Scripting
Post Reply
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Would it be possible to embed Webkit/Gecko DLLs in a UT mod?

Post by Dizzy »

Webkit and Gecko are the HTML/CSS rendering engines which browsers like Chrome and Firefox use to display web pages.

Would it be possible to embed either of these rendering engines inside a UT mod, to either improve the existing UBrowserHTTPClient (which renders only the most basic HTML) and to allow modern HTML and CSS to be rendered in-game?

I have no idea what the limits of native programming for UT are, but would appreciate some knowledge on the subject.

Relevant related reading:

How to embed WebKit into my C/C++/Win32 application?
ChromiumEmbedded: a simple framework for embedding Chromium-based browsers in other applications
Creating rich Internet applications on Linux with WebKit
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
User avatar
UnrealGGecko
Godlike
Posts: 2900
Joined: Wed Feb 01, 2012 11:26 am
Personal rank: GEx the Gecko
Location: Kaunas, Lithuania
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by UnrealGGecko »

Sorry, but why do you want to embed me into a mod?
Spoiler
don't kill me plz... I was just joking :ironic:
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Chamberly »

UnrealGGecko wrote:Sorry, but why do you want to embed me into a mod?
Spoiler
don't kill me plz... I was just joking :ironic:
Gecko.... they are everywhere!
Image
Image
Image Edit: Why does my sig not work anymore?
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by PrinceOfFunky »

Dizzy wrote:I have no idea what the limits of native programming for UT are, but would appreciate some knowledge on the subject.
Native programming is native programming, you're not limited to the software rules but only to the machine ones. The problem is if you want it to work online, people would need to download the needed dll's, and not everyone wants to do it since they can have access to the system.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Dizzy »

PrinceOfFunky wrote:The problem is if you want it to work online, people would need to download the needed dll's, and not everyone wants to do it since they can have access to the system.
I'll cross that bridge when I come to it!

The real problem for me is I work almost exclusively with high-level languages (C#) so when it comes to Unreal and its C header files, I really don't know where to start. The actual programming itself wouldn't be the problem, but understanding the interfaces and general structure of the game code is.

Put it this way: give me a basic C or C++ Windows Forms application in Visual Studio and I could probably shoe-horn a well-documented library like Webkit into it within X amount of time. But give me a bunch of Unreal header files and ask me to embed Webkit into UT in the middle of a game, and I don't even know where I'd begin.

How did the native coders here get started?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
Chris
Experienced
Posts: 134
Joined: Mon Nov 24, 2014 9:27 am

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Chris »

Here is everything you need to know about creating native mods for the engine.
https://wiki.beyondunreal.com/Legacy:Native_Coding

And about sending natives to clients, there is a serious security exploit in the engine which allows servers to send any type of file to your client and even execute it without you knowing it.
This is how NPLoader does it, but it prompts the client first. In respect for the community I am not gonna tell you how this is done, as of now there are few people who knows about it, and it should remain that way.
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Dizzy »

Chris wrote:There is a serious security exploit in the engine which allows servers to send any type of file to your client and even execute it without you knowing it.
This is how NPLoader does it, but it prompts the client first. In respect for the community I am not gonna tell you how this is done, as of now there are few people who knows about it, and it should remain that way.
Two questions:

1. If you're saying a UT server can download and execute arbitrary code silently on any client, then that is indeed a huge security risk, and nobody should be playing on any UT servers unless they explicitly trust them. Is the situation really as bad as that, and if so, can't some kind of patch or protection be introduced?

2. Does this mean that if someone did create a mod which required the Webkit DLL that the clients would have to download the DLL manually and place it in their UT/System folder? Because obviously that's very inconvenient for the client.

I imagined using a similar technique as ACE/NPLoader where it asks the user to download and install any needed DLLs automatically, but you're saying this isn't really possible - or at least not without this risky inside knowledge?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
Chris
Experienced
Posts: 134
Joined: Mon Nov 24, 2014 9:27 am

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Chris »

Two questions:

1. If you're saying a UT server can download and execute arbitrary code silently on any client, then that is indeed a huge security risk, and nobody should be playing on any UT servers unless they explicitly trust them. Is the situation really as bad as that, and if so, can't some kind of patch or protection be introduced?

2. Does this mean that if someone did create a mod which required the Webkit DLL that the clients would have to download the DLL manually and place it in their UT/System folder? Because obviously that's very inconvenient for the client.

I imagined using a similar technique as ACE/NPLoader where it asks the user to download and install any needed DLLs automatically, but you're saying this isn't really possible - or at least not without this risky inside knowledge?[/quote]

While that is true, I don't think it's a huge risk playing on any of the servers available, but then this is just my assumption and not a fact. Very few people are able to write native code for UT, and even fewer is aware of the exploit and how to use it (even even less so the server admins).
Creating a patch against this can be archieved easily, but it would need to include a white list of trusted mods that would allow to install, such as NPLoader.

You could use NPLoader, it's a bit messy to setup because you must make sure that your mod is not a dependency of another package, and it must only execute code after NPLoader has initialized the client, if the mod is the Webkit then it's only supposed to run on the client and draw on the Canvas. I wont dig into how exactly you'd acomplish that but if you intend to use any of the UWindows then you might want to allow that class to dynamically load the native mod and then have it bind to the dll via DynamicLoadObject atleast a second after you login to the server. Try to create a driver interface.
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Dizzy »

Thanks. Do you know if a patch exists for the vulnerability anywhere? And if not, is anyone volunteering to make one?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by sektor2111 »

If exist an Evil Idiot which wants to mess clients he/she can do a random thing - even by getting out of "sand-box", see Java's stupid features which was creating a wide range of exploits at this point - TOO MUCH Power is harmful. Else, If you don't know the target on purpose how can you protect something by guessing ?
Me, one, I'm not installing fancy maps requiring DLLs if are not trusted and these are not for servers... I'm saying this as long as I was asking a question about a map requiring a DLL file how can be set in a server, but I did not see anyone explaining "How To".
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Dizzy »

sektor2111 wrote:If exist an Evil Idiot which wants to mess clients he/she can do a random thing - even by getting out of "sand-box", see Java's stupid features which was creating a wide range of exploits at this point - TOO MUCH Power is harmful. Else, If you don't know the target on purpose how can you protect something by guessing ?
Me, one, I'm not installing fancy maps requiring DLLs if are not trusted and these are not for servers... I'm saying this as long as I was asking a question about a map requiring a DLL file how can be set in a server, but I did not see anyone explaining "How To".
One solution to avoid any risk would be to completely open-source the code and allow people to compile their own version of mods, or just download any third party DLLs from their official repositories if you don't trust the UT script author.

If I could ever get such a project working I would absolutely open source it.

Personally my vision is to have an improved MapVote with a modern embedded browser window inside it so that we can show real web pages with relevant information.

Here is our current map vote which uses the default UBrowser, and you can see the HTML rendering is extremely basic:

Image
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
SC]-[WARTZ_{HoF}
Adept
Posts: 426
Joined: Tue Feb 21, 2012 7:29 pm

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by SC]-[WARTZ_{HoF} »

Very interesting mapvote. :tu:
Image
Image
Image
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by sektor2111 »

There are players unable to setup NetSpeed for "modern times", they were using default 2600 speed, I pushed things up because of them. If you can convince then to load a DLL which might include an unknown vulnerable part, good luck then. It's about a MapVote which has a purpose Voting not lecturing pages... but I'm curious what's the deal...
Anyone willing to read more can click on a page-link browsing things properly, using Mozilla and/or other dedicated browser with no issues... because for me this sounds like turning UT into a browser which seems a bit pointless, players have already browsers...
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Dizzy »

sektor2111 wrote:There are players unable to setup NetSpeed for "modern times", they were using default 2600 speed, I pushed things up because of them. If you can convince then to load a DLL which might include an unknown vulnerable part, good luck then. It's about a MapVote which has a purpose Voting not lecturing pages... but I'm curious what's the deal...
Anyone willing to read more can click on a page-link browsing things properly, using Mozilla and/or other dedicated browser with no issues... because for me this sounds like turning UT into a browser which seems a bit pointless, players have already browsers...
The benefit would not only be the ability to browse web pages. You could render the interfaces for mods using XML and CSS. Imagine never again having to use DrawStretchedTexture() to create a basic UWindow. It would be a huge benefit. But until I learn C++ (or someone with the time and willingness to help comes along) we're stuck :sad2:
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
Chris
Experienced
Posts: 134
Joined: Mon Nov 24, 2014 9:27 am

Re: Would it be possible to embed Webkit/Gecko DLLs in a UT

Post by Chris »

Dizzy wrote:
sektor2111 wrote:There are players unable to setup NetSpeed for "modern times", they were using default 2600 speed, I pushed things up because of them. If you can convince then to load a DLL which might include an unknown vulnerable part, good luck then. It's about a MapVote which has a purpose Voting not lecturing pages... but I'm curious what's the deal...
Anyone willing to read more can click on a page-link browsing things properly, using Mozilla and/or other dedicated browser with no issues... because for me this sounds like turning UT into a browser which seems a bit pointless, players have already browsers...
The benefit would not only be the ability to browse web pages. You could render the interfaces for mods using XML and CSS. Imagine never again having to use DrawStretchedTexture() to create a basic UWindow. It would be a huge benefit. But until I learn C++ (or someone with the time and willingness to help comes along) we're stuck :sad2:
Rendering in Unreal engine is already slow and inefficient, we don't have to make it worse.
Post Reply