Sonic and Sega Retro Message Board: Playing XBLA titles developed with XNA on a PC - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

Playing XBLA titles developed with XNA on a PC My experiments in getting this to work.

#1 User is offline SoullessSentinel 

Posted 11 January 2013 - 04:44 PM

  • Posts: 243
  • Joined: 01-October 05
  • Gender:Male
  • Location:Grimsby, England
  • Project:Sonic 1 32X Remix
I have found a way to run Xbox 360 games on a standard PC, but it can only run titles developed in XNA Game Studio. (Still useful, as some XNA Titles lack Windows versions), for those interested in the details, read on.

After enjoying playing Fez on a friends Xbox 360 console, I knew it was something I would like to play myself, however, I currently lack an Xbox 360 console (It was sold to provide funds towards getting a Wii U).
After some digging around online I discovered that Fez was developed using the XNA Framework. Knowing that XNA runs on .NET, I acquired an XBLA package of the game, and extracted it.

This revealed a number of .XEX files with file names such as Game.exe.xex, FezEngine.dll.xex, and a Runtime folder, containing System.dll.xex, Microsoft.XNA.Framework.xex, among others. This confirmed my belief that this title used XNA and the .NET Framework. With this information, I used xextool to decrypt the .xex files, and load them in a hex editor. The part of the file was a dummy PE header, followed by nothing but zeroes, but I found that at offset 0x30000 in every single one of these files, were .NET assemblies.

I wrote a quick tool to trim the dummy data from the start of the file, double clicked the resulting Game.exe, and was given a RunTimeException from the .NET runtime, meaning that at least some code was being executed from it.

After patching the resulting libraries in .NET Reflector to remove code signing from the references, I managed to get it to run. After replacing the xbox System.dll with the Windows version, it ran, crashing shortly after due to missing library files named STORAGE, D3D and XINPUT, among others. I began working on implementing these functions, and managed to get Fez to execute further. After adding in some logic to convert D3DFORMAT parameters between what XNA expects, and what Direct3D uses, it executed far enough to create a Direct3D device handle, so I believe I this method will be successful, and I began work on an 'Emulator' to handle this patching automatically, and use my implementations of the missing run time libraries.

I'm not certain on this, but if XNA Game Studio uses the same system libraries as standard games (It accessed them via DLLIMPORT, rather than as .NET assembly references), my implementations of the APIs may be useful in the future for emulators that include emulation of the Xbox 360's processor to aid running native games.

TLDR:
I can run XNA developed XBLA titles, but they currently crash due to unimplemented functions, but I'm working on it.
I've created a google code project here, and will be uploading my code so far under the BSD licence in a few days time.

I'm posting here to enquire what people here think of this idea, as I know there are many technically minded people around that could provide their insight into this, and to possibly find testers in the near future.
This post has been edited by SoullessSentinel: 11 January 2013 - 05:06 PM

#2 User is offline sonicblur 

Posted 11 January 2013 - 09:00 PM

  • Posts: 848
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6
If the code is not obfuscated, you'll probably find it easier just to decompile the whole thing in ILspy, fix the compilation errors, and rebuild against the publicly available XNA SDK.
That approach works very well for Windows Phone 7 apps, because nobody bothers to obfuscate them.

#3 User is offline SoullessSentinel 

Posted 11 January 2013 - 09:03 PM

  • Posts: 243
  • Joined: 01-October 05
  • Gender:Male
  • Location:Grimsby, England
  • Project:Sonic 1 32X Remix
I did try that approach first, but after spending several days of tracing through the code, this solution actually seemed better. Plus it has the possibility of working with other games developed in XNA.

#4 User is offline Ch1pper 

Posted 12 January 2013 - 01:22 AM

  • Fighting the Battle of Who Could Care Less
  • Posts: 559
  • Joined: 01-November 09
  • Gender:Male
  • Project:Life.
  • Wiki edits:40
Color me intrigued. If you need testers, I'll be happy to lend a hand.

#5 User is offline winterhell 

Posted 12 January 2013 - 11:00 AM

  • Posts: 747
  • Joined: 16-October 10
  • Gender:Male
This is very nice news (and I already expected this to be the first form of emulating HD consoles). I was working in the past on a 3D vertical shooter for Xbox 360, and have much experience with XNA 2.0 through 4.0 so I'm willing to help by sending you files for both PC and 360 versions of test applications.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users