This repository has been archived by the owner on Mar 26, 2018. It is now read-only.
forked from Neo-Mind/NEMO
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Enable Emblem for BG by @MStr3am
Closes #1
- Loading branch information
1 parent
10e9c99
commit e6d43a3
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters