Comments (6)
Glad it worked out. i'm closing this issue but going to pin it to make it informative to other people. In the future it would be best however to have documentation on the repository
from wpinternals.
Hi, thanks for filing an issue on this repo!
Interop Tools seems to be able to access the registry without permission issues (and changes do stick), however this uses the RegistryRT library which makes use of Nt* calls for registry access. I recall older versions of WPinternals also had an SDK and a root access testing app, I'll dig this for you in a sec so you can tell me if both do seem to work.
from wpinternals.
Here's what I found:
SDK.zip
Root Access Test App.zip
Let me know what this results in.
from wpinternals.
This is what the Test app uses by the way:
using System;
using System.Runtime.InteropServices;
namespace RootAccessTestUWP
{
// Token: 0x02000004 RID: 4
public static class Core
{
// Token: 0x0600000D RID: 13
[DllImport("KERNELBASE.DLL", CharSet = 3, SetLastError = true)]
private static extern int RegQueryValueEx(UIntPtr hKey, string lpValueName, int lpReserved, out Core.RegistryValueKind lpType, IntPtr lpData, ref int lpcbData);
// Token: 0x0600000E RID: 14
[DllImport("KERNELBASE.DLL", CharSet = 3)]
private static extern int RegOpenKeyEx(UIntPtr hKey, string subKey, int ulOptions, int samDesired, out UIntPtr hkResult);
// Token: 0x0600000F RID: 15
[DllImport("KERNELBASE.DLL", SetLastError = true)]
private static extern int RegCloseKey(UIntPtr hKey);
// Token: 0x06000010 RID: 16 RVA: 0x000022E0 File Offset: 0x000004E0
internal static string RegReadStringValue(UIntPtr rootKey, string keyPath, string valueName)
{
UIntPtr hKey;
int num = Core.RegOpenKeyEx(rootKey, keyPath, 0, Core.KEY_READ, out hKey);
if (num != 0)
{
throw new COMException("Failed to open registry key", num);
}
int num2 = 1024;
IntPtr intPtr = Marshal.AllocHGlobal(num2);
Core.RegistryValueKind registryValueKind;
num = Core.RegQueryValueEx(hKey, valueName, 0, out registryValueKind, intPtr, ref num2);
if (num != 0)
{
throw new COMException("Failed to read registry value", num);
}
if (registryValueKind != Core.RegistryValueKind.String)
{
throw new Exception("Wrong registry value type");
}
string result = Marshal.PtrToStringUni(intPtr);
Core.RegCloseKey(hKey);
return result;
}
// Token: 0x06000011 RID: 17 RVA: 0x00002358 File Offset: 0x00000558
internal static uint RegReadDwordValue(UIntPtr rootKey, string keyPath, string valueName)
{
UIntPtr hKey;
int num = Core.RegOpenKeyEx(rootKey, keyPath, 0, Core.KEY_READ, out hKey);
if (num != 0)
{
throw new COMException("Failed to open registry key", num);
}
int num2 = 1024;
IntPtr intPtr = Marshal.AllocHGlobal(num2);
Core.RegistryValueKind registryValueKind;
num = Core.RegQueryValueEx(hKey, valueName, 0, out registryValueKind, intPtr, ref num2);
if (num != 0)
{
throw new COMException("Failed to read registry value", num);
}
if (registryValueKind != Core.RegistryValueKind.DWord)
{
throw new Exception("Wrong registry value type");
}
uint result = (uint)Marshal.ReadInt32(intPtr);
Core.RegCloseKey(hKey);
return result;
}
// Token: 0x04000005 RID: 5
public static UIntPtr HKEY_CLASSES_ROOT = (UIntPtr)2147483648U;
// Token: 0x04000006 RID: 6
public static UIntPtr HKEY_CURRENT_USER = (UIntPtr)2147483649U;
// Token: 0x04000007 RID: 7
public static UIntPtr HKEY_LOCAL_MACHINE = (UIntPtr)2147483650U;
// Token: 0x04000008 RID: 8
public static UIntPtr HKEY_USERS = (UIntPtr)2147483651U;
// Token: 0x04000009 RID: 9
private static int KEY_READ = 131097;
// Token: 0x0200000F RID: 15
public enum RegistryValueKind
{
// Token: 0x0400002A RID: 42
Unknown,
// Token: 0x0400002B RID: 43
String,
// Token: 0x0400002C RID: 44
ExpandString,
// Token: 0x0400002D RID: 45
Binary,
// Token: 0x0400002E RID: 46
DWord,
// Token: 0x0400002F RID: 47
MultiString = 7,
// Token: 0x04000030 RID: 48
QWord = 11,
// Token: 0x04000031 RID: 49
None = -1
}
}
}
from wpinternals.
I made available the source for both things on the repo just now as well if you want to take a look (here's the sdk: https://github.com/ReneLergner/WPinternals/tree/master/WPinternalsSDK)
from wpinternals.
Hi Gus, that was super helpful!
Seems that all the magic must be done via kernelbase.dll. Registry editing works.
Environment.ShellExecute assumingly works as well, but I don't known how to redirect inputs yet.
What I noticed that cappability checks are most likely disable for UWPs too, because I was able to use this class:
https://docs.microsoft.com/en-us/uwp/api/windows.ui.input.preview.injection.inputinjector?view=winrt-20348
My goal is to autostart WIFI hotspot right after boot since I bought 640 (for $2) to serve as cheap LTE modem.
I was able to activate the hostpot via inputinject, now I need a way how to autostart the app.
from wpinternals.
Related Issues (20)
- Downloads Tab Crash
- Failed write ro pipe: 4E4F4B53
- Bootloop after unlocking bootloader. HOT 1
- Crash when flashing original ROM (.ffu) HOT 3
- Error Parsing FFU
- Error 0x1106 on FFU flash HOT 1
- Lumia 950 "Failed to unlock bootloader" HOT 2
- bad GPT
- Issues regarding Label mode (the program closes unexpectedly on both cases).
- I can't click on any items HOT 1
- HTC One M8 not appearing HOT 1
- supposedly supported OS version (8.10.12393.890) not supported? HOT 4
- Does WPinternals support HTC 8x (c620t)? HOT 1
- No partitions on a Lumia 640 - is it recoverable? HOT 7
- Enabling root access not work with Windows Phone 8.0.10517.150
- WP internals hanging and freezing when attempting to unlock device HOT 2
- Lumia 950 blue screen during bootloader unlock
- WPInternals crashing/freezing when pressing "unlock" button(RM-1045, Spec B) HOT 8
- No support for rooting Windows phone 8.0 devices (NOT Windows phone 8.1)
- Supported OS bug on Lumia 820 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpinternals.