Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Commit

Permalink
Added Enable Emblem for BG by @MStr3am
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
secretdataz committed Aug 13, 2017
1 parent 10e9c99 commit e6d43a3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Patches/EnableEmblemForBG.qs
@@ -0,0 +1,33 @@
//###################################################################################\\
//# Modify the Siege mode & BG mode check Jumps to Display Emblem when either is ON #\\
//###################################################################################\\

function EnableEmblemForBG()
{
//Step 1.1 - Look for the Mode checking pattern
var code =
" B9 AB AB AB 00" //MOV ECX, OFFSET g_session
+ " E8 AB AB AB 00" //CALL CSession::IsSiegeMode
+ " 85 C0" //TEST EAX, EAX
+ " 74 AB" //JZ SHORT addr
+ " B9 AB AB AB 00" //MOV ECX, OFFSET g_session
+ " E8 AB AB AB 00" //CALL CSession::IsBgMode
+ " 85 C0" //TEST EAX, EAX
+ " 75 AB" //JNZ SHORT addr ;AB at the end is needed
;

var offset = exe.findCode(code, PTYPE_HEX, true, "\xAB");
if (offset === -1)
return "Failed in Step 1";

//Step 1.2 - Calculate the code size & its half (will point to the second MOV ECX when added to offset)
var csize = code.hexlength();
var hsize = csize/2;

//Step 2.1 - Change the first JZ to JNZ and addr to location after the code
exe.replace(offset + hsize - 2, "75" + hsize.packToHex(1), PTYPE_HEX);

//Step 2.2 - Change the second JNZ to JZ
exe.replace(offset + csize - 2, "74", PTYPE_HEX);
return true;
}
2 changes: 2 additions & 0 deletions Patches/_patchlist.qs
Expand Up @@ -353,3 +353,5 @@ registerPatch(226, "DisableWalkToDelay", "Disable Walk To Delay.", "Fix", 16, "M
registerPatch(227, "SetWalkToDelay", "Change Walk To Delay.", "Fix", 16, "MegaByte", "Can have a quicker response to walking clicks. But client may likely send more/duplicated packets.", false);

registerPatch(228, "DisableDoram", "Disable Doram Character Creation UI [Experimental]", "UI", 0, "Ai4Rei, Secret", "Disable Doram race in the character creation UI. Server-side disabling is also recommended", false);

registerPatch(229, "EnableEmblemForBG", "Enable Emblem hover for BG", "UI", 0, "Neo", "Makes the client show the Emblem on top of the character for Battleground mode as well along with GvG", false);

0 comments on commit e6d43a3

Please sign in to comment.