[Beta] Win86emu: Running x86 apps on WinRT devices

Search This thread

SixSixSevenSeven

Senior Member
Dec 26, 2012
1,617
318
If you can use x86 apps then cant you make a 32bit emulator?

What?

Number of bits != system architecture.

ARM is 32 bit. x86 is 32 bit. It is just a trait of particular CPU types whether it uses a 32 bit word width or a 16 bit or a 12 bit or even 21 if you want to be weird and exotic (it exists).


If you meant running full windows 8 applications on windows RT. Then that is exactly what this already does.... Just slowly.
 

turilo

Senior Member
Jun 17, 2007
3,534
1,565
Hamilton,Ont
Well I almost passed on the surface rt until I found this thread :D so hows it going so far? Is it worth getting the surface rt?
 

Chuckles34

Member
May 9, 2012
27
3
For those who are now going to buy an RT tablet because of this, you do realise there are atom (an x86 cpu) based tablets out there running windows8 for the same prices as RT tablets.....
 

calebrocca

Member
Apr 20, 2013
21
2
In the future, could we use an emulator (or something) like this to run any program we download off the internet?
 

hisoft

Senior Member
Feb 17, 2009
199
20
In the future, could we use an emulator (or something) like this to run any program we download off the internet?

Even if we have high performance ratio and high compatibility emulator. But ARM and x86-64 CPU have many difference that make ARM CPU can't compare to the other one.

We have a slow ARM emulator on speed x86-64. If we try to emulate x86-64 on slow ARM we maybe get very very slow x86-64. :crying:

Don't misunderstand me. I don't care if it slow. The slow one were better than cannot open for sure. :D
 

calebrocca

Member
Apr 20, 2013
21
2
Even if we have high performance ratio and high compatibility emulator. But ARM and x86-64 CPU have many difference that make ARM CPU can't compare to the other one.

We have a slow ARM emulator on speed x86-64. If we try to emulate x86-64 on slow ARM we maybe get very very slow x86-64. :crying:

Don't misunderstand me. I don't care if it slow. The slow one were better than cannot open for sure. :D

Thanks.
That cleared up my understanding a little.:laugh::silly:
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
I honestly can't parse what hisoft said, but the idea of "be able to run any program you download off the web" is more-or-less the end goal of this project. It's a long way from there, though, and most programs will still be too slow to be usable. Additionally, certain types of programs (such as those that require installing drivers) are not planned o ever be supported by this project.
 

SixSixSevenSeven

Senior Member
Dec 26, 2012
1,617
318
My understanding of what hisoft said is that x86 is a fast architecture. Arm is a slow one. Emulating a fast architecture on a slow architecture results in super slow speeds of the emulated architecture (x86).

I guess that's correct enough on a basic level. There is of course a lot more to it than that but it will do I suppose.


As for a faster emulator in future. Its possible to improve the speed. Its also very difficult, you guys are lucky enough to have it in the first place. Improvements were planned but the developer is a busy person. Even so, we're probably talking an emulated speed of approximately 0.2ghz as opposed to the current 0.1 (again, simplified, there is a lot more too speeds than the clock speed in GHz, but it gives a general idea at least).

Best bet is for a native ARM port of whatever game you want to play and chances are, if you paid a single penny for the game, it can never be ported. Open source only and at the moment only a subset of those. C, C++, c# or VB.net with visual studio solutions is about all you can port.
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
Well, you could always ask for ports... but yeah.

It's worth pointing out that ARM chips are getting faster, too. The Xbox 360 was able to quite comfortably emulate 500MHz (0.5 GHz, single core) x86 CPU on PPC (at 3.2GHz, 3-core with hyperthreading) 8 years ago; that's how all legacy Xbox games are supported. PPC is pretty efficient in terms of instructions per clock cycle, and the 360 had a ton of power to burn (compare its power brick to that of a Surface RT) and used a physically larger chip set at a much higher clock speed, but that was also 4+ iterations of Moore's Law back. The next generation of ARM chips are already much faster than the Tegra 3 used in Surface RT and most others of its generation. That speed boost will also improve the emulated speed. It will never catch up to then-current native performance, but (assuming RT sticks around this long) it *might* eventually catch up to today's x86 performance. That's a decade+ away, most likely, though.
 

jimmng

Member
Jan 11, 2013
38
6
finally

I've been lurking around these jailbreak threads for ages now. Finally decided to write ten posts so I can post here :)
anyways,
I've been really desperate to get my Logitech Setpoint software working on my Surface RT, as I have recently bought a t650 track/touchpad.
The device works great on RT, plug&play, press to click, scrolling works, charm/taskbar gesture works. Only problem bugging the heck outta me is that tap to click does not work! Thus I can't click when placing it on a soft surface as the buttons are on the bottom of the trackpad. And who wants to press click when they can tap-click anyways.
As I've read in previous posts that driver related software won't work, but i'm pretty sure this is pure software as the "touch to click" function only works when the setpoint program fully starts up on my win7 desktop.

I've gotten to the point where the setpoint software does actually start up by using the emu on the administrator account, but the window that pops up is just completely blank - white, I've tried pressing enter ; leaving it overnight cause it might be loading but nothing works.

33dwm6g.jpg


I would greatly appreciate it if someone could get it ported/working with the emu.
I'll even give cookies and a 10 dollar aussie note if someone can get it working.

--update--
I've tried copying win7 installation folder and ran setpoint.exe it runs into errors seen in the log below.

00400000-00623000 : C:\Users\Jim\Desktop\SetPointP\SetPoint.exe
[ 9112]W: 04CB0000-04CC4000 : C:\x86node\Windows\System32\VERSION.86.dll
[ 9112]W: 04D00000-04D33000 : C:\x86node\Windows\System32\KERNEL32.86.dll
[ 9112]W: 04CD0000-04CE9000 : C:\x86node\Windows\System32\supp.86.dll
[ 9112]W: 04D40000-04D63000 : C:\x86node\Windows\System32\ADVAPI32.86.dll
[ 9112]W: 04D90000-04DA9000 : C:\x86node\Windows\System32\WINMM.86.dll
[ 9112]W: 04DB0000-04DC6000 : C:\x86node\Windows\System32\WSOCK32.86.dll
[ 9112]W: 04DD0000-04DF5000 : C:\Users\Jim\Desktop\SetPointP\KemUtil.dll
[ 9112]E: PeLdr can't open file: mfc90u.dll
[ 9112]E: Import dll mfc90u.dll not found
[ 9112]E: Import dll KemUtil.dll not found
[ 9112]E: Error loading program: 1168


Then I tried downloading the .dlls and chucked it in the x86node sys32 folder;
Got these errors

2ztdr82.jpg


Many thanks,
Jim

tldr; need Logitech setpoint software on RT
 
Last edited:

SixSixSevenSeven

Senior Member
Dec 26, 2012
1,617
318
It isn't open source so won't be ported, unless Logitech do it. No tap to click is very odd, I always thought it was a windows thing not a device thing.

You have had a peek in the mouse settings in control panel quickly?
 

jimmng

Member
Jan 11, 2013
38
6
It isn't open source so won't be ported, unless Logitech do it. No tap to click is very odd, I always thought it was a windows thing not a device thing.

You have had a peek in the mouse settings in control panel quickly?

Yep, no settings for tap to click.. and I doubt Logitech devs would create a setpoint RT program just for me.
 

sid8810

Senior Member
Aug 25, 2004
94
2
I tried installing firefox, it installed but .. it wont start up. I try to uninstall it...says its running in the background i need to close it. So i cant uninstall this...any help? after a reboot does this hack go...the program doesn't start up. (win86emu)

done it, just deleted the firefox folder from where it installed. Any list of the exe files can you actually install with this ???

i really regret buying this RT surface, should have waited for the pro. I was so para about someone else buying it before me in my house...i went and bought it. I hope Imate release the windows 8 pro smartphone....it will be much better than this ...even if its 4.7 inch .
 
Last edited:

samco08

Senior Member
Jan 24, 2009
159
7
Hello.
I'm trying to launch "Don't starve" but I receive an error message :(

[ 2512]W: 048E0000-04A83000 : E:\Don't starve\Don't starve\bin\dontstarve_steam.exe
[ 2512]W: 04A90000-04B64000 : E:\Don't starve\Don't starve\bin\libGLESv2.dll
[ 2512]W: 00E90000-00EA4000 : C:\x86node\Windows\System32\d3d9.86.dll
[ 2512]W: 00EB0000-00EE3000 : C:\x86node\Windows\System32\KERNEL32.86.dll
[ 2512]W: 00EF0000-00F09000 : C:\x86node\Windows\System32\supp.86.dll
[ 2512]W: 04B70000-04B93000 : C:\x86node\Windows\System32\ADVAPI32.86.dll
[ 2512]E: PeLdr can't open file: MSVCP90.dll
[ 2512]E: Import dll MSVCP90.dll not found
[ 2512]E: Import dll libGLESv2.dll not found
[ 2512]E: Error loading program: 1168

Can you help me please ?
 

SixSixSevenSeven

Senior Member
Dec 26, 2012
1,617
318
Hello.
I'm trying to launch "Don't starve" but I receive an error message :(

[ 2512]W: 048E0000-04A83000 : E:\Don't starve\Don't starve\bin\dontstarve_steam.exe
[ 2512]W: 04A90000-04B64000 : E:\Don't starve\Don't starve\bin\libGLESv2.dll
[ 2512]W: 00E90000-00EA4000 : C:\x86node\Windows\System32\d3d9.86.dll
[ 2512]W: 00EB0000-00EE3000 : C:\x86node\Windows\System32\KERNEL32.86.dll
[ 2512]W: 00EF0000-00F09000 : C:\x86node\Windows\System32\supp.86.dll
[ 2512]W: 04B70000-04B93000 : C:\x86node\Windows\System32\ADVAPI32.86.dll
[ 2512]E: PeLdr can't open file: MSVCP90.dll
[ 2512]E: Import dll MSVCP90.dll not found
[ 2512]E: Import dll libGLESv2.dll not found
[ 2512]E: Error loading program: 1168

Can you help me please ?

Don't starve will be too demanding for this emulator anyway
 

Top Liked Posts

  • There are no posts matching your filters.
  • 96
    The project is abandoned.

    As I no longer own a Windows RT device and I'm not willing to use Windows RT anymore, unless Microsoft would make it more open (at least to run your own desktop apps) - I've decided to stop working on this project.

    As usual I'm publishing complete sources of this tool. Feel free to use them in your own projects or to continue developing this one - only leave my copyrights somewhere.
    Don't ask me how to build the sources or to explain anything in them. Figure that out yourself.

    The project is abandoned. Sorry.

    I'm presenting a tool that allows running a set of x86 Windows applications on Windows RT (ARM) tablets. Its goal is to support all apps except for those that:
    - require much CPU power,
    - use complex features that were cut out from WinRT like D3D9 extensions or OpenGL,
    - require drivers or specific services,
    - make heavy use of COM interfaces,
    - use undocumented windows internals,
    - apps that use .NET framework,
    - x86 Metro apps,
    - 16 or 64 bit Windows programs,
    - buggy apps that require special workarounds.

    The tool is currently on a beta stage, so don't expect much from it. It is far from being complete, but at least it runs something.

    Current version: 0.061
    Just a minor update. The project is not dead, I just had no time to continue the development.
    Attached the fixed ntdll.nt.dll that works under Windows RT 8.1 (Microsoft removed some NTDLL exports, so I had to add more stubs). This fix is not needed on RT 8.0.
    To install it: extract the attached 0.061-ntdll.nt.dll.zip to c:\x86node\windows\SystemNT\ overwriting the existing file.
    Autostarting x86 programs does not work on RT 8.1 ("can't install CreateProcessInternal hook"). I'll look on this later.
    Don't ask on jailbreaking the 8.1 beta in this thread - there is a good progress on it, more info would be on release (in october or when WZOR would leak the RTM).

    Current version: 0.06
    Seems that archive is too big to be attached, so I've uploaded it to google drive and here
    Installation: extract the archive on your unlocked Windows RT device, run the MSI file and follow the instructions.
    Note: Uninstall the previous version before installing a new one.
    List of compatible apps is in this post: http://xdaforums.com/showthread.php?p=40924456

    Trademarks
    Windows is a registered trademark of Microsoft Corporation. ReactOS is a registered trademark or a trademark of ReactOS Foundation. All other trademarks are the property of their respective owners.

    Disclaimer
    This software is provided "as is". Use it on your own risk. I make no warranties as to performance, merchantability, fitness for a particular purpose, or any other warranties whether expressed or implied. No oral or electronic communication with me shall create a warranty of any kind. Under no circumstances should I be liable for direct, indirect, special, incidental, or consequential damages resulting from the use, misuse, or inability to use this software, even if I has been advised of the possibility of such damages.
    I'm trying my best to make the software working, but I can't guarantee that it is free from defects.

    All beta versions of this tool would be freeware. You may freely use it for your own, embed it into your tool, but you can't use it commercially without my confirmation. You can disassemble, analyze or modify this tool for yourself - later I'll provide SDK and document its internals. The only thing that is prohibited is changing embedded copyright notices. I reserve the right of making the project commercial, but this does not mean that this would ever happen.

    This software contains unmodified binaries from the ReactOS project: a registry editor, cmd.exe, ole32.dll to name the few. Those binaries are left unmodified and are covered by LGPL license. Future versions may contain redistributable binaries provided by Microsoft and/or other companies.

    Some more information may be found in my blog. If you want to support development - use the link or press the button on the left side of the post.
    11
    Changes:
    15 may 2013: DInput and DInput8 changes for Fallout2 keyboard compatibility.
    12 may 2013: A minor update. Fallout 2 now works, tested on Russian version from 1C.
    01 may 2013: Added the ability to automatically launch x86 applications. Added the shell32 interfaces - so that installers now work (at least NSIS and InstallShield installers are known to be working).
    05 apr 2013: Fixed a few bugs.
    04 apr 2013: Uploaded a new build after a long delay. Now emulator supports 256-color modes. But due to a limitation on an updated Nvidia driver - 640x480 and 800x600 display modes are no longer supported on Windows RT. You'll see the black lines to the right and bottom of the screen if the program tries to set such mode.
    25 feb 2013: The tool now outputs its version to log. Now one x86 program may launch another - so some of the installers and, for example, 7Z GUI frontend can now run under emulation. Added ~80 DLLs. Some of them are stubs (like D3D9.DLL), others are mostly untested. I have not done all that I've planned for this build, publishing it just as an update to show that the work is going on. Do not expect it to run much more than the previous build.
    13 feb 2013: more informative errors from launcher. Emulator now supports program paths with spaces. EXE files with relocations are now processed correctly. Some bugfixes in kernel32 and advapi32.
    11 feb 2013: fixed a typo in winmm.dll emulation, now pinball has sound. Also updated the launcher.
    10 feb 2013: now the program reached the beta stage.

    Known problems
    No D3D and most of COM interfaces. Lots of programs would crash, don't run or have different issues.

    Notes:
    The program keeps its settings in the HKCU\Software\x86node\Settings registry key. Supported REG_SZ (string) values are:
    DosboxCore: "dynamic", "simple" or "normal". Dynamic is the default as it is the fastest, but the most buggy core.
    LogFile: path to the log file. If not present - log file is %temp%\win86emu.log
    Supported REG_DWORD values:
    LogLevel: 0=no log (default), 4=max logging
    added 13 feb 2013: now default log level is 2: warnings+errors, so you don't need to edit registry

    There are several compatibility hacks that may be useful. Compatibility settings are stored in HKCU\Software\x86node\Compatibility\[filename.exe] key. "filename.exe" - a name of the emulated EXE file without path. All values are DWORD:
    SetProcessAffinityMask = bitmask. Specify which CPUs to use for running a program, read SetProcessAffinityMask description in MSDN. 0 or unset == run on all cores.
    NoRaiseException = 1. RaiseException would just return. Now exceptions are emulated correctly, so this hack is no longer needed.
    UseDirectRegistry = 1. Do not redirect emulated registry keys to HKCU\Software\x86node. Be careful when using it.
    MaxProcessorFeaturePresent = max processor feature number that is "supported". See the IsProcessorFeaturePresent function in MSDN. All requests for the value above specified would return 0. Default: 0 (IsProcessorFeaturePresent always returns 0).
    SimulateAdminRights = 1. Lie to installers that call OpenSCManager function to determine that it is running as administrator, allowing these programs to run without elevation. Redirect the "common start menu" and similar folders to the per-user folders.
    You can fake the OS version to a running program. Default XP SP3:
    OSVersionLo=dword:00000001
    OSVersionHi=dword:00000005
    OSVersionBuild=dword:00000a28
    OSServicepackLo=dword:00000000
    OSServicepackHi=dword:00000003

    Some information on the project internals may appear in my blog: http://mamaich-eng.blogspot.ru, but this thread on XDA would be the main discussion place.
    3
    Sorry for the long delay.

    AOE is already working in my private build. But there are some issues I have to resolve before publishing it.
    3
    I'm not at home...... somebody can try to install FDM ?

    It is better to port free download manager as is is opensource.
    FDM may be compatible with some of the future versions, but there would be no internet explorer integration. I'm not going to support all those COM interfaces, at least in the foreseeable future.

    I'll pause publishing updates for some time as I'm adding several dozens of new system DLLs to the emulator, and need to make them working before making them public. Ws2_32, msimg32 and other requested DLLs are among them. uTorrent 2.x is working now, though with some problems.
    You may see it on the Screenshot
    NSIS installers are working too (checked with 7Zip official installer), though they can't create shortcuts as I have not implemented that interface yet.
    3
    heh, is this a port of the app you showed off back in the CE days? -awesome getting that ported over
    Not exactly a port, it is a clean remake based on the old ideas.
    Would you mind giving a technical explanation?
    The idea is very simple:
    - a PE file loader (load files, process relocs, run TLS callbacks in an emulation mode). Support import loops (DLL A imports B while B imports A), ordinals, etc.
    - a set of wrapper x86 DLLs (kernel32_stub.dll and so on) that "look like" the corresponding Win API functions for an emulated program:
    Code:
    #define DEFINE_FUNC1(name)      \
    static const ModuleDef str_##name={DLL_NAME,#name};     \
    EXTERN_C DW STUB_EXPORT stub_##name(DW p1)              \
    {       \
            DW *p=&p1;      \
            __asm { mov eax,p }     \
            __asm { jmp f1 }        \
            __asm { mov eax,offset str_##name }     \
    f1:     __asm { in eax,0xe5 }   \
            __asm { mov p,eax }     \
            return (DW)p;   \
    }
    .....
    #define DEFINE_FUNC3(name)      \
    static const ModuleDef str_##name={DLL_NAME,#name};     \
    EXTERN_C DW STUB_EXPORT stub_##name(DW p1,DW p2,DW p3)          \
    {       \
            DW *p=&p1;      \
            __asm { mov eax,p }     \
            __asm { jmp f1 }        \
            __asm { mov eax,offset str_##name }     \
    f1:     __asm { in eax,0xe5 }   \
            __asm { mov p,eax }     \
            return (DW)p;   \
    }
    ....
    DEFINE_FUNC1(AddAtomA)
    DEFINE_FUNC1(AddAtomW)
    DEFINE_FUNC7(CreateFileA) -- number in macro == number of parameters to a __stdcall WinAPI function. 
    Compiler automatically generates "ret N*4" at the end of such function. 
    I've decided to use such c+asm approach instead of making a tiny assebler stub, 
    as I can easily implement some of such functions in C directly in a stub DLL plus it 
    simplifies debugging. And the functions have a usual C prologue/epilogue, so that 
    the emulated program may even patch them in runtime, for example for hooks.
    ...
    - a 32-bit x86 emulation engine (currently 2 engines: from bochs and from dosbox, planning on adding my own) that intercepts the command "in eax,0xe5", determines which API is needed by a program and passes it to a handler.
    - native (arm) API handler DLLs (kernel32_yact.dll and so on). They are mostly autogenerated too:
    Code:
    #define DEFINE_FUNC1(name) 	\
    EXTERN_C DW STUB_IMPORT name(DW);	\                     -- this behaves like a function prototype to compiler
    EXTERN_C DW STUB_EXPORT yact_##name(DW *R)		\     -- R - pointer to the x86 stack 
    {	\
      DW r=name(p1);	\         // call the func passing it paramers from the emulated stack, p1==R[0], p2==R[1] and so on
      LEAVE(1);		\         // empty macro, as the stack is unwinded in x86 stub DLL now
      return r;		\
    }
    ...
    #define DEFINE_FUNC3(name) 	\
    EXTERN_C DW STUB_IMPORT name(DW,DW,DW);	\
    EXTERN_C DW STUB_EXPORT yact_##name(DW *R)		\
    {	\
      DW r=name(p1,p2,p3);	\
      LEAVE(3);		\
      return r;		\
    }
    ...
    DEFINE_FUNC1(AddAtomA)
    DEFINE_FUNC1(AddAtomW)
    DEFINE_FUNC7(CreateFileA)  // as you see - implementation part is identical to an x86 stub, so I can use the same stub-generator tool
    Some of the functions require complex emulation due to their absence in ARM or due to the callbacks to x86 code:
    Code:
    static DWORD WINAPI ThreadProc(
      LPVOID lpParameter	// [0] == orig func, [1] == orig param
    )
    {
    	__EXCEPTION_REGISTRATION_RECORD R;
    	DWORD *Parm=(DWORD*)lpParameter;
    	DWORD *TEB=(DWORD*)PeLdrGetCurrentTeb();
    	R.Next=(__EXCEPTION_REGISTRATION_RECORD*)-1;
    	R.Handler=(void*)CbReturnToHost();
    	TEB[0]=(DWORD)&R;	// in case of unhandled exception - just return 
    	PeLdrNotifyNewThread(NULL,DLL_THREAD_ATTACH);
    
    	DWORD Ret=EmuExecute(Parm[0],1,Parm[1]); // 1 == number of parameters to the emulated function
    	delete Parm;
    	return Ret;
    }
    
    EXTERN_C DW STUB_EXPORT yact_CreateThread(DW *R)
    {	
    	DWORD* Parm=new DWORD[2];
    	Parm[0]=p3;                               // TODO: no out-of-memory checking for now
    	Parm[1]=p4;
    	DWORD StackSize=p2;
    	if(StackSize)
    		StackSize+=1024*1024;      // I reserve some space for my own needs (debugging)
    	else
    		StackSize=2*1024*1024;     // TODO: I don't support autogrow stacks, so reserve 2 Mb
    
    	DWORD t=(DWORD)CreateThread((LPSECURITY_ATTRIBUTES)p1,StackSize,ThreadProc,Parm,p5,(LPDWORD)p6);
    	LEAVE(6);		
    	return t;
    }
    Some of the COM interfaces are already implemented, for example DirectDraw and DirectSound, though not heavily debugged. On a desktop emulator build I can already run "Heroes of might and magic 3" and old WinRAR, but there are several RT-specific OS limitations I need to bypass before making them run on ARM. Current work in progress is: overcoming the RT limitations, manually implementing the API functions that callback to a program code (like CreateThread, RegisterClassA and so on), adding stubs for other system DLLs/COM objects.
    Manually thrown SEH exceptions are fully supported, but access violation, int3 and similar OS-generated exceptions would cause program to crash. Some of the TEB fields (TLS and the fields required by the Borland compilers) are implemented too.

    I don't make pointer translation in an emulated code nor make parameter checks passed to API. As a side-effect - the emulated program may trash the emulator in memory, but this greatly increases speed.
    Most of the x86 EXE files don't contain relocations section and need to be loaded on the specific addresses (typically 0x400000). This is not a problem on a desktop, as I can rebase my emulator's EXE to any address I need, and free the corresponding RAM addrs for emulated program, but on ARM - this is a main problem. So currently only EXEs with relocs are supported for emulation, but there are ways to overcome this problem. And some EXEs produced by old Borland compilers contain "broken" relocs, this is a small problem too.