WIP XUser#33
Conversation
1fdc013 to
65c4dc0
Compare
|
Is this related to be able to login into Microsoft account? like in Minecraft Bedrock? |
Yes that is the purpose, although it is not yet complete |
|
Thank you for working on this! Can't wait to see a working product |
Somehow while pulling this into the default branch locally, for debugging purposes, I had a duplicated type definition error and applied this patchdiff --git a/include/xuser.idl b/include/xuser.idl
index 2f7292b..877c59c 100644
--- a/include/xuser.idl
+++ b/include/xuser.idl
@@ -37,7 +37,6 @@ typedef enum XUserState XUserState;
typedef enum XUserPlatformOperationResult XUserPlatformOperationResult;
typedef enum XUserPlatformSpopOperationResult XUserPlatformSpopOperationResult;
-typedef struct APP_LOCAL_DEVICE_ID APP_LOCAL_DEVICE_ID;
typedef struct XUserDeviceAssociationChange XUserDeviceAssociationChange;
typedef struct XUserGetTokenAndSignatureData XUserGetTokenAndSignatureData;
typedef struct XUserGetTokenAndSignatureHttpHeader XUserGetTokenAndSignatureHttpHeader;
@@ -53,6 +52,20 @@ typedef void (__stdcall *XUserPlatformRemoteConnectShowPromptEventHandler)( PVOI
typedef void (__stdcall *XUserPlatformRemoteConnectClosePromptEventHandler)( PVOID context, UINT32 userIdentifier, XUserPlatformOperation operation );
typedef void (__stdcall *XUserPlatformSpopPromptEventHandler)( PVOID context, UINT32 userIdentifier, XUserPlatformOperation operation, LPCSTR modernGamertag, LPCSTR modernGamertagSuffix );
+cpp_quote("#if 0")
+typedef unsigned __int64 uint64_t;
+typedef __int64 int64_t;
+typedef unsigned __int3264 size_t;
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef unsigned short uint16_t;
+typedef unsigned char uint8_t;
+typedef boolean bool;
+typedef struct APP_LOCAL_DEVICE_ID
+{
+ BYTE value[32];
+} APP_LOCAL_DEVICE_ID;
+cpp_quote("#endif")
enum XUserAddOptions
{
@@ -170,11 +183,6 @@ enum XUserPlatformSpopOperationResult
XUserPlatformSpopOperationResult_Canceled = 3
};
-struct APP_LOCAL_DEVICE_ID
-{
- BYTE value[32];
-};
-
struct XUserLocalId {
UINT64 value;
};
|
Thanks, I'm aware of this issue, I just haven't got round to pushing my changes yet. To elaborate more on the auth hold up, the Although I couldn't say for sure without further testing, as I am not super familiar with other projects, Minecraft/PlayFabApi may not verify the message integrity, which may allow a semi-stub of The last part might be completely incorrect and if you know more please let me know 🙂 |
I hope so (and understood this from your original post), but I almost had the conclusion that I have a much bigger problem that I do not have stub idl files of the unknown interfaces that might or not be other xbox live libraries. My general Idea is to intercept the XCurl http client, if it finds the fake signature and remove that from the url. Since I would expect that a provied signature would be validated. Based on examples on msdocs, it reads like signature might be optional and could be NULL, however this depends on how the code interacts with the result. I also read all cross platform games needs to somehow lift such a requirement, but anyhow ms might be able to apply this only on supported platforms.
I wonder did the game call this XUserGetTokenAndSignature function on your end? Could failed for me, since I yet have to figure out how you got the authenticated user credentials for injection.
Yes I let you know once I have more time with experimenting with winegdk, till now no news. |
|
One blocker for proper validation the xtoken code is this requested class and interface:
Maybe it would help me to compile some gdk samples with debug info and link with the debug variant of xbox live static library, which is statically linked into minecraft. An invalid titleid would possible result in errors. |
|
I've been very busy recently but I will try to make some time to get that part working, although as mentioned prior, |
Yes it is, I am still learning slowly how to implement missing class stubs due to almost no documentation how the com impl had been created here. TLDR hiding the long messageI might really hardcode this in my local hacks, it is fully understandable for a good implementation this needs to be read from the game.
If I return garbage here, the game seem to repeatedly call this with playfab urls, but trying to understand where the http calls actually flow. XS api does not look to use XCurl, but playfab uses XCurl. Given I never tried protongdk, I do not know if XCurl has connectivity issues itself. minecraft android xsapi also uses it's own httpclient, just it makes verbose java native interface calls and we have the httpclient c++ source code, actually I might be able to compile the http client for GDK from scratch that is based on WinHttp for debugging. wine is really shocking me, just recompiled once and the debugger ignores breakpoints again..m
My focus might be a bit different :) and specially target xsapi that might use XUser to some extend. EDIT Added sourcecode to xs-api on GitHub, the last time I searched for xbox api code the repo was empty as far as I remember, interesting The public xbox sdk used in GDK does not require signature. |
|
Further research the XalUserGetTokenAndSignatureSilentlyAsync I have running in mcpelauncher, does generate the signature part of XUserGetTokenAndSignatureAsync that GDK wants. It using sha + ecdsa signing on android / mcpelauncher linux + macOS, for this. In a MVP, Minecraft ChromeOS Trial that is available free of charge could be used by my reference implementation that generates even the signature for winegdk. The android xal sdk has debug symbols, that possible can provide insights how to generate the signature directly in wine. I believe that I need to debug also on windows, to get to know why the XUser api usage get stuck Both GDK and android have similar behavior here, up to a point where my GDK setup has problems.
XCurl is libcurl built from source with debug symbols
|
|
Fixed the Additionally left the Additional details on how to get refresh token working for nowcurl 'https://login.live.com/oauth20_connect.srf' -d 'client_id=0000000040159362&scope=service::user.auth.xboxlive.com::MBI_SSL&response_type=device_code' -H 'Content-Type: application/x-www-form-urlencoded'Visit https://microsoft.com/link and enter the Then using the curl 'https://login.live.com/oauth20_token.srf' -d 'device_code=<device_code>&client_id=0000000040159362&grant_type=device_code' -H 'Content-Type: application/x-www-form-urlencoded'Finally update the registry with the wine reg add 'HKLM\Software\Wine\WineGDK' /v RefreshToken /d <refresh_token> |
e23e5cb to
64dbb17
Compare
This PR adds:
Minimal XLauncher implementation(moved to XLauncher Implementation #37)windows.web.dll[HKLM\Software\Wine\WineGDK]"RefreshToken"The
XUserGetTokenAndSignaturemethods seem to be the main roadblock to full online services, token requesting can be adapted from what is here already, but signature generation requires the appropriate keys to be provisioned tocrypt32during package installation, which will likely require more work with XStoreCurrently the oauth
client_id/MSAAppIdhas to be manually set asMicrosoftGame.configparsing is not here yet.