To know how too "-mh" command, first of all have to know the map "-mh" done things, extracted war3map.j file from the map, search for the keyword "might cheat" detection trigger MH
function Trig_EagelAMH_Actions takes nothing returns nothing call DisableTrigger(GetTriggeringTrigger()) call PolledWait(2.00) call EnableTrigger(gg_trg_EagelSeekA) call EnableTrigger(gg_trg_EagelSeekB) call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS) call CreateNUnitsAtLoc(1,'hfoo',Player(15),udg_EagelAMHp,bj_UNIT_FACING) set udg_EagelAMHu=bj_lastCreatedUnit set bj_forLoopAIndex=1 set bj_forLoopAIndexEnd=12 loop exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd if(Trig_EagelAMH_Func007Func001C())then call CreateFogModifierRadiusLocBJ(true,Player(-1+(bj_forLoopAIndex)),FOG_OF_WAR_VISIBLE,udg_EagelAMHp,512) set udg_EagelAMHfog[bj_forLoopAIndex]=bj_lastCreatedFogModifier call SelectUnitForPlayerSingle(udg_EagelAMHu,Player(-1+(bj_forLoopAIndex))) call DestroyFogModifier(udg_EagelAMHfog[bj_forLoopAIndex]) endif set bj_forLoopAIndex=bj_forLoopAIndex+1 endloop call PolledWait(1.) call RemoveUnit(udg_EagelAMHu) call TriggerExecute(gg_trg_EagelPrint) call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS) call DisableTrigger(gg_trg_EagelSeekA) call DisableTrigger(gg_trg_EagelSeekB) call EnableTrigger(GetTriggeringTrigger()) endfunction
Creating a unit, then select the units of the general anti-MH map approach, Lynn's article also says that while the new is really three sapphire using a variety of methods to detect this MH, first call CreateFogModifierRadiusLocBJ, create a fog, then the coordinates to create a unit (like the Terran infantry), and then let the player choose the unit, anyway, our aim is to disrupt the function of this code, the most direct is so that he does not work directly retn (as if no technical content, Lynn is said ...) ...
The following C ++ code is given key
void CbypassDlg :: OnBnClickedPatch () { // the TODO: In this addition control notification handler code DWORD PID; the HWND hwar3 = :: the FindWindow (L " Warcraft III " , L " Warcraft III " ); IF (! hwar3) { the MessageBox (L " CAN Not Find Warcraft III! " ); return ; } GetWindowThreadProcessId (hwar3, & PID); HANDLE Hopen = the OpenProcess (PROCESS_ALL_ACCESS, to false , PID); // _Data1 BYTE [] = {0x33,0xC0,0xE9,0x96,0x01,0x00,0x00,0x90,0x90,0x90,0x90,0x90}; // rewrite the code for function entry CreateFogModifierRadiusLoc BYTE _data2 [] = { 0x33 , 0xC0 , 0xE9 , 0xFC , 0x00 , 0x00 , 0x00 , 0x90 , 0x90 , 0x90 , 0x90 , 0x90 }; // the code rewriting function entry SelectUnit // CreateFogModifierRadiusLoc function entry address 0x6F2B3170 // SelectUnit function entry address 0x6F2C59A0 // if(!WriteProcessMemory(hopen,(LPVOID)(0x6F2B3170), &_data1,12, NULL) || !WriteProcessMemory(hopen,(LPVOID)(0x6F2C59A0), &_data2,12, NULL)) if(!WriteProcessMemory(hopen,(LPVOID)(0x6F2C59A0), &_data2,12, NULL)) { MessageBox(L"patch error!"); return; } else MessageBox(L"success!"); }
In the above code you can see I commented out some changes CreateFogModifierRadiusLoc function at the entrance, because it does not work, that is to say any units created, create function objects and the like, if retn out, then there will be World of Warcraft data synchronization errors and dropped calls, you can only modify the operating functions, but can not modify data affecting the function of Warcraft (here made mistakes = =!) ...
void CbypassDlg::OnBnClickedRecovery() { // 恢复函数 DWORD pid; HWND hwar3=::FindWindow(L"Warcraft III",L"Warcraft III"); if(!hwar3) { MessageBox(L"can't find Warcraft III!"); return; } GetWindowThreadProcessId(hwar3, &pid); HANDLE hopen = OpenProcess(PROCESS_ALL_ACCESS, false, pid); // BYTE _data1[]= {0x55,0x8B,0xEC,0x83,0xEC,0x3C,0x8B,0x0D,0xBC,0x22,0x87,0x6F}; BYTE _data2[]= {0x55,0x8B,0xEC,0x83,0xEC,0x08,0x8B,0x0D,0xBC,0x22,0x87,0x6F}; // if(!WriteProcessMemory(hopen,(LPVOID)(0x6F2B3170), &_data1,12, NULL) || !WriteProcessMemory(hopen,(LPVOID)(0x6F2C59A0), &_data2,12, NULL)) if(!WriteProcessMemory(hopen,(LPVOID)(0x6F2C59A0), &_data2,12, NULL)) { MessageBox(L"recovery error!"); return; } else MessageBox(L"success!"); }
============================================ still dividing line === ========================
I believe enough has been said clearly, source code did not need to give, there are two critical code above will suffice