Jump to content

[Project] SVG Support in WinPE 3 x64


Tripredacus

Recommended Posts

Next up, I can do this project while I have some free time. It falls under R&D! The ability to use SVG for interactive menus has always been something I really wanted to do, however browser support was pretty lacking. We always had the ability to use SVG in Internet Explorer but only if you had the Adobe SVG Plugin. I had some great ideas to use SVG in HTA on my WinPE boot images, however they are all going to be 64bit going forward. I knew my attempt at getting SVG to work properly in WinPE 3 x64 because there was no 64bit binaries in the Adobe plugin, so that getting it to work in a native 64bit OS like WinPE would be next to impossible. I initially brought up this idea here, however it didn't go much beyond that discussion. So I have some extra time and can do some testing with this. Let's see if I can get this to work. I will be recording my steps and progress here in case anyone wants to follow along.

First I will mention that I am using a test system for all testing, but a VM probably would work also. So in any case where I am doing something with an actual PC, you can use whatever you want. The first thing we need are some test files. While SVGs are all about the internet, most of them are static Vector images and not the interactive ones we want. Also, we need to be aware that in browsers that do support interactive SVG, the operate quite differently! Here is my example file:

http://tripredacus.net/test/svgtest.html

If you view this in IE5.5-8 with the Adobe SVGView Plugin, you will see that the red/white gradient box rotates clockwise, the large box changes colors if you click on it, and the other boxes are draggable. If you view this in Firefox, the large box color change works, but the other two features do not. It is know that Firefox does not support some of the interactive elements. So to begin our project, we need to get the following:

1. Dependency Walker x64: http://www.dependencywalker.com/depends22_x64.zip

2. Internet Explorer 9 Beta x64 Standalone Installer: http://download.microsoft.com/download/6/2/F/62F70029-A592-4158-BB51-E102812CBD4F/IE9-Windows7-x64-enu.exe

3. Internet Explorer 9 Beta x64 Prerequisites: http://support.microsoft.com/kb/2409098

4. ProcMon and ProcExp may end up being helpful, but I haven't had to use them yet.

Presuming that ProcMon will open in the WinPE, that and Depends will be needed for use to determine why things aren't working... because maybe we missed a reg entry or a file from the host OS to put into the PE. IE9 "supposedly" supports interactive SVGs without a plugin (this is a selling point for IE) so having an IE9 x64 is the reason why I make this project.

On your test PC, I installed 7PRO64. I Figured it would be best if the machine was activated, knowing in the past that IE and Updates won't install on a Windows that isn't activated. I also made some changes in SecPol:

- UAC: Behavior of the elevation prompt for administrators in Admin Approval Mode: Elevate without promptiong

- UAC: Detect application installations and prompt for elevation: Disabled

- UAC: Switch to Secure Desktop when prompting for elevation: Disabled

Probably don't need some of those lol.

Install the 4 Prerequisites. The first one does not need a reboot but the other three do. After that install IE9 and reboot.

Unfortunately, opening the test HTM and SVG file appeared in IE9 the way it would in IE8 without the plugin. Examining the code on the Platform Preview download, it appears the new SVG files that MS uses (I used the Twitter Cloud one for example) are actually inside of the HTML code in SVG tags, rather than using the EMBED tag. After changing this and adding a similar doctype, I was able to open the htm file in IE9. Unfortunately it behaved the way the original test url did in Firefox.

So at this moment, I can go in two directions. First is getting any SVG to work in WinPE, and then afterwards, figure out how to get the interactive ones to work in IE9. I wrote the example SVG file about a year ago... Here is the source of the modified file:

Removed Code example. You can save the HTM and SVG from the link I provided above.

Interesting notices. When you open the HTM file in IE9, a prompt appears to allow you to run "Active-X Controls." After you allow this, the SVG is viewable, but only the color change code works. Opening the HTA version throws a JavaScript error, which points to getSVGDocument() and I'm not quite certain why. It also throws an error if you try to drag something as well. Interesting how in IE9 it just doesn't work, but MSHTA actually shows you errors.

It is also interesting that the mere installation of IE9 allows SVG to work in MSHTA, as it does not work with IE8 (even with Adobe Plugin) with MSHTA. I would have been fine with trying to get just SVG to work in MSHTA, but I can't do it if it gives errors anytime you click on something. So I will have to go about solving those two coding errors first, then work on getting MSHTA to show SVG in WinPE.

Edited by Tripredacus
Link to comment
Share on other sites


You can not install ie from installer under winpe. It needs 3 updates to be installed. For to install updates need trustedinstaller, wusa,cab support, when they all done it says "this update can not be installed to this version" error. Maybe it can be solved to extract cab context and update.mum patch but i did not try. And lots of other stuff missing under winpe. Better you try to grab reg and file changes and integrate to winpe.Maybe you can try to integrate cab updates directly to winpe by patching update.mum and dism. But also if you can succeed to integrate packages with dism, all the registry additions will refer to C:\ or D:\ partition. Also need to change all to X:\

Edited by Kullenen_Ask
Link to comment
Share on other sites

Well to get started, I have modified the HTA enough so that the one animation is working and there are no errors when it opens. After that, I captured the 64bit versions of Procexp and procmon that are spawned when you open those on a 64bit OS. Boot into WinPE. Copy Procmon64.exe, procexp64.exe and svg.hta to X:\Windows\System32\ from USB key. Launch ProcMon64.exe, add mshta.exe to include filter. Launch mshta.exe x:\windows\system32\svg.hta (FQ path needed in PE to open HTA) Save PML file and view in x64 ProcMon, compare to MSHTA running the HTA in 7PRO64.

I copied the 64bit DLLs that ProcMon showed it using in 7 vs what WinPE did with the same file. Before moving towards full scale dependency testing, I decided to check out the difference between the MSHTA in X:\ vs MSHTA on Win7 both in System32 and sysWOW64. It turns out that BOTH of the MSHTA.EXE in Win7 are 32bit apps, and not a native 64bit app like we have in WinPE. So my true wish was to use a 64bit MSHTA to determine what files were missing in WinPE but that won't happen now. I do not even know if MSHTA from an IA64 version of Windows would work properly in WinPE (or x64 Win7).

So back to finding out what DLLs I needed, using Depends in WinPE, I was getting pretty close but ran into some problems. Depends complained that some of the DLLs had missing exports compared to imports on dependencies. I take this to mean that these files are looking for other versions of those files. However, some of them I cannot replace while booted into the PE and I will have to rebuild a WIM to make the changes. For example, I cannot overwrite shlwapi.dll while the PE is running.

Alas I cannot continue at the moment as during some overwrites, CMD tells me that I am out of HDD space on drive X! Well I notice (in Notepad) that it is only 4MB large. So I need to learn how to make that bigger!

I may also consider two other topics that I haven't read much on.

1. Look into using MakePE3 to build a x64 boot image with IE support.

2. Has anyone tried getting WinPE to allow both architectures? For example, If I can get 32bit MSHTA to work with Adobe SVG Plugin but STILL need the ability to run x64 based apps, that would be great.

Info says I do have a 32MB Scratchspace, but shouldn't the X drive be bigger than a 4MB capacity?

C:\Program Files\Windows OPK\Tools\PETools>DISM /IMage:f:\winpe_amd64\mount /Get

-PESettings

Deployment Image Servicing and Management tool

Version: 6.1.7600.16385

Image Version: 6.1.7600.16385

Windows PE Settings:

Profiling : disabled

Scratch Space : 32MB

Target Path : X:\

The operation completed successfully.

Well I'm done for the week on this. Maybe I can pick back up on Monday.

Edited by Tripredacus
Link to comment
Share on other sites

As a comparison tool, I am using 2 HTA files to work with. One is the one in the GImageX which works fine, and one with the SVG. I have determined that the EMBED tag does not work, but you can actually get "something" by having the SVG actually embedded into the HTML code. However, when MSHTA executes this HTA, a blank "error" box appears (that you can close) and see the HTA. It does not show the vector objects, but it DOES show the words... So basically the HTML portion of the HTA is visible and (somewhat) working, but the Scripted portion does not appear.

Wait... back up there. (I just deleted a bunch of post after noticing something). What did I notice? The text that DOES appear in the HTA are NOT in the HTML portion of the file, they are in the XML (or SVG) portion. So some of the XML is working, but the objects do not appear...

So the only SVG object that works is TEXT, however it ignores X and Y. I will have to test the STYLE attribute to see if that actually is working. It should be noted that all of the Polygons are in object groups, which make it easier to assign functions to large amounts of objects. Think of the Object Group as a DIV container, same idea.

After lunch I'll have to try using a vector object outside of the group, as well as try to determine why MSHTA doesn't like CDATA. Unless I can find another way to assign functions to the objects, presuming I can get these objects to even appear...

Reattempting to use IE9 x64 files based on the new ones that the IE9 Platform preview installs. Too bad the preview isn't x64 capable, or else I could use that instead... Some of the following files I CANNOT CHANGE in the mounted WIM. And there is no ability to change permissions (or even take ownership, etc) so I'm stumped on those... I'll try turning off DEP perhaps tomorrow to get around that.

advpack.dll

dxmsft.dll

dxtrans.dll

html.iec

ieapfltr.dll

iedkcs32.dll

ieframe.dll

ieframe.dll.mui

iertutil.dll

iesetup.dll

ieui.dll

imgutil.dll

jscript9.dll

jsproxy.dll

msfeeds.dll

mdfeedsbs.dll

mshtml.dll

mshtml.tlb

mshtmled.dll

msls31.dll

msrating.dll

occache.dll

sqmapi.dll

urlmon.dll

wininet.dll

Edited by Tripredacus
Link to comment
Share on other sites

Got some results finally. Got MSHTA and MSHTA64 to at least show an HTA with files without giving an error.

Problem is that it doesn't show anything besides the Browse box on the Imagex HTA. The SVG HTA exits out completely.

Had to take ownership of files in the mounted system32. Replaced the following:

ieframe.dll

ieui.dll

imgutil.dll

mshtml.dll

mshtml.tlb

mshtmled.dll

msrating.dll

Removed CDATA object from SVG.HTA and makes no difference.

Got a little further using Depends to determine any particular issues. Added:

wmdrmsdk.dll

rpchttp.dll

d3d10level9.dll

d3d10warp.dll

d3d10.dll

d3d10core.dll

Here's where the problem lies. Depends keeps reporting that DXGI.DLL is calling functions from D3D10WARP.DLL and they are returning NULL values.

Unfortunately, these values are NULL by default, as can be seen here: MSDN

So how to get these variables have values?

This may be related to the fact that DX nor .NET support is in PE, so not sure how to troubleshoot what needs to be present, such as services or

DLLs that need to be registered. :wacko:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...