|
|
|
@ -11,7 +11,7 @@ WNDPROC CurrentProc; |
|
|
|
HANDLE diabdat_mpq; |
|
|
|
HANDLE diabdat_mpq; |
|
|
|
char diabdat_mpq_path[MAX_PATH]; |
|
|
|
char diabdat_mpq_path[MAX_PATH]; |
|
|
|
HANDLE patch_rt_mpq; |
|
|
|
HANDLE patch_rt_mpq; |
|
|
|
int killed_mom_parent; // weak
|
|
|
|
BOOL killed_mom_parent; // weak
|
|
|
|
BOOLEAN screensaver_enabled_prev; |
|
|
|
BOOLEAN screensaver_enabled_prev; |
|
|
|
|
|
|
|
|
|
|
|
/* data */ |
|
|
|
/* data */ |
|
|
|
@ -52,65 +52,60 @@ void init_cleanup(BOOL show_cursor) |
|
|
|
|
|
|
|
|
|
|
|
void init_run_office_from_start_menu() |
|
|
|
void init_run_office_from_start_menu() |
|
|
|
{ |
|
|
|
{ |
|
|
|
HWND v0; // eax
|
|
|
|
LPITEMIDLIST idl; |
|
|
|
char pszPath[256]; // [esp+0h] [ebp-104h]
|
|
|
|
|
|
|
|
LPITEMIDLIST ppidl; // [esp+100h] [ebp-4h]
|
|
|
|
if(!killed_mom_parent) { |
|
|
|
|
|
|
|
return; |
|
|
|
if (killed_mom_parent) { |
|
|
|
} |
|
|
|
//*pszPath = empty_string;
|
|
|
|
|
|
|
|
killed_mom_parent = 0; |
|
|
|
killed_mom_parent = FALSE; |
|
|
|
memset(pszPath, 0, sizeof(pszPath)); |
|
|
|
char szPath[256] = ""; /// BUGFIX: size should be at least 'MAX_PATH'
|
|
|
|
// *(_WORD *)&pszPath[253] = 0;
|
|
|
|
idl = NULL; |
|
|
|
//pszPath[255] = 0;
|
|
|
|
|
|
|
|
ppidl = 0; |
|
|
|
if(SHGetSpecialFolderLocation(GetDesktopWindow(), CSIDL_STARTMENU, &idl) == NOERROR) { |
|
|
|
v0 = GetDesktopWindow(); |
|
|
|
SHGetPathFromIDList(idl, szPath); |
|
|
|
if (!SHGetSpecialFolderLocation(v0, CSIDL_STARTMENU, &ppidl)) { |
|
|
|
init_run_office(szPath); |
|
|
|
SHGetPathFromIDList(ppidl, pszPath); |
|
|
|
|
|
|
|
init_run_office(pszPath); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 634CA0: using guessed type int killed_mom_parent;
|
|
|
|
// 634CA0: using guessed type int killed_mom_parent;
|
|
|
|
|
|
|
|
|
|
|
|
void init_run_office(char *dir) |
|
|
|
void init_run_office(char *dir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char *v1; // esi
|
|
|
|
HANDLE hSearch; |
|
|
|
HANDLE v2; // ebx
|
|
|
|
WIN32_FIND_DATA find; |
|
|
|
BOOLEAN v3; // zf
|
|
|
|
char szFirst[MAX_PATH]; |
|
|
|
HWND v4; // eax
|
|
|
|
|
|
|
|
char Directory[MAX_PATH]; // [esp+8h] [ebp-348h]
|
|
|
|
strcpy(szFirst, dir); |
|
|
|
char FileName[MAX_PATH]; // [esp+10Ch] [ebp-244h]
|
|
|
|
if(szFirst[0] != '\0' && szFirst[strlen(szFirst) - 1] == '\\') { |
|
|
|
struct _WIN32_FIND_DATAA FindFileData; // [esp+210h] [ebp-140h]
|
|
|
|
strcat(szFirst, "*"); |
|
|
|
|
|
|
|
} else { |
|
|
|
v1 = dir; |
|
|
|
strcat(szFirst, "\\*"); |
|
|
|
strcpy(FileName, dir); |
|
|
|
} |
|
|
|
if (FileName[0] && Directory[strlen(FileName) + 259] == '\\') |
|
|
|
hSearch = FindFirstFile(szFirst, &find); |
|
|
|
strcat(FileName, "*"); |
|
|
|
if(hSearch == INVALID_HANDLE_VALUE) { |
|
|
|
else |
|
|
|
return; |
|
|
|
strcat(FileName, "\\*"); |
|
|
|
} |
|
|
|
v2 = FindFirstFile(FileName, &FindFileData); |
|
|
|
|
|
|
|
if (v2 != (HANDLE)-1) { |
|
|
|
while(1) { |
|
|
|
do { |
|
|
|
if(find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { |
|
|
|
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { |
|
|
|
if(strcmp(find.cFileName, ".") != 0 && strcmp(find.cFileName, "..") != 0) { |
|
|
|
if (strcmp(FindFileData.cFileName, ".") && strcmp(FindFileData.cFileName, "..")) { |
|
|
|
char szNext[MAX_PATH] = ""; |
|
|
|
//*Directory = empty_string;
|
|
|
|
if(dir[0] != '\0' && dir[strlen(dir) - 1] == '\\') { |
|
|
|
memset(Directory, 0, sizeof(Directory)); |
|
|
|
sprintf(szNext, "%s%s\\", dir, find.cFileName); |
|
|
|
v3 = *v1 == 0; |
|
|
|
} else { |
|
|
|
// *(_WORD *)&Directory[257] = 0;
|
|
|
|
sprintf(szNext, "%s\\%s\\", dir, find.cFileName); |
|
|
|
//Directory[259] = 0;
|
|
|
|
|
|
|
|
if (v3 || v1[strlen(v1) - 1] != '\\') |
|
|
|
|
|
|
|
sprintf(Directory, "%s\\%s\\", v1, FindFileData.cFileName); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
sprintf(Directory, "%s%s\\", v1, FindFileData.cFileName); |
|
|
|
|
|
|
|
init_run_office(Directory); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (!_strcmpi(FindFileData.cFileName, "Microsoft Office Shortcut Bar.lnk")) { |
|
|
|
init_run_office(szNext); |
|
|
|
v4 = GetDesktopWindow(); |
|
|
|
|
|
|
|
ShellExecute(v4, "open", FindFileData.cFileName, "", v1, SW_SHOWNORMAL); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} while (FindNextFile(v2, &FindFileData)); |
|
|
|
} else if(_strcmpi(find.cFileName, "Microsoft Office Shortcut Bar.lnk") == 0) { |
|
|
|
FindClose(v2); |
|
|
|
ShellExecute(GetDesktopWindow(), "open", find.cFileName, "", dir, SW_SHOWNORMAL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(!FindNextFile(hSearch, &find)) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FindClose(hSearch); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void init_disable_screensaver(BOOLEAN disable) |
|
|
|
void init_disable_screensaver(BOOLEAN disable) |
|
|
|
@ -191,7 +186,7 @@ void init_kill_mom_parent() |
|
|
|
v0 = init_find_mom_parent(); |
|
|
|
v0 = init_find_mom_parent(); |
|
|
|
if (v0) { |
|
|
|
if (v0) { |
|
|
|
PostMessage(v0, WM_CLOSE, 0, 0); |
|
|
|
PostMessage(v0, WM_CLOSE, 0, 0); |
|
|
|
killed_mom_parent = 1; |
|
|
|
killed_mom_parent = TRUE; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 634CA0: using guessed type int killed_mom_parent;
|
|
|
|
// 634CA0: using guessed type int killed_mom_parent;
|
|
|
|
|