yashsingh1/xdaforums huggingface dataset:
[Windows Phone 7 Development and Hacking] Martin7Pro:
This is nice information. Tried it anybody on any native WP7 device? Registry keys and driver must be changed in ROM probably (I mean SD reformat is possible in HR time only, but registry and drivers are reconstructed by HR). Is possible to make it by cab sender? Or any ROM chef cooperation is needed? What about MS update SD driver change preventing (Dynamic ROM offers MS updates)?

Next:I am finishing ondevice HaRET console xap (3-4 weeks to publishing), usable for HaRET testing and all devices IO maps creating. But, my code uses MFC. I tried refactore it to STL, but it is too much work (may be any months more). Is legal to publish MFC using WP7 codes/binaries on XDA? EDIT: I will make opensource MFC equivalent for WP7 coding. First part - CString replacement (CString is not strictly MFC licensed, but derived classes are) is included to attachments. It uses code parts from James Bernard Schumacher III ApxString library, it is converted to unicode and WM/WP SDK customized. Use it free. Advise me how to write a version of some free license and indicate the author of the original ApxString (CPOL license) here. Change deployment by your needs and read original library code bugs comments (I repaired nothing still, converted to WP7 only).

Using example:

#include "WString.h"

...

CWString ws1(L"asdfg");

CWString ws2 = L"efgh";

CWString ws3 = ws1 + ws2;

CWString ws4;

ws4.Format(L"Format %s, %s, %d", L"aaa", L"bbb", 345);

ws4 += ws3;
[Windows Phone 7 Development and Hacking] GodlikePL:
No phone-specific updates but some custom roms offer way to update to official new rom version by zune but that's a very few rom's. Best are only updatable by cabs and I think that's good enough.

Also i suppose that ms wont make another update for WP7 just for destroying Your work here. We have not so many members to make MS angry, and that's our adventage.

Regards
[Windows Phone 7 Development and Hacking] spavlin:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\GPIO]

"MemBase"=multi_sz:"A9000800","A9100C00"

"MemLen"=multi_sz:"00000200","00000100"

"PinStart"=multi_sz:"0","10","2B","44","5F","68","7A","99"

"PinEnd"=multi_sz:"F","2A","43","5E","67","79","98","A4"

"Flags"=dword:10000 ;Trusted caller only

"Priority256"=dword:60

"GpioGroup1Irq"=dword:39 ; 57

"GpioGroup2Irq"=dword:3A ; 58

"ETHERNET_GPIO_BANK"=dword:7

"ETHERNET_GPIO_BMSK"=dword:8 ; T_MSM8650B, but for T_MSM8650A = 0x00004000

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]

"Order"=dword:0d

"Flags"=dword:02

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]

"Dll"="msm7x00_sdhc.dll"

"BusRequestTimeOut"=dword:EA60 ;60 secs

"Prefix"="SHC"

"Flags"=dword:1000

"CardInsertedState"=dword:0 ; logical 0 means a card is inserted

"CardWriteProtectedState"=dword:1 ; logical 1 means the card is write protected

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory\FATFS]

"FormatFatVersion"=dword:10 ; standard sd cards require fat12 or fat16, and cannot use fat32

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDHCMemory\FATFS]

"FormatFatVersion"=dword:20 ; high capacity SD cards need to use fat32 and cannot use fat16

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\HTCI2C]

"HWMode"=dword:00	;Interrupt Mode is 1, Poll Mode is 0

"Flags"=dword:10000	;Trusted caller only

"HalIrq"=dword:8d ;141 decimal; associated hal irq!!!!!!!!!!!!!!!!!!!!!!!!?????????????????

"HWKernelModel"=dword:FFFFFFFF	;Configurable Model 0xFFFFFFFF(100KHz=INTR,400KHz=Poll),0x01=INTR,0x02=POLL

[HKEY_LOCAL_MACHINE\System\DIBR\Settings]

"EncryptionAlgorithm"="AES"

"KeyLength"=dword:10 ; 128bit Key

"HashingAlgorithm"="SHA1"
[Windows Phone 7 Development and Hacking] ultrashot:
Not sure why you're even looking into DIBR. It is Zune Backup encryption/decryption plugin :)
[Windows Phone 7 Development and Hacking] Martin7Pro:
Understand me good there is possible to make Zune Backup unencrypted by simply registry change?
[Windows Phone 7 Development and Hacking] ultrashot:
You can always check.
[Windows Phone 7 Development and Hacking] GodlikePL:
But why leave zune backup unencrypted? This will dump all the phone data. We already have full access to the filesystem.
[Windows Phone 7 Development and Hacking] Martin7Pro:
I did not find access to all files in runtime, only to actually unused. Do you know, how to copy used drivers etc.? For example keyboard and memory drivers are very interesting for me. If I understand good, all phone data dump is possible by XTC only for now. Or not? Do you have full filesystem access in booting time?
[Windows Phone 7 Development and Hacking] GodlikePL:
Hi,

And for that purpose dumping unencrypted data can be useful. I dont make my own roms so you'll have to build one by yourself and try to change registry values. It should work :)
[Windows Phone 7 Development and Hacking] Kr3i0s:
Hi Martin, hope you are making progress on this.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Sorry, I am maximally busy last weaks. I must totally rewrite big industry application in my occupation, then I have no time on day or night. When I will finish it, I will return here. If somebody want, I can send him all my unfinished WP7 codes - mostly C++, some C#.
[Windows Phone 7 Development and Hacking] thangvh:
How is the project?? :D Is this successful now ???? :((
[Windows Phone 7 Development and Hacking] prahladvarda:
does this work with devices unlocked with wp7 root tools??if yes, i will be always ready to test it on my omnia w..

Prahlad
[Windows Phone 7 Development and Hacking] WojtasXda:
I wonder if it would be better run cLK on wp7 devices ? This loader is open source
[Windows Phone 7 Development and Hacking] Martin7Pro:
Yes, I have got HaRET last version running in the Kernel mode with full hardware and physical memory access too. Any unlock needed. But, my HTC7Pro needed hard reset after this version using to unbrick, then I mean it is too danger when you like your phone. Only one function was succesfully tested before HR - Vibration On/Off low-level switching. I have idea to make HaRET safe equivalent, but the way needs to finish my other related projects and I am too busy now. No C++ coder here wants my unfinished codes? Especially shell/batch interpreter with registry export/import/backup and new directives simply adding (may be used for own macro language definition too), pipes for easy interprocess comunication (unmanged/managed too), native WP7 installer with plugins system and low-level system scheduler projects are near of finishing. Any C++ student with free time can finish it all relatively quickly.
[Windows Phone 7 Development and Hacking] saywa:
where is the download of the code ?

want to have a look at it
[Windows Phone 7 Development and Hacking] surrender420:
There's a link to the source in post #1
[Windows Phone 7 Development and Hacking] WojtasXda:
Guys I need memory layout, and GPIO for HTC Mozart , who can help ?
[Windows Phone 7 Development and Hacking] Martin7Pro:
Try http://web.archive.org/web/*/http://htc-linux.org/wiki/index.php?title=Mozart_GPIO

Most usable is probably:

http://web.archive.org/web/20120415222012/http://htc-linux.org/wiki/index.php?title=Mozart_GPIO

Or you can use last HaRET WP7 version with telnet connection. GPIO checking is working, but be carefull, do not try Linux booting.
[Windows Phone 7 Development and Hacking] Martin7Pro:
HaRET WP7 break explanation

...Sorry for my English, I am too busy to search better translating...

There was a biggest problem - running any operations in the kernel mode. We found CE6 standard solution - making stream kernel driver, load it, open "fake" stream from HaRET user mode code and call driver functions by standard way. Simple functions like coprocessor reading/writing are implementable easy for now. Used solution modifies little original HaRET ASM macros to be other HaRET code stayed unchanged. But, all functions must have unique HaRET definition, unique wrapper definition and unique kernel driver definition too. This is very rigid way, functions set is not easy modificable. I tried code injection from user application to kernel driver, but no successibly. Second problem is too slow "calling and returning" way - much allocations and copying in both address spaces (user and kernel ones are different). But, both this problems are acceptable for HaRET "diagnostics only" using (not for Linux booting).

We need also physical memory access for HaRET advanced diagnostics and potentional Linux booting. Physical memory reading/writing functions are implemented by the same way, as coprocessor and other simple function. But, I am totally not sure, if those functions work correctly. Some GPIO testing says yes, but any other attempts caused device bricking (repeated hard reset and GC OS reflashing helped only). I mean memory functions are right, but physical memory space has different organisation in WP7/CE6, as in WM OS, then classical HaRET code writes to any danger memory area probably. There is needed C/C++ coder for testing, not only man, which risks device bricking. There is also very big problem - no debugger offers functioning code tracing and variables/memory evaluation. Or, I do not know it. I asked Ultrashot repeatedly for functioning debugger (he wrote me he had any functioning verion in the past), but he is probably too busy too to search it.

We can use also another way - I copied GPIO functions from CE blog to driver and they seem to be functional. But,this way need any UI coder cooperation to finish version, able make full WP7 devices IO maps.

Hypoteticable Linux booting has much more problems - I will concluse them in future posts.
[Windows Phone 7 Development and Hacking] hatememarkz:
So I'm guessing this is dead then

snt frm a carbonized GS²
[Windows Phone 7 Development and Hacking] egzthunder1:
Not really... Rather processing very slowly.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Return here

Hi friends. I want to continue HaRET development. But, I have a big problem - I could load no KMDriver version to memory on my device. I changed ROM to Dynamics 2 on both my devices in the spring. Do you know anybody (ultrashot, jessenic or anyone else), what may be problem? I tried all different kmdriver.dll versions, old binaries and newly compiled too, but unsuccessfully still. I tried also to change file properties to "system" by WPhoExplorer.

Failed to activate driver: Error 2

The specified network resource or device is no longer Error code : 80070037

I seen error Nr. 2 in past too, but I do not remember, what it means after ActivateDeviceEx(L"Drivers\\BuiltIn\\KMDriver", NULL, 0, NULL) calling.

EDIT: When I compile the same source code on another PC and deploy HeRET to the same device, it is working.

EDIT2: There is another reason. When I try DFT BTDriver Fix second button, HaRET kernel driver starts working. By my little research this register change is necessary:

From:

[HKEY_LOCAL_MACHINE\init\BootVars]

"NXSupport"=dword:00000001

To:

[HKEY_LOCAL_MACHINE\init\BootVars]

"NXSupport"=dword:00000000

Next very annoyning issue:

HaRET crashes in late_GXBeginDraw calling in this script interpreting:

...

print "Video RAM address is %08x" VRAM

...

After 3 similar HaRET running attempts I got SD card unavailable probably. Green line on tricolore says now:

SD UNKNOWN 74 (I am not sure, but I mean I had any different line here)

Partition Info-v211v413

Phone does not boot, big "HTC" is on screen only. I must do hard reset again.

Do you know anybody, if GXBeginDraw@@YAPAXXZ exists in any gx.dll usable for WindowsCE v7.10 (version found by HaRET)? I used any gx.dll, unable to make this calling now. But, in past (may be before WP 7.8 update) those functions worked on my device.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Big request:

Have you anybody functional C++ source code of telnet client, based od winsock2 (or atlsock) library? Ideally WM or WinCE platform related, but may be for desktop windows too. I have finished WP7 WPF console, sending telegrams by native library, which is able to connect to localhost by winsock2. Then this is able to connect to HaRET application locally on device. But, telnet protocol is wrongly implemented in my native library probably. HaRET recognizes incomming connection, but does not send reply (received characters are "too long" probably, more then one byte due any unicode incompatibility). I have fully functional MFC TELNET code, based on CAsyncSocket class and able working with HaRET, but it is unusable in atl library, called from WPF managed application, due to dllmain conflict. I mean for example old pocketputty source code may (I am not sure) be winsock2 based, but web source codes are unavailable now. Thanks for replies. This is last unresolved part for HaRET WP7 xap releasing, able to research WP7 devices hardware configurations (without linux booting still, videomemory and SD card reading causes device hard reset).

EDIT: I made it working by totaly pig code, but I am too busy to clean it and nobody helps me. HaRET console alpha xap will released as PF 2014.

I received many similar PMs - there are answers:

HaRET WP7 is technically soluted. Physical memory and GPIO access is working. On-device HaRET console XAP will finished and published in a few of days. But:

HaRET WP7 will very unstable in first version. Do device backup first! From every 100 runnings I got averably 30 soft resets (long power button holding helps to phone restart) and one hard reset (zune backup helps to OS restore). I hope full bricking will not come, but I could not be sure!

Not all HaRET fetures are working. Every directX functions causes phone reset, any memory and processor functions are not WP7 customized still.

Linux booting is impossible for now! We must prepare full hardware maps before and solute GPU and SD access first. Many testers will needed for different devices hardware configuration checking and for unstability causes discovering.
[Windows Phone 7 Development and Hacking] saywa:
can you post any better link for source (maybe github), to let the community look ?

i mean the links in the first posts doesn't work properly
[Windows Phone 7 Development and Hacking] Martin7Pro:
Working XAP

Use it only if you are very brave, or you do not like your phone. Haret and kernel driver are very unstable. They are likely to cause hardreset after some time usually! I hope they do not cause a full brick, but I could not be sure. I note in advance, I do not accept any responsibility for the functionality of your device .

If you want to take the risk :

1) Make a backup of your phone!

2) Install the attached XAP.

3) Enable the native application access HaRET WP7 Console in Root Manager (in Custom ROM) or using WP7 Root Tools on other ROMs.

4) Start HaRET WP7 Console applicaion. In the application menu, select Install Haret and kernel driver.

5) Wait for the reboot, run the application again.

6) In the menu, select HaRET by Telnet.

7) Wait for the message Incoming connection from ... in the native Haret window.

8) Use long press back button immediately switches back to HaRET WP7 console.

9) If you seen HaRET(1)#, write your command (see HaRET documentation), for example PlaySound 2, press Enter. The console is optimized for HTC7Pro HW keyboard, but it works with SIP too .

10) Play and hope to never destroy your phone.

11) Finish off the console by pressing the back arrow. Terminate the native application by pressing the Exit button better then by typing quit command from console.

Source code will appear here as I add right licenses. Thanks to w.i.n.c.o, ultrashot, jessenic and Microsoft for big source code parts, fiinix, Heathcliff74, Jaxbot, dcordes, GoodDayToDie, pdaimatejam and Cotulla for any needed knowledge, A. Zabolotny and others for WM6 HaRET code and much other people for any code trifles.

Device usually hangs after HaRET using. In this case push long time Power button and reboot device. Sometime reboot will not succes, then you must do HR by HW keys combination and load your previous phone backup. On HTC is usually Vol+ Vol- and Power for HR, Camera and Power for load backup. I do not know another marks then HTC.

Edit: Today build starts HaRET after installation and reboot automatically. I do not know, why native part only, managed part is scripted too (SHLaunchSessionByUri(L"app://614edbb1-18e2-4f4d-b706-f53e52614894/_default", &session) returns 0x80040202 - probably "Unable to open the access token of the current thread" - do you know this error anybody?). Do not close native part and start console yourself, select HaRET by Telnet from the menu.
[Windows Phone 7 Development and Hacking] jessenic:
I can't get any output for watch GPIOS 10 on my Omnia 7. Does it work for you?
[Windows Phone 7 Development and Hacking] Martin7Pro:
Try start native HaRET part under debugger, see standard output, showing GPIO functions initialisation. WPF Telnet console must show the same as external Telnet client.

You can also change haret.exe application in HaRET_WP7 subdirectory for your own version, change line 172 in MainPage.xaml.cs to right version (now "HaRET Version pre-0.5.3-20140101_154118", this is HaRET window title), eventually change driver in Windows subdirectory, recompile, redeploy application and start initialisation again. Managed code is attached. Native code must be cleaned before publishing.

Console communicates with HaRET window by:

HWND hw = ::FindWindow(NULL, WindowTitle);
.....
PostMessage(hw,WM_COMMAND,MAKEWPARAM(uParam,0),0); // Send Listen request

WindowTitle and uParam are filled from managed part to HaRET window title and Listen to network connection button ID.
[Windows Phone 7 Development and Hacking] jessenic:
Still don't get anything, WATCH GPIOS 10 just outputs "Beginning memory tracing" but no GPIO events.
[Windows Phone 7 Development and Hacking] Martin7Pro:
I seen this response to WATCH GPIOS 10:

Can you check next files, its dates and registry values on your device in relation to last added XAP here?

[HKEY_CLASSES_ROOT\.bat]

@="batchfile"

"Content Type"="application/shbatch"

[HKEY_CLASSES_ROOT\batchfile]

[HKEY_CLASSES_ROOT\batchfile\Shell]

[HKEY_CLASSES_ROOT\batchfile\Shell\Open]

[HKEY_CLASSES_ROOT\batchfile\Shell\Open\Command]

@="SHBatch.exe "%1""

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\KMDriver]

"Flags"=dword:00000000

"Dll"="KMDriver.dll"

"Index"=dword:00000001

"Order"=dword:00000004

"DeviceArrayIndex"=dword:00000002

"IClass"=hex(7):\

7b,41,33,32,39,34,32,42,37,2d,39,32,30,43,2d,34,38,36,62,2d,42,30,45,36,2d,\

39,32,41,37,30,32,41,39,39,42,33,35,7d,00,00

"Prefix"="KMD"

[HKEY_LOCAL_MACHINE\init\BootVars]

"NXSupport"=dword:00000000

"\HaRET_WP7\startup.txt"

"\HaRET_WP7\LaunchHaRET.bat"

"\Registry\KMDriver.reg"

"\Registry\BatchFile.reg"

"\Windows\KMDriver.dll"

"\Windows\KMDriverWrapper.dll"

"\Windows\kmodedll.dll"

"\Windows\ace_ddi.dll"

"\Windows\gx.dll"

"\Windows\StartUp\HaRETLauncher.lnk"
[Windows Phone 7 Development and Hacking] jessenic:
Well it might be the ROM I'm using, but cannot flash another as the camera key isn't working :(

And everything seems to be fine (files, registry etc)
[Windows Phone 7 Development and Hacking] Martin7Pro:
You can try LOG FileName. But I have got HR after last logging!
[Windows Phone 7 Development and Hacking] Robbie P:
Hi there, I am about to start to flash wp7.8 to my spare hd2 (backing up sdcard atm)

I will try and boot an sd android build if at all possible

Is there anything you would like me to test

Thanks

Edit; ~I got it to playsound 2

And i got a lot of output for watch gpios 10

gonna try to get it to run the command lines from android startup.txt, wish me luck:fingers-crossed:

Edit; not having much luck yet

got some errors (failed to load \haret_wp7\zImage and failed to lock 1161 pages (code 6)), but have put all the android files into \HaRET_WP7\ and now get no errors when i press "run", but nothing happens.

Is there a way to have haret.exe on the fat partition (\Storage card\), and run it from there. My file explorer wont execute .exe files, is there one that will?
[Windows Phone 7 Development and Hacking] Martin7Pro:
Hi Robbie. Be carefull, HaRET is danger still on WP7. Please, refer here, what action and how many times has success, what action causes application or system hanging (soft reset or battery leaving needed), what action causes soft reset itself and if any action causes hard reset or unbootable system (I seen any times HTC on booting, but unfinished OS loading, Zune Backup restoring was needed). I seen all those phenomena, but I mean totally randomly. Sometime the same action caused hanging when repeated 3-4 times. It is also possible my device is corrupted from first Linux booting attempt. We must repair basic instability first, before finishing GPU and SD access and trying Linux booting.

---------- Post added at 11:27 PM ---------- Previous post was at 11:17 PM ----------

Big request for C# coder here:

I used limited TextBox for Console Input/Output. There is problem os 2048 pixels limit of Microsoft WPF scrollable controls. You can see this limitation for example when using HELP HaRET directive. I know html/javascript elements can be used, but with another limitations. Are you anybody able to make Class, using TextBox wrapped by Scollable Element, which will react to vertical manipulation by changin partial view of long text? I mean it can solve large text editor in WP7 WPF application, but I am too busy for coding it and I am not experience C# coder. You can use zip from this page for any WPF changes. Little note: I need both orientation support, becouse I use HW keyboard on HTC7Pro. I mean little BT keyboards will connected to much WP7 devices too, then landscape possibility is succesfull too.
[Windows Phone 7 Development and Hacking] jessenic:
I can surely take a look at the C# part tomorrow and I'll see if I can get my phone flashed with another ROM.
[Windows Phone 7 Development and Hacking] Robbie P:
Good points, only had a soft reboot once so far, on starting up the app after a (intended) reboot, but it could be the rom i am using (pdaimatejam wp7.8 v8.8)

on step 5 of your instructions after rebooting it went straight into the haret ui (not console)

Seems to be ok elsewise, how can i get a log for you?

Edit; Ok i got it to run from the fat partition using file explorer from heathcliff74's root tools, but i can't get the telnet connection since it is running directly. And am getting "error-Failed to lock 1161 pages (code 6)" again

Edit; Thinking about the 1161, the system.ext4 image is 116Mb so i guess that the android kernel and ramdisk have loaded but the system isn't
[Windows Phone 7 Development and Hacking] Robbie P:
Is there a way to edit the console app to reference \Storage card\***\haret.exe instead of \HaRET_WP7\haret.exe? In my case ***=BBCM7 (i am using sd build here http://xdaforums.com/showthread.php?t=2290298 for any other intrepid hd2 users only)

Edit; I seem to get the console app to communicate with the haret.exe running from the fat partition by starting haret first, then starting the app and connect with telnet. But i think haret is having problems reading any scripts. firstly i can only use capital letters from the keyboard in the console app. if i delete anything, haret does not seem to notice the deletion, some operators are not being recognised eg =._ and sometimes it just misreads the command.

This is the text i am trying to send

i get messages like "cant find INITRDGZ" and CMDLINE=RELPATHBBCM7