Skip to content

Commit

Permalink
micky wonder bypass code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Oct 25, 2024
1 parent 9323dea commit cc16aa2
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class UnlockerIslandFunctionOffsetTest
[TestMethod]
public void GenerateJson()
{
// FunctionOffsetMickeyWonderMethod: public static byte[] AnonymousMethod43(int nType);
// FunctionOffsetMickeyWonderMethodPartner: AnonymousMethod43's return call jmp -> return call jmp
// FunctionOffsetSetFieldOfView: public void set_fieldOfView(float value) -> jmp xxxxxxxx
// FunctionOffsetSetTargetFrameRate: public static void set_targetFrameRate(int value) -> jmp xxxxxxxxx (to the end)
// FunctionOffsetSetEnableFogRendering: public static void set_enableFogRendering(bool value) -> jmp xxxxxxxxx (to the end)
Expand All @@ -24,6 +26,8 @@ public void GenerateJson()
{
Chinese = new()
{
FunctionOffsetMickeyWonderMethod = 0x0FF81CF0,
FunctionOffsetMickeyWonderMethodPartner = 0x002ED400,
FunctionOffsetSetFieldOfView = 0x01136D30,
FunctionOffsetSetTargetFrameRate = 0x0131E600,
FunctionOffsetSetEnableFogRendering = 0x015DC790,
Expand All @@ -32,6 +36,8 @@ public void GenerateJson()
},
Oversea = new()
{
FunctionOffsetMickeyWonderMethod = 0x0FF86DA0,
FunctionOffsetMickeyWonderMethodPartner = 0x002ED390,
FunctionOffsetSetFieldOfView = 0x01136F30,
FunctionOffsetSetTargetFrameRate = 0x0131E800,
FunctionOffsetSetEnableFogRendering = 0x015DC990,
Expand All @@ -45,13 +51,17 @@ public void GenerateJson()

private sealed class UnlockerIslandConfigurationWrapper
{
public required UnlockerIslandConfiguration Oversea { get; set; }

public required UnlockerIslandConfiguration Chinese { get; set; }

public required UnlockerIslandConfiguration Oversea { get; set; }
}

private sealed class UnlockerIslandConfiguration
{
public required uint FunctionOffsetMickeyWonderMethod { get; set; }

public required uint FunctionOffsetMickeyWonderMethodPartner { get; set; }

public required uint FunctionOffsetSetFieldOfView { get; set; }

public required uint FunctionOffsetSetTargetFrameRate { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ public async ValueTask PostUnlockAsync(CancellationToken token = default)
private static unsafe void InitializeIslandEnvironment(nint handle, IslandFunctionOffsets offsets, LaunchOptions options)
{
IslandEnvironment* pIslandEnvironment = (IslandEnvironment*)handle;

pIslandEnvironment->FunctionOffsetMickeyWonderMethod = offsets.FunctionOffsetMickeyWonderMethod;
pIslandEnvironment->FunctionOffsetMickeyWonderMethodPartner = offsets.FunctionOffsetMickeyWonderMethodPartner;
pIslandEnvironment->FunctionOffsetSetFieldOfView = offsets.FunctionOffsetSetFieldOfView;
pIslandEnvironment->FunctionOffsetSetEnableFogRendering = offsets.FunctionOffsetSetEnableFogRendering;
pIslandEnvironment->FunctionOffsetSetTargetFrameRate = offsets.FunctionOffsetSetTargetFrameRate;
pIslandEnvironment->FunctionOffsetOpenTeam = offsets.FunctionOffsetOpenTeam;
pIslandEnvironment->FunctionOffsetOpenTeamPageAccordingly = offsets.FunctionOffsetOpenTeamPageAccordingly;

pIslandEnvironment->LoopAdjustFpsOnly = options.LoopAdjustFpsOnly;

UpdateIslandEnvironment(handle, options);
Expand All @@ -134,6 +136,7 @@ private static unsafe void InitializeIslandEnvironment(nint handle, IslandFuncti
private static unsafe IslandEnvironmentView UpdateIslandEnvironment(nint handle, LaunchOptions options)
{
IslandEnvironment* pIslandEnvironment = (IslandEnvironment*)handle;

pIslandEnvironment->FieldOfView = options.TargetFov;
pIslandEnvironment->FixLowFovScene = options.FixLowFovScene;
pIslandEnvironment->TargetFrameRate = options.TargetFps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ internal struct IslandEnvironment
public bool RemoveOpenTeamProgress;
public bool LoopAdjustFpsOnly;

public uint FunctionOffsetMickeyWonderMethod;
public uint FunctionOffsetMickeyWonderMethodPartner;
public uint FunctionOffsetSetFieldOfView;
public uint FunctionOffsetSetEnableFogRendering;
public uint FunctionOffsetSetTargetFrameRate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ internal struct IslandEnvironmentView
public bool RemoveOpenTeamProgress;
public bool LoopAdjustFpsOnly;

public uint FunctionOffsetMickeyWonderMethod;
public uint FunctionOffsetMickeyWonderMethodPartner;
public uint FunctionOffsetSetFieldOfView;
public uint FunctionOffsetSetEnableFogRendering;
public uint FunctionOffsetSetTargetFrameRate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ namespace Snap.Hutao.Service.Game.Unlocker.Island;

internal sealed class IslandFunctionOffsets
{
public required uint FunctionOffsetSetFieldOfView { get; set; }
public required uint FunctionOffsetMickeyWonderMethod { get; set; }

public required uint FunctionOffsetSetEnableFogRendering { get; set; }
public required uint FunctionOffsetMickeyWonderMethodPartner { get; set; }

public required uint FunctionOffsetSetFieldOfView { get; set; }

public required uint FunctionOffsetSetTargetFrameRate { get; set; }

public required uint FunctionOffsetSetEnableFogRendering { get; set; }

public required uint FunctionOffsetOpenTeam { get; set; }

public required uint FunctionOffsetOpenTeamPageAccordingly { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Snap.Hutao.UnlockerIsland" Version="1.1.14">
<PackageReference Include="Snap.Hutao.UnlockerIsland" Version="1.1.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit cc16aa2

Please sign in to comment.