yashsingh1/xdaforums huggingface dataset:
[Windows Phone 7 Development and Hacking] Martin7Pro:
Do you know anybody, how to switch off checkrelocs ("There is an external reference from a standalone haret section") in application, but to switch on in kernel dll? I publish actual errorneeous source code (with strictly divided kernel and user parts) for study (it will removed after repair). Error first aid is (in makefile):

#####	@echo " Checking for relocations"

#####	$(Q)tools/checkrelocs $(filter %.o,$^)

Little change to attached source haret.cpp:

...
case WM_DESTROY:
{
Output("WM_DESTROY");
if (hLibrary)
{
destroyWindowTreeUpdater = (DESTROYWINDOWTREEUPDATER)GetProcAddress(hLibrary, L"DeleteWindowTreeUpdater");
if (destroyWindowTreeUpdater)
{
destroyWindowTreeUpdater(hWindowTreeUpdater);
}
FreeLibrary(hLibrary);
hLibrary = NULL;
}
return TRUE;
} break;
...
...
case BT_EXIT:
{
Output("BT_EXIT");
EndDialog (hWnd, IDOK);
return TRUE;
} break;
...

jessenic: See "Exit" button (with code change above, hLibrary is static/global variable here). This enables correct debugging session ending and graphical WP7 manager cleaning too for HaRET application. You can prepare any working parts to github, but not all actual state. I mean assembler part is better usable from HaRET 0.3.8 version to kernel dll (now dividing is tried, but very complicated - see TODO), but we must find first, if anyhing is not missing in this version assembler part.

EDIT: My phone is bricked now! No boot,

no flashing

is possible (tricolore and USB mode seems OK, but flashing returns error 266 immediatelly). EDIT2: Power+Volume up works too, then I did hard reset, now phone seems OK, but without all data. EDIT3: Flashing is possible, but by GoldCard only, where Y-cable is connected to original HTC charger (higher voltage and hard current) instead of computer. Problem seems not in SPL, but in USB port behaviour. I remember this device had USB problems in past too, may be it is not a HaRET using reason. But OS destroying is HaRET work sure, be carefull (do backup) to use this version!

---------- Post added at 01:36 AM ---------- Previous post was at 01:31 AM ----------

I mean it is not similarly simply on CE6/CE7 based system. All hybrid code is present twice (two different dlls for both modes) on newer CE systems. Would be Microsoft does more work internally, if it is so simply? I mean not, both modes have own memory managers and different mapping structures probably.
[Windows Phone 7 Development and Hacking] spavlin:
RWLock coredll.dll WP7

View attachment 1819190
[Windows Phone 7 Development and Hacking] ultrashot:
"trap" function has never been interesting for anyone ;)
[Windows Phone 7 Development and Hacking] Martin7Pro:
Can you write more?
[Windows Phone 7 Development and Hacking] ultrashot:
https://encrypted-tbn3.gstatic.com/...4RlTcUb2wd4hqkwuztRpZPozlOqwAiIMC9tJtmrpwb0WL

the code from his picture is a "trap" function - it calls kernel's SetKMode
[Windows Phone 7 Development and Hacking] Martin7Pro:
Delay

Sorry for delay. I have got unused phone from last HaRET using, then I made:

1. Full internal memory cleaning.

2. SD card changing to 32GB class 10 (I can recommend it for everybody). One screw was lying on the table after the repair and I do not know where it belongs :).

3. Data restoring (big thanks to Ultrashot).

4. Actualisations (unfortunately, Microsoft is lying again, the phone with 8860+8862 updates under LockScreen very quickly discharged too, all livetiles closing helps only). I hope we will have WM6, Ubuntu or RT on our WP7 devices in near future. My very old S80 devices knew how much more and lasted a week on a single charge.

5. Finishing WP7 native FTP Client library, you are welcome for testing.

Next weak I have very much work in a occupation, but I hope I will send to Jessenic much HaRET updates next weakend.
[Windows Phone 7 Development and Hacking] AntiBillOS:
Haret is best idea for our WP7 phones! If it start work (start load Linux kernel) it be verry good!

I do some playing with Omnia i900 + haret (summer 2012). I even build new Linux kernel for test. This is greate method!

Sorry for spam and i hope you get it work! Good luck guys!!!
[Windows Phone 7 Development and Hacking] Martin7Pro:
Code checking request

Hi friends. If you wait for Silverlight UI HaRET xap version, help me, please, with very small low-level coding http://xdaforums.com/showthread.php?t=2208647 . I can use blocking queue, but unmanaged/managed switching can be too slow for HaRET time critical operations. There is possible to use two piped blocking queues, but I mean unblocking one can be better solution Also for other needed applications. When I will solute problem of Silverlight UI controls controlled by unmanaged threads, I will publish here HaRET version, which will offer to everybody:

1. installing as usual homebrew application,

2. working without any PC/net connection,

3. showing output in scrollable WPF control,

4. sending immediatelly on device editable directions (scripts) to HaRET for testing (on device feature like HaRET console).

But, I am afraid to base it all on unchecked, possible danger code. Thanks you for any answer.

________________________________

Nobody checked it still. I tried simplified managed UI/native library callbacks in FTP Client example. It seems working, I will try to make Silverlight HaRET version.

________________________________

Sorry, I am too busy now. Silverlight seems to be too buggy for simple UI creating. Is there no one WP7 WPF coder for co-operation? And also anybody Linux experienced, able to change HaRET source makefile from exe to native dll? I have prepared managed/native callbacks interface, but HaRET transfering to dll and any simple Silverlight UI structures are needed still.
[Windows Phone 7 Development and Hacking] icomn:
may be dcordes should help?
[Windows Phone 7 Development and Hacking] Martin7Pro:
Thanks for answer. I mean all experienced C/C++ coders are busy now, but may be exe->dll makefile converting is probably one minute problem only for them. My bigger request is for any student, which have got free time to try VS express for WP and it's features, which seem to be very strange for me (for example TextBlock behaviour, where only any first part of content is visible on the device, but all content is visible on emulator, memory leaking in managed part, etc, etc).
[Windows Phone 7 Development and Hacking] Martin7Pro:
Nobody is here able to make simple Silverlight UI? I can share managed callbacks source and HaRET kernel driver unfinished features ideas, but I am too busy to finish working XAP now. It may be a lot of work, but mechanical by MS tutorials only, no advanced experience is needed. Sorry, I have got many PMs in last time from people wanting HaRET working, but, it seems no one want to do any simple part of needed work. When XAP will finished, every unlocked WP7 phone owners will able to make and to test own HaRET scripts without telnet connection, to be Linux/Android/... runnable in future on WP7 devices. I am not sure if it is really possible due to SD card WP specific formatting, but may be it will not the biggest problem.
[Windows Phone 7 Development and Hacking] Jaxbot:
That sounds like the easy part; if it's not done when the actual HaRET part nears completion, I might be able to take a stab at it. We'll see, though; I'm in the middle of the worst exam week (month) of my life, so I'll be afk until June.
[Windows Phone 7 Development and Hacking] reker:
I think native window+UpdateWindowTree is a simple way, and it can be easily modify to fit the needs of development
[Windows Phone 7 Development and Hacking] Martin7Pro:
Hi reker. I mean there are three reasons for WPF UI:

1. Too small coders community here. I am able to finish HaRET WP7 myself, but I am too busy for any next months everyday coding. Ultrashot is able to finish something like HaRET very quickly, but he is the most busy man here. I mean dcordes or jessenic are able too, but also too busy. For two to three years HaRET for wp7 will not be relevant already. I do not like Silverlight and garbage collector really. But, it is prefered techology now and it allows relative rapid development for total coding beginners. Then we must be open for C#/WPF coders.

2. Remote Linux console is relatively good accesory. I mean, on-device HaRET console in simply XAP version is much better solution for large community. We need large community for all WP7 devices IO Maps creating.

3. For example, I have got HTC7Pro, probably the most Linux-friendly hardware possible. But, native API for automatical landscape orientation support is removed from WP7 by MS. There are possibilities to make landscape by any own way, but why, when WP7 Silverlight have got full landscape support? Portrait orientation is very bad for my phone.

I am preparing another universal solution now - my own WP7 simply named pipes implementation (MS removed pipes from native API). It will allowe any interprocess communication include managed-native cooperation in the same or more different address spaces a different user/kernel too. Then, we will can use finished native HaRET application and to code independent managed XAP as UI, able to start native application on the background (just soluted) and communicate with it by pipes. This solution will usable for much other utilities too.
[Windows Phone 7 Development and Hacking] icomn:
Any chance to finish haret project ???
[Windows Phone 7 Development and Hacking] Martin7Pro:
Busy, busy, busy, busy, busy, busy, busy, busy, busy, ...

I hope later.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Important question again

I have got no answer to my old repeated question: Is really possible to run Android without full SD card access? How works Android under HaRET on WM devices? Is possible to use virtualised storage device only (img file, accessible by WP7 filesystem functions), or full physical access is neaded? It may be much bigger problem, then processor and physical memory access (just soluted). I mean a card will accessible as other HW, but after any access it will unusable for WP7 booting, is not it? I mean my phone hard reset was probably caused by SD card acces in Linux booting attempt time. Is possible to modify linux/Android to use any subpart of WP7 encrypted storage, or to use external SD card reader, connected by reverse USB cable and external power source? Is possible to boot Linux/Android to memory only (any ramdisk using SD card instead)?
[Windows Phone 7 Development and Hacking] GodlikePL:
Dear Martin7Pro,

I still have WP7 device and still want it to boot WP8 or Android. MS has fu****me with WP8, also WP8 phones are mostly plastic and ****ty so i wont change HTC Mozart to new device and wait for new possibilities but you should mind that many poeple will just change phone to the WP8 in next months and you will later work hard for no-one. So i propose that you should complete this project in next months.

I dont know how far are you with your work, i also dont know how hard it is, im just C#/PHP coder with no understanding of C++ as it is obsolete language for me. I just want to thank you for everything you've done and wish you success with later works.

Regards
[Windows Phone 7 Development and Hacking] Useless guy:
Your HTC Mozart lags even on WP7. I'm telling it as a HTC HD7 owner.

Please stop asking for ETA and hurrying developers. That won't help.
[Windows Phone 7 Development and Hacking] GodlikePL:
Im not hurrying developers, just some facts.

And i dont know here you find that Mozart lags, HD7 is on same SoC so fail.

Stop offtop. No more no-developer replies.
[Windows Phone 7 Development and Hacking] Martin7Pro:
I mean this post was relevant, not hurrying. There is actual state:

Jessenic versions are usable for HaRET console using (need Linux or Cygwin on connected PC). Those versions use my physical memory access driver library, which is unfinished now. Finishing is mechanical work only - to add more assembler macros by WM HaRET IO access modules is needed. But, those versions are very danger for now, when you try Linux booting - I have got hard-reseted device by it. First must be created IO maps for devices and SD card access soluted fo safe Linux booting.

I want to make ondevice HaRET console version for easier hardware testing. But, it depends on much my unfinished projects:

1. registry management library,

2. shell interpreter,

3. universal installer/scheduler,

4. named pipes native and managed library,

5. simply HaRET console XAP, communicated with HaRET application by pipes.

Order of finishing must be from 1 to 5, then I must found much free time to get status for WPF developers cooperation (console will very simple WPF application, but communication way must be finished first).

When we will have simple XAP for ondevice HW testing, much people can work on IO maps creating for different WP7 devices.

Little note: WP7 devices have got better hardware configuration, then any years old WinXP game machines! Lagging is OS creators idiocy, not hardware insufficiency. More cores and quicker processor can help, but it is only OS creators mistakes repairing.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Sorry I've been away for a while, checking in again here... have you fixed or worked around the lack of a SetKMode API? Because I can tell somebody how to implement that using the HtcUtility driver, if you'd like. The steps are pretty basic:

Method 1: Change the saved processor state register while the target app is not in the foreground.

Use the driver to walk the list of process sturctures (as the HtcRoot project does).

Upon finding your process, read the the saved register file.

Use an OR mask to set the bit for Ring0/Kernel/Supervisor/whatever-the-hell-ARM-calls-it in the processor state/flags/whatever register.

Use the driver to write that register value back into your app's register file.

Upon returning from the driver's process to your process, you should be a kernel-mode process.

Method 2: Create an actual SetKMode function and modify the syscall table to use it.

Write a function that, if it were to execute in kernel mode, could do the following:

Find the saved process state from a system call (which I believe will hold the old processor state register, spo it can be restored).

Flip the bit controlling kernel mode.

Use (not in the above function) the HtcUtility driver to save, then overwrite, a system call function pointer or an interrupt handler to instead point to the address of the function.

Invoke that system call or trigger that interrupt.

Restore the kernel function pointer (should be possible to do it directly now).
[Windows Phone 7 Development and Hacking] Martin7Pro:
We implemented system calls and physical memory access by kernel driver and memory marshalling any months ago in latest jessenic's version (see github). But, there are more complicated problems for now (see my latest posts). WP7 HaRET finishing is very slow by two reasons - 1. I am too busy now for large missing API substitution and MS idiots restrictions hacking, 2. I need fully working native debugger urgently (HaRET late versions contain code parts unintelligible for me without sofisticated realtime debugging). Latest MSVC HaRET version (3.8) is very clear for me, but it is too old for a meaningful using. Andrew Zabolotny MSVC coding is autocommenting, but later GCC HaRET versions authors used Perl-like "one-way programming" in my opinion and no one answered for my co-operation request.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Ah. Sadly, I doubt I'd be able to help much; I have zero familiarity with HaRET and would be working from the ground up.
[Windows Phone 7 Development and Hacking] Robbie P:
Hi Martin, I have the feeling that android will need it's own (primary) partition(s) on sdcard. On the HD2, dual booting is achieved in a number of ways but it is dependant on there being an existing FAT partition on the SDcard which is used by WP7 for logs etc and is 200MB FAT16. I am not sure if this exists for all WP7 phones. If it does exist, there are CAB files which can be used to unlock and expand the storage area to various sizes in FAT32 and set as primary(see storage part of OP in this thread), that is if the card is not removable from phone.

Android builds that run entirely from SDcard need the partition to be a primary partition for android itself to access the card, so if the removed card is formatted and partitioned on PC (which is possible too), it must be set as primary.

SD builds can be a little slow depending on speed of sdcard. The HD2 has another way of booting android called nativeSD which boots from the FAT32 but uses an EXT4 partition to load/run the android system and data from (so 3 partitions are used FAT, EXT4 and WP7). The EXT4 could be created from PC or by using a Recovery.

Hope this all helps
[Windows Phone 7 Development and Hacking] GodlikePL:
It's microSD card in HTC Mozart and Trophy. Just dissasemble and you can replace it with bigger capacity :)
[Windows Phone 7 Development and Hacking] Robbie P:
The day before yesterday I tried Jessenic's haret build 21, but could not get haret to execute as before here.

I think the only difference is that I updated to 8862 from 8858. Is this because Microsoft have done something in the update?

---------- Post added at 08:35 PM ---------- Previous post was at 08:33 PM ----------

The storage/extrapart CABs I linked to before might be easier;)
[Windows Phone 7 Development and Hacking] Robbie P:
See here, would be good to see if they work on native devices.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
BTW, don't get your hopes up on the SD card partitioning; WP7 actually uses the Secure part of SD to lock the card and prevent other access. If you partitioned it before installing, Linux might be able to use the other partition (assuming that the phone didn't nuke and rebuild the partition table) but so far nobody has managed to get the data out again; just wiping the card emough to make it *usable* in other devices takes work.
[Windows Phone 7 Development and Hacking] GodlikePL:
No problem, we can wipe all the data if it be needed to install WP8 or Android and install WP7 again if something goes wrong, remember that in these two models cards are easily removable.

Regards
[Windows Phone 7 Development and Hacking] Kr3i0s:
The SD Card removable in HTC 7 Pro(Gold) as well.
[Windows Phone 7 Development and Hacking] Robbie P:
Latest HD2 WP7 roms do not use encryption on the sdcard.

Native WP7 phone SDcards are encrypted and do not show up on PC or linux afaik.

It is possible to send dev-storagelock.cab to unlock the card on nativeWP7 (see http://xdaforums.com/showthread.php?p=22939884) but xboxmod certificate may need to be on phone first, not sure about this.
[Windows Phone 7 Development and Hacking] Kr3i0s:
I have tried sending the xboxmod cab for the partioning to my HTC 7 Pro . Although cab is sent successfully and the phone shows it had been successfully updated the size of the card does not change when I check back in WP7

i have no idea how to go about it.
[Windows Phone 7 Development and Hacking] Robbie P:
You need to do a settings/about/reset_your _phone for the partition to take effect.

Back up your phone first, if you haven't done so already.
[Windows Phone 7 Development and Hacking] Kr3i0s:
I have not been able to take a backup yet as Wmdc on my PC is not detecting the phone. However I unlocked the storage using xboxmod's cab and put it in the card reader. There were 2 partitions, one 199 MB FAT and the rest as unformatted. I tried HxD and changed the first sector with all 0's but that did not work.
[Windows Phone 7 Development and Hacking] Robbie P:
Sync with zune first (and save your pics)
[Windows Phone 7 Development and Hacking] Martin7Pro:
Thanks for useful info. Next two questions:

1. Exists any HD2 WP7 build using encrypted partition, able to leave any SD card part unformatted (unencrypted)?

2. If not, do you know mechanism of non-encrypted SD HD2 build changing? May be it applicable also to any native WP7 device build (by any cab)? Is enrypting a part of OS Loader, or OS ROM?

I mean all filesystem access API must be changed and format calling too. Is no easier to redirect all linux filesystem access to native WP7 API calling (and stay SD card encryted, contained any "virtual partition" in vmx syle for example)?
[Windows Phone 7 Development and Hacking] Robbie P:
Nearly all HD2 WP7 roms do not encrypt the card, so that when the card is put PC, the 200Mb Fat16 partition is visible. This suggests to me that the encryption process occurs in the ROM.

Only YukiXDA's Back to the Future rom encrypts the card like a native WP7 phone. YukiXDA created the extrapart cabs and storagelock cab to enable dual booting, unfortunately he has left xda.

I don't know how non-encryption is achieved in HD2 ROMS, or whether it can be acheived by sending a cab, perhaps [MENTION=2075341]HD2Owner[/MENTION], [MENTION=489538]xboxmod[/MENTION], [MENTION=1622319]pdaimatejam[/MENTION] or [MENTION=788611]ansar.ath.gr[/MENTION] could help with this:fingers-crossed:
[Windows Phone 7 Development and Hacking] spavlin:
[HKEY_LOCAL_MACHINE\Drivers\BlockDevice\UniBlk]

"Dll"="unifiedblock.dll"

"Profile"="UniBlk"

"Prefix"="DSK"

"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",

"{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

"RamdiskDeviceKey"="Drivers\\BlockDevice\\RAMDisk"

"PairChangeApp"="unifiedpair.exe"

"ExtraPartitionSize"=dword:C8

"ExtraPartitionType"=dword:7

[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\UniBlk]

"DriverPath"="Drivers\\BlockDevice\\UniBlk"

"LoadFlags"=dword:2

"BootPhase"=dword:1

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\RootProfile]

"AutoPart"=dword:1

"AutoFormat"=dword:1

"AutoPartType"=dword:2

"PartitionDriverName"="MSPART"

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

"MountPermanent"=dword:0

"MountAsRoot"=dword:0

"FormatTfat"=dword:1

"CheckForFormat"=dword:1

"Folder"="OSRoot"

"FormatClusterSize"=dword:4000

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\UniBlk]

"AutoPart"=dword:1

"AutoFormat"=dword:1

"AutoPartType"=dword:2

"PartitionDriverName"="MSPART"

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

"MountPermanent"=dword:0

"MountAsRoot"=dword:0

"FormatTfat"=dword:1

"CheckForFormat"=dword:1

"Folder"="OSRoot"

"FormatClusterSize"=dword:4000
[Windows Phone 7 Development and Hacking] titi66200:
And "SDMemory.dll" repaced by "LEO_SDMemory.dll".

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class\EmbeddedHigh_Capacity]

"Dll"="LEO_SDMemory.dll"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class\High_Capacity]

"Dll"="LEO_SDMemory.dll"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class]

"Dll"="LEO_SDMemory.dll"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class\High_Capacity]

"Dll"="LEO_SDMemory.dll"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class]

"Dll"="LEO_SDMemory.dll"