Request to the Forum Moderators.

Status
Not open for further replies.

djamol

Senior Member
Jun 3, 2014
444
405
0
29
Pune
www.twitter.com
lol, yes I got that. I just dont understand where you want me to use them in the registry editor.


Just check out targeted manifest file. Look out the InProcessServer, ActivableClasses. This mean your component is registered for that app.

Then, you "SHOULD BE" use that component. Don't use external libs. Because they are not registered for that app. Got it ?

We are just taking advantages of Registered components. That's it !
 

djamol

Senior Member
Jun 3, 2014
444
405
0
29
Pune
www.twitter.com
The exception is FileNotFound. It's referring to a StubHelper library. I may be able to dig down to it.

I use exception handling in all my apps.


Hahahaha, lol, how's i guess that your .wimd file is corrupted ?

Just had fun. I don't know the reason but it won't work with any version of that lib. Ok take a serious.



If we really want to use external libs ?

Then we need to make a clone of lib.

We'll take an example:-

1. Nokia's "RegistryRT" lib.

2. @GoodDayToDie's native "Registry" lib.

Such as "Registry.NativeRegistry" to

"RegistryRT.CRegistryRT".

Then we can use your library as registered component.

I bet, it'll work definetly.



Edit:

We have to Work with all team members. We have to take a task one by one. We need to work as a Team. Our efforts will never waste. We just need planning organisation and i really hope for that. We can achive lot's thing's with team work.
 
Last edited:

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,930
0
Seattle
I don't think you quite understand the problem. The libs work fine. They just aren't written for high-privilege access, so they don't do what it takes to get it. Here's how a normal native function call works in WP8:
1) Managed (.NET) code calls a function in a .WINMD file.
2) The .DLL corresponding to the .WINMD is loaded into the process address space, if not already present. The native function matching the one the program called is identified.
3) The function's parameters are "Marshaled" into native code parameters, which (among other things) converts a .NET System.String object to a C++/CX Platform::String object.
4) The native function is called, and executes within the process that called it. It has no more or less privileges than its caller. During this process, the native code may call other native code.
5) The return value of the native function is marshaled back into managed types.
6) The managed code receives the returned value and proceeds to do whatever its next instruction is.

Note that every part of this happens inside the app's address space. Therefore, every part of it happens with the app's token (apps don't have enough privileges to impersonate, in case you were wondering). App tokens tend to have very little access. Some capabilities that are available to OEMs give extra access, but it's still basically just a whitelist of places you can reach. The ID_CAP_INTEROPSERVICES capability is a little different. It says that an app can make Remote Procedure Calls (RPC), which means the app can now tell other processes to do stuff, and that stuff gets done outside of the app and therefore with different privileges. Here's now that works:

1-3) Same as above.
4) The native function is called. Rather than executing the operation itself, it instead opens a connection to a particular RPC service, assuming such a connection isn't already open. The native code then marshals its parameters again, but instead of marshaling them for managed/native interop, it marshals them to be passed between processes.
5) The native function uses a native Windows mechanism for communicating between processes (inter-process communication or IPC) to tell that RPC service "hey, call function X with these parameters" and passes the parameters.
6) The native function - indeed, that whole thread of the app - stops executing for a while. On the RPC service, a thread that was waiting for an incoming call wakes up.
7) The RPC service receives the request to run the function, and the parameters to run it with. The function begins executing within the RPC service, using the RPC service's security ID (usually SYSTEM, the Windows equivalent of "root").
8) The RPC service completes execution and marshals the return value for passing back to our app, then passes it back over the channel that the request came from.
9) The native code in the app, having received the result of executing the function, wakes up and marshals the response from the RPC server from native types to managed types.
10) Same as #6 above.

Those extra steps - sending the function over to the RPC service to have it executed under different privileges, and then waiting until the RPC service does so and sends the result back - are why some function calls run with much higher privileges than others. You can't just make a high-privilege copy of a library; first you need to even *find* a high-privilege RPC service that will run that function, then you need to write the code to open a connection to the service, pass it the function call, and receive the response. Nokia might not even *have* a RPC service that allows writing to arbitrary memory locations. If it does, there's no RPC client - the native library we have our app use - which will do that, so we would first need to find the RPC service and figure out how to call it, then write the RPC client to make the call. This is not impossible (assuming such a service really does exist) but it's not a simple thing. If that service doesn't exist at all, we are in trouble.

There are still other cool things you can do with this kind of access. For example, some of the stuff that our registry tweaks do is in locations which an OEM app could write to, so we can hijack an OEM app's chamber to do that for us without worrying about RPC at all. This includes things like creating special accent colors, but not things like Full FS Access (that requires writing to places OEM apps can't even *read* unless they have an RPC service do it for them). It also expands the area we can search for other, better hacks. But it looks like HTC and Nokia may have been a step ahead of us even here.
 

reker

Senior Member
May 23, 2009
124
168
0
Shanghai
Can you give us step by step in depth as to what you did in order to get this to work? Especially ALL steps involving the SD Card. Did you have to remove the SD Card, place it in your computer and then copy the files over?

I haven't been able to view the inside of the app container from a store app on the sd card using your trick with the Pocket File Manager at all.

:EDIT:: IT WORKS!
How it works? I tried Pocket File Manager, and could only see deployed apps, store app folders are all empty.
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,930
0
Seattle
Thanks Spavlin, but we already had all of that. Nearly all Samsung homebrew, including the BootstrapSamsung app to enable capability-unlock, are based on it. That's not to say it has no value to extract that stuff, but it doesn't help for non-Samsung phones. :-/
 

MameTozhio

Senior Member
Apr 27, 2013
2,457
1,365
0
21
I'd assume the Preview for Developers app has special capabilities, maybe it could be experimented with.
 
Last edited:

fonix232

Senior Member
Jun 20, 2009
1,054
553
143
London
It doesn't have INTEROPSERVICES as I know !
are you sure ?
The Developer Preview app does not do much - it only flips a switch that makes the phone request developer preview builds instead of stable ones.

It is possible it does something to the registry but I highly doubt it.
 

ngame

Senior Member
Mar 13, 2012
1,126
545
0
Mashad
The Developer Preview app does not do much - it only flips a switch that makes the phone request developer preview builds instead of stable ones.

It is possible it does something to the registry but I highly doubt it.
I accept this .
for those users who do not have Glance Background you can also use Nokia Care I think
[Edited :]
Code:
<?xml version="1.0" encoding="utf-8"?>
<Deployment AppPlatformVersion="8.0" xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment">
  <DefaultLanguage code="en" xmlns="" />
  <Languages xmlns="">
    <Language code="en-GB" />
    <Language code="en-US" />
    <Language code="es-MX" />
    <Language code="zh-CN" />
    <Language code="zh-TW" />
    <Language code="ko-KR" />
    <Language code="vi-VN" />
    <Language code="fr-FR" />
    <Language code="pt-BR" />
    <Language code="de-DE" />
    <Language code="ru-RU" />
    <Language code="it-IT" />
    <Language code="fi-FI" />
    <Language code="sv-SE" />
    <Language code="da-DK" />
    <Language code="nb-NO" />
    <Language code="tr-TR" />
    <Language code="th-TH" />
    <Language code="ar-SA" />
    <Language code="ms-MY" />
    <Language code="hi-IN" />
    <Language code="pl-PL" />
    <Language code="es-ES" />
    <Language code="az-Latn-AZ" />
    <Language code="be-BY" />
    <Language code="bg-BG" />
    <Language code="ca-ES" />
    <Language code="cs-CZ" />
    <Language code="el-GR" />
    <Language code="et-EE" />
    <Language code="fa-IR" />
    <Language code="fil-PH" />
    <Language code="he-IL" />
    <Language code="hr-HR" />
    <Language code="hu-HU" />
    <Language code="id-ID" />
    <Language code="ja-JP" />
    <Language code="kk-KZ" />
    <Language code="lt-LT" />
    <Language code="lv-LV" />
    <Language code="mk-MK" />
    <Language code="nl-NL" />
    <Language code="pt-PT" />
    <Language code="ro-RO" />
    <Language code="sk-SK" />
    <Language code="sl-SI" />
    <Language code="sq-AL" />
    <Language code="sr-Latn-CS" />
    <Language code="uk-UA" />
    <Language code="uz-Latn-UZ" />
    <Language code="fr-CA" />
  </Languages>
  <App Author="Nokia Corporation" Description="Sample description" Genre="apps.normal" ProductID="{ccfdca81-e2fe-44bd-8957-d0c55c636933}" Publisher="Nokia Corporation" PublisherID="{79d73754-db4a-4fcb-9b57-f2088eb2f225}" RuntimeType="Silverlight" Title="@AppResLib.dll,-1" Version="1.3.0.6" xmlns="" IsBeta="false" PublisherId="{79d73754-db4a-4fcb-9b57-f2088eb2f225}">
    <IconPath IsRelative="true" IsResource="false">Onboarding_UI_List_99.png</IconPath>
    <Capabilities>
      <Capability Name="ID_CAP_IDENTITY_DEVICE" />
      <Capability Name="ID_CAP_IDENTITY_USER" />
      <Capability Name="ID_CAP_LOCATION" />
      <Capability Name="ID_CAP_NETWORKING" />
      <Capability Name="ID_CAP_PHONEDIALER" />
      <Capability Name="ID_CAP_SENSORS" />
      <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
      <Capability Name="ID_CAP_CONTACTS" />
      <Capability Name="ID_CAP_APPOINTMENTS" />
      <Capability Name="ID_CAP_MEDIALIB_AUDIO" />
      <Capability Name="ID_CAP_MEDIALIB_PHOTO" />
      <Capability Name="ID_CAP_INTEROPSERVICES" />
      <Capability Name="ID_CAP_MAP" />
      <Capability Name="ID_CAP_OEMPUBLICDIRECTORY" />
    </Capabilities>
    <Tasks>
      <DefaultTask Name="_default" NavigationPage="/Pages/MainPage.xaml" />
    </Tasks>
    <Tokens>
      <PrimaryToken TaskName="_default" TokenID="QuickStartToken">
        <TemplateFlip>
          <SmallImageURI IsRelative="true" IsResource="false">Onboarding_UI_Small_159.png</SmallImageURI>
          <Count>0</Count>
          <BackgroundImageURI IsRelative="true" IsResource="false">Onboarding_UI_Medium_336.png</BackgroundImageURI>
          <Title>@AppResLib.dll,-2</Title>
          <BackContent>@AppResLib.dll,-3</BackContent>
          <BackBackgroundImageURI IsRelative="true" IsResource="false">Onboarding_UI_Medium_336.png</BackBackgroundImageURI>
          <BackTitle>@AppResLib.dll,-2</BackTitle>
          <DeviceLockImageURI></DeviceLockImageURI>
          <HasLarge>False</HasLarge>
        </TemplateFlip>
      </PrimaryToken>
    </Tokens>
    <Extensions>
      <Protocol Name="nokia-care" NavUriFragment="encodedLaunchUri=%s" TaskID="_default" />
    </Extensions>
    <ActivatableClasses>
      <InProcessServer>
        <Path>OnboardingRT.dll</Path>
        <ActivatableClass ActivatableClassId="OnboardingRuntime.COnboardingRuntime" ThreadingModel="both" />
      </InProcessServer>
      <InProcessServer>
        <Path>NokiaAnalyticsNative.dll</Path>
        <ActivatableClass ActivatableClassId="NokiaAnalyticsNative.CNARegistryBridge" ThreadingModel="both" />
      </InProcessServer>
    </ActivatableClasses>
    <ScreenResolutions>
      <ScreenResolution Name="ID_RESOLUTION_WVGA" />
      <ScreenResolution Name="ID_RESOLUTION_WXGA" />
      <ScreenResolution Name="ID_RESOLUTION_HD720P" />
    </ScreenResolutions>
  </App>
</Deployment>
 
Last edited:

djamol

Senior Member
Jun 3, 2014
444
405
0
29
Pune
www.twitter.com
"Preview For Developers" has a right's to write the Registry but as "INDIRECTLY", Just like a toggle switch so that is no point.

@GoodDayToDie.
I mean that, we can use external libs in that way and it is possible 100%.
Solved issues about the NrsRuntime. (ex File_Not_Found). Just forgot to add another class for it(for Instance and runtime) but it's getting me different thread.
Anyway can you provide me a clone of your library? when you will get free time. I really want to research on it in deep, for my pleasure. PM me, I'll back again after my exams at 4th Dec.
Thanks.

Edit:-

"NrsRuntime" writes the values under,

"\Registry\Machine\System\..."

But confused, which one ? HKLM or another? I'll send you pm soon, just checkout. Wrote a rough code, but it's working.
 
Last edited:
  • Like
Reactions: matgras

fonix232

Senior Member
Jun 20, 2009
1,054
553
143
London
"Preview For Developers" has a right's to write the Registry but as "INDIRECTLY", Just like a toggle switch so that is no point.

@GoodDayToDie.
I mean that, we can use external libs in that way and it is possible 100%.
Solved issues about the NrsRuntime. (ex File_Not_Found). Just forgot to add another class for it(for Instance and runtime) but it's getting me different thread.
Anyway can you provide me a clone of your library? when you will get free time. I really want to research on it in deep, for my pleasure. PM me, I'll back again after my exams at 4th Dec.

Thanks.
That was my point. It invokes a system function which edits one and only one specific registry field. It cannot be used.
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,930
0
Seattle
Preview For Developers only has one interesting Capability, but it's a pretty interesting one. Using that capability will give write access to a small portion of the registry. Incidentally, it does in fact write to the registry directly (it would need interopservices to write indirectly). However, the library it uses to do the writing may not be useful for anything else; I haven't checked. In any case, it doesn't give *more* access than any of a number of other OEM or first-party apps' chambers.
@djamol: Some keys under HKLM\System are writable by the right capabilities (without interop, I mean), but it's still possible that NrsRuntime uses interop to gain the ability to write to other places. Worth checking out, for sure. Do please send me that code, or post it here. The simple test app I wrote is attached to this message. It's really basic; I haven't yet tried to do anything particular to make NrsRuntime work so it may just be that it needs a library that I'm not including or something equally silly.
 

Attachments

Status
Not open for further replies.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone