[Windows Phone 7 Development and Hacking] Martin7Pro:
Hi saywa. Thanks for your offer. The biggest problem is usable debugging, without it I must reflash my device weakly, because actual HaRET version causes system errors sometime. If you have a free time, try next ideas:

1. Download the newest HaRET code from jessenic GIT. If you use desktop Windows, try cygwin gcc compilation and Windows binaries of GDB for WinCE. If you use Linux, try native GDB with DDD UI to code tracing, stepping, breakpointing. I am not sure, but this can be the way of WP7 native debugging.

2. If method 1 will not usable: Try to port HaRET sources to PellesC IDE. The most of HaRET sources are wrote in pure C, then this could not be too much work, but some assembler directives must be prepared to unique kernel mode driver (see sources, most of them is finished now), which must stay in gcc source, becouse too difficilly portable. Pelles C IDE works with WP7 succesfully, when one breakpoit only is setted, but it is much better then VS2008 with corecon5 and patched edm2.exe, where no breakpoint works.

3. If no 1 or 2 will usable, try: Install VS 2012 from Dreamspark, or VS 2012 Express for WP8 (if you use Windows 7 desktop like me, use tutorial from XDA). When WP7 device connection and managed debugging will work, search Werner Willemsen's CE Blog WEC6/7 SDK tutorial for VS2012/13. You can use any WEC7 standard SDK or also WM 5.0, 6.0, 6.5 or 6.5.3 SDK (you probably need VS2008 installed first to be WM SDK unpacked). I mean WP7 corecon10 files and edm3.exe can work with VS 2012 native remote device debugger, but I am not sure. If you will have succes, very much WEC/WinCE coders will thanks you for possible tutorial, because Microsoft WEC7/2013 VS version breakdown is very frustrating for all embedded devices developers.

If method 1 or 3 will succesfull, I have a many ideas how to finish not only HaRET application, I will send more after.

First one will simple RunInKernelMode(Fn * pCallback, void * pParam, unsigned int nParamSize) function. It is a big security hole, but we can make it to simplier HaRET porting and updating. It will very difficult, but possible by using some tricks. See http://media.blackhat.com/bh-us-12/Briefings/Oi/BH_US_12_Oi_Windows_Phone_Slides.pdf , http://wincework.blogspot.cz/2008/02/ce6-drivers-what-you-need-to-know.html?m=1 etc. But, I am afraid, information about WinCE6 callbacks in http://blogs.msdn.com/b/ce_base/archive/2007/01/29/what-is-kernel-mode.aspx article is not probably valid! We must try it to research, if kernel mode driver uses really common code address space. I mean CeDriverPerformCallback(...) function changes privileges, but also maps both data and code address spaces too. Probably only undirect calls are possible between modes (http://www.tech-archive.net/Archive...c.windowsce.platbuilder/2007-11/msg00289.html etc.).

With RunInKernelMode(...) function we can also make very usefull diagnostics features, for example global hooks or API interceptors.

See next links (normally not usable for WP7/WinCE6+):

http://code.google.com/p/roadrover/downloads/detail?name=cespy.zip&can=2&q=

http://www.drdobbs.com/cpp/spy-a-windows-ce-api-interceptor/184405459

http://xdaforums.com/showthread.php?t=235792

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644959(v=vs.85).aspx

http://www.codeproject.com/KB/DLL/keyboardhook.aspx

With working API interceptor we can make for example simple WM6 applications launcher for WP7 devices. Missing APIs we can determine by using standard debugging API, which is present in WP7 kernel, and compile it from WinCE5 shared source parts.