mirror of
https://github.com/uberhalit/SekiroFpsUnlockAndMore.git
synced 2026-06-13 09:57:55 +00:00
added feature to increase emblem cap on upgrades
changed way to obtain kills, fixes slow stats updates improved pattern scan algorithm
This commit is contained in:
parent
e158678422
commit
50d043c75a
7 changed files with 181 additions and 41 deletions
10
README.md
10
README.md
|
|
@ -152,6 +152,9 @@ This option will remove the effect dragonrot has on NPCs, if an NPC already got
|
|||
### On 'Disable death penalties (except dragonrot)':
|
||||
Like 'Unseen Aid' you will not lose any Sen or Experience upon death with this option enabled. Dragonrot will not be modified, check the option above to prevent dragonrot from increasing.
|
||||
|
||||
### On 'Increase spirit emblem cap. on upgrades':
|
||||
Whenever you upgrade your prosthetic arm the maximum spirit emblem capacity will now be increased by 1 **permanently**. Deactivating this option will not remove the additional capacity gained by it. With the base 15 capacity and +5 capacity by skills the normal maximal capacity is 20, with this feature enabled you can reach up to 50 max capacity as there are 30 prosthetic upgrades.
|
||||
|
||||
### On 'Game speed':
|
||||
Slow down the game to beat a boss like a game journalist or speed it up and become gud. Game speed acts as a global time scale and is used by the game itself to create a dramatic effect in a few cutscenes. All game physics (even opening the menu) will be affected equally: all time-critical windows like dodge and deflect will be proportionally prolonged or shortened while the amount of damage given and taken as well as all other damage physics will be unaltered. A hit from an enemy on 150% game speed will do the exact same damage as on 80%, the deflect window on 50% is exactly twice as long as on 100% and so on. Of course, Sekiro himself will be affected by the speed too so even though a time window might be different now, the speed which you can react on it is different too. Can be toggled by pressing CTRL+M. Be aware that both speed modifications can potentially crash the game in certain cutscenes and NPC interactions so use them with caution.
|
||||
|
||||
|
|
@ -163,6 +166,7 @@ Be aware that both speed modifications can potentially crash the game in certain
|
|||
* Utility can't seem to find the game? - Make sure your game exe is called `sekiro.exe`
|
||||
* Make sure you followed the appropriate steps and didn't skip any (especially not the deletion of the Sekiro profile!)
|
||||
* Try disabling `Fullscreen optimization` for Sekiro: right mouse click on `sekiro.exe -> Compatibility-> tick 'Disable fullscreen optimizations'`
|
||||
* If you are using ReShade make sure your preset doesn't enforce 60 Hz, try removing ReShade and see if it solves the problem
|
||||
* Try adding the whole game folder and `Sekiro FPS Unlocker and more` to your antivirus's exclusion list
|
||||
* Try disabling `Steam Broadcast` (streaming via overlay)
|
||||
* Try to force disable VSYNC even when you are using GSYNC
|
||||
|
|
@ -181,7 +185,7 @@ Be aware that both speed modifications can potentially crash the game in certain
|
|||
|
||||
## Preview
|
||||
|
||||
[](#)
|
||||
[](#)
|
||||
|
||||
### Unlocked framerate
|
||||
[](#)
|
||||
|
|
@ -231,6 +235,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|||
|
||||
## Version History
|
||||
|
||||
* v1.2.4.0 (2019-05-02)
|
||||
* added feature to increase spirit emblem capacity on prosthetic upgrades
|
||||
* changed way to obtain player kills, fixes slow stats updates
|
||||
* improved pattern scan algorithm
|
||||
* v1.2.3.2 (2019-04-26)
|
||||
* added hotkey to toggle speed modifiers (CTRL+M)
|
||||
* added game version 1.04 (1.4.0.0) to supported versions
|
||||
|
|
|
|||
|
|
@ -107,9 +107,9 @@ namespace SekiroFpsUnlockAndMore
|
|||
/**
|
||||
Reference pointer pCurrentResolutionWidth to <int>iInternalGameWidth (and <int>iInternalGameHeight which is +4 bytes).
|
||||
000000014114B5C5 | 0F57D2 | xorps xmm2,xmm2 |
|
||||
000000014114B5C8 | 890D 521B7D02 | mov dword ptr ds:[14391D120],ecx |
|
||||
000000014114B5C8 | 890D 521B7D02 | mov dword ptr ds:[14391D120],ecx | iInternalGameWidth
|
||||
000000014114B5CE | 0F57C9 | xorps xmm1,xmm1 |
|
||||
000000014114B5D1 | 8915 4D1B7D02 | mov dword ptr ds:[14391D124],edx |
|
||||
000000014114B5D1 | 8915 4D1B7D02 | mov dword ptr ds:[14391D124],edx | iInternalGameHeight
|
||||
|
||||
000000014114AC88 (Version 1.2.0.0)
|
||||
*/
|
||||
|
|
@ -176,16 +176,20 @@ namespace SekiroFpsUnlockAndMore
|
|||
|
||||
|
||||
/**
|
||||
Reference pointer pTotalKills to <int>iTotalKills, does not get updated on every kill but mostly on every 2nd, includes own player deaths...
|
||||
0000000141152178 | 48:8D0D A9ACB302 | lea rcx,qword ptr ds:[143C8CE28] | pTotalKills->iTotalKills
|
||||
000000014115217F | 891481 | mov dword ptr ds:[rcx+rax*4],edx |
|
||||
0000000141152182 | C3 | ret |
|
||||
Reference pointer pPlayerStatsRelated to 2 more PlayerStatsRelated pointer, offset in struct to <int>iTotalKills.
|
||||
00000001407BFE25 | 48:69D8 18020000 | imul rbx,rax,218 |
|
||||
00000001407BFE2C | 48:8B05 FD8E3803 | mov rax,qword ptr ds:[143B48D30] | pPlayerStatsRelated->[PlayerStatsRelated1+0x08]->[PlayerStatsRelated2+0xDC]->iTotalKills
|
||||
00000001407BFE33 | 48:03D9 | add rbx,rcx |
|
||||
00000001407BFE36 | 48:897C24 20 | mov qword ptr ss:[rsp+20],rdi |
|
||||
00000001407BFE3B | 48:8B78 08 | mov rdi,qword ptr ds:[rax+8] | offset PlayerStatsRelated1->PlayerStatsRelated2
|
||||
|
||||
0000000141151838 (Version 1.2.0.0)
|
||||
*/
|
||||
// credits to 'Me_TheCat' for original offset
|
||||
internal const string PATTERN_TOTAL_KILLS = "48 8D 0D ?? ?? ?? ?? 89 14 81 C3";
|
||||
0000000000000000 (Version 1.2.0.0)
|
||||
*/
|
||||
internal const string PATTERN_TOTAL_KILLS = "48 ?? D8 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 ?? ?? 48 89 ?? ?? ?? 48 8B ?? 08";
|
||||
internal const int PATTERN_TOTAL_KILLS_OFFSET = 7;
|
||||
internal const int PATTERN_TOTAL_KILLS_INSTRUCTION_LENGTH = 7;
|
||||
internal const int PATTERN_TOTAL_KILLS_POINTER1_OFFSET = 0x0008;
|
||||
internal const int PATTERN_TOTAL_KILLS_POINTER2_OFFSET = 0x00DC;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -369,6 +373,48 @@ namespace SekiroFpsUnlockAndMore
|
|||
internal static readonly byte[] PATCH_DEATHSCOUNTER_ENABLE = new byte[4] { 0x84, 0xDB, 0x0F, 0x85 }; // test bl,bl; jne
|
||||
|
||||
|
||||
/**
|
||||
Whenever we upgrade a prosthetic or learn an ability the following function block will get called.
|
||||
We inject a check to determine if case is prosthetic and set register affecting SkillEffect4 to 1 so that the upgrade increases our maximum spirit emblem capacity.
|
||||
Type for struct SKILL_PARAM_ST is defined below.
|
||||
0000000140A84C29 | 48:85C0 | test rax,rax |
|
||||
0000000140A84C2C | 74 4A | je sekiro.140A84C78 | IncreaseSkill4OnUpgrade ?
|
||||
0000000140A84C2E | 0FB650 37 | movzx edx,byte ptr ds:[rax+37] | get SKILL_PARAM_ST.SkillEffect4 to edx | code inject overwrite from here
|
||||
0000000140A84C32 | 85D2 | test edx,edx | check if edx is 0
|
||||
0000000140A84C34 | 74 42 | je sekiro.140A84C78 | if 0 jump here | jump back here from code inject
|
||||
0000000140A84C36 | 48:8B0D F3400C03 | mov rcx,qword ptr ds:[143B48D30] | increase skill4 on upgrade routine
|
||||
0000000140A84C3D | 48:8B49 08 | mov rcx,qword ptr ds:[rcx+8] |
|
||||
0000000140A84C41 | 48:85C9 | test rcx,rcx |
|
||||
0000000140A84C44 | 74 32 | je sekiro.140A84C78 |
|
||||
0000000140A84C46 | 48:81C1 46010000 | add rcx,146 |
|
||||
0000000140A84C4D | 66:0111 | add word ptr ds:[rcx],dx | increases Skill4 on upgrade, will get skipped if edx == 0
|
||||
|
||||
0000000000000000 (Version 1.2.0.0)
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 0x0060)]
|
||||
private struct SKILL_PARAM_ST
|
||||
{
|
||||
[FieldOffset(0x0030)]
|
||||
private Int32 SkillFamily; // (Unk6) 2700000 for prosthetic upgrades
|
||||
|
||||
[FieldOffset(0x0037)]
|
||||
private UInt16 SkillEffect4; // (Unk10) controls how much spirit emblem capacity rises on acquisition of skill/upgrade
|
||||
}
|
||||
*/
|
||||
internal const string PATTERN_EMBLEMUPGRADE = "48 85 C0 74 ?? 0F B6 50 37 85 D2 74 ?? 48 8B 0D";
|
||||
internal const int PATTERN_EMBLEMUPGRADE_OFFSET = 5;
|
||||
internal const int INJECT_EMBLEMUPGRADE_OVERWRITE_LENGTH = 6;
|
||||
internal static readonly byte[] INJECT_EMBLEMUPGRADE_SHELLCODE = new byte[]
|
||||
{
|
||||
0x81, 0x78, 0x30, 0xE0, 0x32, 0x29, 0x00, // cmp dword ptr ds:[rax+30],2932E0 | if (SKILL_PARAM_ST.SkillFamily == 2700000)
|
||||
0x75, 0x07, // jne +7 | {
|
||||
0xBA, 0x01, 0x00, 0x00, 0x00, // mov edx,1 | edx = 1
|
||||
0xEB, 0x04, // jmp +4 | } else {
|
||||
0x0F, 0xB6, 0x50, 0x37, // movzx edx,byte ptr ds:[rax+37] | edx = SKILL_PARAM_ST.SkillEffect4 }
|
||||
0x85, 0xD2 // test edx,edx | check if edx is 0
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Reference pointer pTimeRelated to TimescaleManager pointer, offset in struct to <float>fTimescale which acts as a global speed scale for almost all ingame calculations.
|
||||
000000014114A7C7 | 48:8B05 3A2BB402 | mov rax,qword ptr ds:[143C8D308] | pTimeRelated->[TimescaleManager+0x360]->fTimescale
|
||||
|
|
@ -396,9 +442,9 @@ namespace SekiroFpsUnlockAndMore
|
|||
// credits to 'Zullie the Witch' for original offset
|
||||
internal const string PATTERN_TIMESCALE_PLAYER = "48 8B 1D ?? ?? ?? ?? 48 85 DB 74 ?? 8B ?? 81 FA";
|
||||
internal const int PATTERN_TIMESCALE_PLAYER_INSTRUCTION_LENGTH = 7;
|
||||
internal const int PATTERN_TIMESCALE_POINTER2_OFFSET = 0x88;
|
||||
internal const int PATTERN_TIMESCALE_POINTER2_OFFSET = 0x0088;
|
||||
internal const int PATTERN_TIMESCALE_POINTER3_OFFSET = 0x1FF8;
|
||||
internal const int PATTERN_TIMESCALE_POINTER4_OFFSET = 0x28;
|
||||
internal const int PATTERN_TIMESCALE_POINTER5_OFFSET = 0xD00;
|
||||
internal const int PATTERN_TIMESCALE_POINTER4_OFFSET = 0x0028;
|
||||
internal const int PATTERN_TIMESCALE_POINTER5_OFFSET = 0x0D00;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:SekiroFpsUnlockAndMore"
|
||||
mc:Ignorable="d"
|
||||
Title="Sekiro FPS Unlocker and more v1.2.3" Width="Auto" Height="Auto" SizeToContent="WidthAndHeight" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing">
|
||||
Title="Sekiro FPS Unlocker and more v1.2.4" Width="Auto" Height="Auto" SizeToContent="WidthAndHeight" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing">
|
||||
|
||||
<Grid Background="#FFF9F9F9">
|
||||
<DockPanel>
|
||||
|
|
@ -40,19 +40,20 @@
|
|||
<CheckBox x:Name="cbDragonrot" Margin="0,3,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Prevent dragonrot increase on death" ToolTip="NPCs won't get the disease and/or their condition won't get worse" Checked="CbDragonrot_Check_Handler" Unchecked="CbDragonrot_Check_Handler" TabIndex="14" />
|
||||
<CheckBox x:Name="cbDeathPenalty" Margin="0,3,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Disable death penalties (except dragonrot)" ToolTip="Disables Sen and Experience loss upon death" Checked="CbDeathPenalty_Check_Handler" Unchecked="CbDeathPenalty_Check_Handler" TabIndex="15" />
|
||||
<CheckBox x:Name="cbDeathPenaltyHidden" Margin="0,3,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="(DEBUG) Disable hidden death penalties" ToolTip="DEBUG ONLY" Checked="CbDeathPenaltyHidden_Check_Handler" Unchecked="CbDeathPenaltyHidden_Check_Handler" IsTabStop="False" Visibility="Collapsed" />
|
||||
<CheckBox x:Name="cbEmblemUpgrade" Margin="0,3,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Increase spirit emblem cap. on upgrades" ToolTip="Every prosthetic upgrade will increase maximum emblem capacity by 1. PERMANENT INCREASE!" Checked="CbEmblemUpgrade_Check_Handler" Unchecked="CbEmblemUpgrade_Check_Handler" TabIndex="16"/>
|
||||
<DockPanel Margin="0,3,0,0" LastChildFill="False">
|
||||
<CheckBox x:Name="cbGameSpeed" DockPanel.Dock="Left" Margin="0,0,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Game speed (%):" ToolTip="Increase or decrease. Can potentially crash the game in cutscenes, use with caution" Checked="CbGameSpeed_Check_Handler" Unchecked="CbGameSpeed_Check_Handler" TabIndex="16" />
|
||||
<CheckBox x:Name="cbGameSpeed" DockPanel.Dock="Left" Margin="0,0,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Game speed (%):" ToolTip="Increase or decrease. Can potentially crash the game in cutscenes, use with caution" Checked="CbGameSpeed_Check_Handler" Unchecked="CbGameSpeed_Check_Handler" TabIndex="17" />
|
||||
<Button x:Name="bGs100" DockPanel.Dock="Right" Content="100" Margin="0,0,0,0" Width="30" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BGs100_Click" />
|
||||
<Button x:Name="bGsHigher" DockPanel.Dock="Right" Content=">" Margin="0,0,3,0" Width="25" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BGsHigher_Click" />
|
||||
<TextBox x:Name="tbGameSpeed" DockPanel.Dock="Right" Margin="0,0,3,0" Width="30" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Text="100" TextAlignment="Center" MaxLength="3" PreviewTextInput="Numeric_PreviewTextInput" DataObject.Pasting="Numeric_PastingHandler" TabIndex="17" />
|
||||
<TextBox x:Name="tbGameSpeed" DockPanel.Dock="Right" Margin="0,0,3,0" Width="30" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Text="100" TextAlignment="Center" MaxLength="3" PreviewTextInput="Numeric_PreviewTextInput" DataObject.Pasting="Numeric_PastingHandler" TabIndex="18" />
|
||||
<Button x:Name="bGsLower" DockPanel.Dock="Right" Content="<" Margin="0,0,3,0" Width="25" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BGsLower_Click" />
|
||||
<Button x:Name="bGs0" DockPanel.Dock="Right" Content="0" Margin="0,0,3,0" Width="30" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BGs0_Click" />
|
||||
</DockPanel>
|
||||
<DockPanel Margin="0,5,0,0" LastChildFill="False">
|
||||
<CheckBox x:Name="cbPlayerSpeed" DockPanel.Dock="Left" Margin="0,0,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Player speed (%):" ToolTip="Increase or decrease. To enable this start the game and load a save, then tick the checkbox. Can potentially crash the game in cutscenes, use with caution" Checked="CbPlayerSpeed_Check_Handler" Unchecked="CbPlayerSpeed_Check_Handler" TabIndex="18" />
|
||||
<CheckBox x:Name="cbPlayerSpeed" DockPanel.Dock="Left" Margin="0,0,0,0" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Content="Player speed (%):" ToolTip="Increase or decrease. To enable this start the game and load a save, then tick the checkbox. Can potentially crash the game in cutscenes, use with caution" Checked="CbPlayerSpeed_Check_Handler" Unchecked="CbPlayerSpeed_Check_Handler" TabIndex="19" />
|
||||
<Button x:Name="bPs100" DockPanel.Dock="Right" Content="100" Margin="0,0,0,0" Width="30" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BPs100_Click" />
|
||||
<Button x:Name="bPsHigher" DockPanel.Dock="Right" Content=">" Margin="0,0,3,0" Width="25" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BPsHigher_Click" />
|
||||
<TextBox x:Name="tbPlayerSpeed" DockPanel.Dock="Right" Margin="0,0,3,0" Width="30" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Text="100" TextAlignment="Center" MaxLength="3" PreviewTextInput="Numeric_PreviewTextInput" DataObject.Pasting="Numeric_PastingHandler" TabIndex="19" />
|
||||
<TextBox x:Name="tbPlayerSpeed" DockPanel.Dock="Right" Margin="0,0,3,0" Width="30" Height="25" FontSize="14 px" VerticalContentAlignment="Center" Text="100" TextAlignment="Center" MaxLength="3" PreviewTextInput="Numeric_PreviewTextInput" DataObject.Pasting="Numeric_PastingHandler" TabIndex="20" />
|
||||
<Button x:Name="bPsLower" DockPanel.Dock="Right" Content="<" Margin="0,0,3,0" Width="25" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BPsLower_Click" />
|
||||
<Button x:Name="bPs0" DockPanel.Dock="Right" Content="0" Margin="0,0,3,0" Width="30" Height="25" FontSize="14 px" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Focusable="False" Click="BPs0_Click" />
|
||||
</DockPanel>
|
||||
|
|
@ -76,6 +77,8 @@
|
|||
<Run FontWeight="Bold">Custom resolution adds 21:9 support and overwrites a default resolution, hud will be limited to 16:9.</Run>
|
||||
<Run>Borderless window mode with custom resolution requires you to patch and set resolution first, then activate borderless afterwards.</Run>
|
||||
<Run FontWeight="Bold">Disabling camera auto rotate is mostly intended for mouse users.</Run>
|
||||
<Run>Spirit emblem capacity upgrades are</Run>
|
||||
<Run FontWeight="Bold" Foreground="#FFF00000">permanent.</Run>
|
||||
<Run>Both speed modifiers can be toggled by pressing hotkey CTRL+M.</Run>
|
||||
<Run FontWeight="Bold">To enable Player Speed modification you have to be ingame first.</Run>
|
||||
<Run FontWeight="Bold" Foreground="#FFF00000">See the link below for detailed information, guides, GSYNC support and an AMD fix.</Run>
|
||||
|
|
@ -84,7 +87,7 @@
|
|||
</Expander>
|
||||
<Label HorizontalAlignment="Right" FontSize="12 px" TabIndex="22">
|
||||
<Hyperlink NavigateUri="https://github.com/uberhalit/SekiroFpsUnlockAndMore" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
v1.2.3 - by uberhalit
|
||||
v1.2.4 - by uberhalit
|
||||
</Hyperlink>
|
||||
</Label>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ namespace SekiroFpsUnlockAndMore
|
|||
internal long _offset_resolution = 0x0;
|
||||
internal long _offset_resolution_default = 0x0;
|
||||
internal long _offset_resolution_scaling_fix = 0x0;
|
||||
internal long _offset_total_kills = 0x0;
|
||||
internal long _offset_player_deaths = 0x0;
|
||||
internal long _offset_total_kills = 0x0;
|
||||
internal long _offset_camera_reset = 0x0;
|
||||
internal long _offset_dragonrot_routine = 0x0;
|
||||
internal long _offset_deathpenalties1 = 0x0;
|
||||
|
|
@ -54,6 +54,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
internal bool _dataCave_speedfix = false;
|
||||
internal bool _dataCave_fovsetting = false;
|
||||
internal bool _codeCave_camadjust = false;
|
||||
internal bool _codeCave_emblemupgrade = false;
|
||||
internal bool _retryAccess = true;
|
||||
internal bool _statLoggingEnabled = false;
|
||||
internal bool _initialStartup = true;
|
||||
|
|
@ -70,6 +71,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
internal const string _CODECAVE_CAMADJUST_YAW_Z = "camAdjustYawZ";
|
||||
internal const string _CODECAVE_CAMADJUST_PITCH_XY = "camAdjustPitchXY";
|
||||
internal const string _CODECAVE_CAMADJUST_YAW_XY = "camAdjustYawXY";
|
||||
internal const string _CODECAVE_EMBLEM_UPGRADE = "emblemCapUpgrade";
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
|
|
@ -201,6 +203,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
this.cbDeathPenalty.IsChecked = _settingsService.ApplicationSettings.cbDeathPenalty;
|
||||
this.cbDeathPenaltyHidden.Visibility = _settingsService.ApplicationSettings.hiddenDPs == ZUH_HIDDEN_DP ? Visibility.Visible : Visibility.Collapsed;
|
||||
if (_settingsService.ApplicationSettings.hiddenDPs == ZUH_HIDDEN_DP) { _debugMode = true; sbMode.Text = "DEBUG"; }
|
||||
this.cbEmblemUpgrade.IsChecked = _settingsService.ApplicationSettings.cbEmblemUpgrade;
|
||||
this.cbGameSpeed.IsChecked = _settingsService.ApplicationSettings.cbGameSpeed;
|
||||
this.tbGameSpeed.Text = _settingsService.ApplicationSettings.tbGameSpeed.ToString();
|
||||
this.cbPlayerSpeed.IsChecked = _settingsService.ApplicationSettings.cbPlayerSpeed;
|
||||
|
|
@ -228,6 +231,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
_settingsService.ApplicationSettings.cbCamReset = this.cbCamReset.IsChecked == true;
|
||||
_settingsService.ApplicationSettings.cbDragonrot = this.cbDragonrot.IsChecked == true;
|
||||
_settingsService.ApplicationSettings.cbDeathPenalty = this.cbDeathPenalty.IsChecked == true;
|
||||
_settingsService.ApplicationSettings.cbEmblemUpgrade = this.cbEmblemUpgrade.IsChecked == true;
|
||||
_settingsService.ApplicationSettings.cbGameSpeed = this.cbGameSpeed.IsChecked == true;
|
||||
_settingsService.ApplicationSettings.tbGameSpeed = this.tbGameSpeed.Text != "" && !this.tbGameSpeed.Text.Contains(" ") ? Convert.ToInt32(this.tbGameSpeed.Text) : 100;
|
||||
_settingsService.ApplicationSettings.cbPlayerSpeed = this.cbPlayerSpeed.IsChecked == true;
|
||||
|
|
@ -422,14 +426,25 @@ namespace SekiroFpsUnlockAndMore
|
|||
if (!IsValidAddress(_offset_player_deaths))
|
||||
_offset_player_deaths = 0x0;
|
||||
|
||||
long ref_lpTotalKills = patternScan.FindPattern(GameData.PATTERN_TOTAL_KILLS);
|
||||
long ref_lpTotalKills = patternScan.FindPattern(GameData.PATTERN_TOTAL_KILLS) + GameData.PATTERN_TOTAL_KILLS_OFFSET;
|
||||
Debug.WriteLine("ref_lpTotalKills found at: 0x" + ref_lpTotalKills.ToString("X"));
|
||||
if (IsValidAddress(ref_lpTotalKills))
|
||||
{
|
||||
_offset_total_kills = DereferenceStaticX64Pointer(_gameAccessHwndStatic, ref_lpTotalKills, GameData.PATTERN_TOTAL_KILLS_INSTRUCTION_LENGTH);
|
||||
if (!IsValidAddress(_offset_total_kills))
|
||||
_offset_total_kills = 0x0;
|
||||
long lpPlayerStatsRelatedKills1 = DereferenceStaticX64Pointer(_gameAccessHwndStatic, ref_lpTotalKills, GameData.PATTERN_TOTAL_KILLS_INSTRUCTION_LENGTH);
|
||||
Debug.WriteLine("lpPlayerStatsRelatedKills found at: 0x" + lpPlayerStatsRelatedKills1.ToString("X"));
|
||||
if (IsValidAddress(lpPlayerStatsRelatedKills1))
|
||||
{
|
||||
long lpPlayerStructRelatedKills2 = Read<Int64>(_gameAccessHwndStatic, lpPlayerStatsRelatedKills1) + GameData.PATTERN_TOTAL_KILLS_POINTER1_OFFSET;
|
||||
Debug.WriteLine("lpPlayerStructRelatedKills2 found at: 0x" + lpPlayerStructRelatedKills2.ToString("X"));
|
||||
if (IsValidAddress(lpPlayerStructRelatedKills2))
|
||||
{
|
||||
_offset_total_kills = Read<Int64>(_gameAccessHwndStatic, lpPlayerStructRelatedKills2) + GameData.PATTERN_TOTAL_KILLS_POINTER2_OFFSET;
|
||||
Debug.WriteLine("iTotalKills found at: 0x" + _offset_total_kills.ToString("X"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!IsValidAddress(_offset_total_kills))
|
||||
_offset_total_kills = 0x0;
|
||||
|
||||
long lpCamAdjustPitch = patternScan.FindPattern(GameData.PATTERN_CAMADJUST_PITCH);
|
||||
long lpCamAdjustYawZ = patternScan.FindPattern(GameData.PATTERN_CAMADJUST_YAW_Z) + GameData.PATTERN_CAMADJUST_YAW_Z_OFFSET;
|
||||
|
|
@ -507,6 +522,15 @@ namespace SekiroFpsUnlockAndMore
|
|||
_offset_deathscounter_routine = 0x0;
|
||||
}
|
||||
|
||||
long lpSkill4OnUpgrade = patternScan.FindPattern(GameData.PATTERN_EMBLEMUPGRADE) + GameData.PATTERN_EMBLEMUPGRADE_OFFSET;
|
||||
Debug.WriteLine("lpSkill4OnUpgrade found at: 0x" + lpSkill4OnUpgrade.ToString("X"));
|
||||
if (IsValidAddress(lpSkill4OnUpgrade))
|
||||
{
|
||||
if (_memoryCaveGenerator.CreateNewCodeCave(_CODECAVE_EMBLEM_UPGRADE, lpSkill4OnUpgrade, GameData.INJECT_EMBLEMUPGRADE_OVERWRITE_LENGTH, GameData.INJECT_EMBLEMUPGRADE_SHELLCODE))
|
||||
_codeCave_emblemupgrade = true;
|
||||
Debug.WriteLine("lpSkill4OnUpgrade code cave at: 0x" + _memoryCaveGenerator.GetCodeCaveAddressByName(_CODECAVE_EMBLEM_UPGRADE).ToString("X"));
|
||||
}
|
||||
|
||||
long ref_lpTimeRelated = patternScan.FindPattern(GameData.PATTERN_TIMESCALE);
|
||||
Debug.WriteLine("ref_lpTimeRelated found at: 0x" + ref_lpTimeRelated.ToString("X"));
|
||||
if (IsValidAddress(ref_lpTimeRelated))
|
||||
|
|
@ -648,6 +672,13 @@ namespace SekiroFpsUnlockAndMore
|
|||
if (_offset_deathscounter_routine == 0x0)
|
||||
this.cbDeathPenaltyHidden.IsEnabled = false;
|
||||
|
||||
if (!_codeCave_emblemupgrade)
|
||||
{
|
||||
UpdateStatus("emblem upgrade not found...", Brushes.Red);
|
||||
LogToFile("emblem upgrade not found...");
|
||||
this.cbEmblemUpgrade.IsEnabled = false;
|
||||
}
|
||||
|
||||
if (_offset_timescale == 0x0)
|
||||
{
|
||||
UpdateStatus("timescale not found...", Brushes.Red);
|
||||
|
|
@ -664,7 +695,8 @@ namespace SekiroFpsUnlockAndMore
|
|||
this.bPatch.IsEnabled = true;
|
||||
_running = true;
|
||||
PatchGame();
|
||||
InjectToGame();
|
||||
InjectCamAdjust();
|
||||
InjectEmblemUpgrades();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -728,6 +760,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
_offset_deathpenalties1 = 0x0;
|
||||
_offset_deathpenalties2 = 0x0;
|
||||
_offset_deathscounter_routine = 0x0;
|
||||
_codeCave_emblemupgrade = false;
|
||||
_offset_timescale = 0x0;
|
||||
_offset_timescale_player = 0x0;
|
||||
_offset_timescale_player_pointer_start = 0x0;
|
||||
|
|
@ -1149,9 +1182,9 @@ namespace SekiroFpsUnlockAndMore
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inject or eject code to game using code caves.
|
||||
/// Inject or eject code to control cam adjustment.
|
||||
/// </summary>
|
||||
private void InjectToGame()
|
||||
private void InjectCamAdjust()
|
||||
{
|
||||
if (!CanPatchGame() || !_codeCave_camadjust) return;
|
||||
|
||||
|
|
@ -1202,6 +1235,27 @@ namespace SekiroFpsUnlockAndMore
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inject or eject code to control emblem upgrades.
|
||||
/// </summary>
|
||||
private void InjectEmblemUpgrades()
|
||||
{
|
||||
if (!CanPatchGame() || !_codeCave_emblemupgrade) return;
|
||||
|
||||
if (this.cbEmblemUpgrade.IsChecked == true)
|
||||
{
|
||||
this.cbEmblemUpgrade.IsEnabled = false;
|
||||
_memoryCaveGenerator.ActivateCodeCaveByName(_CODECAVE_EMBLEM_UPGRADE);
|
||||
this.cbEmblemUpgrade.IsEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.cbEmblemUpgrade.IsEnabled = false;
|
||||
_memoryCaveGenerator.DeactivateCodeCaveByName(_CODECAVE_EMBLEM_UPGRADE);
|
||||
this.cbEmblemUpgrade.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Freeze values in memory that can't be patched to require no freezing easily.
|
||||
/// </summary>
|
||||
|
|
@ -1243,6 +1297,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
if (_statLoggingEnabled) LogStatsFile(_path_deathsLog, playerDeaths.ToString());
|
||||
int totalKills = Read<Int32>(_gameAccessHwndStatic, _offset_total_kills);
|
||||
totalKills -= playerDeaths; // Since this value seems to track every death, including the player
|
||||
if (totalKills < 0) totalKills = 0;
|
||||
_statusViewModel.Kills = totalKills;
|
||||
if (_statLoggingEnabled) LogStatsFile(_path_killsLog, totalKills.ToString());
|
||||
}
|
||||
|
|
@ -1629,7 +1684,7 @@ namespace SekiroFpsUnlockAndMore
|
|||
private void CbCamAdjust_Check_Handler(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.cbCamAdjust.IsEnabled)
|
||||
InjectToGame();
|
||||
InjectCamAdjust();
|
||||
}
|
||||
|
||||
private void CbCamReset_Check_Handler(object sender, RoutedEventArgs e)
|
||||
|
|
@ -1656,6 +1711,12 @@ namespace SekiroFpsUnlockAndMore
|
|||
PatchDeathPenaltyHidden();
|
||||
}
|
||||
|
||||
private void CbEmblemUpgrade_Check_Handler(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.cbEmblemUpgrade.IsEnabled)
|
||||
InjectEmblemUpgrades();
|
||||
}
|
||||
|
||||
private void CbGameSpeed_Check_Handler(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PatchGameSpeed();
|
||||
|
|
@ -1817,7 +1878,6 @@ namespace SekiroFpsUnlockAndMore
|
|||
UInt64 dwSize,
|
||||
out IntPtr lpNumberOfBytesWritten);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
|
@ -71,25 +72,45 @@ namespace SekiroFpsUnlockAndMore
|
|||
|
||||
long ix;
|
||||
int iy;
|
||||
bool bFound = false;
|
||||
|
||||
List<byte> not0PatternBytesList = new List<byte>();
|
||||
List<int> not0PatternBytesIndexList = new List<int>();
|
||||
|
||||
int dataLength = bData.Length - bPattern.Length;
|
||||
|
||||
for (iy = bPattern.Length - 1; iy > -1; iy--)
|
||||
{
|
||||
if (szMask[iy] == 'x')
|
||||
{
|
||||
not0PatternBytesList.Add(bPattern[iy]);
|
||||
not0PatternBytesIndexList.Add(iy);
|
||||
}
|
||||
}
|
||||
|
||||
byte[] not0PatternBytesArray = not0PatternBytesList.ToArray();
|
||||
int not0PatternBytesL = not0PatternBytesArray.Length;
|
||||
int[] not0PatternBytesIndexArray = not0PatternBytesIndexList.ToArray();
|
||||
|
||||
for (ix = 0; ix < dataLength; ix++)
|
||||
{
|
||||
bFound = true;
|
||||
for (iy = bPattern.Length - 1; iy > -1; iy--)
|
||||
if (not0PatternBytesArray[not0PatternBytesL - 1] != bData[ix]) continue;
|
||||
bool check = true;
|
||||
|
||||
for (iy = not0PatternBytesArray.Length - 1; iy > -1; iy--)
|
||||
{
|
||||
if (szMask[iy] != 'x' || bPattern[iy] == bData[ix + iy])
|
||||
if (not0PatternBytesArray[iy] == bData[ix + not0PatternBytesIndexArray[iy]])
|
||||
continue;
|
||||
bFound = false;
|
||||
check = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bFound)
|
||||
if (check)
|
||||
{
|
||||
return dwStart + ix;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,5 +18,5 @@ using System.Runtime.InteropServices;
|
|||
ResourceDictionaryLocation.SourceAssembly
|
||||
)]
|
||||
|
||||
[assembly: AssemblyVersion("1.2.3.1")]
|
||||
[assembly: AssemblyFileVersion("1.2.3.1")]
|
||||
[assembly: AssemblyVersion("1.2.4.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.4.0")]
|
||||
|
|
@ -51,6 +51,8 @@ namespace SekiroFpsUnlockAndMore
|
|||
[XmlElement]
|
||||
public int hiddenDPs { get; set; }
|
||||
[XmlElement]
|
||||
public bool cbEmblemUpgrade { get; set; }
|
||||
[XmlElement]
|
||||
public bool cbGameSpeed { get; set; }
|
||||
[XmlElement]
|
||||
public int tbGameSpeed { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue