New build pushed to the SVN!
Includes a MUCH improved scripting interface, speed improvements, API improvements, a 'base hook' (currently just a PoC and a very heaving WIP), lots of bug fixes, etc.
Be warned however, there are quite a few 'breaking changes', so don't update to this build until you are ready to potentially update any code that uses it. The changes should be fairly minor, but I figured it would be best to give a warning nevertheless.
As always, please let me know if you have any suggestions, bug reports, etc, or even just general feedback.* Be 'brutal' (as Kynox puts it), the more relevant complaints I get the more improvements I can make. Also, if you have code you'd like to contribute, or if you'd like to join as either an official or unofficial developer for the project please let me know.
* hadesmem - Project Hosting on Google Code <-- Don't forget that the project page has an issue tracker! Reports can be aimed directly to me, but I'd much prefer it if you used the issue tracker. Thanks.
* Improved base hook. Added D3D hooks, input hooks, a console (thanks to Bobbysing for rereleasing his GUI lib under the MIT license for me), support for loaders (i.e. Steam, WoWs Launcher, etc), etc. Currently still quite rudimentary, but it's making decent progress. Soon I'll hook a scripting interface up and add .NET support so the console is actually useful for something, then I'll probably add extension support and start exposing an API. Still a bunch of other things I want to fix at the same time though too (like the input code which is currently very basic and doesn't support multiple windows or rehooking, and also the GUI code which isn't thread safe or multiple device save due to the architecture of the GUI library which I will need to fix).
* Miscellaneous changes and fixes to other parts.
* Lua scripting support added to injected base hook. Currently linked to the console. Just a framework at the moment, but an API will be exposed soon and expanded over time.
* Extension loading support added to injected base hook. Currently just a very basic framework, but will be expanded over time.
* Lots of memory leak fixes, bug fixes, and cleanup to the GUI library.
Ran a quick test for most of the games I had installed on my PC (obviously didn't bother trying D3D10-only games or w/e because I haven't added D3D10 support yet) and checked that the basics were working. Rendering and keyboard input worked on all games except Eve (I think it's because they separate the device and swapchain so EndScene is never called, I'll add IDirect3DDevice9::Present hooking soon). Mouse input worked on most (a couple still aren't showing the cursor properly, I'll have to look at them, it's probably something to do with IDirect3DDevice9::ShowCursor or ShowCursor or SetCursor).
Nothing amazing, just an example of how writing generic code (eventually) pays off.
Screenshots:
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
http://dl.dropbox.com/u/74751/HadesM...-20100623a.png
No Hello Kitty Island Adventure screenshot?!
This is looking really good Cypher. Nice work.
Perhaps consider Gwen as a GUI?
* Added .NET 3.5 support. I have not yet got .NET 4.0 to work the way I want it to, so for now 3.5 will have to do. I will try to get 4.0 up and running soon though.
* General fixes, cleanups, and improvements.
You trying to host the CLR? This code should do:
It's not pretty or anything, but it gets the job done. I haven't really used it, though. I literally wrote an injector + CLR hosting DLL and never did anything with it... Except for displaying a message box, which kinda indicated that it works (EDIT: Oh, and console output did too; but that's really all I did).Code:struct AssemblyInfo { public: AssemblyInfo(cstring path, cstring type, cstring method, cstring arguments); cstring GetPath() const { return Path; } cstring GetType() const { return Type; } cstring GetMethod() const { return Method; } cstring GetArguments() const { return Arguments; } private: cstring Path; cstring Type; cstring Method; cstring Arguments; }; AssemblyInfo::AssemblyInfo(cstring path, cstring type, cstring method, cstring arguments) { Path = path; Type = type; Method = method; Arguments = arguments; } class DotNetHost { public: DotNetHost(AssemblyInfo& assembly); ~DotNetHost(); void Execute(); private: AssemblyInfo& Assembly; ICLRMetaHost* Policy; ICLRRuntimeInfo* Info; ICLRRuntimeHost* Host; }; DotNetHost::DotNetHost(AssemblyInfo& assembly) : Assembly(assembly), Info(NULL), Host(NULL) { CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (nothing*)&Policy); } DotNetHost::~DotNetHost() { Host->Release(); Info->Release(); Policy->Release(); } void DotNetHost::Execute() { uint32 version = 0; uint32 flags = 0; HRESULT hr = Policy->GetRuntime(TEXT("v4.0.30319"), IID_ICLRRuntimeInfo, (nothing*)&Info); hr = Info->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (nothing*)&Host); hr = Host->Start(); uint32 result = 0; hr = Host->ExecuteInDefaultAppDomain(Assembly.GetPath(), Assembly.GetType(), Assembly.GetMethod(), Assembly.GetArguments(), (DWORD*)&result); Host->Stop(); }
Last edited by XTZGZoReX; 06-30-2010 at 12:10 PM.
Been there done that. Was being a **** when I was trying to launch multiple assemblies side by side.
I also need to add support for the .NET apps to register to events from the C++ layer. e.g. .NET apps running under Hades can subscribe to an 'OnFrame' event. Something which is working in the 3.5 layer, but was also being a **** in the 4.0 layer.
Thanks, but I'm gonna take another look at it later.
Finally fixed the .NET 4.0 support. Whoop whoop.
I've migrated to v7.1 of the Windows SDK (I know that seems pointless, but there was a reason for it). Everything will still work fine with v7.0A if you don't mind tweaking the project files, but if you just want stuff to work out of the box, then you can download v7.1 here:
Web - Download details: Microsoft Windows SDK 7.1
ISO - Download details: Microsoft Windows SDK 7.1