最近用多開,注意到一個現象
直接關Garena會順便把一個War3關掉 (不知道哪版開始改的)
似乎很方便?
實際上,GGC直接暴力關掉War3 (不使用正常方式結束程式)
這樣做的結果就是,程式結束應該做的釋放資源等動作不會被執行
(驗證方式請用message sniffer,看war3不會收到WM_DESTROY就結束
印象中clean up的動作是在WM_DESTROY中做的)
會不會有memory leak,這要看war3是怎麼寫的
其實改成送WM_DESTROY來結束war3就解決了,怎麼會犯這種錯誤?
我有聽過更誇張的內幕,這邊就不方便透露了 (認識管理員的應該都有機會聽到)
像我就很偷懶,MSDN說程式結束會自動釋放的,我就沒手動寫
如果你沒正常結束koala's WC3 helper,我可以告訴你
基本上會有memory leak,某些系統資源會沒機會釋放
Sunday, October 25, 2009
Saturday, October 17, 2009
Autohotkey Send送出中文
範例程式碼原作者是PTT的Lumania
Autohotkey Send中文.ahk
測試過這個方法對War3無效...
參考資料
http://yonken.blogcn.com/diary,11740703.shtml
http://blog.xuite.net/emisjerry/tech/16012429
Autohotkey中 Send的部份用法
Autohotkey Send中文.ahk
測試過這個方法對War3無效...
參考資料
http://yonken.blogcn.com/diary,11740703.shtml
http://blog.xuite.net/emisjerry/tech/16012429
Autohotkey中 Send的部份用法
{ASC nnnnn} | Sends an ALT+nnnnn keypad combination, which can be used to generate special characters that don't exist on the keyboard. To generate ASCII characters, specify a number between 1 and 255. To generate ANSI characters (standard in most languages), specify a number between 128 and 255, but precede it with a leading zero, e.g. {Asc 0133}. To generate Unicode characters, specify a number between 256 and 65535 (without a leading zero). However, this is not supported by all applications. Therefore, for greater compatibility and easier sending of long Unicode strings, use "Transform Unicode" |
Labels:
software
Friday, September 25, 2009
xGC最近又開始濫了
久不見的藍畫面又出現了
進入TW dota room就當機,進其他國家的房間都不會出錯
看了訊息問題可能在 WC3Ladder.dll
推 Sighter:知道原因了 重灌一次就ok, 那是ladder plugin版本汰舊 09/24 22:22
根據Retty(Sighter@ptt)的回答,猜測是因為該檔案版本過舊
那為什麼自動更新系統沒更新到呢?
官方又放大絕了,重灌就可以解決,自動更新放好看也不是第一次了
重灌後,登入完就當掉,連房間都不用進,變強大了....
試了幾次,終於有登入不當機的,進房照當
→ maggot7398:多國語言版中的繁體中文一樣會出錯,一定要抓純繁中 09/25 00:15
這說明了什麼? 台灣白老鼠再現....台灣玩家用的版本是不一樣的
進入TW dota room就當機,進其他國家的房間都不會出錯
看了訊息問題可能在 WC3Ladder.dll
推 Sighter:知道原因了 重灌一次就ok, 那是ladder plugin版本汰舊 09/24 22:22
根據Retty(Sighter@ptt)的回答,猜測是因為該檔案版本過舊
那為什麼自動更新系統沒更新到呢?
官方又放大絕了,重灌就可以解決,自動更新放好看也不是第一次了
重灌後,登入完就當掉,連房間都不用進,變強大了....
試了幾次,終於有登入不當機的,進房照當
→ maggot7398:多國語言版中的繁體中文一樣會出錯,一定要抓純繁中 09/25 00:15
這說明了什麼? 台灣白老鼠再現....台灣玩家用的版本是不一樣的
Labels:
ggc
Sunday, September 6, 2009
Ghost++ 開遊戲機器人
BBS版本請到PTT(telnet://ptt.cc) WarcraftChat板觀看
我不發Warcraft板,發文沒被m過,浪費力氣
http://forum.codelain.com/index.php?board=22.0
GHost++ stands for Game Host.
簡單說就是開game用的 (目前只支援War3)
為什麼要使用GHost++?
Open Source!! 可額外選用patch增加需要的功能,或自己改
可以分離主機和玩家端,開遊戲不一定要用自己的電腦開,可節省資源減少lag
可同時進行多個遊戲,只要遊戲開始了,bot就可以繼續開一下個遊戲
可自動開遊戲,人滿就自動開始 (!autohost)
內建無訊息自動刷房 (不會出現誰加入離開)
內建反延遲及遊戲管理功能 (ex: 查ping, 國家, 黑名單...等)
可自動踢掉網路太差的玩家
可自動過濾國家 (目前custom build才有,官方版沒採用)
支援多平台,不需要安裝遊戲主程式 (Windows, Linux, Mac皆可使用)
ghost.cfg 設定檔
motd.txt 進入遊戲大廳的公告 (沒有請自己建立)
gameloaded.txt 地圖讀取完的訊息
gameover.txt 遊戲結束的訊息
ghost.cfg需要改的地方
bot_war3path = D:\Warcraft III\
war3路徑
沒有war3的電腦,要有下面的檔案 (請從有安裝的電腦copy過來)
game.dll
Storm.dll
war3.exe
blizzard.j
common.j
bot_mappath = maps\
war3地圖檔路徑,請把要用的圖都copy一份進去
或是使用 link shell extension 做連結
bot_spoofchecks = 0
bot_requirespoofchecks = 0
改名檢查,最好關掉 (不關應該沒幾個人會通過,就被踢光光)
bot_latency = 150
反延遲設定
admingame_create = 1
開啟Lan game管理介面
admingame_password = ranranru
Lan game管理介面密碼
bnet_cdkeyroc =
bnet_cdkeytft =
遊戲序號
bnet_server = uswest.battle.net
bnet_serveralias = USWest
bnet_username = IamBot
bnet_password = ******
帳號 密碼
bnet_firstchannel = test
進哪個頻道
bnet_rootadmin = ranranru
你老大是誰
bnet_bnlsserver = bnls.hikato.com
bnet_bnlsport = 19283
Warden相關的東西,直接用老外提供的就可以了
不想用老外的,自己跑server也可以
設定錯誤會一直跟Battlenet斷線
常用指令
!map load a map file (".w3m" and ".w3x" files),
!load load a map config file (".cfg" files), leave
blank to see current map
!priv host private game
!pub host public game
!close ... close slot
!open ... open slot
!closeall close all open slots
!openall open all closed slots
!from display the country each player is from
!ping [number] ping players, optionally add [number] to kick
players with ping above [number]
!unhost unhost game
!start [force] start game, optionally add [force] to skip
checks
使用方式
先用 !map 或 !load 選一張圖
!map指令只能開非正規圖,只能用預設選項開,不能在遊戲開始時打指令
!map ImbaWar592b.w3x
請確定 bot_mappath 路徑內有 ImbaWar592b.w3x,否則會錯誤
以正規圖為例,介紹!load的用法
!load tw-ref.cfg
請確定 bot_mapcfgpath 路徑內有 tw-ref.cfg,否則會錯誤
tw-ref.cfg的內容
map_path = Maps\FrozenThrone\(4)TwistedMeadows.w3x
給replay看的,(4)TwistedMeadows.w3x改成你用的地圖,其他不要動
map_localpath = FrozenThrone\(4)TwistedMeadows.w3x
看你圖放在哪就設哪嘍
map_speed = 3
map_visibility = 4
map_flags = 3
map_gametype = 2
# map observers
# 1 = none
# 2 = on defeat
# 3 = allowed
# 4 = referees
map_observers = 4
選完圖後
公開遊戲 !pub 正規隨便打
私人遊戲 !priv 1234
公開遊戲開了bot就會從頻道消失,私人遊戲不會
有沒有開成功,bot會告訴你
進入遊戲後,記得先用/w 密一下bot,做完id檢查 (bot跟war3同一台的不用檢查)
否則bot怕你是假冒的,不會聽你的話
開始遊戲打 !start
關掉遊戲打 !unhost
遊戲開始後bot就會回到聊天頻道了,可再開下一個遊戲
頻道中的對話,bot也可轉送給你
只有一套cdkey要怎麼使用?
在ghost.cfg中 admingame_create = 1
進lan game,加入admingame
加入後打 !password ranranru (你的密碼)
接著就跟前面提到的一樣了 (!map/!load 然後 !pub/!priv)
開好後,離開admingame
會在lan game看到你剛開的遊戲,加入即可
有Visual C++的,建議調一下設定,自己編最佳化版本
檔案比較小,執行效率也比較好
較少用的功能懶得寫,某些功能/用法是不能寫
未提及的部份,請自己看文件
我編的15.0以後版本需配合官方版本使用
Ghost++ 15.0 SSE2 build
Ghost++ 14.7 SSE2 build
我不發Warcraft板,發文沒被m過,浪費力氣
http://forum.codelain.com/index.php?board=22.0
GHost++ stands for Game Host.
簡單說就是開game用的 (目前只支援War3)
為什麼要使用GHost++?
Open Source!! 可額外選用patch增加需要的功能,或自己改
可以分離主機和玩家端,開遊戲不一定要用自己的電腦開,可節省資源減少lag
可同時進行多個遊戲,只要遊戲開始了,bot就可以繼續開一下個遊戲
可自動開遊戲,人滿就自動開始 (!autohost)
內建無訊息自動刷房 (不會出現誰加入離開)
內建反延遲及遊戲管理功能 (ex: 查ping, 國家, 黑名單...等)
可自動踢掉網路太差的玩家
可自動過濾國家 (目前custom build才有,官方版沒採用)
支援多平台,不需要安裝遊戲主程式 (Windows, Linux, Mac皆可使用)
ghost.cfg 設定檔
motd.txt 進入遊戲大廳的公告 (沒有請自己建立)
gameloaded.txt 地圖讀取完的訊息
gameover.txt 遊戲結束的訊息
ghost.cfg需要改的地方
bot_war3path = D:\Warcraft III\
war3路徑
沒有war3的電腦,要有下面的檔案 (請從有安裝的電腦copy過來)
game.dll
Storm.dll
war3.exe
blizzard.j
common.j
bot_mappath = maps\
war3地圖檔路徑,請把要用的圖都copy一份進去
或是使用 link shell extension 做連結
bot_spoofchecks = 0
bot_requirespoofchecks = 0
改名檢查,最好關掉 (不關應該沒幾個人會通過,就被踢光光)
bot_latency = 150
反延遲設定
admingame_create = 1
開啟Lan game管理介面
admingame_password = ranranru
Lan game管理介面密碼
bnet_cdkeyroc =
bnet_cdkeytft =
遊戲序號
bnet_server = uswest.battle.net
bnet_serveralias = USWest
bnet_username = IamBot
bnet_password = ******
帳號 密碼
bnet_firstchannel = test
進哪個頻道
bnet_rootadmin = ranranru
你老大是誰
bnet_bnlsserver = bnls.hikato.com
bnet_bnlsport = 19283
Warden相關的東西,直接用老外提供的就可以了
不想用老外的,自己跑server也可以
設定錯誤會一直跟Battlenet斷線
常用指令
!map
!load
blank to see current map
!priv
!pub
!close
!open
!closeall close all open slots
!openall open all closed slots
!from display the country each player is from
!ping [number] ping players, optionally add [number] to kick
players with ping above [number]
!unhost unhost game
!start [force] start game, optionally add [force] to skip
checks
使用方式
先用 !map 或 !load 選一張圖
!map指令只能開非正規圖,只能用預設選項開,不能在遊戲開始時打指令
!map ImbaWar592b.w3x
請確定 bot_mappath 路徑內有 ImbaWar592b.w3x,否則會錯誤
以正規圖為例,介紹!load的用法
!load tw-ref.cfg
請確定 bot_mapcfgpath 路徑內有 tw-ref.cfg,否則會錯誤
tw-ref.cfg的內容
map_path = Maps\FrozenThrone\(4)TwistedMeadows.w3x
給replay看的,(4)TwistedMeadows.w3x改成你用的地圖,其他不要動
map_localpath = FrozenThrone\(4)TwistedMeadows.w3x
看你圖放在哪就設哪嘍
map_speed = 3
map_visibility = 4
map_flags = 3
map_gametype = 2
# map observers
# 1 = none
# 2 = on defeat
# 3 = allowed
# 4 = referees
map_observers = 4
選完圖後
公開遊戲 !pub 正規隨便打
私人遊戲 !priv 1234
公開遊戲開了bot就會從頻道消失,私人遊戲不會
有沒有開成功,bot會告訴你
進入遊戲後,記得先用/w 密一下bot,做完id檢查 (bot跟war3同一台的不用檢查)
否則bot怕你是假冒的,不會聽你的話
開始遊戲打 !start
關掉遊戲打 !unhost
遊戲開始後bot就會回到聊天頻道了,可再開下一個遊戲
頻道中的對話,bot也可轉送給你
只有一套cdkey要怎麼使用?
在ghost.cfg中 admingame_create = 1
進lan game,加入admingame
加入後打 !password ranranru (你的密碼)
接著就跟前面提到的一樣了 (!map/!load 然後 !pub/!priv)
開好後,離開admingame
會在lan game看到你剛開的遊戲,加入即可
有Visual C++的,建議調一下設定,自己編最佳化版本
檔案比較小,執行效率也比較好
較少用的功能懶得寫,某些功能/用法是不能寫
未提及的部份,請自己看文件
Ghost++ 15.0 SSE2 build
Ghost++ 14.7 SSE2 build
Saturday, September 5, 2009
War3多開 1.24b
Allows multiple warcraft 3 instances and joining your own LAN game.
The file must be placed within your Warcraft 3 folder or it will fail. Must
be run as administrator.
1.24b
The file must be placed within your Warcraft 3 folder or it will fail. Must
be run as administrator.
1.24b
Friday, September 4, 2009
NEGiES 日文限流軟體
很久沒更新的官網
拿來限制上傳地圖速度還不錯用
NEGiES1.57 可以不用安裝
NEGiES2 要先到driver的目錄先安裝driver後才能用
64bit用amd64目錄的,32bit就用i386
在inf檔案右鍵選安裝
拿來限制上傳地圖速度還不錯用
NEGiES1.57 可以不用安裝
NEGiES2 要先到driver的目錄先安裝driver後才能用
64bit用amd64目錄的,32bit就用i386
在inf檔案右鍵選安裝
Saturday, August 29, 2009
[1.23]Opensource Hack with Many offsets! by sd333221
現在差不多都1.24了,留個備份
僅提供研究,使用後果自行負責
作者是sd333221
//SimpleWc3Hack for Warcraft 3 Patch 1.23...
#include
#include
#include
using namespace std;
DWORD GetPIDForProcess (char* process);
void EnableDebugPriv();
DWORD GetDLLBase(char* DllName, DWORD tPid);
#define PATCH(i,w,l) WriteProcessMemory(hProc,reinterpret_cast(gameBase+i),w,l,&dSize)
#define NPATCH(i,w,l) WriteProcessMemory(hProc,reinterpret_cast(i),w,l,&dSize)
int main()
{
cout << "SimpleWc3Hack v2.1 by sd333221 loaded (for WC3 v1.23)!" << endl << endl; cout << "Searching Wc3..." << endl; if(GetPIDForProcess("WAR3.EXE") == 0) { cout << "Warcraft 3 was not found..." << endl; system("Pause"); exit(0); } else { cout << "Getting debug privileges..." << endl; EnableDebugPriv(); cout << "Opening Warcraft 3 Process..." << endl; HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, GetPIDForProcess("WAR3.EXE")); if(hProc) { cout << "Process opened... Patching" << endl; DWORD gameBase = GetDLLBase("Game.dll",GetPIDForProcess("WAR3.EXE")); DWORD dSize = 0; PATCH(0x3A1E9B,"\x90\x90",2); //Patch 6F3A1E9B to nop nop :-) if(dSize == 0) { cout << "Failed to patch showunitsingame" << endl; } PATCH(0x361DFC,"\x00",1); if(dSize == 0) { cout << "Failed to patch showunitsmap" << endl; } PATCH(0x285B8C,"\x90\x90",2); if(dSize == 0) { cout << "Failed to patch clickableunits" << endl; } PATCH(0x285BA2,"\xEB\x29",2); if(dSize == 0) { cout << "Failed to patch clickableunits (2nd patch)" << endl; } PATCH(0x28345C,"\x40\xc3",2); if(dSize == 0) { cout << "Failed to patch revealillu" << endl; } PATCH(0x73DEC9,"\xB2\x00\x90\x90\x90\x90",6); if(dSize == 0) { cout << "Failed to patch removefogingame" << endl; } PATCH(0x431556,"\x3B\xC0\x0F\x85\xC0\x00\x00\x00\x8D\x8B\xF0\x00\x00\x00\xE8\x07\x3D\x03\x00\x3B\xC0\x0F\x85\xAD\x00\x00\x00",27); if(dSize == 0) { cout << "Failed to patch pingsignal" << endl; } PATCH(0x362211,"\x3B\xC0\x0F\x85\x30\x04\x00\x00",8); if(dSize == 0) { cout << "Failed to patch showinvisiblemap" << endl; } PATCH(0x356E7E,"\x90\x90\x90",3); if(dSize == 0) { cout << "Failed to patch showinvisiblemap" << endl; } PATCH(0x3C5C22,"\xEB",1); PATCH(0x3C135C,"\xB8\xFF\x00\x00\x00\xEB",6); if(dSize == 0) { cout << "Failed to bypass DotA -ah command" << endl; } PATCH(0x3F92CA,"\x90\x90",2); PATCH(0x3A1DDB,"\xEB",1); if(dSize == 0) { cout << "Failed to enable viewable items" << endl; } NPATCH(0x4559EC,"\x60\x0B\xC0\x75\x2F\x8A\x8E\xD0\x02\x00\x00\x80\xF9\x01\x74\x51\xC6\x86\xD0\x02\x00\x00\x01\xC6\x86\xD1\x02\x00\x00\x01\xC6\x86\xD2\x02\x00\x00\xFF\x8B\xCE\xB8\xFF\x01\x01\xFF\xFF\x15\x60\x5A\x45\x00\xEB\x2D\x8A\x8E\xD0\x02\x00\x00\x80\xF9\xFF\x74\x22\xC6\x86\xD0\x02\x00\x00\xFF\xC6\x86\xD1\x02\x00\x00\xFF\xC6\x86\xD2\x02\x00\x00\xFF\x8B\xCE\xB8\xFF\xFF\xFF\xFF\xFF\x15\x60\x5A\x45\x00\x61\xB8\x01\x00\x00\x00\x23\xD8\x89\x44\x24\xE4\xFF\x35\x65\x5A\x45\x00\xC3",116); DWORD addr[3]; addr[0] = gameBase + 0x29E270; //References to the Game.dll addr[1] = gameBase + 0x39A3BF; // addr[2] = 0x4559EC; //Detour NPATCH(0x455A60,&addr[0],sizeof(DWORD)); NPATCH(0x455A65,&addr[1],sizeof(DWORD)); NPATCH(0x455A6A,&addr[2],sizeof(DWORD)); PATCH(0x39A3B9,"\xFF\x25\x6A\x5A\x45\x00",6); //Plant detour if(dSize == 0) { cout << "Failed to enable colored invisibles" << endl; } PATCH(0x2030DC,"\x90\x90\x90\x90\x90\x90",6); PATCH(0x34FC68,"\x90\x90",2); if(dSize == 0) { cout << "Failed to enable view skills" << endl; } PATCH(0x28EBCE,"\xEB",1); PATCH(0x34FCA6,"\x90\x90\x90\x90",4); if(dSize == 0) { cout << "Failed to enable view cooldowns" << endl; } PATCH(0x285BA2,"\xEB",1); if(dSize == 0) { cout << "Failed to enable click invisible units" << endl; } //Tradeamount disabled /*PATCH(0x34E762,"\xB8\x00\x00\x00\x00\x90",6); DWORD highTradeAmount = 200; PATCH(0x34E763,&highTradeAmount,sizeof(DWORD)); PATCH(0x34E76A,"\xB8\x00\x00\x00\x00\x90",6); DWORD lowTradeAmount = 100; PATCH(0x34E76B,&lowTradeAmount,sizeof(DWORD)); if(dSize == 0) { cout << "Failed to patch tradeamount" << endl; }*/ cout << "Show hero icons: " << endl; cout << "Press F1 to view all hero icons, F2 for enemy icons, F3 for ally icons, any key for nothing!" << endl; system("Pause"); if(GetAsyncKeyState(VK_F1)) { PATCH(0x371581, "\x5B\x26",2); PATCH(0x371587, "\x90\x90\x90\x90\x90\x90",6); if(dSize == 0) { cout << "Failed to patch view all icons" << endl; } } else if(GetAsyncKeyState(VK_F2)) { PATCH(0x371581, "\x5B\x26",2); PATCH(0x371587, "\x0F\x85\x8F\x02\x00\x00",6); if(dSize == 0) { cout << "Failed to patch view enemy icons" << endl; } } else if(GetAsyncKeyState(VK_F3)) { PATCH(0x371581, "\x5B\x26",2); PATCH(0x371587, "\x0F\x84\x8F\x02\x00\x00",6); if(dSize == 0) { cout << "Failed to patch view ally icons" << endl; } } else { cout << "View hero icons not enabled!" << endl; } Sleep(1000); cout << "Unlimited camera zoom" << endl; cout << "Press F1 to enable camera zoom" << endl; system("Pause"); if(GetAsyncKeyState(VK_F1)) { float zoom = 0; cout << "Please enter zoom: "; cin >> zoom;
PATCH(0x285B68, "\xE9\x04\xA3\x5E\x00",5);
PATCH(0x86FE71, "\xE8\xDA\x13\xCC\xFF\x6A\x01\x6A\x00\x68\xCC\xCC\xCC\xCC\x6A\x00\x8B\x0D\xD8\xA7\xAB\x6F\x8B\x89\x54\x02\x00\x00\xE8\x8E\x65\xA9\xFF\xE9\xD6\x5C\xA1\xFF",38);
PATCH(0x86FE7B,&zoom,sizeof(DWORD));
}
cout << "Done, goodbye!" << endl;
system("Pause");
exit(1);
}
else
{
cout << "Warcraft 3 could not be opened..." << endl;
system("Pause");
exit(0);
}
}
return 0;
}
//Queries the ProcessId of a certain process
DWORD GetPIDForProcess (char* process)
{
BOOL working=0;
PROCESSENTRY32 lppe= {0};
DWORD targetPid=0;
HANDLE hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS ,0);
if (hSnapshot)
{
lppe.dwSize=sizeof(lppe);
working=Process32First(hSnapshot,&lppe);
while (working)
{
if(_stricmp(lppe.szExeFile,process)==0)
{
targetPid=lppe.th32ProcessID;
break;
}
working=Process32Next(hSnapshot,&lppe);
}
}
CloseHandle( hSnapshot );
return targetPid;
}
//Enables to open other processes
void EnableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if ( ! OpenProcessToken( GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
return;
if ( ! LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &sedebugnameValue ) ){
CloseHandle( hToken );
return;
}
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if ( ! AdjustTokenPrivileges( hToken, FALSE, &tkp, sizeof tkp, NULL, NULL ) )
CloseHandle( hToken );
}
//Gets the base of our dll
DWORD GetDLLBase(char* DllName, DWORD tPid)
{
HANDLE snapMod;
MODULEENTRY32 me32;
if (tPid == 0) return 0;
snapMod = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, tPid);
me32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(snapMod, &me32)){
do{
if (strcmp(DllName,me32.szModule) == 0){
CloseHandle(snapMod);
return (DWORD) me32.modBaseAddr;
}
}while(Module32Next(snapMod,&me32));
}
CloseHandle(snapMod);
return 0;
}
僅提供研究,使用後果自行負責
作者是sd333221
//SimpleWc3Hack for Warcraft 3 Patch 1.23...
#include
#include
#include
using namespace std;
DWORD GetPIDForProcess (char* process);
void EnableDebugPriv();
DWORD GetDLLBase(char* DllName, DWORD tPid);
#define PATCH(i,w,l) WriteProcessMemory(hProc,reinterpret_cast
#define NPATCH(i,w,l) WriteProcessMemory(hProc,reinterpret_cast
int main()
{
cout << "SimpleWc3Hack v2.1 by sd333221 loaded (for WC3 v1.23)!" << endl << endl; cout << "Searching Wc3..." << endl; if(GetPIDForProcess("WAR3.EXE") == 0) { cout << "Warcraft 3 was not found..." << endl; system("Pause"); exit(0); } else { cout << "Getting debug privileges..." << endl; EnableDebugPriv(); cout << "Opening Warcraft 3 Process..." << endl; HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, GetPIDForProcess("WAR3.EXE")); if(hProc) { cout << "Process opened... Patching" << endl; DWORD gameBase = GetDLLBase("Game.dll",GetPIDForProcess("WAR3.EXE")); DWORD dSize = 0; PATCH(0x3A1E9B,"\x90\x90",2); //Patch 6F3A1E9B to nop nop :-) if(dSize == 0) { cout << "Failed to patch showunitsingame" << endl; } PATCH(0x361DFC,"\x00",1); if(dSize == 0) { cout << "Failed to patch showunitsmap" << endl; } PATCH(0x285B8C,"\x90\x90",2); if(dSize == 0) { cout << "Failed to patch clickableunits" << endl; } PATCH(0x285BA2,"\xEB\x29",2); if(dSize == 0) { cout << "Failed to patch clickableunits (2nd patch)" << endl; } PATCH(0x28345C,"\x40\xc3",2); if(dSize == 0) { cout << "Failed to patch revealillu" << endl; } PATCH(0x73DEC9,"\xB2\x00\x90\x90\x90\x90",6); if(dSize == 0) { cout << "Failed to patch removefogingame" << endl; } PATCH(0x431556,"\x3B\xC0\x0F\x85\xC0\x00\x00\x00\x8D\x8B\xF0\x00\x00\x00\xE8\x07\x3D\x03\x00\x3B\xC0\x0F\x85\xAD\x00\x00\x00",27); if(dSize == 0) { cout << "Failed to patch pingsignal" << endl; } PATCH(0x362211,"\x3B\xC0\x0F\x85\x30\x04\x00\x00",8); if(dSize == 0) { cout << "Failed to patch showinvisiblemap" << endl; } PATCH(0x356E7E,"\x90\x90\x90",3); if(dSize == 0) { cout << "Failed to patch showinvisiblemap" << endl; } PATCH(0x3C5C22,"\xEB",1); PATCH(0x3C135C,"\xB8\xFF\x00\x00\x00\xEB",6); if(dSize == 0) { cout << "Failed to bypass DotA -ah command" << endl; } PATCH(0x3F92CA,"\x90\x90",2); PATCH(0x3A1DDB,"\xEB",1); if(dSize == 0) { cout << "Failed to enable viewable items" << endl; } NPATCH(0x4559EC,"\x60\x0B\xC0\x75\x2F\x8A\x8E\xD0\x02\x00\x00\x80\xF9\x01\x74\x51\xC6\x86\xD0\x02\x00\x00\x01\xC6\x86\xD1\x02\x00\x00\x01\xC6\x86\xD2\x02\x00\x00\xFF\x8B\xCE\xB8\xFF\x01\x01\xFF\xFF\x15\x60\x5A\x45\x00\xEB\x2D\x8A\x8E\xD0\x02\x00\x00\x80\xF9\xFF\x74\x22\xC6\x86\xD0\x02\x00\x00\xFF\xC6\x86\xD1\x02\x00\x00\xFF\xC6\x86\xD2\x02\x00\x00\xFF\x8B\xCE\xB8\xFF\xFF\xFF\xFF\xFF\x15\x60\x5A\x45\x00\x61\xB8\x01\x00\x00\x00\x23\xD8\x89\x44\x24\xE4\xFF\x35\x65\x5A\x45\x00\xC3",116); DWORD addr[3]; addr[0] = gameBase + 0x29E270; //References to the Game.dll addr[1] = gameBase + 0x39A3BF; // addr[2] = 0x4559EC; //Detour NPATCH(0x455A60,&addr[0],sizeof(DWORD)); NPATCH(0x455A65,&addr[1],sizeof(DWORD)); NPATCH(0x455A6A,&addr[2],sizeof(DWORD)); PATCH(0x39A3B9,"\xFF\x25\x6A\x5A\x45\x00",6); //Plant detour if(dSize == 0) { cout << "Failed to enable colored invisibles" << endl; } PATCH(0x2030DC,"\x90\x90\x90\x90\x90\x90",6); PATCH(0x34FC68,"\x90\x90",2); if(dSize == 0) { cout << "Failed to enable view skills" << endl; } PATCH(0x28EBCE,"\xEB",1); PATCH(0x34FCA6,"\x90\x90\x90\x90",4); if(dSize == 0) { cout << "Failed to enable view cooldowns" << endl; } PATCH(0x285BA2,"\xEB",1); if(dSize == 0) { cout << "Failed to enable click invisible units" << endl; } //Tradeamount disabled /*PATCH(0x34E762,"\xB8\x00\x00\x00\x00\x90",6); DWORD highTradeAmount = 200; PATCH(0x34E763,&highTradeAmount,sizeof(DWORD)); PATCH(0x34E76A,"\xB8\x00\x00\x00\x00\x90",6); DWORD lowTradeAmount = 100; PATCH(0x34E76B,&lowTradeAmount,sizeof(DWORD)); if(dSize == 0) { cout << "Failed to patch tradeamount" << endl; }*/ cout << "Show hero icons: " << endl; cout << "Press F1 to view all hero icons, F2 for enemy icons, F3 for ally icons, any key for nothing!" << endl; system("Pause"); if(GetAsyncKeyState(VK_F1)) { PATCH(0x371581, "\x5B\x26",2); PATCH(0x371587, "\x90\x90\x90\x90\x90\x90",6); if(dSize == 0) { cout << "Failed to patch view all icons" << endl; } } else if(GetAsyncKeyState(VK_F2)) { PATCH(0x371581, "\x5B\x26",2); PATCH(0x371587, "\x0F\x85\x8F\x02\x00\x00",6); if(dSize == 0) { cout << "Failed to patch view enemy icons" << endl; } } else if(GetAsyncKeyState(VK_F3)) { PATCH(0x371581, "\x5B\x26",2); PATCH(0x371587, "\x0F\x84\x8F\x02\x00\x00",6); if(dSize == 0) { cout << "Failed to patch view ally icons" << endl; } } else { cout << "View hero icons not enabled!" << endl; } Sleep(1000); cout << "Unlimited camera zoom" << endl; cout << "Press F1 to enable camera zoom" << endl; system("Pause"); if(GetAsyncKeyState(VK_F1)) { float zoom = 0; cout << "Please enter zoom: "; cin >> zoom;
PATCH(0x285B68, "\xE9\x04\xA3\x5E\x00",5);
PATCH(0x86FE71, "\xE8\xDA\x13\xCC\xFF\x6A\x01\x6A\x00\x68\xCC\xCC\xCC\xCC\x6A\x00\x8B\x0D\xD8\xA7\xAB\x6F\x8B\x89\x54\x02\x00\x00\xE8\x8E\x65\xA9\xFF\xE9\xD6\x5C\xA1\xFF",38);
PATCH(0x86FE7B,&zoom,sizeof(DWORD));
}
cout << "Done, goodbye!" << endl;
system("Pause");
exit(1);
}
else
{
cout << "Warcraft 3 could not be opened..." << endl;
system("Pause");
exit(0);
}
}
return 0;
}
//Queries the ProcessId of a certain process
DWORD GetPIDForProcess (char* process)
{
BOOL working=0;
PROCESSENTRY32 lppe= {0};
DWORD targetPid=0;
HANDLE hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS ,0);
if (hSnapshot)
{
lppe.dwSize=sizeof(lppe);
working=Process32First(hSnapshot,&lppe);
while (working)
{
if(_stricmp(lppe.szExeFile,process)==0)
{
targetPid=lppe.th32ProcessID;
break;
}
working=Process32Next(hSnapshot,&lppe);
}
}
CloseHandle( hSnapshot );
return targetPid;
}
//Enables to open other processes
void EnableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if ( ! OpenProcessToken( GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
return;
if ( ! LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &sedebugnameValue ) ){
CloseHandle( hToken );
return;
}
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if ( ! AdjustTokenPrivileges( hToken, FALSE, &tkp, sizeof tkp, NULL, NULL ) )
CloseHandle( hToken );
}
//Gets the base of our dll
DWORD GetDLLBase(char* DllName, DWORD tPid)
{
HANDLE snapMod;
MODULEENTRY32 me32;
if (tPid == 0) return 0;
snapMod = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, tPid);
me32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(snapMod, &me32)){
do{
if (strcmp(DllName,me32.szModule) == 0){
CloseHandle(snapMod);
return (DWORD) me32.modBaseAddr;
}
}while(Module32Next(snapMod,&me32));
}
CloseHandle(snapMod);
return 0;
}
Sunday, July 26, 2009
Saturday, July 25, 2009
Wednesday, July 22, 2009
Tuesday, July 21, 2009
Friday, June 5, 2009
Sunday, April 19, 2009
Saturday, April 11, 2009
windows media player不能開
http://www.techsupportforum.com/microsoft-support/windows-vista-support/214216-can-t-open-windown-media-player.html
regsvr32 jscript.dll
regsvr32 vbscript.dll
regsvr32 wmp.dll
或是
設定程式存取及預設值
把mediaplayer打勾
regsvr32 jscript.dll
regsvr32 vbscript.dll
regsvr32 wmp.dll
或是
設定程式存取及預設值
把mediaplayer打勾
Labels:
M$
Subscribe to:
Posts (Atom)