diff --git a/Commons/updatingConst.h b/Commons/updatingConst.h index 99a53d9..b349699 100644 --- a/Commons/updatingConst.h +++ b/Commons/updatingConst.h @@ -44,11 +44,12 @@ enum UpdateServerConst US_MAXGOLD, US_PUTGOLD, US_TAKEGOLD, - -//For CB - US_TEST1, - US_TEST2, - US_TEST3 + US_TEST1, //For CB + US_TEST2, //For CB + US_TEST3, //For CB + US_TOGGLE, + US_SWAP, + US_SWAPLAST = 0xFFFF }; /*================================= END OF FILE =================================*/ \ No newline at end of file diff --git a/PlugY/Commands.cpp b/PlugY/Commands.cpp index 722cfed..1b505b0 100644 --- a/PlugY/Commands.cpp +++ b/PlugY/Commands.cpp @@ -23,11 +23,18 @@ bool active_savegame=false; #define MAX_CMD_SIZE 200 const char * CMD_RENAME="/rename"; + +const char * CMD_PAGENAME = "/pagename"; const char * CMD_LISTCUBEFORMULA="/listcube"; const char * CMD_SELECTPAGE="/page"; +const char * CMD_SWAP = "/swap"; +const char * CMD_TOGGLE = "/toggle"; const char * CMD_RELOAD="/reload"; +const char * CMD_LOCK_MOUSE = "/lockmouse"; +const char * CMD_LOCK_MOUSE2 = "/lock"; + const char * CMD_STARTSAVE="/save"; const char * CMD_MAXGOLD="/maxgold"; @@ -145,18 +152,89 @@ int STDCALL commands (char* ptText) char command[MAX_CMD_SIZE]; ZeroMemory(command,MAX_CMD_SIZE); strncpy(command,ptText,MAX_CMD_SIZE-1); - strlwr(command); + _strlwr(command); - if (!strncmp(command,CMD_RENAME,strlen(CMD_RENAME))) + if (!strncmp(command, CMD_RENAME, strlen(CMD_RENAME)) && ptClientNameChar != NULL) + { + char* param = &command[strlen(CMD_RENAME)]; + int len = strlen(param); + if (param[0] != ' ') + return 1; + param++; + len--; + if (len < 2 || len > 15) + return 0; + for (int i = 0; i < len; i++) + { + char c = param[i]; + if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_'))) + return 1; + } + // Move current save file + { + char szCurrentFile[MAX_PATH]; + char szNewFile[MAX_PATH]; + + //Get temporary savefile name. + D2FogGetSavePath(szCurrentFile, MAX_PATH); + D2FogGetSavePath(szNewFile, MAX_PATH); + strcat(szCurrentFile, ptChar->ptPlayerData->name); + strcat(szNewFile, param); + strcat(szCurrentFile, "."); + strcat(szNewFile, "."); + int curLen = strlen(szCurrentFile); + int newLen = strlen(szNewFile); + strcpy(&szCurrentFile[curLen], "d2s"); + strcpy(&szNewFile[newLen], "d2s"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "d2x"); + strcpy(&szNewFile[newLen], "d2x"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "key"); + strcpy(&szNewFile[newLen], "key"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "ma0"); + strcpy(&szNewFile[newLen], "ma0"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "ma1"); + strcpy(&szNewFile[newLen], "ma1"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "ma2"); + strcpy(&szNewFile[newLen], "ma2"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "ma3"); + strcpy(&szNewFile[newLen], "ma3"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "ma4"); + strcpy(&szNewFile[newLen], "ma4"); + MoveFile(szCurrentFile, szNewFile); + strcpy(&szCurrentFile[curLen], "map"); + strcpy(&szNewFile[newLen], "map"); + MoveFile(szCurrentFile, szNewFile); + } + // Update server + for (int i = 0; i <= len; i++) + { + updateServer(US_RENAME + (param[i] << 8)); + } + + // Update client + log_msg("Rename on Client : %s -> %s\n", ptChar->ptPlayerData->name, param); + strcpy(ptChar->ptPlayerData->name, param); + strcpy(ptClientNameChar, param); + updateServer(US_SAVE); + return 0; + } + + if (!strncmp(command, CMD_PAGENAME,strlen(CMD_PAGENAME))) { if (!active_multiPageStash) return 1; - char* param = &command[strlen(CMD_RENAME)]; + char* param = &command[strlen(CMD_PAGENAME)]; DWORD len = strlen(param); - if (len && (param[0] != ' ')) return 1; Stash* ptStash = PCPY->currentStash; if (!ptStash) return 0; - if (len>1) + if (len>1 && param[0] == ' ') { D2FogMemDeAlloc(ptStash->name,__FILE__,__LINE__,0); ptStash->name = (char *)malloc(len);//D2FogMemAlloc(len,__FILE__,__LINE__,0); @@ -182,6 +260,32 @@ int STDCALL commands (char* ptText) return 0; } + if (!strncmp(command, CMD_TOGGLE, strlen(CMD_TOGGLE))) + { + if (!active_sharedStash) return 1; + int page = atoi(&command[strlen(CMD_TOGGLE)]) - 1; + if (page < 0) + return 1; + updateServer(US_SWAP3 + ((page & 0xFF000000) >> 16)); + updateServer(US_SWAP2 + ((page & 0xFF0000) >> 8)); + updateServer(US_SWAP1 + (page & 0xFF00)); + updateServer(US_SWAP0_TOGGLE + ((page & 0xFF) << 8)); + return 0; + } + + if (!strncmp(command, CMD_SWAP, strlen(CMD_SWAP))) + { + if (!active_multiPageStash) return 1; + int page = atoi(&command[strlen(CMD_SWAP)]) - 1; + if (page < 0) + return 1; + updateServer(US_SWAP3 + ((page & 0xFF000000) >> 16)); + updateServer(US_SWAP2 + ((page & 0xFF0000) >> 8)); + updateServer(US_SWAP1 + (page & 0xFF00)); + updateServer(US_SWAP0 + ((page & 0xFF) << 8)); + return 0; + } + if (!strcmp(command,CMD_RELOAD)) { if (onRealm) return 1; @@ -189,10 +293,17 @@ int STDCALL commands (char* ptText) return 0; } + if (!strcmp(command, CMD_LOCK_MOUSE) || !strcmp(command, CMD_LOCK_MOUSE2)) + { + if (onRealm) return 1; + lockMouseCursor(); + return 0; + } + if (!strcmp(command,CMD_STARTSAVE)) { if (onRealm) return 1; - updateServer(US_STARTSAVE); + updateServer(US_SAVE); return 0; } diff --git a/PlugY/D2wrapper.cpp b/PlugY/D2wrapper.cpp index 7552405..054f8d6 100644 --- a/PlugY/D2wrapper.cpp +++ b/PlugY/D2wrapper.cpp @@ -470,7 +470,7 @@ extern "C" __declspec(dllexport) void* __stdcall Init(LPSTR IniName) if (active_VersionTextChange) Install_VersionChange(); - if (active_PrintPlugYVersion) + if (active_PrintPlugYVersion || active_Windowed) Install_PrintPlugYVersion(); if (active_StatsPoints) diff --git a/PlugY/ExtraOptions.cpp b/PlugY/ExtraOptions.cpp index e8d6cc3..2100fb8 100644 --- a/PlugY/ExtraOptions.cpp +++ b/PlugY/ExtraOptions.cpp @@ -10,10 +10,11 @@ #include "d2functions.h" #include -int active_RunLODs = false; -int active_alwaysRegenMapInSP = false; -DWORD nbPlayersCommandByDefault = 1; +int active_Windowed = true; int active_DisplayItemLevel = false; +DWORD nbPlayersCommandByDefault = 0; +int active_alwaysRegenMapInSP = false; +int active_RunLODs = false; int active_AlwaysDisplayLifeMana = false; int active_EnabledTXTFilesWithMSExcel = false; int active_DisplayBaseStatsValue = false; @@ -22,6 +23,90 @@ int active_EnabledCowPortalWhenCowKingWasKill = false; /****************************************************************************************************/ +int setWindowedOptionsDone = false; +int active_RemoveBorder = true; +int active_WindowOnTop = true; +int active_Maximized = true; +int active_SetWindowPos = true; +int windowedX = 240; +int windowedY = 0; +int windowedWidth = 1440; +int windowedHeight = 1080; +int active_LockMouseOnStartup = true; + +void lockMouseCursor(int width, int height) +{ + RECT clientRect; + RECT rect; + HWND hwnd = GetActiveWindow(); + GetClientRect(hwnd, &clientRect); + GetWindowRect(hwnd, &rect); + int shiftX = (rect.right - rect.left - clientRect.right) / 2; + int shiftY = rect.bottom - rect.top - clientRect.bottom - shiftX; + log_msg("Windows size : %i, %i, %i, %i\n", rect.left, rect.top, rect.right, rect.bottom); + rect.left += shiftX; + rect.right = rect.left + width; + rect.top += shiftY; + rect.bottom = rect.top + height; + //no resize : 560, 231, 1360, 831 + //resized : 240, 0, 1040, 600 + log_msg("Lock Mouse Cursor : %i, %i, %i, %i\n", rect.left, rect.top, rect.right, rect.bottom); + ClipCursor(&rect); +} + +void lockMouseCursor() { lockMouseCursor(ResolutionX, ResolutionY); } + +void SetWindowedOptions() +{ + if (setWindowedOptionsDone) + return; + HWND hwnd = GetActiveWindow(); + RECT clientRect; + GetClientRect(hwnd, &clientRect); + + if (active_RemoveBorder) + { + LONG lStyle = GetWindowLong(hwnd, GWL_STYLE); + lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU); + SetWindowLong(hwnd, GWL_STYLE, lStyle); + SetWindowPos(hwnd, NULL, 0, 0, clientRect.right, clientRect.bottom, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); + } + + if (active_Maximized && !active_SetWindowPos) + { + RECT screen; + GetWindowRect(GetDesktopWindow(), &screen); + log_msg("Screen size : %i, %i, %i, %i\n", screen.left, screen.top, screen.right, screen.bottom); + int w = screen.bottom * clientRect.right / clientRect.bottom; + int h = w * clientRect.bottom / clientRect.right; + if (screen.right < w) + { + h = screen.right * clientRect.bottom / clientRect.right; + w = h * clientRect.right / clientRect.bottom; + } + windowedX = (screen.right - w) / 2; + windowedY = (screen.bottom - h) / 2; + windowedWidth = w; + windowedHeight = h; + } + + if (active_SetWindowPos || active_Maximized) + { + if (active_WindowOnTop) + SetWindowPos(hwnd, HWND_TOPMOST, windowedX, windowedY, windowedWidth, windowedHeight, SWP_FRAMECHANGED); + else + SetWindowPos(hwnd, NULL, windowedX, windowedY, windowedWidth, windowedHeight, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER); + } else if (active_WindowOnTop) + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, clientRect.right, clientRect.bottom, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE); + + if (active_LockMouseOnStartup) + lockMouseCursor(clientRect.right, clientRect.bottom); + + setWindowedOptionsDone = true; +} + +/****************************************************************************************************/ + void STDCALL displayItemlevel(LPWSTR popup, Unit* ptItem) { if (onRealm && (selectModParam==MOD_NO)) return; @@ -135,7 +220,7 @@ void Install_DisplayItemLevel() { static int isInstalled = false; if (isInstalled) return; - + log_msg("Patch D2Client for display item popup. (DisplayPopup)\n"); // print the text in the final buffer @@ -393,7 +478,6 @@ void Install_AlwaysDisplayLifeMana() //6FAD7659 |. A1 4CBCB86F MOV EAX,DWORD PTR DS:[6FB8BC4C] //6FAD7667 |. 0F8C A4000000 JL D2Client.6FAD7711 - } else { // Always display life. mem_seek R7(D2Client, 58B32, 58B32, 5F102, 2D713, B5DF3, 81733, 0000); diff --git a/PlugY/INIfile.cpp b/PlugY/INIfile.cpp index 63e82a5..030e1d3 100644 --- a/PlugY/INIfile.cpp +++ b/PlugY/INIfile.cpp @@ -37,7 +37,7 @@ static char *strstri(char *text, char *string) { while(*text) { - if(strnicmp(string, text, len) == 0) + if(_strnicmp(string, text, len) == 0) { found = text; break; @@ -280,7 +280,7 @@ int INIFile::GetPrivateProfileString(const char *section, const char *key, const if((m_cache) && (section && key && dest && size)) { - if(stricmp(section, m_currentSection) != 0) + if(_stricmp(section, m_currentSection) != 0) { strncpy(m_currentSection, section, MAX_SECTIONNAME_LENGTH); @@ -343,7 +343,7 @@ BOOL INIFile::WritePrivateProfileString(char *section, char *key, char *string) { if(!section || !key || !string) return false; - if(stricmp(section, m_currentSection) != 0) + if(_stricmp(section, m_currentSection) != 0) { if(m_cacheWritePos == 0) m_cacheWritePos += sprintf((m_cache + m_cacheWritePos), "[%s]\r\n", section); diff --git a/PlugY/InfinityStash.cpp b/PlugY/InfinityStash.cpp index 97f80a1..dae83bf 100644 --- a/PlugY/InfinityStash.cpp +++ b/PlugY/InfinityStash.cpp @@ -26,7 +26,7 @@ bool separateHardSoftStash = false; bool active_sharedGold=false; char* sharedStashFilename = NULL; -typedef int (*TchangeToSelectedStash)(Unit* ptChar, Stash* newStash, DWORD bIsClient); +typedef int (*TchangeToSelectedStash)(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient); Unit* firstClassicStashItem(Unit* ptChar) { @@ -130,11 +130,11 @@ Stash* getStash(Unit* ptChar, DWORD isShared, DWORD id)//WORKS } -int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient) +int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient) { if (!newStash) return 0; - log_msg("changeToSelectedStash ID:%d\tshared:%d\tclient:%d\n",newStash->id,newStash->id,bIsClient); + log_msg("changeToSelectedStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n", newStash->id, newStash->isShared, bOnlyItems, bIsClient); Stash* currentStash = PCPY->currentStash; if (currentStash == newStash) return 0; @@ -175,7 +175,6 @@ int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient) } // add items of new stash - PCPY->currentStash = newStash; ptItem = newStash->ptListItem; while (ptItem) { @@ -183,16 +182,20 @@ int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient) D2Common10242(PCInventory, D2GetRealItem(ptItem), 1); ptItem = D2UnitGetNextItem(ptItem); } - newStash->ptListItem = NULL; + if (bOnlyItems) + newStash->ptListItem = PCPY->currentStash->ptListItem; + else + PCPY->currentStash = newStash; + PCPY->currentStash->ptListItem = NULL; return 1; } -int changeToSelectedStash_10(Unit* ptChar, Stash* newStash, DWORD bIsClient) +int changeToSelectedStash_10(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient) { if (!newStash) return 0; - log_msg("changeToSelectedStash ID:%d\tshared:%d\tclient:%d\n",newStash->id,newStash->id,bIsClient); + log_msg("changeToSelectedStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n",newStash->id,newStash->isShared, bOnlyItems,bIsClient); Stash* currentStash = PCPY->currentStash; if (currentStash == newStash) return 0; @@ -220,14 +223,17 @@ int changeToSelectedStash_10(Unit* ptChar, Stash* newStash, DWORD bIsClient) } // add items of new stash - PCPY->currentStash = newStash; ptItem = newStash->ptListItem; while (ptItem) { D2InvAddItem(PCInventory, ptItem, ptItem->path->x, ptItem->path->y, 0xC, bIsClient, 4); ptItem = D2UnitGetNextItem(ptItem); } - newStash->ptListItem = NULL; + if (bOnlyItems) + newStash->ptListItem = PCPY->currentStash->ptListItem; + else + PCPY->currentStash = newStash; + PCPY->currentStash->ptListItem = NULL; return 1; } @@ -277,12 +283,12 @@ DWORD loadStashList(Unit* ptChar, BYTE data[], DWORD maxSize, DWORD* curSize, bo while (curStash < nbStash) { newStash = addStash(ptChar, isShared); - changeToSelectedStash(ptChar, newStash, false); + changeToSelectedStash(ptChar, newStash, 0, false); DWORD ret = loadStash(ptChar, newStash, data, *curSize, 10000000, curSize); if (ret) return ret; curStash++; } - + if (!isShared && !PCPY->selfStash) { newStash = addStash(ptChar, isShared); @@ -295,7 +301,7 @@ DWORD loadStashList(Unit* ptChar, BYTE data[], DWORD maxSize, DWORD* curSize, bo if (!PCPY->currentStash) PCPY->currentStash = newStash; } - + return 0; } @@ -383,20 +389,20 @@ void updateSelectedStashClient(Unit* ptChar)//WORKS void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags)//WORKS { - log_msg("setSelectedStashClient ID:%d, isShared:%d, flags:%08X\n", stashId, stashFlags&1, flags); + log_msg("setSelectedStashClient ID:%d, stashFlags:%d, flags:%08X\n", stashId, stashFlags, flags); Unit* ptChar = D2GetClientPlayer(); - Stash* newStash = getStash(ptChar, stashFlags&1, stashId); + Stash* newStash = getStash(ptChar, (stashFlags & 1) == 1, stashId); if (!newStash) do - newStash = addStash(ptChar, stashFlags&1); + newStash = addStash(ptChar, (stashFlags & 1) == 1); while (newStash->id < stashId); - changeToSelectedStash(ptChar, newStash, 1); + changeToSelectedStash(ptChar, newStash, (stashFlags & 2) == 2, 1); PCPY->flags = flags; } void selectStash(Unit* ptChar, Stash* newStash)//WORKS { - changeToSelectedStash(ptChar, newStash, 0); + changeToSelectedStash(ptChar, newStash, 0, 0); updateSelectedStashClient(ptChar); } @@ -423,6 +429,35 @@ void toggleToSharedStash(Unit* ptChar) } } +void swapStash(Unit* ptChar, Stash* curStash, Stash* swpStash) +{ + if (!ptChar || !curStash || !swpStash || curStash == swpStash) + return; + changeToSelectedStash(ptChar, swpStash, 1, 0); + updateClient(ptChar, UC_SELECT_STASH, swpStash->id, swpStash->flags | 2, PCPY->flags); +} + +void toggleStash(Unit* ptChar, DWORD page) +{ + log_msg("toggle stash page = %u\n", page); + Stash* curStash = PCPY->currentStash; + Stash* swpStash = curStash->isShared ? PCPY->selfStash : PCPY->sharedStash; + swapStash(ptChar, curStash, swpStash); +} + +void swapStash(Unit* ptChar, DWORD page, bool toggle) +{ + log_msg("swap stash page = %u\n", page); + Stash* curStash = PCPY->currentStash; + Stash* swpStash = curStash->isShared == toggle ? PCPY->selfStash : PCPY->sharedStash; + for (DWORD i = 0; i < page; i++) + { + if (curStash->nextStash == NULL) + addStash(ptChar, swpStash->isShared); + swpStash = swpStash->nextStash; + } + swapStash(ptChar, curStash, swpStash); +} void selectPreviousStash(Unit* ptChar) { diff --git a/PlugY/MainScreen.cpp b/PlugY/MainScreen.cpp index b024f23..2056c5b 100644 --- a/PlugY/MainScreen.cpp +++ b/PlugY/MainScreen.cpp @@ -8,6 +8,7 @@ #include "common.h" #include "error.h" #include "d2functions.h" +#include "extraOptions.h" #include char* versionText = ""; @@ -20,12 +21,17 @@ DWORD newTextBoxData[]={4,0x237,0x243,0xC8,0x14,0,0,0,0,0,0,2};//type,x,y,l,h,?, void STDCALL printPlugYVersion(void** childrens, DWORD* sgnNumChildren) { - char buf[20]; - void* textbox = D2CreateTextBox(newTextBoxData); - childrens[*sgnNumChildren]=textbox; - d2_assert((*sgnNumChildren)++ >= 40,"sgnNumChildren < MAX_CHILDREN", __FILE__, __LINE__); - sprintf(buf, "PlugY %s", PLUGY_VERSION); - D2PrintLineOnTextBox(textbox, buf, colorOfPlugYVersion); + if (active_Windowed) + SetWindowedOptions(); + if (active_PrintPlugYVersion) + { + char buf[20]; + void* textbox = D2CreateTextBox(newTextBoxData); + childrens[*sgnNumChildren] = textbox; + d2_assert((*sgnNumChildren)++ >= 40, "sgnNumChildren < MAX_CHILDREN", __FILE__, __LINE__); + sprintf(buf, "PlugY %s", PLUGY_VERSION); + D2PrintLineOnTextBox(textbox, buf, colorOfPlugYVersion); + } } FCT_ASM ( caller_printPlugYVersion ) diff --git a/PlugY/Parameters.cpp b/PlugY/Parameters.cpp index af78253..24c8b8e 100644 --- a/PlugY/Parameters.cpp +++ b/PlugY/Parameters.cpp @@ -60,6 +60,18 @@ const char* S_active_CheckMemory = "ActiveCheckMemory"; const char* S_active_Commands = "ActiveCommands"; const char* S_active_othersFeatures = "ActiveAllOthersFeatures"; +const char* S_WINDOWED = "WINDOWED"; +const char* S_ActiveWindowed = "ActiveWindowed"; +const char* S_RemoveBorder = "RemoveBorder"; +const char* S_WindowOnTop = "WindowOnTop"; +const char* S_Maximized = "Maximized"; +const char* S_SetWindowPos = "SetWindowPos"; +const char* S_X = "X"; +const char* S_Y = "Y"; +const char* S_Width = "Width"; +const char* S_Height = "Height"; +const char* S_LockMouseOnStartup = "LockMouseOnStartup"; + const char* S_LANGUAGE = "LANGUAGE"; const char* S_active_ChangeLanguage = "ActiveChangeLanguage"; const char* S_selectedLanguage = "SelectedLanguage"; @@ -210,7 +222,7 @@ void init_General(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDefaultFi { GET_PRIVATE_PROFILE_STRING(S_GENERAL, S_active_DisableBattleNet, "0"); active_DisableBattleNet = atoi(buffer) != 0; - log_msg("active_DisableBattleNet\t\t\t\t= %d\n", active_DisableBattleNet); + log_msg("active_DisableBattleNet\t\t= %d\n", active_DisableBattleNet); GET_PRIVATE_PROFILE_STRING(S_GENERAL, S_active_logFile, "0"); active_logFile = atoi(buffer)+1; @@ -242,6 +254,51 @@ void init_General(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDefaultFi log_msg("\n"); } +void init_Windowed(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDefaultFile, char* buffer, DWORD maxSize) +{ + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_ActiveWindowed, "0"); + active_Windowed = atoi(buffer) != 0; + log_msg("active_Windowed\t\t\t\t= %d\n", active_Windowed); + if (active_Windowed) + { + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_RemoveBorder, "0"); + active_RemoveBorder = atoi(buffer) != 0; + log_msg("active_RemoveBorder\t\t\t= %d\n", active_RemoveBorder); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_WindowOnTop, "0"); + active_WindowOnTop = atoi(buffer) != 0; + log_msg("active_WindowOnTop\t\t\t= %d\n", active_WindowOnTop); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_Maximized, "0"); + active_Maximized = atoi(buffer) != 0; + log_msg("active_Maximized\t\t\t= %d\n", active_Maximized); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_SetWindowPos, "0"); + active_SetWindowPos = atoi(buffer) != 0; + log_msg("active_MoveAndResizeWindow\t= %d\n", active_SetWindowPos); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_X, "0"); + windowedX = atoi(buffer); + log_msg("windowedX\t\t\t\t\t= %d\n", windowedX); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_Y, "0"); + windowedY = atoi(buffer); + log_msg("windowedY\t\t\t\t\t= %d\n", windowedY); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_Width, "0"); + windowedWidth = atoi(buffer); + log_msg("windowedWidth\t\t\t\t= %d\n", windowedWidth); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_Height, "0"); + windowedHeight = atoi(buffer); + log_msg("windowedHeight\t\t\t\t= %d\n", windowedHeight); + + GET_PRIVATE_PROFILE_STRING(S_WINDOWED, S_LockMouseOnStartup, "0"); + active_LockMouseOnStartup = atoi(buffer) != 0; + log_msg("active_LockMouseOnStartup\t= %d\n\n", active_LockMouseOnStartup); + } +} + void init_ActiveLanguage(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDefaultFile, char* buffer, DWORD maxSize) { GET_PRIVATE_PROFILE_STRING(S_LANGUAGE, S_active_ChangeLanguage, "0"); @@ -251,7 +308,7 @@ void init_ActiveLanguage(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDe if (active_ChangeLanguage) { GET_PRIVATE_PROFILE_STRING(S_LANGUAGE, S_selectedLanguage, "ENG"); - strupr(buffer); + _strupr(buffer); switch (*(DWORD*)buffer) { case BIN('E','N','G',0) : selectedLanguage=LNG_ENG;break; @@ -281,7 +338,7 @@ void init_ActiveLanguage(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDe if (active_LanguageManagement) { GET_PRIVATE_PROFILE_STRING(S_LANGUAGE, S_defaultLanguage, "ENG"); - strupr(buffer); + _strupr(buffer); switch (*(DWORD*)buffer) { case BIN('E','N','G',0) : defaultLanguage=LNG_ENG;break; @@ -302,7 +359,7 @@ void init_ActiveLanguage(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDe GET_PRIVATE_PROFILE_STRING(S_LANGUAGE, S_availableLanguages, "ENG|ESP|DEU|FRA|POR|ITA|JPN|KOR|SIN|CHI|POL|RUS"); availableLanguages.all = 0; - strupr(buffer); + _strupr(buffer); char* curString = strtok(buffer,"|"); while (curString) { @@ -783,6 +840,7 @@ void loadParameters() if (active_plugin) { init_General(iniFile, iniFixedFile, iniDefaultFile, buffer, BUFSIZE); + init_Windowed(iniFile, iniFixedFile, iniDefaultFile, buffer, BUFSIZE); init_ActiveLanguage(iniFile, iniFixedFile, iniDefaultFile, buffer,BUFSIZE); init_SavePath(iniFile, iniFixedFile, iniDefaultFile, buffer, BUFSIZE); init_VersionText(iniFile, iniFixedFile, iniDefaultFile, buffer, BUFSIZE); diff --git a/PlugY/PlugY.aps b/PlugY/PlugY.aps index ddd515b..330dce1 100644 Binary files a/PlugY/PlugY.aps and b/PlugY/PlugY.aps differ diff --git a/PlugY/PlugY.cpp b/PlugY/PlugY.cpp index 38c35d5..2266fb5 100644 --- a/PlugY/PlugY.cpp +++ b/PlugY/PlugY.cpp @@ -1,22 +1,6 @@ -/*================================================================= - File created by Yohann NICOLAS. +// PlugY.cpp : Defines the exported functions for the DLL application. +// - Main file of this DLL +#include "stdafx.h" -=================================================================*/ -#include - -BOOL WINAPI DllMain(HANDLE /*hModule*/, DWORD dwReason, LPVOID /*lpReserved*/) -{ - switch(dwReason) - { - case DLL_PROCESS_ATTACH: - break; - case DLL_PROCESS_DETACH: - break; - } - return true; -} - -/*================================= END OF FILE =================================*/ \ No newline at end of file diff --git a/PlugY/PlugY.rc b/PlugY/PlugY.rc index fb9713a..d0abca0 100644 Binary files a/PlugY/PlugY.rc and b/PlugY/PlugY.rc differ diff --git a/PlugY/PlugY.sln b/PlugY/PlugY.sln index 8651a40..9d77e53 100644 --- a/PlugY/PlugY.sln +++ b/PlugY/PlugY.sln @@ -1,17 +1,26 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugY", "PlugY.vcproj", "{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}" + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugY", "PlugY.vcxproj", "{5059AE94-61B0-4D07-A970-B670BBCB142C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Debug|Win32.ActiveCfg = Debug|Win32 - {F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Debug|Win32.Build.0 = Debug|Win32 - {F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Release|Win32.ActiveCfg = Release|Win32 - {F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Release|Win32.Build.0 = Release|Win32 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Debug|x64.ActiveCfg = Debug|x64 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Debug|x64.Build.0 = Debug|x64 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Debug|x86.ActiveCfg = Debug|Win32 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Debug|x86.Build.0 = Debug|Win32 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Release|x64.ActiveCfg = Release|x64 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Release|x64.Build.0 = Release|x64 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Release|x86.ActiveCfg = Release|Win32 + {5059AE94-61B0-4D07-A970-B670BBCB142C}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PlugY/PlugY.vcxproj b/PlugY/PlugY.vcxproj new file mode 100644 index 0000000..6c784fb --- /dev/null +++ b/PlugY/PlugY.vcxproj @@ -0,0 +1,267 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {5059AE94-61B0-4D07-A970-B670BBCB142C} + Win32Proj + PlugY + 8.1 + + + + DynamicLibrary + true + v140 + MultiByte + + + DynamicLibrary + false + v140 + true + MultiByte + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGY_EXPORTS;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + + + Windows + true + + + + + + + + + + + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;PLUGY_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGY_EXPORTS;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + copy "$(TargetPath)" "..\PlugYInstaller\PlugY.dll" + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;PLUGY_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PlugY/PlugY.vcxproj.filters b/PlugY/PlugY.vcxproj.filters new file mode 100644 index 0000000..14cbf86 --- /dev/null +++ b/PlugY/PlugY.vcxproj.filters @@ -0,0 +1,308 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {f21d23d6-3719-4624-84e8-f488328334b7} + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\Commons + + + Header Files\Commons + + + Header Files\Commons + + + Header Files\Commons + + + Header Files\Commons + + + Header Files\Commons + + + Header Files\Commons + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PlugY/UpdateClient.cpp b/PlugY/UpdateClient.cpp index df230e2..70683e1 100644 --- a/PlugY/UpdateClient.cpp +++ b/PlugY/UpdateClient.cpp @@ -35,7 +35,6 @@ void updateClient(Unit* ptChar, DWORD mFunc, DWORD p1, DWORD p2, DWORD p3) D2SendPacket(ptNetClient, &packet, sizeof(DataPacket)); } - DWORD FASTCALL handleClientUpdate(DataPacket* packet) { log_msg("[CLIENT] Received custom message: %d with param: %08X , %08X , %08X\n",packet->mFunc,packet->mParam1,packet->mParam2,packet->mParam3); diff --git a/PlugY/UpdateServer.cpp b/PlugY/UpdateServer.cpp index 07cb3f9..bf385a0 100644 --- a/PlugY/UpdateServer.cpp +++ b/PlugY/UpdateServer.cpp @@ -15,11 +15,16 @@ #include "infinityStash.h" #include "commands.h" +int renameIndex = 0; +char renameString[16]; +DWORD PageSwap; int STDCALL handleServerUpdate(Unit* ptChar, WORD param) { - log_msg("Received custom message: %X\n", param); - switch(param & 0xFF) + int type = param & 0xFF; + DWORD arg = (param & 0xFF00) >> 8; + log_msg("Received custom message: type=%i, arg=%i\n", type, arg); + switch(type) { case US_UNASSIGN_STR_POINT : UnassignStrPoint( ptChar ); return 1; case US_UNASSIGN_ENE_POINT : UnassignEnePoint( ptChar ); return 1; @@ -42,17 +47,36 @@ int STDCALL handleServerUpdate(Unit* ptChar, WORD param) case US_SELECT_PREVIOUS_INDEX2: selectPreviousIndex2Stash( ptChar ); return 1; case US_SELECT_NEXT_INDEX2 : selectNextIndex2Stash( ptChar ); return 1; - case US_STARTSAVE : savePlayers( ptChar ); return 1; + case US_SAVE : savePlayers( ptChar ); return 1; case US_MAXGOLD : maxGold(ptChar); return 1; case US_PUTGOLD : putGold(ptChar, 0); return 1; case US_TAKEGOLD : takeGold(ptChar, 0); return 1; - default : return 0; + case US_SWAP3 : PageSwap = arg << 24; return 1; + case US_SWAP2 : PageSwap |= arg << 16; return 1; + case US_SWAP1 : PageSwap |= arg << 8; return 1; + case US_SWAP0: swapStash(ptChar, PageSwap | arg, false); PageSwap = 0; return 1; + case US_SWAP0_TOGGLE : swapStash(ptChar, PageSwap | arg, true); PageSwap = 0; return 1; + case US_RENAME : + if (renameIndex == 0) + for (int i = 0; i < 16; i++) + renameString[i] = 0; + renameString[renameIndex++] = (char)arg; + if (arg == 0) + { + renameIndex = 0; + log_msg("Rename on Server : %s -> %s\n", ptChar->ptPlayerData->name, renameString); + strcpy(ptChar->ptPlayerData->name, renameString); + strcpy(ptChar->ptPlayerData->ptNetClient->name, renameString); + } + return 1; + default : + return 0; } } FCT_ASM( caller_handleServerUpdate) - PUSH EAX + PUSH ESI PUSH EBX CALL handleServerUpdate TEST EAX,EAX diff --git a/PlugY/dllmain.cpp b/PlugY/dllmain.cpp new file mode 100644 index 0000000..8a4edd3 --- /dev/null +++ b/PlugY/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/PlugY/extraOptions.h b/PlugY/extraOptions.h index 6ec75c7..2488290 100644 --- a/PlugY/extraOptions.h +++ b/PlugY/extraOptions.h @@ -8,24 +8,38 @@ #ifndef __EXTRAOPTIONS_H__INCLUDED #define __EXTRAOPTIONS_H__INCLUDED -extern int active_RunLODs; -extern int active_alwaysRegenMapInSP; -extern DWORD nbPlayersCommandByDefault; +extern int active_Windowed; +extern int active_LockMouseCursor; extern int active_DisplayItemLevel; +extern DWORD nbPlayersCommandByDefault; +extern int active_alwaysRegenMapInSP; +extern int active_RunLODs; extern int active_AlwaysDisplayLifeMana; extern int active_EnabledTXTFilesWithMSExcel; extern int active_DisplayBaseStatsValue; extern int active_LadderRunewords; extern int active_EnabledCowPortalWhenCowKingWasKill; -void Install_RunLODs(); -void Install_AlwaysRegenMapInSP(); -void Install_SendPlayersCommand(); +extern int active_RemoveBorder; +extern int active_WindowOnTop; +extern int active_Maximized; +extern int active_SetWindowPos; +extern int windowedX; +extern int windowedY; +extern int windowedWidth; +extern int windowedHeight; +extern int active_LockMouseOnStartup; + void Install_DisplayItemLevel(); +void Install_SendPlayersCommand(); +void Install_AlwaysRegenMapInSP(); +void Install_RunLODs(); void Install_AlwaysDisplayLifeMana(); void Install_EnabledTXTFilesWithMSExcel(); void Install_DisplayBaseStatsValue(); void Install_LadderRunewords(); void Install_EnabledCowPortalWhenCowKingWasKill(); +void SetWindowedOptions(); +void lockMouseCursor(); #endif \ No newline at end of file diff --git a/PlugY/infinityStash.h b/PlugY/infinityStash.h index d19eed8..86c8410 100644 --- a/PlugY/infinityStash.h +++ b/PlugY/infinityStash.h @@ -33,6 +33,7 @@ void selectPrevious2Stash(Unit* ptChar); void selectNext2Stash(Unit* ptChar); void selectPreviousIndex2Stash(Unit* ptChar); void selectNextIndex2Stash(Unit* ptChar); +void swapStash(Unit* ptChar, DWORD page, bool toggle); void selectStash(Unit* ptChar, Stash* newStash); void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags); diff --git a/PlugY/parameters.h b/PlugY/parameters.h index 3e5fc45..0169fb9 100644 --- a/PlugY/parameters.h +++ b/PlugY/parameters.h @@ -7,7 +7,7 @@ #pragma once -#define PLUGY_VERSION "10.00" +#define PLUGY_VERSION "10.01" #define LOG_FILE "PlugY.log" diff --git a/PlugY/resource.h b/PlugY/resource.h index 62f6f54..388f0cb 100644 --- a/PlugY/resource.h +++ b/PlugY/resource.h @@ -1,13 +1,12 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by PlugY.rc -// // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 106 +#define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/PlugY/stdafx.cpp b/PlugY/stdafx.cpp new file mode 100644 index 0000000..1f389ba --- /dev/null +++ b/PlugY/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// PlugY.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/PlugY/stdafx.h b/PlugY/stdafx.h new file mode 100644 index 0000000..677e68a --- /dev/null +++ b/PlugY/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/PlugY/targetver.h b/PlugY/targetver.h new file mode 100644 index 0000000..90e767b --- /dev/null +++ b/PlugY/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/PlugYInstaller/PlugY.ini b/PlugYInstaller/PlugY.ini index 4268f34..fd8d33f 100644 --- a/PlugYInstaller/PlugY.ini +++ b/PlugYInstaller/PlugY.ini @@ -5,7 +5,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 10.00 ; +; version 10.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -28,6 +28,19 @@ ActiveCommands=1 ActiveCheckMemory=1 +[WINDOWED] +ActiveWindowed=0 +RemoveBorder=1 +WindowOnTop=1 +Maximized=1 +SetWindowPos=0 +X=0 +Y=0 +Width=0 +Height=0 +LockMouseOnStartup=1 + + [LANGUAGE] ;ENG|ESP|DEU|FRA|POR|ITA|JPN|KOR|SIN|CHI|POL|RUS ActiveChangeLanguage=0 diff --git a/PlugYInstaller/PlugY.nsi b/PlugYInstaller/PlugY.nsi index d06c30e..e842e16 100644 --- a/PlugYInstaller/PlugY.nsi +++ b/PlugYInstaller/PlugY.nsi @@ -2,7 +2,7 @@ !include "LogicLib.nsh" !include "MUI2.nsh" -!define VERSION "10.00" +!define VERSION "10.01" !define D2FILES "." !define NAME "PlugY, The Survival Kit" !define MOD_DIR "Mod PlugY" @@ -18,7 +18,8 @@ !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_FINISHPAGE_SHOWREADME "$(README_FILENAME)" -!define MUI_FINISHPAGE_RUN "PlugY.exe" +!define MUI_FINISHPAGE_RUN ;"PlugY.exe" +!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchPlugY" !define MUI_FINISHPAGE_RUN_NOTCHECKED !define MUI_FINISHPAGE_NOREBOOTSUPPORT !define MUI_ABORTWARNING @@ -106,6 +107,11 @@ Function Un.onInit ReadRegStr $D2Path HKLM "${REGKEY}" "PlugYDllPath" FunctionEnd +Function LaunchPlugY + SetOutPath "$INSTDIR" + ExecShell "" "$INSTDIR\PlugY.exe" +FunctionEnd + ;-------------------------------- ; Custom Page ;Function OptionsPage @@ -151,8 +157,7 @@ Section "!$(SECTION_NAME_CORE)" Core File "${D2FILES}\PlugY_The_Survival_Kit_-_Readme.txt" File "${D2FILES}\PlugY_The_Survival_Kit_-_LisezMoi.txt" File "${D2FILES}\PlugY_The_Survival_Kit_-_Liesmich.txt" - CreateDirectory "$D2Path\PlugY" - setOutPath "$D2Path\PlugY" + setOutPath "$INSTDIR\PlugY" File "${D2FILES}\PlugY\EmptyPage.dc6" File "${D2FILES}\PlugY\PlugYDefault.ini" File "${D2FILES}\PlugY\PlugYFixed.ini" @@ -175,7 +180,7 @@ Section $(SECTION_NAME_STARTMENU_SHORTCUTS) MenuShortcuts SectionIn 1 CreateDirectory "$SMPROGRAMS\${NAME}" SetOutPath $INSTDIR - CreateShortCut "$SMPROGRAMS\${NAME}\Uninstall.lnk" "$INSTDIR\${UNINSTALL_FILE}" "" "$INSTDIR\${UNINSTALL_FILE}" 0 + CreateShortCut "$SMPROGRAMS\${NAME}\Uninstaller.lnk" "$INSTDIR\${UNINSTALL_FILE}" "" "$INSTDIR\${UNINSTALL_FILE}" 0 CreateShortCut "$SMPROGRAMS\${NAME}\${NAME}.lnk" "$INSTDIR\PlugY.exe" "" "$INSTDIR\PlugY.exe" 0 SectionEnd @@ -187,13 +192,13 @@ Section $(SECTION_NAME_UNINSTALLER) Uninstaller WriteUninstaller "${UNINSTALL_FILE}" ; Write the installation path into the registry - WriteRegStr HKLM "${REGKEY}" "InstallPath" "$INSTDIR" + WriteRegStr HKLM "${REGKEY}" "InstallPath" $INSTDIR WriteRegStr HKLM "${REGKEY}" "PlugYDllPath" "$D2Path" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "InstallLocation" "$$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayName" "${NAME}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "HelpLink" "http://djaftal.chez-alice.fr/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "HelpLink" "http://plugy.free.fr" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayVersion" "${VERSION}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "UninstallString" '"$INSTDIR\${UNINSTALL_FILE}"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "NoModify" 1 @@ -224,6 +229,7 @@ Section "Uninstall" Uninstall Delete "$D2Path\RestoreD2gfxDll.exe" Delete "$INSTDIR\PlugY.exe" Delete "$INSTDIR\PlugY.log" + Delete "$INSTDIR\BnetLog.txt" Delete "$INSTDIR\PlugY.ini" Delete "$INSTDIR\PlugY_The_Survival_Kit_-_Readme.txt" Delete "$INSTDIR\PlugY_The_Survival_Kit_-_LisezMoi.txt" diff --git a/PlugYInstaller/PlugY/PlugYDefault.ini b/PlugYInstaller/PlugY/PlugYDefault.ini index c0a7bde..0b390e4 100644 --- a/PlugYInstaller/PlugY/PlugYDefault.ini +++ b/PlugYInstaller/PlugY/PlugYDefault.ini @@ -5,7 +5,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 10.00 ; +; version 10.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -25,6 +25,19 @@ ActiveCheckMemory=1 ActiveAllOthersFeatures=0 +[WINDOWED] +ActiveWindowed=0 +RemoveBorder=0 +WindowOnTop=0 +Maximized=0 +SetWindowPos=0 +X=0 +Y=0 +Width=0 +Height=0 +LockMouseOnStartup=0 + + [LANGUAGE] ;ENG|ESP|DEU|FRA|POR|ITA|JPN|KOR|SIN|CHI|POL|RUS ActiveChangeLanguage=0 diff --git a/PlugYInstaller/PlugY/PlugYFixed.ini b/PlugYInstaller/PlugY/PlugYFixed.ini index dcd6fe5..3088eda 100644 --- a/PlugYInstaller/PlugY/PlugYFixed.ini +++ b/PlugYInstaller/PlugY/PlugYFixed.ini @@ -6,7 +6,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 10.00 ; +; version 10.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -16,6 +16,8 @@ [GENERAL] +[WINDOWED] + [LANGUAGE] [SAVEPATH] diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt index 19e6f45..2f8d402 100644 --- a/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt +++ b/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt @@ -1,10 +1,10 @@ ;--------------------------------------------------------------------------------------; ; ; -; "PlugY, The Survival Kit" ; +; "PlugY, The Survival Kit" ; ; ; ; von Yohann Nicolas ; ; ; -; version 10.00 ; +; version 10.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -20,7 +20,7 @@ WARNUNG: - PlugY.ini wurde stark verndert, bitte nehmt die Neue! - Vergesst nicht den Teil: "Kommentare zur Konfigurations-Datei" zu lesen. - Bitte lest im PlugY-Forum: - http://phrozenkeep.planetdiablo.gamespy.com/forum/viewforum.php?f=133 + http://d2mods.info/forum/viewforum.php?f=133 ******** ALLE FUNKTIONEN ******** @@ -43,20 +43,48 @@ WARNUNG: - Man kann die Versionsanzeige im Hauptbildschirm anpassen. - Diablo kann nun auf Text-Dateien laden die von Microsoft Excel geffnet sind. - Lokalisiert in Englisch, Franzsisch, Deutsch, Italienisch, Spanisch, Polnisch. +- Add following commands (the corresponding functions must be enabled in PlugY.ini) : + /save : Save game without exit. + /reload : Reload gamble page. + /page 1 : Show normal stats page (stats page must be opened, space not mandatory). + /page 2 : Show extra stats page (stats page must be opened, space not mandatory). + /page 3 : Show resistance stats page (stats page must be opened, space not mandatory). + /page 4 : (beta) Show available runewords (stats page must be opened, space not mandatory). + /lockmouse : Lock mouse cursor in the window. + /lock : same as /lockmouse. + /pagename name : (beta) Rename current page stash (the new name isn't saved). + /swap page : Swap the content of current stash page with the content of another page (space not mandatory). + /toggle page : Swap the content of current stash page with the content of another page in opposing stash shared/personal (space not mandatory). + /dlm : Toggle always display mana and life mode. (Since 1.13c, you can click on the bottom of each orbs) + /dml : Same as /dlm. + /dl : Toggle always display life mode. (Since 1.13c, you can click on the bottom of the orb) + /dm : Toggle always display mana mode. (Since 1.13c, you can click on the bottom of the orb) + /rename newname : (beta) rename your character and save it. (You must exit the game to update the stats page.) + /listcube : (beta) Create a "cube.txt" file in current directory containing all cube's receipts. + /maxgold : CHEAT don't use in normal game. Set personnal stash, shared stash and character to max gold. +v10.01 nderungen : +- Add windowed mode. +- Can lock mouse cursor in the window (windowed mode). +- Can remove border (windowed mode). +- Can resize or maximize window (windowed mode). +- Can fix window above any others windows including taskbar (windowed mode). +- Can lock mouse cursor in the windows on startup and with command "/lockmouse" or "/lock" (windowed mode). +- Add command "/swap page" to swap the content of current stash page with the content of another page. +- Add command "/toggle page" to swap the content of current stash page with the content of another page in opposing stash shared/personal. +- Add command "/rename newname" to rename your character. This feature is still in beta and you must exit the game to update the stats page. + v10.00 nderungen : - Disable access to Battle.net via main menu button. - PlugY funktioniert nun auch mit LoD 1.13c Versionen. - Fix shortcut in start menu - v9.00 nderungen : - PlugY funktioniert nun auch mit LoD 1.12 Versionen. - Ein paar Bugs behoben. - Eine neue Mglichkeit zum Skills neuverteilen in Mods hinzugefgt. - v8.00 nderungen : - Einfachere Installation : Neuer Installer. - Das Portal zum Cow-Level kann nun geffnet werden auch wenn der Spieler den Cow-King in der aktuellen Schwierigkeit bereits gettet hat. @@ -67,12 +95,10 @@ v8.00 - Multiplayer : Die Truhendaten werden jetzt korrekt gespeichert wenn es einen Disconnect oder einen Fehler whrend des Speicherns gibt. - Die "check load memory failed" Meldung, wenn die D2gfx.dll gepachtt war, wurde entfernt. - v7.01b nderungen : - Behoben : Die Ladder-only Runenwortfeatures in den LoD-Versionen 1.11 und 1.10. - Behoben : Seltsame Zeichen in manchen Texten. - v7.01 nderungen : - Die Ladder-Only Runenwrter knnen fr den Singleplayer aktivert werden. - Fehler bei der AI des berbaals behoben @@ -81,7 +107,6 @@ v7.01 - Eine eigene EXE wurde hinzugefgt um PlugY zu starten (es werden keine LoD-Dateien mehr verndert) - Spanische und Polnische bersetzung hinzugefgt. - V7.00 nderungen : - PlugY funktioniert nun auch mit LoD 1.11b Versionen. - Den Basiswert fr jeden Stat im Mausbertext hinzugefgt. @@ -89,17 +114,14 @@ V7.00 - Behoben: Einige Features blieben auch im Battle.net aktiviert - Italienische bersetzung hinzugefgt. - v6.01b nderungen : - Fehler mit dem Popups der Statuspunktvergabe-Buttons behoben. - v6.01 nderungen : - Behoben : unique carry1 items verschwinden nicht wenn sie in LoD 1.10 gecubt werden - Schlssel und Uber-Organe werden nicht mehr entfernt wenn man das rote Portal ausserhalb von Harrogath ffnen wollte. - Fehler in der Versionsanzeige wegen einem Konflikt mit D2Mod behoben. - V6.00 nderungen : - PlugY funktioniert nun auch mit LoD 1.11 Versionen - Freischaltung des ber-Quests ausserhalb von der Realm (LoD 1.11 only). @@ -107,14 +129,12 @@ V6.00 - Kleine Fehler behoben, und kleine Verbesserungen eingebaut - "/save"-Befehl hinzugefgt um das Spiel zu speichern ohne es zu verlassen (nur LoD 1.11). - v5.06 nderungen : - Knpf for gemeinsamen Goldvorrat hinzugefgt. - Gemeinsamer Goldvorrat in Multiplayer hinzugefgt. - Befehl "/DisplayLifeMana" ersetzt durch "/dlm". - Diverse Fehler behoben. - v5.05 nderungen : - Standard Hintergrundfarbe im Status Interface gendert - Gemeinsames Gold per Kommando hinzugefgt. @@ -122,24 +142,20 @@ v5.05 - Mglichkeit die Namen von Setgegenstnd in Grn bei Mouseover in der gemeinsamen Kiste anzuzeigen - Multiplayer Fehler behoben, indem der gesamte Prozess neu programmiert wurde - v5.04 nderungen : - Behoben : Status/Skill Punkte per Levelup bug. - Behoben : Multiplayer bugs. - PlugY/PlugYDefault.ini sind jetzt vollstndig. - v5.03 nderungen : - Behoben : Bug der manchmal zwischen den Hardcore und Softcore gemeinsamen Truhen gewechselt hat. - Farbnderung der Schrift in den Extra-Seiten mglich. - Standartwerte in den Extra-Seiten gendert. - EnabledTXTFilesWhenMSExcelOpenIt in der PlugY.ini ist nun standartmig aktiviert. - v5.02 nderungen : - Behoben : Bug der das Verschwinden von Gegenstnden hervorgerufen hat. - v5.01 nderungen : - Behoben : Grere bugs bei der gemeinsamen Truhe. - Behoben : ActiveLogFile ist jetzt in der PlugY.ini standartmig deaktiviert. @@ -160,14 +176,12 @@ v5.00 - Behoben : Das Erscheinen des Diablo Klones am Spielstart. - Behoben : Andere kleine Bugs. - v4.04 nderungen : - Behoben : Anzeige-bug wenn StatPerLevelUp aktiviert war. - Behoben : Fehler bei der Speicherprozedur wenn die Festplatte voll war. - Neues Konfigurations-System fr Modder. - Man kann auswhlen, ob die Mana und Lebens Anzeige immer ber den Kugeln erscheint. - v4.03 nderungen - Behoben: Wenn man einen "carry1" - einzigartigen Gegenstand (einzigartiger Zauber) in den Wrfel steckt - Man kann direkt zur ersten und letzten Seite der Kiste gehen (shift + klick auf Nchste/Vorherige Seite) @@ -177,11 +191,9 @@ v4.03 - Button fr die zustzlichen Status Seiten an die gleiche Stelle verschoben, wie die original Buttons (nur in 800x600) - Man kann auswhlen, ob die zuletzt angezeigte Seite erscheint, oder die Hauptseite - v4.02b nderungen : - Behoben : Alle Funktionen bleiben im offenen Battle.net eingeschaltet. - v4.02 nderungen : - Behoben : Das vergessene "d" in "SeparateHardcoreStash=1" in der PlugY.ini ergnzt - Behoben : Standardmssig wird dei Sprache in der PlugY.ini nicht gendert. @@ -211,29 +223,24 @@ v4.00 - Behoben : Diablo Clone kann nicht mehr in Normal und Albtraum erscheinen - Behoben : Zerstrung von zustzlichen Minions wenn man Fertigkeitspukte zurcksetzt - v3.02 nderungen : - Fehler im Bereich Statuspunkte pro LevelUp behoben - Fehler behoben der verhinderte das bei abgeschalteter gemeinsamer Kiste ein Charkter nicht geladen werden konnte. - Fehler behoben der es erlaubte Werte zu setzen, ohne das Fertigkeiten pro LevelUp aktiviert waren. - v3.01 nderungen : - Man kann die Statuspunkte ndern, die man beim LevelUp bekommt. - Problem mit fehlerhafter Menge der Fertigkeitspunkte beim zurcksetzen behoben. - Konfigurationsparameter fr den World Event hinzugefgt - Standardmssig wird nur inHlle der World Event Zhler gezeigt "X SOJ verkauft". - v3.00 nderungen : - Lokaler World Event ! - Zurcksetzen von Fertigkeitspunkten - v2.05 nderungen : - Wichtiger Ffix : Alle Fehler die einen Start von Diablo2 verhinderten sind entfernt - v2.04 nderungen : - Das zurcksetzen der Statuspunkte, sowie die Fertigkeiten pro LevelUp werden abgeschaltet, wenn man sich in ein Realm-Spiel einklinkt (wie bei der Goldkiste die Knpfe) - Es wird eine Fehlermeldung angezeigt, anstelle eines Absturzes, wenn PlugY.dll nicht gefunden werden kann @@ -241,11 +248,9 @@ v2.04 - Einen Fehler bezglich der verschwindenden Knpfe behoben - Abspeicher-Problem unter Win95/98/Me behoben - v2.03b nderungen : - Anzeige der PlugY Version nur im Hauptbild - v2.03 nderungen : - Wichtigster Fix : Die Abspeicher-Routine gendert, damit bei einem Spiel-Absturz keine Items in der Kiste verloren gehen, und der Charakter korrupt wird. - Kein Absturz des Host Spiels, wenn ein Charakter nicht ins Spiel kann. @@ -253,7 +258,6 @@ v2.03 - Die Versionsanzeige auf der Hauptseite gendert (PlugY Version jetzt rechts, und Farben sind nun mglich) - Charaktere ohne PlugY knnen nun an Spielen teilnehmen die gehosted werden von PlugY-Spilern. - v2.02 nderungen : - PlugY nutzt die D2win.dll nicht mehr zum laden. - PlugY enthlt einen Patcher/Ent-Patcher um die D2gfx.dll so zu verndern, das PlugY gestartet wird. @@ -261,12 +265,10 @@ v2.02 - Die Goldkistenerweiterung wird bei Realm Spielen automatisch abgeschaltet. - Index Button Fehler behoben. - v.2.01 nderungen - Fertigkeitsfehler beim LevelUp behoben. - Anzeigefehler im Hauptbildschirm behoben. - v2.00 nderungen : - Deutsche Lokalisierung hinzugefgt. - Die Anzahl der Fertigkeitspunkte beim erreichen des nchsten Levels ist einstellbar. @@ -283,19 +285,16 @@ v2.00 - Der Fehler mir carry1 Gegenstnden wurde behoben (Uniques die nur einaml getragen werden drfen) - Weitere kleine Verbesserungen eingebaut. - v1.03 nderungen : - Franzsische Liesmich- und Ini-Datei hinzugefgt. - Fehler in D2Classic-Spielen entfernt (es gibt dort keine Seiten-Erweiterungen, dies ist kein Fehler) - Fehler behoben, der beim laden mit vor LOD 1.10 generierten Charakteren auftrat. (zB: ShadowMaster Charakter oder 1.09 oder D2Classic Charakter) - v1.02 nderungen : - Dateinamen gendert wegen eines Fehlers mit dem IE und ZIP-Files - Man kann die Versions-Information im Hauptbildschirm ndern (siehe Ini-Datei). - v1.01 nderungen : - Franzsische Lokalisierung hinzugefgt (Franzsisches Liesmich.txt folgt) - Dateinamen von "PlugY, The Survival Kit.ini" in "PlugY,The_Survival_Kit" gendert. @@ -305,7 +304,6 @@ v1.01 (Man kann ihn weiterhin hinzufgen, sollte aber wissen, was man tut...) - Paket von .rar auf .zip umgestellt - v1.00 Funktionen (es knnen alle einfach ein- und ausgeschaltet werden) : - Man kann den "Save"-Pfad anpassen. - Man kann jeden MOD starten, ohne die gesicherten Spielstnde verschieben zu mssen. @@ -340,11 +338,6 @@ v1.00 Funktionen (es k ******** INSTALLATION ******** -- The officials sites are : -http://djaftal.chez-alice.fr/ -http://phrozenkeep.18v.biz/dload.php?action=category&cat_id=128 -http://diablo2.judgehype.com/index.php?page=telechargements - Installation : - Entpacke alle Dateien in dein Diablo Verzeichnis. - Kopiere die PlugY.ini und die PlugY.exe in das Verzeichnis in dem dein Mod ist. @@ -532,6 +525,30 @@ Nur Ausschalten wenn du weist was du machst. - ActiveCheckMemory=1 +[WINDOWED] +Launch in windowed mode. +- ActiveWindowed=0 {0:Disabled; 1:Enabled} + +Remove border in windowed mode. +- RemoveBorder=0 {0:Disabled; 1:Enabled} + +Set window at most top (above taskbar) in windowed mode. +- WindowOnTop=0 {0:Disabled; 1:Enabled} + +Maximized and center window (keep ratio 4/3) in windowed mode (if SetWindowPos=0). +- Maximized=0 {0:Disabled; 1:Enabled} + +Set position and size of the window in windowed mode. +- SetWindowPos=0 {0:Disabled; 1:Enabled} +- X=0 {0:Window Position X} +- Y=0 {0:Window Position Y} +- Width=0 {0:Window Width} +- Height=0 {0:Window Height} + +Lock cursor mouse in the window in windowed mode. +- LockMouseOnStartup=0 {0:Disabled; 1:Enabled} + + [LANGUAGE] Wechselt die ausgewhlte Sprache Ihr msst die Dateien der Sprache besitzen!!! @@ -753,4 +770,4 @@ Zur Korrektur der deutschen * Spanish : Acrerune * Polnisch : Serdel - ~~~~~~~~~~~~ \ No newline at end of file +;--------------------------------------------------------------------------------------; \ No newline at end of file diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt index 514c531..46f22a9 100644 --- a/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt +++ b/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt @@ -4,7 +4,7 @@ ; ; ; par Yohann Nicolas ; ; ; -; version 10.00 ; +; version 10.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -23,13 +23,13 @@ Vous pouvez y faire un don si vous le souhaitez. - Les moddeurs devraient lire la version anglaise de ce readme. - N'oubliez pas de lire les forums : http://forum.judgehype.com/judgehype/ModsetModding/liste_sujet-1.htm - http://phrozenkeep.planetdiablo.gamespy.com/forum/viewforum.php?f=133 (anglais) + http://d2mods.info/forum/viewforum.php?f=133 (anglais) ******** CARACTERISTIQUES ******** - Dsactive l'accs Battle.net -- Espace de stockage infini dans le coffre (jusqu' 4 294 967 296 pages personnelles!) -- Espace de stockage partag dans le coffre (jusqu' 4 294 967 296 pages partages aussi!) +- Espace de stockage infini dans le coffre ! +- Espace de stockage partag dans le coffre ! - Active les mots runiques du ladder en dehors des royaumes. - World Event et Uber Quest en Local pour le monojoueur et le multijoueur hors royaumes ! - Permet d'ouvrir le portail vers le Cow Level mme quand on a tuer le Cow King dans cette difficult. @@ -46,20 +46,48 @@ Vous pouvez y faire un don si vous le souhaitez. - D2 peut charger tout les fichiers, mme ceux ouvert par Microsoft Excel (dsactiv par defaut). - Affiche la valeur courante des caracs (sans les bonus magiques). - Localis en franais, anglais, allemand, italien, espagnol et polonais. +- Ajout des commandes suivantes (les fonctions correspondantes doivent tre actives dans PlugY.ini) : + /save : Sauvegarde la partie sans quitter. + /reload : Recharge la page des paris. + /page 1 : Affiche la page des stats de base (la page des stats doit tre ouverte, espace non obligatoire). + /page 2 : Affiche la page des stats en plus (la page des stats doit tre ouverte, espace non obligatoire). + /page 3 : Affiche la page des stats de resistances (la page des stats doit tre ouverte, espace non obligatoire). + /page 4 : (bta) Affiche la page des mots runiques actifs (la page des stats doit tre ouverte, espace non obligatoire). + /lockmouse : Bloque le curseur de la souris dans la fentre. + /lock : Identique /lockmouse. + /pagename name : (bta) Renomme la page courante du coffre (Ce nouveau nom n'est pas sauvegard). + /swap page : Echange le contenu de la page actuelle du coffre avec le contenu d'une autre "page" (espace non obligatoire). + /toggle page : Echanger le contenu de la page actuelle du coffre avec le contenu d'une autre "page" du coffre oppos partag/personnel (espace non obligatoire). + /dlm : Inverse le mode d'affichage: Toujours afficher les valeurs de vie et de mana. (Depuis 1.13c, on peut clicker sur le bas de l'orbe) + /dml : Identique /dlm. + /dl : Inverse le mode d'affichage: Toujours afficher les valeurs de vie. (Depuis 1.13c, on peut clicker sur le bas de l'orbe) + /dm : Inverse le mode d'affichage: Toujours afficher les valeurs de mana. (Depuis 1.13c, on peut clicker sur le bas de l'orbe) + /rename newname : (bta) Renomme la personnage et le sauvegarde (Vous devez quitter la partie pour la mise jour de la page des stats). + /listcube : (bta) Cre un fichier "cube.txt" dans le rpertoire courant contenant toutes les formules actives du cube. + /maxgold : CHEAT ne pas utiliser en partie normal. Remplit le coffre personnel, celui partage et le personnage au maximum d'or. +Changements apports par la v10.01 : +- Ajout du mode fentr. +- Peut bloquer le curseur de la souris dans la fentre. (mode fentr). +- Peut supprimer les bordure de la fentre (mode fentr). +- Peut redimensionner ou maximiser la fentre (mode fentr). +- Peut mettre la fentre au-dessus de toutes les autres fentres, y compris la barre des tches (mode fentr). +- Permet de verrouiller le curseur de la souris dans les fentres au dmarrage et avec la commande "/lockmouse" ou "/lock" (mode fentr). +- Ajout de la commande "/swap page" pour changer le contenu de la page actuelle du coffre avec le contenu d'une autre "page". +- Ajout de la commande "/toggle page" pour changer le contenu de la page actuelle du coffre avec le contenu d'une autre "page" du coffre oppos (partag/personnel). +- Ajout de la commande "/rename newname" pour renommer son personnage. Cette fonctionnalit est en bta et vous devez quitter la partie pour mettre jour la page des stats. + Changements apports par la v10.00 : - Dsactive l'accs Battle.net par le bouton du menu principal. - PlugY fonctionne aussi la version 1.13c de LOD. - Corrige le raccourci dans le menu dmarrer. - Changements apports par la v9.00 : - PlugY fonctionne aussi la version 1.12 de LOD. - Corrige diffrents bugs. - Ajout d'une option pour le dassignement des skill dans les mods. - Changements apports par la v8.00 : - Installation plus aise : Nouvel installeur. - Permet d'ouvrir le portail vers le Cow Level mme quand on a tuer le Cow King dans cette difficult. @@ -70,16 +98,13 @@ Changements apport - Multiplayer : Sauvegarde les fichiers du stash (avec les donnes du client comme avec les versions d'avant 5.00) quand il y a une dconnection ou une erreur apparait durant la procdure de sauvegarde. - Remove the "check load memory failed" message when D2gfx.dll was patched. - Changements apports par la v7.02 : - Corrige la perte de points de skills quand on les dsalloue dans les mods contenant des skills spciaux. - Changements apports par la v7.01b : - Corrige l'activation des mots runiques du ladder dans les versions 1.11 and 1.10 de LoD. - Corrige les caractres tranges de quelques texts. - Changements apports par la v7.01 : - Active les mots runiques du ladder en dehors des royaumes. - Corrige le bug avec l'IA de Uber Baal. @@ -88,7 +113,6 @@ Changements apport - Ajout d'un excutable pour lancer Plugy (plus aucun fichier de LoD modifi). (RAPPEL) - Traduction en espagnol et polonais. - Changements apports par la v7.00 : - PlugY fonctionne aussi la version 1.11b de LOD. - Ajout d'un excutable pour lancer Plugy (plus aucun fichier de LoD modifi). @@ -97,17 +121,14 @@ Changements apport - Corrige les fonctions qui restais active sur Battle.net. - Traduction en italien. - Changements apports par la v6.01b : - Correction d'un bug avec l'affichage du popup sur les bouttons d'assignement des points de stats. - Changements apports par la v6.01 : - Corrige le bug qui cause la disparition des items "carry1" du stash quand ils sont cubbs dans LoD 1.10 - Cls et organes des uber ne sont plus dtruit quant on essaie d'ouvrir le portail en dehors d'Harrogath. - Corrige le conflit avec D2Mod pour l'affichage de la version. - Changements apports par la v6.00 : - PlugY fonctionne aussi la version 1.11 de LOD. - Active la Uber Quest hors des Royaumes. (uniquement LoD 1.11). @@ -115,14 +136,12 @@ Changements apport - Corrige quelques bugs mineurs et ajoute des amliorations mineurs. - Ajoute la commande "/save" pour sauvegarder la partie sans quitter (uniquement LoD 1.11). - Changements apports par la v5.06 : - Ajoute des bouttons pour le partage de l'or. - Active l'or partag en multijoueur. - La commande "/DisplayLifeMana" est remplace par "/dlm". - Corrige quelques bugs. - Changements apports par la v5.05 : - Corrige les couleurs par dfauts dans l'interface des stats. - Ajoute de l'or partage via des commandes. @@ -130,30 +149,25 @@ Changements apport - Possiblit d'afficher ou non les nom des objets de set dans le popup quand ceux-ci sont dans le coffre partage. - Correction des bugs du multiplayer (rcriture de ces fonctions). - Changements apports par la v5.04 : - Corrige Stat/Skill points par levelup - Corrige des bugs en Multiplayer. - PlugY/PlugYDefault.ini complet. - Changements apports par la v5.03 : - Corrige le bug qui change quelques fois les coffres partags Hardcore et Softcore. - Ajoute de la couleur sur les nouvelles pages de stats. - Change les valeurs par dfaut des nouvelles pages de stats. - Mets EnabledTXTFilesWhenMSExcelOpenIt=1 dans le fichier PlugY.ini. - Changements apports par la v5.02 : - Corrige la correction d'un bug prcdent qui engendre la disparition d'objets. - Changements apports par la v5.01 : - Corrige les bugs importants dans la gestion du stash. - Remets ActiveLogFile=0 par dfaut dans le fichier PlugY.ini. - Corrige : Bug quand le stash partag est dsactiv. - Changements apports par la v5.00 : - PlugY fonctionne sur les mods des versions 1.09, 1.09b, 1.09d et 1.10 de LOD. - PlugY peut lancer D2Mod.dll. @@ -168,14 +182,12 @@ Changements apport - Corrige la gnration de DiabloClone au dmarrage d'une nouvelle partie. - Corrige plusieurs autres bugs. - Changements apports par la v4.04 : - Corrige le bug d'affichage quand statPerLevelUp est activ - Corrige le bug de sauvegarde quand le disque dur est plein. - Nouveau systme de configuration pour les moddeurs. - Affiche toujours les valeurs numriques de mana et de vie au-dessus des globes correspondants. - Changements apports par la v4.03 : - Corrige le bug des objets uniques carry1 (charme unique) quand on drop le cube. - Possibilit d'aller directement la premire ou dernire page du coffre (shift + clic sur prcdent/suivant). @@ -183,13 +195,11 @@ Changements apport - Ajouts d'infos sur les pages de stats supplmentaires (2 pages maintenant). - Ajoute un bouton "page prcdente" sur la principale page de stats (uniquement en 800x600). - Dplace les boutons des pages de stats supplmentaire aux mme emplacements que ceux de la page principale (uniquement en 800x600). -- Possibilit de choisir si la page affiche quand on ouvre la page des stats est la page principale ou celle slectionne prcdemment. - +- Possibilit de choisir si la page affiche quand on ouvre la page des stats est la page principale ou celle slectionne prcdemment Changements apports par la v4.02b : - Les fonctionnalits restent actives sur Battle.net ouvert. - Changements apports par la v4.02 : - Corrige le conflit avec Battle.net (BigStash dsactiv sur les royaumes) - Corrige l'oublie du "d" de "SeparateHardcoreStash=1" de PlugY.ini @@ -197,16 +207,13 @@ Changements apport - Corrige l'activation de l'affichage de l'item level pour toutes les configurations de PlugY. - Ajouts d'infos sur la 2me page de stats. - Changements apports par la v4.01 : - Corrige le bug du MSVCR70.dll non trouv. - Ajouts d'infos sur la 2me page de stats. - Changements apports par la v4.00b : - Corrige le bug du MSVCR70.dll non trouv. - Changements apports par la v4.00 : - Meilleure optimisation du code. - Ajoute des pages supplmentaires pour l'affichage de plus de statistiques du perso comme le %MF. @@ -224,20 +231,17 @@ Changements apport - Corrige : Diablo Clone ne peut pas apparatre en mode normal et cauchemar. - Corrige : Dtruit les minions(par exemple les squelettes) en trop prs la dsallocation si on a un bonus +x dans cette skill. - Changements apports par la v3.02 : - Corrige : le changement du nombre de points de Stats reus chaque gain de niveau. - Corrige : Quand le coffre partag est dsactiv vous pouvez charger vos persos. - Corrige : Vous pouvez changer les paramtres du World Event sans activer les skill reus chaque gain de niveau. - Changements apports par la v3.01 : - Change le nombre de points de Stats reus chaque gain de niveau. - Corrige les bugs qui donnent des points supplmentaires quand on dsallouent les skills. - Ajoutent les paramtres du WorldEvent dans le fichier de configuration. - Par dfaut, Le WorldEvent AFFICHE "X SOJ vendu" uniquement dans la difficult enfer. - Changements apports par la v3.00 : - World Event en Local pour le monojoueur et le multijoueur hors royaumes ! - Dsalloue les points de capacits(skills) prcdemment alloues. @@ -245,7 +249,6 @@ Changements apport - On peut changer le nom du fichier de sauvegarde. - L'affichage du numero de page pour le coffre partag est en rouge maintenant. - Changements apports par la v2.05 : - Correction importante : Le bug qui faisais que D2 ne dmarrais est dfinitivement corrig. @@ -293,19 +296,13 @@ Changements apport ******** INSTALLATION ******** -Les sites de tlchargement officiel sont : -http://djaftal.chez-alice.fr/ -http://phrozenkeep.18v.biz/dload.php?action=category&cat_id=128 -http://diablo2.judgehype.com/index.php?page=telechargements - - Installation normale : - Suivre les directives de l'installeur. note : Vous pouvez choisir le rpertoire de "Diablo II" comme rpertoire d'installation. Installation dans un autre mod -- Copier PlugY.ini, PlugY.exe er PlugY folder (+son sontenu) dans le rpertoire du mod cibl. +- Copier PlugY.ini, PlugY.exe et PlugY folder (+son sontenu) dans le rpertoire du mod cibl. - Editer PlugY.ini pour configurer les options (voir section plus bas). - Lancer le jeu PlugY.exe et amusez-vous :) @@ -314,8 +311,8 @@ note : Vous pouvez d Exemple : Si vous avez install Lord of Destruction ici : C:\Jeux\Diablo II\Diablo II.exe -Et que le mod cibl se trouve l : D:\D2Mod\MyMod\ -Et que un second mod se trouve l : D:\D2Mod\MyMod2\ +Et que le mod cibl se trouve dans : D:\D2Mod\MyMod\ +Et qu'un second mod se trouve dans : D:\D2Mod\MyMod2\ Alors la configuration classique est ceci : C:\Jeux\Diablo II\PlugY.dll D:\D2Mod\MyMod\PlugY\SharedGoldBtns.dc6 @@ -492,6 +489,30 @@ Active les fonctions cach - ActiveAllOthersFeatures=0 {0:Dsactiv; 1:Activ} +[WINDOWED] +Lancement en mode fentr. +- ActiveWindowed=0 {0:Dsactiv; 1:Activ} + +Supprime le cadre de la fentre en mode fentr. +- RemoveBorder=0 {0:Dsactiv; 1:Activ} + +Met la fentre au plus haut (au-dessus de la barre des tches) en mode fentr. +- WindowOnTop=0 {0:Dsactiv; 1:Activ} + +Fentre centre et maximise (ratio maintenu 4/3) en mode fentr (si SetWindowPos = 0). +- Maximized=0 {0:Dsactiv; 1:Activ} + +Dfinie la position et la taille de la fentre en mode fentr. +- SetWindowPos=0 {0:Dsactiv; 1:Activ} +- X=0 {0:Position X de la fentre} +- Y=0 {0:Position Y de la fentre} +- Width=0 {0:Largeur de la fentre} +- Height=0 {0:Hauteur de la fentre} + +Verrouiller le curseur da la souris dans la fentre en mode fentr. +- LockMouseOnStartup=0 {0:Dsactiv; 1:Activ} + + [LANGUAGE] Change la langue du jeu. Vous devez avoir les fichiers de langue choisi. @@ -702,4 +723,5 @@ PS : D * Italien : ItalianPlayer * Espagnol : Acrerune * Polonais : Serdel - ~~~~~~~~~~~~ \ No newline at end of file + +;--------------------------------------------------------------------------------------; \ No newline at end of file diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt index c9f3ea3..a3319dd 100644 --- a/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt +++ b/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt @@ -4,7 +4,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 10.00 ; +; version 10.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -20,13 +20,13 @@ You can make a donation if you want. - PlugY.ini has changed since previous version, use the one in this package. - Don't forget to read the part named "COMMENTS ON THE CONFIGURATION FILE". - Don't forget to read the PlugY forum at : - http://phrozenkeep.planetdiablo.gamespy.com/forum/viewforum.php?f=133 + http://d2mods.info/forum/viewforum.php?f=133 ******** FEATURES ******** - Disable access to Battle.net. -- Infinite storage space in the stash (up to 4,294,967,296 personal pages!) -- Shared storage space in the stash (up to 4,294,967,296 shared pages too!) +- Infinite storage space in the stash. +- Shared storage space in the stash. - Enabled the ladder only runewords out of realms. - Local World Event and Uber Quest for singleplayer and multiplayer off-realm ! - Can open Cow Level Portal even when player have kill the Cow King in that difficulty. @@ -42,21 +42,50 @@ You can make a donation if you want. - Always display Mana and Life values above the globes. - D2 can load all files, even those opened with Microsoft Excel (disabled by default). - Display the stats current value (without magical bonus) like Magic/gold find or maximum resistances. +- Can launch game in windowed mode with some options (lock mouse/resize/on top/noborder). - PlugY is localized in English, French, German, Italian, Spanish, Polish. +- Add following commands (the corresponding functions must be enabled in PlugY.ini) : + /save : Save game without exit. + /reload : Reload gamble page. + /page 1 : Show normal stats page (stats page must be opened, space not mandatory). + /page 2 : Show extra stats page (stats page must be opened, space not mandatory). + /page 3 : Show resistance stats page (stats page must be opened, space not mandatory). + /page 4 : (beta) Show available runewords (stats page must be opened, space not mandatory). + /lockmouse : Lock mouse cursor in the window. + /lock : same as /lockmouse. + /pagename name : (beta) Rename current page stash (the new name isn't saved). + /swap page : Swap the content of current stash page with the content of another page (space not mandatory). + /toggle page : Swap the content of current stash page with the content of another page in opposing stash shared/personal (space not mandatory). + /dlm : Toggle always display mana and life mode. (Since 1.13c, you can click on the bottom of each orbs) + /dml : Same as /dlm. + /dl : Toggle always display life mode. (Since 1.13c, you can click on the bottom of the orb) + /dm : Toggle always display mana mode. (Since 1.13c, you can click on the bottom of the orb) + /rename newname : (beta) rename your character and save it. (You must exit the game to update the stats page.) + /listcube : (beta) Create a "cube.txt" file in current directory containing all cube's receipts. + /maxgold : CHEAT don't use in normal game. Set personnal stash, shared stash and character to max gold. +v10.01 changes : +- Add windowed mode. +- Can lock mouse cursor in the window (windowed mode). +- Can remove border (windowed mode). +- Can resize or maximize window (windowed mode). +- Can fix window above any others windows including taskbar (windowed mode). +- Can lock mouse cursor in the windows on startup and with command "/lockmouse" or "/lock" (windowed mode). +- Add command "/swap page" to swap the content of current stash page with the content of another page. +- Add command "/toggle page" to swap the content of current stash page with the content of another page in opposing stash shared/personal. +- Add command "/rename newname" to rename your character. This feature is still in beta and you must exit the game to update the stats page. + v10.00 changes : - Disable access to Battle.net via main menu button. - PlugY works for 1.13c version of LoD too. - Fix shortcut in start menu - v9.00 changes : - PlugY works for 1.12 version of LoD too. - Fix somes bugs. - Add option for unassign skill for mods. - v8.00 changes : - Easier installation : New installer. - Can open Cow Level Portal even when player have kill the Cow King in that difficulty. @@ -67,12 +96,10 @@ v8.00 changes : - Multiplayer : Save stash files (with client's data like version before 5.00) when a deconnection or error happend during saving process. - Remove the "check load memory failed" message when D2gfx.dll was patched. - v7.01b changes : - Fix the ladder only runewords features in versions 1.11 and 1.10 of LoD. - Fix wierd characters in some text. - v7.01 changes : - Enabled the ladder only runewords out of realms. - Fixed Uber Baal AI. @@ -81,7 +108,6 @@ v7.01 changes : - Add an executable to launch PlugY (no more LoD's files modified) (RECALL) - Translation into spanish and polish. - v7.00 changes : - PlugY works for 1.11b version of LoD too. - Add an executable to launch PlugY (no more LoD's files modified) @@ -90,17 +116,14 @@ v7.00 changes : - Fix features which stayed enabled on Battle.net. - Translation into italian. - v6.01b changes : - Bug fix with the display of popup on stat assignment buttons. - v6.01 changes : - Major fix : unique carry1 items don't disappear when they are cubbed in LoD 1.10 - Keys and Uber organs aren't destroyed when we try to open a Red Porpal out of Harrogath. - Fix conflict with D2Mod for the version display. - v6.00 changes : - PlugY works for 1.11 version of LoD too ! - Enabled Uber Quest off realm (LoD 1.11 only). @@ -108,14 +131,12 @@ v6.00 changes : - Fixed some minor bugs and added some minor improvements. - Added command "/save" to save the game without exit (LoD 1.11 only). - v5.06 changes : - Added buttons for shared gold. - Enabled shared gold in multiplayer. - Command "/DisplayLifeMana" is replaced by "/dlm". - Fixed some bugs. - v5.05 changes : - Fixed bad default color in interface stats. - Added Shared gold via commands. @@ -123,30 +144,25 @@ v5.05 changes : - Display green set item name in popup when it's in the shared stash. - Fixed multiplayer bugs by redoing multiplayer procedure. - v5.04 changes : - Fixed : Stat/Skill points per level-up bug. - Fixed : Multiplayer bugs. - PlugY/PlugYDefault.ini completed. - v5.03 changes : - Fixed : Bug which sometimes swaps Hardcore and Softcore shared stash. - Added color on extra stats page. - Changed default values on extra stats page. - Set EnabledTXTFilesWhenMSExcelOpenIt=1 in PlugY.ini file. - v5.02 changes : - Fixed : Previous bug fix which caused items to disappear. - v5.01 changes : - Fixed : Major bugs in stash management. - Fixed : Set back PlugY.ini with ActiveLogFile=0 by default. - Fixed : bug when shared stash is disabled. - v5.00 changes : - PlugY works for 1.09, 1.09b, 1.09d versions of LoD, including mods based on these releases ! - PlugY can load D2Mod.dll. @@ -161,14 +177,12 @@ v5.00 changes : - Fixed : The spawn of DiabloClone at starting of a new game - Fixed : Some other small bugs. - v4.04 changes : - Fixed : Display bug when statPerLevelUp enabled. - Fixed : Bug in saving procedure when the disk is full. - New configuration system for modders. - Always display Mana and Life values above the globes. - v4.03 changes : - Fixed : "carry 1" unique item (unique charm) when we drop the cube. - Can go directly to first or last page of stash (shift + click on next/previous). @@ -178,7 +192,6 @@ v4.03 changes : - Moved buttons in extra stats pages to same place as in main stats page (only in 800x600). - Can choose whether the main (first) page or the last selected page is displayed on opening the stats page. - v4.02b changes : - Fixed : Features stay enabled in open Battle.net @@ -190,16 +203,13 @@ v4.02 changes : - Fixed : Item level display enabled correctly for all configurations of PlugY. - Added data in the extra stats page. - v4.01 changes : - Fixed : NbPlayers always set to 8 when active. - Added data in the extra stats page. - v4.00b changes : - Fixed : MSVCR70.dll not found bug. - v4.00 changes : - Better optimization of the code. - Added some pages for displaying more characters stats like %MF. @@ -217,20 +227,17 @@ v4.00 changes : - Fixed : Diablo Clone can't spawn in normal and nightmare difficulty. - Fixed : Destruction of extra minions after unassignment if you have +x bonus to the skill. - v3.02 changes : - Fixed : Change the number of stats points gained when player gains a level. - Fixed : When the shared stash is disabled, you can load a game with your character. - Fixed : You can change parameters of World Event without activating skill per level up. - v3.01 changes : - Change the number of stats points gained when player gains a level. - Fixed bugs which give extra points when skills points are unassigned. - Added parameters for the WorldEvent in configuration file. - By default, World Event only SHOWS "X SOJ Sold" in hell difficulty. - v3.00 changes : - Local World Event for singleplayer and multiplayer off-realm ! - Unassign assigned skills points. @@ -238,11 +245,9 @@ v3.00 changes : - Can change the filename of the shared savefile. - Shared stash page number display are in red now. - v2.05 changes : - major fix : bugs which cause D2 not to start are finally removed. - v2.04 changes : - Unassign stats points, skills on level up are disabled when you connect to realm (like stash). - Open a error message box instead of crash when PlugY.dll isn't found by D2. @@ -250,11 +255,9 @@ v2.04 changes : - Fixed bug display of buttons. - Fixed win95/98/Me saving. - v2.03b changes : - Show PlugY version only in main screen. - v2.03 changes : - Major fix : Correct and secure the saving procedure. - No more crash of the host game when a character is unable to enter the game. @@ -262,7 +265,6 @@ v2.03 changes : - Change version printing on main screen (change color & PlugY version in right corner) - Character without PlugY can join game host with PlugY enabled. - v2.02 changes : - PlugY doesn't use D2win.dll to launch PlugY anymore. - PlugY includes a patcher/unpatcher for editing D2gfx.dll to launch PlugY. @@ -270,12 +272,10 @@ v2.02 changes : - The infinite storage sytem is automatically disabled on a realm game. - Fixed index button bugs. - v2.01 changes : - Fixed skill per level up bug - Fixed bug display of text in the main menu - v2.00 changes : - Localized in German. - Change the number of Skills points gained when player gains a level. @@ -292,7 +292,6 @@ v2.00 changes : - Removed the bug of "carry 1" - Add other small improvements... :) - v1.03 changes : - Added French readme and ini files. - Removed bugs in D2Classic game (there is no multipage, it's not a bug) @@ -302,12 +301,10 @@ v1.03 changes : * must read : You can start any mods without moving SAVES files (you need to move dll files with classic script). - v1.02 changes : - Re-changed name files due to an IE bug with colon in zip file. - Ability to change the version text print in the main menu (see ini file). - v1.01 changes : - Localized for french version (wait for an french readme.txt) - Changed filename from "PlugY, The Survival Kit.ini" to "PlugY,The_Survival_Kit". @@ -317,7 +314,6 @@ v1.01 changes : (you can add it if you want but need to know what are you doing...) - Released in .zip file instead of .rar - v1.00 features (can all be easily enabled or disabled) : - You can change the save path directory. - You can start any mods without moving saves files. @@ -353,12 +349,6 @@ v1.00 features (can all be easily enabled or disabled) : ******** INSTALLATION ******** -- The officials sites are : -http://djaftal.chez-alice.fr/ -http://phrozenkeep.18v.biz/dload.php?action=category&cat_id=128 -http://diablo2.judgehype.com/index.php?page=telechargements - - Normal Installation : - Follow directive installer. @@ -548,17 +538,14 @@ Following are default values, between {} are some examples values with descripti - ActivePlugin=0 {0:Don't load any features; 1:Plugin enabled} Enable or disable BattleNet Access. -Following are default values, between {} are some examples values with descriptions : - DisableBattleNet=1 {0:Battle.net access enable; 1:Battle.net access disable} Create a log file "PlugY.log" in the current directory. This feature can slow down your game. -Following are default values, between {} are some examples values with descriptions : - ActiveLogFile=0 {0:No information is written while playing; 1:Always enabled} Load dll of a specific mod for used PlugY in same time. Separate each dll file name by the character pipe (|) -Following are default values, between {} are some examples values with descriptions : - DllToLoad= {(empty): load nothing; D2extra.dll|myDll.dll: Load both D2extra.dll and myDll.dll} - DllToLoad2= {(empty): Same as DlltoLoad} @@ -576,6 +563,30 @@ Activate hidden or not-finished feature. (don't use it) - ActiveAllOthersFeatures=0 {0:Disabled; 1:Enabled} +[WINDOWED] +Launch in windowed mode. +- ActiveWindowed=0 {0:Disabled; 1:Enabled} + +Remove border in windowed mode. +- RemoveBorder=0 {0:Disabled; 1:Enabled} + +Set window at most top (above taskbar) in windowed mode. +- WindowOnTop=0 {0:Disabled; 1:Enabled} + +Maximized and center window (keep ratio 4/3) in windowed mode (if SetWindowPos=0). +- Maximized=0 {0:Disabled; 1:Enabled} + +Set position and size of the window in windowed mode. +- SetWindowPos=0 {0:Disabled; 1:Enabled} +- X=0 {0:Window Position X} +- Y=0 {0:Window Position Y} +- Width=0 {0:Window Width} +- Height=0 {0:Window Height} + +Lock cursor mouse in the window in windowed mode. +- LockMouseOnStartup=0 {0:Disabled; 1:Enabled} + + [LANGUAGE] Change the selected language. You must have files of the selected language. @@ -657,6 +668,7 @@ Following are default values, between {} are some examples values with descripti [STAT ON LEVEL UP] +WARNING : CHEAT, DON'T USE IN NORMAL GAME. Change the number of Stats Points you receive when your character gains a level. Following are default values, between {} are some examples values with descriptions : - ActiveStatPerLevelUp=0 {0:Disabled; 1:Enabled} @@ -676,6 +688,7 @@ Following are default values, between {} are some examples values with descripti [SKILL ON LEVEL UP] +WARNING : CHEAT, DON'T USE IN NORMAL GAME. Change the number of Skills Points you receive when your character gains a level. Following are default values, between {} are some examples values with descriptions : - ActiveSkillPerLevelUp=0 {0:Disabled; 1:Enabled} @@ -786,4 +799,5 @@ PS : Sorry for english faults ;) * Italian : ItalianPlayer * Spanish : Acrerune * Polish : Serdel - ~~~~~~~~~~~~ \ No newline at end of file + +;--------------------------------------------------------------------------------------; \ No newline at end of file diff --git a/PlugYRun/PlugYRun.cpp b/PlugYRun/PlugYRun.cpp index 4b0552d..1d97832 100644 --- a/PlugYRun/PlugYRun.cpp +++ b/PlugYRun/PlugYRun.cpp @@ -1,16 +1,8 @@ /* - File created by Yohann NICOLAS. +File created by Yohann NICOLAS. */ -#include -#include -#include -//#using -//#using -//using namespace EnvDTE; -//using namespace System; -//using namespace System::Diagnostics; -//using namespace System::ComponentModel; -//using namespace System.Diagnostics; +#include "stdafx.h" +#include "PlugYRun.h" /* 0012C458 00000000 |ModuleFileName = NULL 0012C45C 0012C908 |CommandLine = ""C:\Jeux\Diablo II\Game.exe"" @@ -22,115 +14,118 @@ 0012C474 0012DF94 |CurrentDir = "C:\Jeux\Diablo II\" 0012C478 0012C6BC |pStartupInfo = 0012C6BC 0012C47C 0012C5CC \pProcessInfo = 0012C5CC -$ ==> >44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D............... -$+10 >1A 13 03 00 08 00 00 00 14 13 04 00 00 00 00 00 ......... -$+20 >01 00 00 00 0C C7 12 00 34 87 D1 77 81 00 00 00 .....4w... -$+30 >0A 00 00 00 00 00 00 00 00 00 00 00 89 F6 D4 77 ............w -$+40 >CD AB BA DC 00 00 00 00 ͫ.... +$ ==> >44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +$+10 >1A 13 03 00 08 00 00 00 14 13 04 00 00 00 00 00 +$+20 >01 00 00 00 0C C7 12 00 34 87 D1 77 81 00 00 00 +$+30 >0A 00 00 00 00 00 00 00 00 00 00 00 89 F6 D4 77 +$+40 >CD AB BA DC 00 00 00 00 -//0xE9,0x1C,0xD1,0xA8,0x6F +0xE9,0x1C,0xD1,0xA8,0x6F */ +#define MAX_LOADSTRING 100 #define SUBKEY "Software\\Blizzard Entertainment\\Diablo II" -#define GAMEFILE "\\Game.exe " -#define INIFILE "\\PlugY.ini" +#define GAMEFILE "Game.exe " +#define INIFILE "PlugY.ini" #define LAUNCHING "LAUNCHING" #define LOD_VERSION "LodVersionFolder" #define PARAM "Param" +#define WINDOWED "Windowed" +#define ACTIVE_WINDOWED "ActiveWindowed" #define LIBRARY_NAME "Library" -BYTE loadDll[]={ -0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] -0xFF,0x15,0x40,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.LoadLibraryA>] ; kernel32.LoadLibraryA -0x50, //PUSH EAX -0x68,0x80,0xBE,0xA7,0x6F, //PUSH d2gfx.6FA7BE80 ; ASCII "PlugY.dll" -0xFF,0x15,0x40,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.LoadLibraryA>] ; kernel32.LoadLibraryA -0xA3,0xFC,0xEF,0xA8,0x6F, //MOV DWORD PTR DS:[6FA8EFFC],EAX -0x85,0xC0, //TEST EAX,EAX -0x74,0x2F, //JE SHORT d2gfx.6FA7BE37 -0x50, //PUSH EAX -0x68,0x90,0xBE,0xA7,0x6F, //PUSH d2gfx.6FA7BE10 ;Init String -0x50, //PUSH EAX -0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAddress>] ; kernel32.GetProcAddress -0x85,0xC0, //TEST EAX,EAX -0x74,0x04, //JE SHORT d2gfx.6FA7BDC1 -0x6A,0x00, //PUSH 0 -0xEB,0x13, //JMP SHORT d2gfx.6FA7BDC1 -0x68,0x10,0x27,0x00,0x00, //PUSH 2710 ;Init Ordinal(10000) -0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] -0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAddress>] ; kernel32.GetProcAddress -0x85,0xC0, //TEST EAX,EAX -0x74,0x02, //JE SHORT d2gfx.6FA7BDC1 -0xFF,0xD0, //CALL EAX -0x58, //POP EAX -0x58, //POP EAX -0xC2,0x04,0x00, //RETN 4 -0x59, //POP ECX -0xB9,0x80,0xBE,0xA7,0x6F, //MOV ECX,d2gfx.6FA7BE80 ; ASCII "PlugY.dll" -0x83,0x04,0x24,0x10, //ADD DWORD PTR SS:[ESP],10 -0xC2,0x04,0x00, //RETN 4 -0x00,0x00,0x00,0x00}; //HANDLE var; +BYTE loadDll[] = { + 0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] + 0xFF,0x15,0x40,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.LoadLibraryA>] ; kernel32.LoadLibraryA + 0x50, //PUSH EAX + 0x68,0x80,0xBE,0xA7,0x6F, //PUSH d2gfx.6FA7BE80 ; ASCII "PlugY.dll" + 0xFF,0x15,0x40,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.LoadLibraryA>] ; kernel32.LoadLibraryA + 0xA3,0xFC,0xEF,0xA8,0x6F, //MOV DWORD PTR DS:[6FA8EFFC],EAX + 0x85,0xC0, //TEST EAX,EAX + 0x74,0x2F, //JE SHORT d2gfx.6FA7BE37 + 0x50, //PUSH EAX + 0x68,0x90,0xBE,0xA7,0x6F, //PUSH d2gfx.6FA7BE10 ;Init String + 0x50, //PUSH EAX + 0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAddress>] ; kernel32.GetProcAddress + 0x85,0xC0, //TEST EAX,EAX + 0x74,0x04, //JE SHORT d2gfx.6FA7BDC1 + 0x6A,0x00, //PUSH 0 + 0xEB,0x13, //JMP SHORT d2gfx.6FA7BDC1 + 0x68,0x10,0x27,0x00,0x00, //PUSH 2710 ;Init Ordinal(10000) + 0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] + 0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAddress>] ; kernel32.GetProcAddress + 0x85,0xC0, //TEST EAX,EAX + 0x74,0x02, //JE SHORT d2gfx.6FA7BDC1 + 0xFF,0xD0, //CALL EAX + 0x58, //POP EAX + 0x58, //POP EAX + 0xC2,0x04,0x00, //RETN 4 + 0x59, //POP ECX + 0xB9,0x80,0xBE,0xA7,0x6F, //MOV ECX,d2gfx.6FA7BE80 ; ASCII "PlugY.dll" + 0x83,0x04,0x24,0x10, //ADD DWORD PTR SS:[ESP],10 + 0xC2,0x04,0x00, //RETN 4 + 0x00,0x00,0x00,0x00 }; //HANDLE var; -BYTE freeDll[]={ -0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] -0xFF,0x15,0x48,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.FreeLibrary>] ; kernel32.FreeLibrary -0x50, //PUSH EAX -0xA1,0xFC,0xEF,0xA8,0x6F, //MOV EAX,DWORD PTR DS:[6FA8EFFC] -0x85,0xC0, //TEST EAX,EAX -0x74,0x2D, //JE SHORT d2gfx.6FA7BE74 -0x50, //PUSH EAX -0x68,0xA0,0xBE,0xA7,0x6F, //PUSH d2gfx.6FA7BE20 ;Release String -0x50, //PUSH EAX -//0x33,0xC0, //XOR EAX,EAX -//0xA3,0xFC,0xEF,0xA8,0x6F, //MOV DWORD PTR DS:[6FA8EFFC],EAX -0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAdd>; kernel32.GetProcAddress -0x85,0xC0, //TEST EAX,EAX -0x75,0x13, //JNZ SHORT d2gfx.6FA7BDEF -0x68,0x11,0x27,0x00,0x00, //PUSH 2711 ;Release Ordinal(10001) -0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] -0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAdd>; kernel32.GetProcAddress -0x85,0xC0, //TEST EAX,EAX -0x74,0x02, //JE SHORT d2gfx.6FA7BDEF -0xFF,0xD0, //CALL EAX -0xFF,0x15,0x48,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.FreeLibrar>; kernel32.FreeLibrary -0x58, //POP EAX -0xC2,0x04,0x00}; //RETN 4 +BYTE freeDll[] = { + 0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] + 0xFF,0x15,0x48,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.FreeLibrary>] ; kernel32.FreeLibrary + 0x50, //PUSH EAX + 0xA1,0xFC,0xEF,0xA8,0x6F, //MOV EAX,DWORD PTR DS:[6FA8EFFC] + 0x85,0xC0, //TEST EAX,EAX + 0x74,0x2D, //JE SHORT d2gfx.6FA7BE74 + 0x50, //PUSH EAX + 0x68,0xA0,0xBE,0xA7,0x6F, //PUSH d2gfx.6FA7BE20 ;Release String + 0x50, //PUSH EAX + //0x33,0xC0, //XOR EAX,EAX + //0xA3,0xFC,0xEF,0xA8,0x6F, //MOV DWORD PTR DS:[6FA8EFFC],EAX + 0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAdd>; kernel32.GetProcAddress + 0x85,0xC0, //TEST EAX,EAX + 0x75,0x13, //JNZ SHORT d2gfx.6FA7BDEF + 0x68,0x11,0x27,0x00,0x00, //PUSH 2711 ;Release Ordinal(10001) + 0xFF,0x74,0x24,0x04, //PUSH DWORD PTR SS:[ESP+4] + 0xFF,0x15,0x3C,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.GetProcAdd>; kernel32.GetProcAddress + 0x85,0xC0, //TEST EAX,EAX + 0x74,0x02, //JE SHORT d2gfx.6FA7BDEF + 0xFF,0xD0, //CALL EAX + 0xFF,0x15,0x48,0xC0,0xA7,0x6F, //CALL DWORD PTR DS:[<&KERNEL32.FreeLibrar>; kernel32.FreeLibrary + 0x58, //POP EAX + 0xC2,0x04,0x00 }; //RETN 4 -//LPCSTR dllName = "PlugY.dll"; + //LPCSTR dllName = "PlugY.dll"; LPCSTR initFctName = "_Init@4"; LPCSTR releaseFctName = "_Release@0"; static bool versionXP; -typedef int (__stdcall* tDebugActiveProcessStop)(DWORD); +typedef int(__stdcall* tDebugActiveProcessStop)(DWORD); tDebugActiveProcessStop debugActiveProcessStop; void assertion(LPCSTR msg) { - MessageBox(0, msg, "PlugYRun", MB_OK|MB_ICONASTERISK); + MessageBox(0, msg, "PlugY", MB_OK | MB_ICONASTERISK); exit(1); } bool installPlugY(HANDLE h, DWORD addr, char* libraryName, int isAdd) { BYTE buf[200]; - DWORD pos=0; - SIZE_T nb=0; + DWORD pos = 0; + SIZE_T nb = 0; DWORD version; int res; // Get Version and needed addresses. - res = ReadProcessMemory(h,(LPVOID)(addr+0x110),&version,4,&nb);//0x80 - if (!res || (nb!=4)) assertion("Read to get current d2gfx version in memory failed"); - + res = ReadProcessMemory(h, (LPVOID)(addr + 0x110), &version, 4, &nb);//0x80 + if (!res || (nb != 4)) assertion("Read to get current d2gfx version in memory failed"); + DWORD loadCallerAddr = addr; DWORD freeCallerAddr = addr; DWORD loadLibraryAddr = addr; DWORD freeLibraryAddr = addr; DWORD getProcAddressAddr = addr; -// GET_VERSION(D2gfx, 110, 000054EB, 00001000, 0000C000, 42E6C22A, 43028B19);//110 + // GET_VERSION(D2gfx, 110, 000054EB, 00001000, 0000C000, 42E6C22A, 43028B19);//110 switch (version) { case 0x000054EB://1.09b 0x00949FA8: @@ -182,17 +177,17 @@ bool installPlugY(HANDLE h, DWORD addr, char* libraryName, int isAdd) //Verify if memory are ok. bool alreadyInstalled = false; - res = ReadProcessMemory(h,(LPVOID)loadCallerAddr,buf,6,&nb); - if (!res || nb<6 ) assertion("Read memory failed for checking."); - if (buf[0]!=0xFF || buf[1]!=0x15 || *(DWORD*)(buf+2) != loadLibraryAddr) - if (buf[0]!=0xE8 /*|| buf[1]!=0xD8 || buf[2]!=0x19*/ || buf[3]!=0x00 || buf[4]!=0x00 || buf[5]!=0x90) + res = ReadProcessMemory(h, (LPVOID)loadCallerAddr, buf, 6, &nb); + if (!res || nb<6) assertion("Read memory failed for checking."); + if (buf[0] != 0xFF || buf[1] != 0x15 || *(DWORD*)(buf + 2) != loadLibraryAddr) + if (buf[0] != 0xE8 /*|| buf[1]!=0xD8 || buf[2]!=0x19*/ || buf[3] != 0x00 || buf[4] != 0x00 || buf[5] != 0x90) assertion("Checking library memory check failed."); else alreadyInstalled = true; - res = ReadProcessMemory(h,(LPVOID)freeCallerAddr,buf,6,&nb); - if (!res || nb<6 ) assertion("Read memory failed for checking."); - if (buf[0]!=0xFF || buf[1]!=0x15 || *(DWORD*)(buf+2) != freeLibraryAddr) - if (buf[0]!=0xE8 /*|| buf[1]!=0x75 || buf[2]!=0x1A*/ || buf[3]!=0x00 || buf[4]!=0x00 || buf[5]!=0x90) + res = ReadProcessMemory(h, (LPVOID)freeCallerAddr, buf, 6, &nb); + if (!res || nb<6) assertion("Read memory failed for checking."); + if (buf[0] != 0xFF || buf[1] != 0x15 || *(DWORD*)(buf + 2) != freeLibraryAddr) + if (buf[0] != 0xE8 /*|| buf[1]!=0x75 || buf[2]!=0x1A*/ || buf[3] != 0x00 || buf[4] != 0x00 || buf[5] != 0x90) if (!alreadyInstalled) assertion("Checking library memory failed."); @@ -200,45 +195,45 @@ bool installPlugY(HANDLE h, DWORD addr, char* libraryName, int isAdd) return true; //Alloc custom memory data. - DWORD memory = (DWORD)VirtualAllocEx(h,NULL,200,MEM_COMMIT,PAGE_EXECUTE_READWRITE); - DWORD oldProtect=-1; + DWORD memory = (DWORD)VirtualAllocEx(h, NULL, 200, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + DWORD oldProtect = -1; if (!memory) { -// MessageBox(0, "no memory", "RunPlugY.\n", MB_OK|MB_ICONASTERISK); - memory = addr + 0xBE00 + isAdd*0x1000; - if( !VirtualProtectEx(h,(LPVOID)memory, 200, PAGE_EXECUTE_READWRITE, &oldProtect) ) + // MessageBox(0, "no memory", "RunPlugY.\n", MB_OK|MB_ICONASTERISK); + memory = addr + 0xBE00 + isAdd * 0x1000; + if (!VirtualProtectEx(h, (LPVOID)memory, 200, PAGE_EXECUTE_READWRITE, &oldProtect)) assertion("Failed to get memory pool for PlugY loading."); } //Make memory data int len; - pos=0; + pos = 0; //Dll name - DWORD dllNameAddr = memory+pos; - len = strlen(libraryName)+1; - res = WriteProcessMemory(h,(LPVOID)dllNameAddr,libraryName,len,&nb); - if (!res || (nb!=len)) assertion("Write custom data in memory failed"); - pos += pos%16 ? len + 16 - pos%16 : len; + DWORD dllNameAddr = memory + pos; + len = strlen(libraryName) + 1; + res = WriteProcessMemory(h, (LPVOID)dllNameAddr, libraryName, len, &nb); + if (!res || (nb != len)) assertion("Write custom data in memory failed"); + pos += pos % 16 ? len + 16 - pos % 16 : len; //init name - DWORD initNameAddr = memory+pos; - len = strlen(initFctName)+1; - res = WriteProcessMemory(h,(LPVOID)initNameAddr,initFctName,len,&nb); - if (!res || (nb!=len)) assertion("Write custom data in memory failed"); - pos += pos%16 ? len + 16 - pos%16 : len; + DWORD initNameAddr = memory + pos; + len = strlen(initFctName) + 1; + res = WriteProcessMemory(h, (LPVOID)initNameAddr, initFctName, len, &nb); + if (!res || (nb != len)) assertion("Write custom data in memory failed"); + pos += pos % 16 ? len + 16 - pos % 16 : len; //release name - DWORD releaseNameAddr = memory+pos; - len = strlen(releaseFctName)+1; - res = WriteProcessMemory(h,(LPVOID)releaseNameAddr,releaseFctName,len,&nb); - if (!res || (nb!=len)) assertion("Write custom data in memory failed"); - pos += pos%16 ? len + 16 - pos%16 : len; + DWORD releaseNameAddr = memory + pos; + len = strlen(releaseFctName) + 1; + res = WriteProcessMemory(h, (LPVOID)releaseNameAddr, releaseFctName, len, &nb); + if (!res || (nb != len)) assertion("Write custom data in memory failed"); + pos += pos % 16 ? len + 16 - pos % 16 : len; //load fct - DWORD loadDllAddr = memory+pos; + DWORD loadDllAddr = memory + pos; DWORD handleAddr = loadDllAddr + sizeof(loadDll) - 4; - *(DWORD*)&loadDll[6] = loadLibraryAddr; + *(DWORD*)&loadDll[6] = loadLibraryAddr; *(DWORD*)&loadDll[12] = dllNameAddr; *(DWORD*)&loadDll[18] = loadLibraryAddr; *(DWORD*)&loadDll[23] = handleAddr; @@ -247,42 +242,42 @@ bool installPlugY(HANDLE h, DWORD addr, char* libraryName, int isAdd) *(DWORD*)&loadDll[63] = getProcAddressAddr; *(DWORD*)&loadDll[80] = dllNameAddr; len = sizeof(loadDll); - res = WriteProcessMemory(h,(LPVOID)loadDllAddr,loadDll,len,&nb); - if (!res || (nb!=len)) assertion("Write custom data in memory failed"); - pos += pos%16 ? len + 16 - pos%16 : len; + res = WriteProcessMemory(h, (LPVOID)loadDllAddr, loadDll, len, &nb); + if (!res || (nb != len)) assertion("Write custom data in memory failed"); + pos += pos % 16 ? len + 16 - pos % 16 : len; //free fct - DWORD freeDllAddr = memory+pos; - *(DWORD*)&freeDll[6] = freeLibraryAddr; + DWORD freeDllAddr = memory + pos; + *(DWORD*)&freeDll[6] = freeLibraryAddr; *(DWORD*)&freeDll[12] = handleAddr; *(DWORD*)&freeDll[22] = releaseNameAddr; -// *(DWORD*)&freeDll[30] = handleAddr; - *(DWORD*)&freeDll[36-7] = getProcAddressAddr; - *(DWORD*)&freeDll[55-7] = getProcAddressAddr; - *(DWORD*)&freeDll[67-7] = freeLibraryAddr; + // *(DWORD*)&freeDll[30] = handleAddr; + *(DWORD*)&freeDll[36 - 7] = getProcAddressAddr; + *(DWORD*)&freeDll[55 - 7] = getProcAddressAddr; + *(DWORD*)&freeDll[67 - 7] = freeLibraryAddr; len = sizeof(freeDll); - res = WriteProcessMemory(h,(LPVOID)freeDllAddr,freeDll,len,&nb); - if (!res || (nb!=len)) assertion("Write custom data in memory failed"); - pos += pos%16 ? len + 16 - pos%16 : len; + res = WriteProcessMemory(h, (LPVOID)freeDllAddr, freeDll, len, &nb); + if (!res || (nb != len)) assertion("Write custom data in memory failed"); + pos += pos % 16 ? len + 16 - pos % 16 : len; //Patch load library - buf[0]=0x90; - buf[1]=0xE8; - *(DWORD*)(buf+2) = (DWORD)loadDllAddr - (DWORD)loadCallerAddr-6; + buf[0] = 0x90; + buf[1] = 0xE8; + *(DWORD*)(buf + 2) = (DWORD)loadDllAddr - (DWORD)loadCallerAddr - 6; len = 6; - res = WriteProcessMemory(h,(LPVOID)loadCallerAddr,buf,len,&nb); - if (!res || (nb!=len)) assertion("Write load library in memory failed"); + res = WriteProcessMemory(h, (LPVOID)loadCallerAddr, buf, len, &nb); + if (!res || (nb != len)) assertion("Write load library in memory failed"); //Patch free library - *(DWORD*)(buf+2) = (DWORD)freeDllAddr - (DWORD)freeCallerAddr-6; - res = WriteProcessMemory(h,(LPVOID)freeCallerAddr,buf,len,&nb); - if (!res || (nb!=len)) assertion("Write free library in memory failed"); + *(DWORD*)(buf + 2) = (DWORD)freeDllAddr - (DWORD)freeCallerAddr - 6; + res = WriteProcessMemory(h, (LPVOID)freeCallerAddr, buf, len, &nb); + if (!res || (nb != len)) assertion("Write free library in memory failed"); -// sprintf(tmp,"mem = %08X (read = %d)",buf[0],nbRead); -// MessageBox(0, tmp, "RunPlugY.\n", MB_OK|MB_ICONASTERISK); -// if (oldProtect != -1) -// VirtualProtectEx(h,(LPVOID)memory, 200, oldProtect, &oldProtect); + // sprintf(tmp,"mem = %08X (read = %d)",buf[0],nbRead); + // MessageBox(0, tmp, "RunPlugY.\n", MB_OK|MB_ICONASTERISK); + // if (oldProtect != -1) + // VirtualProtectEx(h,(LPVOID)memory, 200, oldProtect, &oldProtect); return true; } @@ -294,21 +289,21 @@ bool installPlugY(HANDLE h, DWORD addr, char* libraryName, int isAdd) /*bool copyLodVersionFiles() { - BYTE folder[MAX_PATH]; - if (!GetPrivateProfileString(LAUNCHING,LOD_VERSION,"",folder,MAX_PATH,INI_FILE)) - return true; - strcat(folder,"\\*"); - WIN32_FIND_DATA FindFileData; - HANDLE hFind = FindFirstFile(folder,&FindFileData); - if (hFind==INVALID_HANDLE_VALUE) - return true; +BYTE folder[MAX_PATH]; +if (!GetPrivateProfileString(LAUNCHING,LOD_VERSION,"",folder,MAX_PATH,INI_FILE)) +return true; +strcat(folder,"\\*"); +WIN32_FIND_DATA FindFileData; +HANDLE hFind = FindFirstFile(folder,&FindFileData); +if (hFind==INVALID_HANDLE_VALUE) +return true; - do { +do { // CopyFile(); - } while (FindNextFile(hFind,&FindFileData); +} while (FindNextFile(hFind,&FindFileData); - FindClose(hFind); - return true; +FindClose(hFind); +return true; }*/ @@ -317,342 +312,254 @@ bool isD2gfx(HANDLE hProcess, LPVOID dllAdr) { SIZE_T nbRead; BYTE buf[BUF_SIZE]; - ReadProcessMemory(hProcess,dllAdr,buf,BUF_SIZE, &nbRead); + ReadProcessMemory(hProcess, dllAdr, buf, BUF_SIZE, &nbRead); if (nbRead < 0x40) return false; - int offsetPESignature = *(DWORD*)(buf+0x3C); - if (offsetPESignature+38 >= BUF_SIZE) return false; - DWORD baseOfCode = *(DWORD*)(buf+offsetPESignature + 0x34); - if ( ( baseOfCode != 0x6FA80000) && (baseOfCode != 0x6FA70000)) return false; + int offsetPESignature = *(DWORD*)(buf + 0x3C); + if (offsetPESignature + 38 >= BUF_SIZE) return false; + DWORD baseOfCode = *(DWORD*)(buf + offsetPESignature + 0x34); + if ((baseOfCode != 0x6FA80000) && (baseOfCode != 0x6FA70000)) return false; return true; } -bool getWinReg(char* buf, DWORD bufsize) +bool isGameLoaded(HANDLE hProcess, LPVOID baseAdr) +{ + SIZE_T nbRead; + BYTE buf[BUF_SIZE]; + ReadProcessMemory(hProcess, baseAdr, buf, BUF_SIZE, &nbRead); + if (nbRead < 0x40) return false; + int offsetPESignature = *(DWORD*)(buf + 0x3C); + if (offsetPESignature + 0x5C >= BUF_SIZE) return false; + DWORD baseOfCode = *(DWORD*)(buf + offsetPESignature + 0x34); + DWORD SizeOfImage = *(DWORD*)(buf + offsetPESignature + 0x50); + DWORD CheckSum = *(DWORD*)(buf + offsetPESignature + 0x58); + if ((baseOfCode==0x00400000) && (SizeOfImage == 0x005A5000) && (CheckSum == 0x00374101)) return true;//1.14c + + return false; +} + +bool getWinReg(LPSTR buf, DWORD bufsize) { HKEY hKey; DWORD type; int res; + DWORD len = bufsize; if (RegOpenKeyEx(HKEY_CURRENT_USER, SUBKEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { - res = RegQueryValueEx(hKey,"InstallPath",NULL,&type,(LPBYTE)buf,&bufsize); + res = RegQueryValueEx(hKey, "InstallPath", NULL, &type, (LPBYTE)buf, &len); RegCloseKey(hKey); - if (res!=ERROR_SUCCESS) return false; - } else if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, SUBKEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { - res = RegQueryValueEx(hKey,"InstallPath",NULL,&type,(LPBYTE)buf,&bufsize); + if (res != ERROR_SUCCESS) return false; + } + else if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, SUBKEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { + res = RegQueryValueEx(hKey, "InstallPath", NULL, &type, (LPBYTE)buf, &len); RegCloseKey(hKey); - if (res!=ERROR_SUCCESS) return false; - } else { + if (res != ERROR_SUCCESS) return false; + } + else { return false; } - strcat(buf, GAMEFILE); - if (GetFileAttributes(buf) == INVALID_FILE_ATTRIBUTES) + if (len <= 1) return false; + if (buf[len - 2] != '\\') + { + if (len >= bufsize) + return false; + buf[len - 1] = '\\'; + buf[len] = NULL; + } return true; } -bool launchNormal(char* command, char* currentDirectory) +bool launchNormal(LPSTR commandLine, LPSTR currentDirectory) { STARTUPINFO si; PROCESS_INFORMATION pi; - ZeroMemory( &si, sizeof(si) ); + ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - BOOL success = CreateProcess(0, command, 0, 0, false, 0, 0, currentDirectory, &si, &pi);//DEBUG_ONLY_THIS_PROCESS - return success?true:false; + ZeroMemory(&pi, sizeof(pi)); + BOOL success = CreateProcess(NULL, commandLine, NULL, NULL, false, 0, NULL, currentDirectory, &si, &pi);//DEBUG_ONLY_THIS_PROCESS + return success ? true : false; } -bool launchGame98(char* command, char* currentDirectory, char* libraryName) +bool launchGame98(LPSTR commandLine, LPSTR currentDirectory, LPSTR libraryName) { -// MessageBox(0, "LAUNCH 98", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "LAUNCH 98", "PlugYRun", MB_OK|MB_ICONASTERISK); STARTUPINFO si; PROCESS_INFORMATION pi; - ZeroMemory( &si, sizeof(si) ); + ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - BOOL success = CreateProcess(0, command, 0, 0, false, 0, 0, currentDirectory, &si, &pi);//DEBUG_ONLY_THIS_PROCESS + ZeroMemory(&pi, sizeof(pi)); + BOOL success = CreateProcess(0, commandLine, 0, 0, false, 0, 0, currentDirectory, &si, &pi);//DEBUG_ONLY_THIS_PROCESS if (!success) return false; DWORD ret; -// MessageBox(0, "LAUNCH 98 while", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "LAUNCH 98 while", "PlugYRun", MB_OK|MB_ICONASTERISK); Sleep(10); while (true) { SuspendThread(pi.hThread);// == (DWORD)-1) - //MessageBox(0, "Thread not suspended", "PlugYRun", MB_OK|MB_ICONASTERISK); + //MessageBox(0, "Thread not suspended", "PlugYRun", MB_OK|MB_ICONASTERISK); - if (!GetExitCodeProcess(pi.hProcess,&ret) || (ret != STILL_ACTIVE)) + if (!GetExitCodeProcess(pi.hProcess, &ret) || (ret != STILL_ACTIVE)) exit(0); - if (isD2gfx(pi.hProcess,(LPVOID)0x6FA80000)) + if (isD2gfx(pi.hProcess, (LPVOID)0x6FA80000)) { -// MessageBox(0, "INSTALL 98", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "INSTALL 98", "PlugYRun", MB_OK|MB_ICONASTERISK); installPlugY(pi.hProcess, 0x6FA80000, libraryName, 1); ResumeThread(pi.hThread); return true; } - if (isD2gfx(pi.hProcess,(LPVOID)0x6FA70000)) + if (isD2gfx(pi.hProcess, (LPVOID)0x6FA70000)) { -// MessageBox(0, "INSTALL 98", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "INSTALL 98", "PlugYRun", MB_OK|MB_ICONASTERISK); installPlugY(pi.hProcess, 0x6FA70000, libraryName, 0); ResumeThread(pi.hThread); return true; } ResumeThread(pi.hThread); -// Sleep(10); + // Sleep(10); } return true; } - -bool launchGameXP(char* command, char* currentDirectory, char* libraryName) +bool launchGameXP(LPSTR commandLine, LPSTR currentDirectory, LPSTR libraryName) { -// MessageBox(0, "LAUNCH XP", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "LAUNCH XP", "PlugYRun", MB_OK|MB_ICONASTERISK); STARTUPINFO si; PROCESS_INFORMATION pi; - ZeroMemory( &si, sizeof(si) ); + ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - BOOL success = CreateProcess(0, command, 0, 0, false, DEBUG_PROCESS, 0, currentDirectory, &si, &pi);//DEBUG_ONLY_THIS_PROCESS + ZeroMemory(&pi, sizeof(pi)); + BOOL success = CreateProcess(0, commandLine, 0, 0, false, DEBUG_PROCESS, 0, currentDirectory, &si, &pi);//DEBUG_ONLY_THIS_PROCESS if (!success) return false; DEBUG_EVENT DebugEvent; DWORD status; -// MessageBox(0, "START WAITING", "PlugYRun", MB_OK|MB_ICONASTERISK); - while (WaitForDebugEvent(&DebugEvent,INFINITE)) + while (WaitForDebugEvent(&DebugEvent, INFINITE)) { status = DBG_CONTINUE; - switch(DebugEvent.dwDebugEventCode) + switch (DebugEvent.dwDebugEventCode) { case CREATE_THREAD_DEBUG_EVENT: CloseHandle(DebugEvent.u.CreateThread.hThread); break; case CREATE_PROCESS_DEBUG_EVENT: + if (isGameLoaded(pi.hProcess, DebugEvent.u.CreateProcessInfo.lpBaseOfImage)) + { + //installPlugYOnGame(pi.hProcess, (DWORD)DebugEvent.u.CreateProcessInfo.lpBaseOfImage, libraryName, (DWORD)DebugEvent.u.LoadDll.lpBaseOfDll == 0x6FA8000); + CloseHandle(DebugEvent.u.CreateProcessInfo.hFile); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + debugActiveProcessStop(DebugEvent.dwProcessId); + return true; + } break; case EXIT_PROCESS_DEBUG_EVENT: -// MessageBox(0, "EXIT", "PlugY", MB_OK|MB_ICONASTERISK); exit(0); case EXCEPTION_DEBUG_EVENT: if (DebugEvent.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) - MessageBox(0, "EXCEPTION_ACCESS_VIOLATION", "PlugY", MB_OK|MB_ICONASTERISK); -// status = DBG_EXCEPTION_NOT_HANDLED; + MessageBox(0, "EXCEPTION_ACCESS_VIOLATION", "PlugY", MB_OK | MB_ICONASTERISK); break; case LOAD_DLL_DEBUG_EVENT: -// if (!GetModuleBaseName(pi.hProcess,(HMODULE)DebugEvent.u.LoadDll.lpBaseOfDll,buf,100)) -// MessageBox(0, "ERROR", "PlugYRun", MB_OK|MB_ICONASTERISK); -// sprintf(buf,"%08X : %d",DebugEvent.u.LoadDll.lpBaseOfDll,GetLastError()); -// MessageBox(0, buf, "PlugYRun", MB_OK|MB_ICONASTERISK); -// if (!strcmp(buf,"d2gfx.dll")) -// if ((LPVOID)GetModuleHandle("D2gfx.dll") == DebugEvent.u.LoadDll.lpBaseOfDll)//pi.hProcess,,buf,bufSize); - if(isD2gfx(pi.hProcess, DebugEvent.u.LoadDll.lpBaseOfDll)) + if (isD2gfx(pi.hProcess, DebugEvent.u.LoadDll.lpBaseOfDll)) { -// MessageBox(0, "INSTALL XP", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "INSTALL XP", "PlugYRun", MB_OK|MB_ICONASTERISK); installPlugY(pi.hProcess, (DWORD)DebugEvent.u.LoadDll.lpBaseOfDll, libraryName, (DWORD)DebugEvent.u.LoadDll.lpBaseOfDll == 0x6FA8000); CloseHandle(DebugEvent.u.LoadDll.hFile); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); debugActiveProcessStop(DebugEvent.dwProcessId); -// MessageBox(0, "INSTALL XP end", "PlugYRun", MB_OK|MB_ICONASTERISK); + // MessageBox(0, "INSTALL XP end", "PlugYRun", MB_OK|MB_ICONASTERISK); return true; - } else + } + else CloseHandle(DebugEvent.u.LoadDll.hFile); break; } - ContinueDebugEvent(DebugEvent.dwProcessId,DebugEvent.dwThreadId,status); + ContinueDebugEvent(DebugEvent.dwProcessId, DebugEvent.dwThreadId, status); } - MessageBox(0, "ERROR : PlugY isn't installed", "PlugYRun", MB_OK|MB_ICONASTERISK); + MessageBox(0, "ERROR : PlugY isn't installed", "PlugYRun", MB_OK | MB_ICONASTERISK); return true; } - -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +int APIENTRY WinMain(_In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPSTR lpCmdLine, + _In_ int nCmdShow) { char currrentDirectory[MAX_PATH]; char iniFileName[MAX_PATH]; - char command[MAX_PATH+50]; + char command[MAX_PATH + 256]; -// MessageBox(NULL,"START","PlugYRun",MB_OK); - //Get Current Directory. - if (!GetCurrentDirectory(MAX_PATH-1,currrentDirectory)) + // Get Current Directory. + if (!GetCurrentDirectory(sizeof(currrentDirectory), currrentDirectory)) assertion("Current directory not found"); int len = strlen(currrentDirectory); - if (len && currrentDirectory[len-1] != '\\') + if (len == 0) + assertion("Current directory not found"); + + if (currrentDirectory[len - 1] != '\\') { - currrentDirectory[len+1]=NULL; - currrentDirectory[len]='\\'; + if (len >= MAX_PATH - 1) + assertion("Path length too long"); + currrentDirectory[len++] = '\\'; + currrentDirectory[len] = NULL; } - //Get ini full path name. - strcpy(iniFileName,currrentDirectory); - strcat(iniFileName,INIFILE); + // Get ini full path name. + strcpy(iniFileName, currrentDirectory); + if (len + strlen(INIFILE) >= sizeof(iniFileName)) + assertion("Path length too long"); + strcat(iniFileName, INIFILE); + + // Get game.exe path. + strcpy(command, currrentDirectory); + int cmdLen = len + strlen(GAMEFILE); + if (cmdLen >= sizeof(command)) + assertion("Path length too long"); + strcat(command, GAMEFILE); - //Get current directory. - strcpy(command,currrentDirectory); - strcat(command,GAMEFILE); if (GetFileAttributes(command) == INVALID_FILE_ATTRIBUTES) - if (!getWinReg(command, MAX_PATH+50)) - return 1; + { + if (!getWinReg(command, sizeof(command))) + return 1; + cmdLen = strlen(command) + strlen(GAMEFILE); + if (cmdLen >= sizeof(command)) + assertion("Path length too long"); + strcat(command, GAMEFILE); + if (GetFileAttributes(command) == INVALID_FILE_ATTRIBUTES) + return false; + } - //Add params. - strcat(command,lpCmdLine); - len = strlen(command); - GetPrivateProfileString(LAUNCHING,PARAM,"",&command[len],MAX_PATH-len,iniFileName); - - //copyLodVersionFiles(); + // Add params. + int paramLen = strlen(lpCmdLine); + if (paramLen > 0) + { + cmdLen += paramLen + 1; + if (cmdLen > sizeof(command)) + assertion("Path length too long"); + strcat(command, lpCmdLine); + strcat(command, " "); + } + int windowed = GetPrivateProfileInt(WINDOWED, ACTIVE_WINDOWED, 0, iniFileName); + if (windowed) + { + cmdLen += paramLen + 3; + if (cmdLen > sizeof(command)) + assertion("Path length too long"); + strcat(command, "-w "); + } + GetPrivateProfileString(LAUNCHING, PARAM, NULL, command + cmdLen, sizeof(command) - cmdLen, iniFileName); char libraryName[50]; - if (!GetPrivateProfileString(LAUNCHING,LIBRARY_NAME,"",libraryName,50,iniFileName) || !libraryName[0]) + if (!GetPrivateProfileString(LAUNCHING, LIBRARY_NAME, "", libraryName, 50, iniFileName) || !libraryName[0]) return !launchNormal(command, currrentDirectory); -// MessageBox(NULL,command,"PlugYRun",MB_OK); + // Launch LoD and install PlugY HMODULE module = GetModuleHandle("Kernel32.dll"); if (module) { - debugActiveProcessStop = (tDebugActiveProcessStop) GetProcAddress(module,"DebugActiveProcessStop"); + debugActiveProcessStop = (tDebugActiveProcessStop)GetProcAddress(module, "DebugActiveProcessStop"); if (debugActiveProcessStop) return !launchGameXP(command, currrentDirectory, libraryName); } return !launchGame98(command, currrentDirectory, libraryName); } - - -/* else if (GetVersion() & 0x80000000) - { - versionXP=false; - } else { - versionXP=true; - }*/ -//HINSTANCE -// CreateProcessInternalA -// HMODULE HPlugY = LoadLibrary("C:\\Jeux\\Diablo II\\PlugY.dll"); -// if (!HPlugY) return 0; -// DuplicateHandle -// GetCurrentProcess(); -/* typedef void* (__stdcall* Tinit)(LPSTR IniName); - Tinit init = (Tinit)GetProcAddress(HPlugY,"_Init@4"); - if (!init) return 0; - init(0);*/ -/* -6FC2BD50 /$ 81EC 08010000 SUB ESP,108 -6FC2BD56 |. 53 PUSH EBX -6FC2BD57 |. 8A9C24 1801000>MOV BL,BYTE PTR SS:[ESP+118] -6FC2BD5E |. F6C3 10 TEST BL,10 -6FC2BD61 |. 55 PUSH EBP -6FC2BD62 |. 56 PUSH ESI -6FC2BD63 |. C707 00000000 MOV DWORD PTR DS:[EDI],0 -6FC2BD69 |. C74424 0C 0000>MOV DWORD PTR SS:[ESP+C],0 -6FC2BD71 |. BE F3030000 MOV ESI,3F3 -6FC2BD76 |. C64424 10 00 MOV BYTE PTR SS:[ESP+10],0 -6FC2BD7B |. 75 25 JNZ SHORT storm.6FC2BDA2 -6FC2BD7D |. F6C3 02 TEST BL,2 -6FC2BD80 |. 68 04010000 PUSH 104 -6FC2BD85 |. 74 0C JE SHORT storm.6FC2BD93 -6FC2BD87 |. 68 146AC36F PUSH storm.6FC36A14 ; ASCII "Software\Battle.net\" -6FC2BD8C |. 8D4424 18 LEA EAX,DWORD PTR SS:[ESP+18] -6FC2BD90 |. 50 PUSH EAX -6FC2BD91 |. EB 0A JMP SHORT storm.6FC2BD9D -6FC2BD93 |> 68 F069C36F PUSH storm.6FC369F0 ; ASCII "Software\Blizzard Entertainment\" -6FC2BD98 |. 8D4C24 18 LEA ECX,DWORD PTR SS:[ESP+18] -6FC2BD9C |. 51 PUSH ECX -6FC2BD9D |> E8 EE07FEFF CALL storm.#501 -6FC2BDA2 |> 8B9424 1801000>MOV EDX,DWORD PTR SS:[ESP+118] -6FC2BDA9 |. 68 04010000 PUSH 104 -6FC2BDAE |. 52 PUSH EDX -6FC2BDAF |. 8D4424 18 LEA EAX,DWORD PTR SS:[ESP+18] -6FC2BDB3 |. 50 PUSH EAX -6FC2BDB4 |. E8 6705FEFF CALL storm.#503 -6FC2BDB9 |. F6C3 04 TEST BL,4 -6FC2BDBC |. 8B2D 1030C36F MOV EBP,DWORD PTR DS:[<&ADVAPI32.RegQuer>; advapi32.RegQueryValueExA -6FC2BDC2 |. 75 5D JNZ SHORT storm.6FC2BE21 -6FC2BDC4 |. 8D4C24 0C LEA ECX,DWORD PTR SS:[ESP+C] -6FC2BDC8 |. 51 PUSH ECX ; /pHandle -6FC2BDC9 |. 68 19000200 PUSH 20019 ; |Access = KEY_READ -6FC2BDCE |. 6A 00 PUSH 0 ; |Reserved = 0 -6FC2BDD0 |. 8D5424 1C LEA EDX,DWORD PTR SS:[ESP+1C] ; | -6FC2BDD4 |. 52 PUSH EDX ; |Subkey -6FC2BDD5 |. 68 01000080 PUSH 80000001 ; |hKey = HKEY_CURRENT_USER -6FC2BDDA |. FF15 0830C36F CALL DWORD PTR DS:[<&ADVAPI32.RegOpenKey>; \RegOpenKeyExA -002281A4 80000001 |hKey = HKEY_CURRENT_USER -002281A8 002281C8 |Subkey = "Software\Blizzard Entertainment\Diablo II" -002281AC 00000000 |Reserved = 0 -002281B0 00020019 |Access = KEY_READ -002281B4 002281C4 \pHandle = 002281C4 - - -6FC2BDE0 |. 8BF0 MOV ESI,EAX -6FC2BDE2 |. 85F6 TEST ESI,ESI -6FC2BDE4 |. 75 3B JNZ SHORT storm.6FC2BE21 -6FC2BDE6 |. 8B8C24 2801000>MOV ECX,DWORD PTR SS:[ESP+128] -6FC2BDED |. 8B9424 2401000>MOV EDX,DWORD PTR SS:[ESP+124] -6FC2BDF4 |. 8B8424 2C01000>MOV EAX,DWORD PTR SS:[ESP+12C] -6FC2BDFB |. 57 PUSH EDI ; /pBufSize -6FC2BDFC |. 51 PUSH ECX ; |Buffer -6FC2BDFD |. 8B4C24 14 MOV ECX,DWORD PTR SS:[ESP+14] ; | -6FC2BE01 |. 52 PUSH EDX ; |pValueType -6FC2BE02 |. 8907 MOV DWORD PTR DS:[EDI],EAX ; | -6FC2BE04 |. 8B8424 2801000>MOV EAX,DWORD PTR SS:[ESP+128] ; | -6FC2BE0B |. 56 PUSH ESI ; |Reserved -6FC2BE0C |. 50 PUSH EAX ; |ValueName -6FC2BE0D |. 51 PUSH ECX ; |hKey -6FC2BE0E |. FFD5 CALL EBP ; \RegQueryValueExA -002281A0 00000124 |hKey = 124 -002281A4 6FF77B88 |ValueName = "InstallPath" -002281A8 00000000 |Reserved = NULL -002281AC 002282FC |pValueType = 002282FC -002281B0 00228320 |Buffer = 00228320 -002281B4 00228300 \pBufSize = 00228300 - - -6FC2BE10 |. 8B5424 0C MOV EDX,DWORD PTR SS:[ESP+C] -6FC2BE14 |. 52 PUSH EDX ; /hKey -6FC2BE15 |. 8BF0 MOV ESI,EAX ; | -6FC2BE17 |. FF15 1830C36F CALL DWORD PTR DS:[<&ADVAPI32.RegCloseKe>; \RegCloseKey -002281B4 00000124 \hKey = 00000124 (window) - -6FC2BE1D |. 85F6 TEST ESI,ESI -6FC2BE1F |. 74 62 JE SHORT storm.6FC2BE83 -6FC2BE21 |> F6C3 01 TEST BL,1 -6FC2BE24 |. 75 59 JNZ SHORT storm.6FC2BE7F -6FC2BE26 |. 8D4424 0C LEA EAX,DWORD PTR SS:[ESP+C] -6FC2BE2A |. 50 PUSH EAX ; /pHandle -6FC2BE2B |. 68 19000200 PUSH 20019 ; |Access = KEY_READ -6FC2BE30 |. 6A 00 PUSH 0 ; |Reserved = 0 -6FC2BE32 |. 8D4C24 1C LEA ECX,DWORD PTR SS:[ESP+1C] ; | -6FC2BE36 |. 51 PUSH ECX ; |Subkey -6FC2BE37 |. 68 02000080 PUSH 80000002 ; |hKey = HKEY_LOCAL_MACHINE -6FC2BE3C |. FF15 0830C36F CALL DWORD PTR DS:[<&ADVAPI32.RegOpenKey>; \RegOpenKeyExA -6FC2BE42 |. 8BF0 MOV ESI,EAX -6FC2BE44 |. 85F6 TEST ESI,ESI -6FC2BE46 |. 75 4C JNZ SHORT storm.6FC2BE94 -6FC2BE48 |. 8B8424 2801000>MOV EAX,DWORD PTR SS:[ESP+128] -6FC2BE4F |. 8B8C24 2401000>MOV ECX,DWORD PTR SS:[ESP+124] -6FC2BE56 |. 8B9424 2C01000>MOV EDX,DWORD PTR SS:[ESP+12C] -6FC2BE5D |. 57 PUSH EDI -6FC2BE5E |. 50 PUSH EAX -6FC2BE5F |. 8B4424 14 MOV EAX,DWORD PTR SS:[ESP+14] -6FC2BE63 |. 51 PUSH ECX -6FC2BE64 |. 8917 MOV DWORD PTR DS:[EDI],EDX -6FC2BE66 |. 8B9424 2801000>MOV EDX,DWORD PTR SS:[ESP+128] -6FC2BE6D |. 56 PUSH ESI -6FC2BE6E |. 52 PUSH EDX -6FC2BE6F |. 50 PUSH EAX -6FC2BE70 |. FFD5 CALL EBP -6FC2BE72 |. 8B4C24 0C MOV ECX,DWORD PTR SS:[ESP+C] -6FC2BE76 |. 51 PUSH ECX ; /hKey -6FC2BE77 |. 8BF0 MOV ESI,EAX ; | -6FC2BE79 |. FF15 1830C36F CALL DWORD PTR DS:[<&ADVAPI32.RegCloseKe>; \RegCloseKey -6FC2BE7F |> 85F6 TEST ESI,ESI -6FC2BE81 |. 75 11 JNZ SHORT storm.6FC2BE94 -6FC2BE83 |> 5E POP ESI -6FC2BE84 |. 5D POP EBP -6FC2BE85 |. B8 01000000 MOV EAX,1 -6FC2BE8A |. 5B POP EBX -6FC2BE8B |. 81C4 08010000 ADD ESP,108 -6FC2BE91 |. C2 1800 RETN 18 -6FC2BE94 |> 56 PUSH ESI ; /Error -6FC2BE95 |. FF15 2832C36F CALL DWORD PTR DS:[<&KERNEL32.SetLastErr>; \SetLastError -6FC2BE9B |. 5E POP ESI -6FC2BE9C |. 5D POP EBP -6FC2BE9D |. 33C0 XOR EAX,EAX -6FC2BE9F |. 5B POP EBX -6FC2BEA0 |. 81C4 08010000 ADD ESP,108 -6FC2BEA6 \. C2 1800 RETN 18 -*/ - -///////////////////////// END OF FILE /////////////////////// \ No newline at end of file diff --git a/PlugYRun/PlugYRun.h b/PlugYRun/PlugYRun.h new file mode 100644 index 0000000..e60f2eb --- /dev/null +++ b/PlugYRun/PlugYRun.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/PlugYRun/PlugYRun.rc b/PlugYRun/PlugYRun.rc index 289a11d..32482be 100644 Binary files a/PlugYRun/PlugYRun.rc and b/PlugYRun/PlugYRun.rc differ diff --git a/PlugYRun/PlugYRun.sln b/PlugYRun/PlugYRun.sln index b97d16b..1cc571d 100644 --- a/PlugYRun/PlugYRun.sln +++ b/PlugYRun/PlugYRun.sln @@ -1,17 +1,26 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugYRun", "PlugYRun.vcproj", "{119E844E-4DF8-409D-8B12-DC5CDDB5E37C}" + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugYRun", "PlugYRun.vcxproj", "{73941C80-3185-4FC1-A248-A6C6E4B39BCB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {119E844E-4DF8-409D-8B12-DC5CDDB5E37C}.Debug|Win32.ActiveCfg = Debug|Win32 - {119E844E-4DF8-409D-8B12-DC5CDDB5E37C}.Debug|Win32.Build.0 = Debug|Win32 - {119E844E-4DF8-409D-8B12-DC5CDDB5E37C}.Release|Win32.ActiveCfg = Release|Win32 - {119E844E-4DF8-409D-8B12-DC5CDDB5E37C}.Release|Win32.Build.0 = Release|Win32 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Debug|x64.ActiveCfg = Debug|x64 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Debug|x64.Build.0 = Debug|x64 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Debug|x86.ActiveCfg = Debug|Win32 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Debug|x86.Build.0 = Debug|Win32 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Release|x64.ActiveCfg = Release|x64 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Release|x64.Build.0 = Release|x64 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Release|x86.ActiveCfg = Release|Win32 + {73941C80-3185-4FC1-A248-A6C6E4B39BCB}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PlugYRun/PlugYRun.vcxproj b/PlugYRun/PlugYRun.vcxproj new file mode 100644 index 0000000..1bae5df --- /dev/null +++ b/PlugYRun/PlugYRun.vcxproj @@ -0,0 +1,168 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {73941C80-3185-4FC1-A248-A6C6E4B39BCB} + Win32Proj + PlugYRun + 8.1 + + + + Application + true + v140 + MultiByte + + + Application + false + v140 + true + MultiByte + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + PlugY + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + Windows + true + + + + + Use + Level3 + Disabled + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + copy "$(TargetPath)" "..\PlugYInstaller\PlugY.exe" + + + + + Level3 + Use + MaxSpeed + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + diff --git a/PlugYRun/PlugYRun.vcxproj.filters b/PlugYRun/PlugYRun.vcxproj.filters new file mode 100644 index 0000000..d890fca --- /dev/null +++ b/PlugYRun/PlugYRun.vcxproj.filters @@ -0,0 +1,49 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PlugYRun/resource.h b/PlugYRun/resource.h index 44fcdf1..da28879 100644 Binary files a/PlugYRun/resource.h and b/PlugYRun/resource.h differ diff --git a/PlugYRun/stdafx.cpp b/PlugYRun/stdafx.cpp new file mode 100644 index 0000000..685e901 --- /dev/null +++ b/PlugYRun/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// PlugYRun.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/PlugYRun/stdafx.h b/PlugYRun/stdafx.h new file mode 100644 index 0000000..de0dfa3 --- /dev/null +++ b/PlugYRun/stdafx.h @@ -0,0 +1,21 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + +// C RunTime Header Files +#include +#include +#include +#include + + +// TODO: reference additional headers your program requires here diff --git a/PlugYRun/targetver.h b/PlugYRun/targetver.h new file mode 100644 index 0000000..90e767b --- /dev/null +++ b/PlugYRun/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include