factored out WinMainCRT setup, moved unnamed sub to help functions

This commit is contained in:
Sydney Biscuit committed 2019-08-17 07:55:42 -07:00
1 parent e1075d2bc5
commit 6c7a90b7c9
2 files changed
+24 -143

No files matched your search

+24
View File
@@ -61,3 +61,27 @@ return 0;
}
// 1025720: using guessed type HWND (__stdcall *pHtmlHelpA)(HWND, const char *, unsigned int, unsigned int);
// 1025728: using guessed type int dword_1025728;
//----- (0101CEB6) --------------------------------------------------------
int __stdcall sub_101CEB6(LPBYTE lpData)
{
signed int v1; // esi
DWORD cbData; // [esp+4h] [ebp-8h]
HKEY phkResult; // [esp+8h] [ebp-4h]
v1 = 0;
if (RegOpenKeyExA(
HKEY_CLASSES_ROOT,
"CLSID\\{ADB880A6-D8FF-11CF-9377-00AA003B7A11}\\InprocServer32",
0,
0x20019u,
&phkResult))
{
return 0;
}
cbData = 260;
if (!RegQueryValueExA(phkResult, WindowName, 0, 0, lpData, &cbData))
v1 = 1;
RegCloseKey(phkResult);
return v1;
}
-143
View File
@@ -917,146 +917,3 @@ signed int sub_10082A9()
// 1024FD8: using guessed type int single_step;
// 1024FEC: using guessed type int has_focus;
// 1028200: using guessed type int return_value;
//----- (0101CEB6) --------------------------------------------------------
int __stdcall sub_101CEB6(LPBYTE lpData)
{
signed int v1; // esi
DWORD cbData; // [esp+4h] [ebp-8h]
HKEY phkResult; // [esp+8h] [ebp-4h]
v1 = 0;
if ( RegOpenKeyExA(
HKEY_CLASSES_ROOT,
"CLSID\\{ADB880A6-D8FF-11CF-9377-00AA003B7A11}\\InprocServer32",
0,
0x20019u,
&phkResult) )
{
return 0;
}
cbData = 260;
if ( !RegQueryValueExA(phkResult, WindowName, 0, 0, lpData, &cbData) )
v1 = 1;
RegCloseKey(phkResult);
return v1;
}
//----- (01020F95) --------------------------------------------------------
int WinMainCRTStartup()
{
HMODULE v0; // eax
int v1; // ecx
int v2; // eax
int v3; // eax
bool v4; // zf
CHAR *v5; // esi
signed int v6; // eax
int v7; // ST20_4
HMODULE v8; // eax
int v9; // eax
int v10; // esi
struct _STARTUPINFOA StartupInfo; // [esp+Ch] [ebp-80h]
int v13; // [esp+50h] [ebp-3Ch]
int v14; // [esp+54h] [ebp-38h]
char v15; // [esp+58h] [ebp-34h]
char v16; // [esp+5Ch] [ebp-30h]
char v17; // [esp+60h] [ebp-2Ch]
int v18; // [esp+68h] [ebp-24h]
CHAR *v19; // [esp+6Ch] [ebp-20h]
int v20; // [esp+70h] [ebp-1Ch]
CPPEH_RECORD ms_exc; // [esp+74h] [ebp-18h]
v0 = GetModuleHandleA(0);
if ( *(_WORD *)v0 != 23117 )
goto LABEL_5;
v1 = (int)v0 + *((_DWORD *)v0 + 15);
if ( *(_DWORD *)v1 != 17744 )
goto LABEL_5;
v2 = *(unsigned __int16 *)(v1 + 24);
if ( v2 == 267 )
{
if ( *(_DWORD *)(v1 + 116) > 0xEu )
{
v3 = 0;
v4 = *(_DWORD *)(v1 + 232) == 0;
goto LABEL_10;
}
LABEL_5:
v20 = 0;
goto LABEL_11;
}
if ( v2 != 523 || *(_DWORD *)(v1 + 132) <= 0xEu )
goto LABEL_5;
v3 = 0;
v4 = *(_DWORD *)(v1 + 248) == 0;
LABEL_10:
LOBYTE(v3) = !v4;
v20 = v3;
LABEL_11:
ms_exc.registration.TryLevel = 0;
___set_app_type(2);
__onexitend = -1;
__onexitbegin = -1;
*(_DWORD *)___p__fmode() = _fmode;
*(_DWORD *)___p__commode() = _commode;
_adjust_fdiv = __adjust_fdiv;
check_expiration_date();
if ( !__defaultmatherr )
___setusermatherr(check_expiration_date);
_setdefaultprecision();
_initterm(&__xi_a, &__xi_z);
v18 = _newmode;
v14 = ___getmainargs(&v15, &v16, &v17, _dowildcard, &v18);
_initterm(&__xc_a, &__xc_z);
v5 = (CHAR *)__acmdln;
v19 = (CHAR *)__acmdln;
if ( *__acmdln != 34 )
{
while ( (unsigned __int8)*v5 > 0x20u )
v19 = ++v5;
goto LABEL_18;
}
do
v19 = ++v5;
while ( *v5 && *v5 != 34 );
if ( *v5 != 34 )
goto LABEL_18;
do
{
v19 = ++v5;
LABEL_18:
;
}
while ( *v5 && (unsigned __int8)*v5 <= 0x20u );
StartupInfo.dwFlags = 0;
GetStartupInfoA(&StartupInfo);
if ( StartupInfo.dwFlags & 1 )
v6 = StartupInfo.wShowWindow;
else
v6 = 10;
v7 = v6;
v8 = GetModuleHandleA(0);
v9 = WinMain(v8, 0, v5, v7);
v10 = v9;
v13 = v9;
if ( !v20 )
_exit(v9);
__cexit();
return v10;
}
// 10012BC: using guessed type int __cdecl ___getmainargs(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10012C4: using guessed type int __cdecl ___setusermatherr(_DWORD);
// 10012D0: using guessed type int ___p__fmode(void);
// 10012D4: using guessed type int __cdecl ___set_app_type(_DWORD);
// 100134C: using guessed type int ___p__commode(void);
// 10211AE: using guessed type int __cdecl _initterm(_DWORD, _DWORD);
// 1024890: using guessed type int __defaultmatherr;
// 1027BFC: using guessed type int _dowildcard;
// 1027C00: using guessed type int _newmode;
// 1027C04: using guessed type int _commode;
// 1028298: using guessed type int __onexitend;
// 102829C: using guessed type int __onexitbegin;
// 10282A0: using guessed type int _adjust_fdiv;