Доброго дня!! Річ не в тому що він має якусь цінність а просто я хочу щосьь розібрати
і скомпілювати наново, для досвіду і що б розібратися з можливостями шестикутного.
402170 - чому лається на __usercall? Це адже на нього? Можна для компіляції ігнорувати (видалити)?
/* This file has been generated by the Hex-Rays decompiler.
Copyright (c) 2009 Hex-Rays <info@hex-rays.com>
Detected compiler: Visual C++
*/
#include <windows.h>
#include "defs.h"
//-------------------------------------------------------------------------
// Data declarations
extern _UNKNOWN _ImageBase; // weak
extern _UNKNOWN unk_400ED8; // weak
extern _UNKNOWN unk_404120; // weak
extern char aKuadraticEku_0[27]; // weak
extern char aHresYoursRotsO[]; // idb
extern char String[64]; // idb
extern char byte_4050C2[64]; // idb
extern char byte_405102[64]; // idb
extern char byte_405142[64]; // idb
extern char Caption[]; // idb
extern char Text[]; // idb
extern int dword_4051C8; // weak
extern int dword_4051D0; // weak
extern _DWORD dword_4051D8; // idb
extern _UNKNOWN dword_4051DC; // weak
extern int (__stdcall *dword_4051E0)(_DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_4051E4)(_DWORD, _DWORD); // weak
extern int (__fastcall *dword_4051E8)(_DWORD, _DWORD); // weak
extern int (__cdecl *dword_4051EC)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern _DWORD dword_4051F0; // idb
extern int dword_4051F4; // weak
extern int dword_4051F8; // weak
extern int (__stdcall *dword_4051FC)(_DWORD, _DWORD, _DWORD, _DWORD); // weak
extern _UNKNOWN unk_405208; // weak
extern int dword_405210; // weak
extern int dword_405220; // weak
extern int dword_405378; // weak
//-------------------------------------------------------------------------
// Function declarations
#define __thiscall __cdecl // Test compile in C mode
void __cdecl start();
int loc_401046(); // weak
BOOL __stdcall DialogFunc(HWND hDlg, int a2, int a3, int a4);
int __stdcall loc_40122E(HWND hDlg, int, int, int); // weak
int __cdecl sub_401318(signed int a1);
_DWORD __cdecl sub_401395(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
int __cdecl sub_401511();
_DWORD __cdecl sub_401598(char, char); // weak
int __usercall__sub_401670(char a1, int result);
void __fastcall sub_4016A0(int a1, int a2);
int __cdecl sub_4018D0(_DWORD); // weak
// int __usercall sub_401980<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>);
// signed int __usercall sub_401A10<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>);
bool __cdecl sub_401D20();
int __cdecl sub_401DB0(int a1, int a2);
int __cdecl sub_401E20(int a1, int a2, int a3, int a4);
// int __usercall sub_4020C0<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, int a5);
// int __usercall sub_402170<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, int a5, int a6, int a7, int a8);
int __cdecl sub_402240(int a1, const void *a2);
void __thiscall sub_40234E(void *this);
int __cdecl sub_402363();
int __cdecl sub_402372();
bool __cdecl sub_4023A1(int a1);
void __cdecl sub_402E90();
// INT_PTR __stdcall DialogBoxParamA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
// BOOL __stdcall EndDialog(HWND hDlg, INT_PTR nResult);
// UINT __stdcall GetDlgItemTextA(HWND hDlg, int nIDDlgItem, LPSTR lpString, int cchMax);
// int __stdcall MessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
// void __stdcall ExitProcess(UINT uExitCode);
// HMODULE __stdcall GetModuleHandleA(LPCSTR lpModuleName);
_DWORD __cdecl sub_40342E(_DWORD, _DWORD); // weak
_DWORD __cdecl sub_403433(_DWORD, _DWORD); // weak
int __thiscall sub_40343D(_DWORD); // weak
int __cdecl sub_403442(_DWORD, _DWORD, _DWORD); // weak
int __cdecl sub_403447(_DWORD); // weak
int __cdecl sub_40344C(_DWORD); // weak
int __cdecl sub_403460(_DWORD); // weak
//----- (00401000) --------------------------------------------------------
void __cdecl start()
{
int v0; // eax@3
HMODULE v1; // eax@3
if ( (unsigned __int16)MessageBoxA(0, "Do you want to solve a cuadratic ekuation?", "Kuadratic ekuation solover", 0) != 1 )
ExitProcess(0);
v1 = GetModuleHandleA(0);
v0 = DialogBoxParamA(v1, (LPCSTR)0x101, 0, (DLGPROC)DialogFunc, 0) + 1;
if ( v0 )
{
JUMPOUT(v0, 0, *(unsigned int *)DialogFunc);
MessageBoxA(0, "Hres yours rots off square ekuateon!", byte_405142, 0);
}
ExitProcess(0);
}
//----- (00401060) --------------------------------------------------------
BOOL __stdcall DialogFunc(HWND hDlg, int a2, int a3, int a4)
{
BOOL result; // eax@4
char v5; // zf@10
int v6; // esi@16
int v7; // eax@16
int v8; // esi@16
int v9; // eax@16
char v10; // [sp+0h] [bp-12Ch]@11
int v11; // [sp+C4h] [bp-68h]@11
int v12; // [sp+D0h] [bp-5Ch]@11
int v13; // [sp+DCh] [bp-50h]@11
int v14; // [sp+E8h] [bp-44h]@14
int v15; // [sp+F4h] [bp-38h]@14
int v16; // [sp+100h] [bp-2Ch]@15
int v17; // [sp+10Ch] [bp-20h]@11
int v18; // [sp+118h] [bp-14h]@11
int v19; // [sp+11Ch] [bp-10h]@21
int v20; // [sp+120h] [bp-Ch]@21
int v21; // [sp+124h] [bp-8h]@11
int v22; // [sp+12Ch] [bp+0h]@21
if ( a2 == 272 )
return 1;
if ( a2 == 273 )
{
if ( a3 == 2 )
goto LABEL_10;
if ( a3 == 1 )
{
GetDlgItemTextA(hDlg, 101, String, 64);
GetDlgItemTextA(hDlg, 102, byte_4050C2, 64);
GetDlgItemTextA(hDlg, 103, byte_405102, 64);
goto LABEL_11;
}
return 1;
}
if ( a2 != 16 )
return 0;
LABEL_10:
result = EndDialog(hDlg, -1);
if ( v5 )
return result;
LABEL_11:
memset(&v10, 0, 0x12Cu);
v21 = 511;
v18 = 1023;
v17 = 1279;
v13 = 0;
v12 = 0;
v11 = 0;
sub_401395(&v21, &v18, &v17, &v13, &v12, &v11);
if ( !v21 )
{
if ( v18 )
{
v14 = -(v17 / v18);
v15 = -(v17 / v18);
}
goto LABEL_21;
}
v16 = v18 * v18 - v17 * 4 * v21;
if ( v16 <= 0 )
{
if ( v16 )
goto LABEL_21;
v15 = -v18 / (2 * v21);
v14 = -v18 / (2 * v21);
}
else
{
v6 = -v18;
v7 = sub_401318(v16);
v15 = (v7 + v6) / (2 * v21);
v8 = -v18;
v9 = sub_401318(v16);
v14 = (v8 - v9) / (2 * v21);
}
sub_401598(v15, v14);
LABEL_21:
sub_4016A0((int)&v22, (int)loc_40122E);
sub_403442(v19, v20, v21);
return EndDialog(hDlg, 1);
}
// 40122E: using guessed type int __stdcall loc_40122E(HWND hDlg, int, int, int);
// 401395: using guessed type _DWORD __cdecl sub_401395(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 401598: using guessed type _DWORD __cdecl sub_401598(char, char);
// 403442: using guessed type int __cdecl sub_403442(_DWORD, _DWORD, _DWORD);
//----- (00401318) --------------------------------------------------------
int __cdecl sub_401318(signed int a1)
{
int v2; // [sp+D0h] [bp-8h]@1
v2 = (a1 / 63 + 63) >> 1;
v2 = (v2 + a1 / v2) >> 1;
return (v2 + a1 / v2) >> 1;
}
//----- (00401395) --------------------------------------------------------
//#error "4014B7: call analysis failed (funcsize=131)"
//----- (00401511) --------------------------------------------------------
//#error "40157A: call analysis failed (funcsize=34)"
//----- (00401598) --------------------------------------------------------
//#error "401628: positive sp value has been found (funcsize=57)"
//----- (00401670) --------------------------------------------------------
int __usercall__sub_401670(char a1, int result)
{
int v2; // ST18_4@3
int v3; // [sp+0h] [bp+0h]@3
if ( !a1 )
{
v2 = result;
sub_40342E(v3, 0);
result = v2;
}
return result;
}
// 40342E: using guessed type _DWORD __cdecl sub_40342E(_DWORD, _DWORD);
//----- (004016A0) --------------------------------------------------------
void __fastcall sub_4016A0(int a1, int a2)
{
int v2; // ebx@1
int v3; // edi@1
int v4; // esi@1
int v5; // eax@2
int v6; // ecx@2
int i; // [sp+Ch] [bp-4h]@1
void *v8; // [sp+14h] [bp+4h]@4
v3 = 0;
v4 = a2;
v2 = a1;
for ( i = 0; i < *(_DWORD *)v4; ++i )
{
v5 = *(_DWORD *)(v4 + 4);
v6 = *(_DWORD *)(v5 + v3);
if ( *(_DWORD *)(v6 + v2 - 4) != -858993460 || *(_DWORD *)(v6 + *(_DWORD *)(v5 + v3 + 4) + v2) != -858993460 )
sub_403433(v8, *(_DWORD *)(v5 + v3 + 8));
v3 += 12;
}
}
// 403433: using guessed type _DWORD __cdecl sub_403433(_DWORD, _DWORD);
//----- (004018D0) --------------------------------------------------------
//#error "4018E1: call analysis failed (funcsize=36)"
//----- (00401980) --------------------------------------------------------
int __usercall__sub_401980(int a1, int a2, int a3, int a4)
{
int result; // eax@1
sub_401A10(a1, a2, a3, a4);
dword_4051EC = (int (__cdecl *)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD))dword_4051C8;
result = dword_4051EC(byte_405102, byte_4050C2, String, dword_4051E0, 4288880);
dword_4051E0 = (int (__stdcall *)(_DWORD, _DWORD, _DWORD, _DWORD))result;
if ( (signed int)dword_4051E0 < 0 )
result = sub_401A10(result, a2, a3, a4);
return result;
}
// 4051C8: using guessed type int dword_4051C8;
// 4051E0: using guessed type int (__stdcall *dword_4051E0)(_DWORD, _DWORD, _DWORD, _DWORD);
// 4051EC: using guessed type int (__cdecl *dword_4051EC)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (00401A10) --------------------------------------------------------
signed int __usercall__sub_401A10(int a1, int a2, int a3, int a4)
{
int v4; // eax@4
int v5; // ecx@4
int v7; // edx@23
int v8; // ecx@23
int v9; // edx@25
int v10; // ecx@25
int v11; // [sp-10h] [bp-3Ch]@1
const void *v12; // [sp-Ch] [bp-38h]@1
int v13; // [sp-8h] [bp-34h]@1
int v14; // [sp-4h] [bp-30h]@1
int v15; // [sp+0h] [bp-2Ch]@12
int v16; // [sp+4h] [bp-28h]@28
int v17; // [sp+8h] [bp-24h]@3
int v18; // [sp+Ch] [bp-20h]@3
int v19; // [sp+10h] [bp-1Ch]@3
int *v20; // [sp+14h] [bp-18h]@1
int v21; // [sp+1Ch] [bp-10h]@1
int (__cdecl *v22)(_DWORD); // [sp+20h] [bp-Ch]@1
unsigned int v23; // [sp+24h] [bp-8h]@1
int v24; // [sp+28h] [bp-4h]@1
int v25; // [sp+2Ch] [bp+0h]@1
v24 = -2;
v22 = sub_403460;
v21 = a1;
v14 = a2;
v13 = a4;
v12 = (const void *)a3;
v23 = dword_4051F4 ^ (unsigned int)&unk_404120;
v11 = (unsigned int)&v25 ^ dword_4051F4;
v20 = &v11;
if ( !dword_4051DC )
dword_4051E0(0, 1, 0, 0);
v24 = 0;
v17 = 0;
v18 = *(_DWORD *)(sub_402240(v11, v12) + 4);
v19 = 0;
while ( 1 )
{
v4 = dword_4051FC(4289924, v18, 0, v11);
v17 = v4;
if ( !v4 )
break;
if ( v17 == v18 )
{
v19 = 1;
break;
}
v11 = 1000;
dword_4051E8(v5, v17);
}
if ( dword_4051E4 == (int (__stdcall *)(_DWORD, _DWORD))1 )
{
v4 = sub_4018D0(31);
}
else
{
if ( dword_4051E0 )
{
dword_405378 = 1;
}
else
{
dword_4051D0 = 1;
v4 = sub_401A10(&unk_404120, &dword_4051F4);
if ( v4 )
{
v15 = 255;
v24 = -2;
return 255;
}
}
}
if ( dword_4051E8 == (int (__fastcall *)(_DWORD, _DWORD))1 )
{
v11 = (int)&unk_405208;
sub_4020C0(v4, a2, a3, a4, (int)"Kuadratic ekuation solover");
dword_405210 = 2;
}
if ( dword_405210 != 2 )
{
if ( dword_4051EC(2, 4282424, 476, 0, 4282544) == 1 )
__asm { int 3 ; Trap to Debugger }
}
if ( !v19 )
dword_4051E4(4289924, 0);
if ( dword_4051E0 )
{
if ( sub_403460(4289952) )
{
v11 = 0;
dword_4051E8(v8, v7);
}
}
dword_4051EC(1, v12, v13, v14, v15);
*(_DWORD *)dword_4051EC = dword_4051F0;
v11 = dword_4051F0;
dword_4051D0 = sub_4020C0(dword_4051F0, a2, a3, a4, dword_4051F8);
if ( !dword_4051E0 )
{
v11 = dword_4051D8;
dword_4051E8(v10, v9);
}
if ( !dword_4051D8 )
dword_4051EC(v12, v13, v14, v15, v16);
return dword_405220;
}
// 4051E8: invalid function type has been ignored
// 4051E4: invalid function type has been ignored
// 4018D0: using guessed type int __cdecl sub_4018D0(_DWORD);
// 403460: using guessed type int __cdecl sub_403460(_DWORD);
// 4051D0: using guessed type int dword_4051D0;
// 4051D8: using guessed type int dword_4051D8;
// 4051DC: using guessed type int dword_4051DC;
// 4051E0: using guessed type int (__stdcall *dword_4051E0)(_DWORD, _DWORD, _DWORD, _DWORD);
// 4051E4: using guessed type int (__stdcall *dword_4051E4)(_DWORD, _DWORD);
// 4051E8: using guessed type int (__fastcall *dword_4051E8)(_DWORD, _DWORD);
// 4051EC: using guessed type int (__cdecl *dword_4051EC)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 4051F0: using guessed type int dword_4051F0;
// 4051F4: using guessed type int dword_4051F4;
// 4051F8: using guessed type int dword_4051F8;
// 4051FC: using guessed type int (__stdcall *dword_4051FC)(_DWORD, _DWORD, _DWORD, _DWORD);
// 405210: using guessed type int dword_405210;
// 405220: using guessed type int dword_405220;
// 405378: using guessed type int dword_405378;
//----- (00401D20) --------------------------------------------------------
bool __cdecl sub_401D20()
{
bool result; // eax@2
char *v1; // [sp+0h] [bp-8h]@3
if ( _ImageBase == 23117 )
{
v1 = (char *)&_ImageBase + *((_DWORD *)&_ImageBase + 15);
if ( *(_DWORD *)v1 == 17744 )
{
if ( *((_WORD *)v1 + 12) == 267 )
{
if ( *((_DWORD *)v1 + 29) > 0xEu )
result = *((_DWORD *)v1 + 58) != 0;
else
result = 0;
}
else
{
result = 0;
}
}
else
{
result = 0;
}
}
else
{
result = 0;
}
return result;
}
//----- (00401DB0) --------------------------------------------------------
int __cdecl sub_401DB0(int a1, int a2)
{
int result; // eax@1
int v3; // ecx@2
result = a2;
if ( (unsigned int)a2 > 4 )
{
result = sub_401E20(a1, 1, 5, 4282640);
}
else
{
v3 = *(_DWORD *)(4 * a2 + 0x41701C);
if ( v3 != -1 )
result = sub_401E20(a1, v3, a2, *(_DWORD *)(4 * a2 + 0x415C34));
}
return result;
}
//----- (00401E20) --------------------------------------------------------
int __cdecl sub_401E20(int a1, int a2, int a3, int a4)
{
int v4; // eax@3
int v5; // esi@3
int v6; // eax@8
int v7; // esi@11
char *v8; // ebx@17
int (__stdcall *v9)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // edi@17
char *v10; // esi@19
int v12; // ST20_4@24
int v13; // ST24_4@24
int v14; // ST28_4@24
int v15; // [sp+10h] [bp-E3Ch]@1
int v16; // [sp+18h] [bp-E34h]@5
int v17; // [sp+1Ch] [bp-E30h]@1
char v18; // [sp+20h] [bp-E2Ch]@4
char v19; // [sp+420h] [bp-A2Ch]@17
char v20; // [sp+72Ch] [bp-720h]@19
char v21; // [sp+A38h] [bp-414h]@15
char v22; // [sp+C40h] [bp-20Ch]@15
unsigned int v23; // [sp+E48h] [bp-4h]@1
int v24; // [sp+E4Ch] [bp+0h]@1
v23 = (unsigned int)&v24 ^ (unsigned int)dword_4051E8;
v15 = 0;
v17 = sub_403447(a1);
if ( !v17 )
v15 = sub_40344C(a1);
v5 = v7c809c98;
v4 = v7c809c98(65001, 0, a4, -1, 0, 0);
if ( (unsigned int)v4 < 0x200
&& (v4 = ((int (__stdcall *)(signed int, _DWORD, int, signed int, char *, int))v5)(65001, 0, a4, -1, &v18, v4)) != 0 )
v16 = (int)&v18;
else
v16 = 4283800;
if ( sub_4020C0(v4, a1, a4, v5, 4098) )
{
v6 = sub_402170(v16, a1, a3, v5, a3, *(_DWORD *)(4 * a3 + 0x415C4C), a1, v16);
if ( v6 )
return sub_402170(v6, v14, v12, v13, a4, v15, a3, v16);
v6 = 0;
}
else
{
v6 = 1;
}
v7 = v17;
if ( !v15 && !v17 )
goto LABEL_27;
if ( (_BYTE)v6 )
{
v6 = v7c82f6ef();
if ( v6 )
goto LABEL_27;
}
unk_400ED8(a1 - 5, &v21, 260, &v17, &v22, 260);
if ( v7 )
{
v6 = ((int (__cdecl *)(int, char *, int, char *, signed int, int, int))v7)(a2, &v21, v17, &v22, 4283720, a3, v16);
}
else
{
v9 = (int (__stdcall *)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD))v7c839509;
v8 = (char *)4283696;
if ( v7c839509(65001, 0, &v21, -1, &v19, 778, 0, 0) )
v8 = &v19;
v10 = (char *)4283672;
if ( v9(65001, 0, &v22, -1, &v20, 778, 0, 0) )
v10 = &v20;
v6 = ((int (__cdecl *)(int, char *, int, char *, signed int, int, int))v15)(a2, v8, v17, v10, 4283632, a3, a4);
}
if ( v6 == 1 )
LABEL_27:
__asm { int 3 ; Trap to Debugger }
return sub_402170(v6, v14, v12, v13, a4, v15, a3, v16);
}
// 403447: using guessed type int __cdecl sub_403447(_DWORD);
// 40344C: using guessed type int __cdecl sub_40344C(_DWORD);
// 4051E8: using guessed type int (__fastcall *dword_4051E8)(_DWORD, _DWORD);
// 7C82F6EF: using guessed type int (*)(void);
//----- (004020C0) --------------------------------------------------------
int __usercall sub_4020C0<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, int a5)
{
char v6; // [sp-10h] [bp-44h]@1
int v7; // [sp+0h] [bp-34h]@1
int v8; // [sp+Ch] [bp-28h]@1
int v9; // [sp+10h] [bp-24h]@1
int v10; // [sp+14h] [bp-20h]@1
int v11; // [sp+18h] [bp-1Ch]@1
unsigned __int8 v12; // [sp+1Bh] [bp-19h]@1
int v13; // [sp+20h] [bp-14h]@1
int v14; // [sp+24h] [bp-10h]@1
signed int v15; // [sp+28h] [bp-Ch]@1
int v16; // [sp+2Ch] [bp-8h]@1
int v17; // [sp+30h] [bp-4h]@1
int v18; // [sp+34h] [bp+0h]@1
v15 = 4264046;
v14 = a1;
v16 = v417048 ^ 0x416C50;
v12 = 0;
v17 = 0;
v4181e8(1080890248, 0, 6, &v7, (unsigned int)&v18 ^ v417048, a3, a4, a2, 4097, a5, &v12, v8, v9, v10, v11, &v6, v13);
return v12;
}
// 4181E8: using guessed type int (__stdcall *)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (00402170) --------------------------------------------------------
int __usercall sub_402170(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
{ // Ошибка 81 error C2059: синтаксическая ошибка: ;
char v9; // [sp-10h] [bp-44h]@1
int v10; // [sp+0h] [bp-34h]@1
int v11; // [sp+18h] [bp-1Ch]@1
unsigned __int8 v12; // [sp+1Bh] [bp-19h]@1
int v13; // [sp+20h] [bp-14h]@1
int v14; // [sp+24h] [bp-10h]@1
signed int v15; // [sp+28h] [bp-Ch]@1
int v16; // [sp+2Ch] [bp-8h]@1
int v17; // [sp+30h] [bp-4h]@1
int v18; // [sp+34h] [bp+0h]@1
v15 = 4264046;
v14 = a1;
v16 = dword_4051F0 ^ 0x416C70;
v12 = 0;
v17 = 0;
v4181e8(
1080890248,
0,
6,
&v10,
(unsigned int)&v18 ^ dword_4051F0,
a3,
a4,
a2,
4098,
a5,
a6,
a7,
&v12,
a8,
v11,
&v9,
v13);
return v12;
}
// 4051F0: using guessed type int dword_4051F0;
// 4181E8: using guessed type int (__stdcall *)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (00402240) --------------------------------------------------------
int __cdecl sub_402240(int a1, const void *a2)
{
const void *v2; // eax@1
int v3; // ecx@4
int v4; // ebx@4
char v5; // dl@5
char v6; // cl@6
unsigned int v7; // eax@7
void *v8; // edi@7
char v9; // cl@8
unsigned int v10; // eax@9
void *v11; // edi@9
char v12; // cl@10
int v14; // [sp+0h] [bp-408h]@1
char v15[1024]; // [sp+4h] [bp-404h]@4
unsigned int v16; // [sp+404h] [bp-4h]@1
int v17; // [sp+408h] [bp+0h]@1
v16 = (unsigned int)&v17 ^ (unsigned int)dword_4051E8;
v14 = a1;
v2 = a2;
if ( *(_DWORD *)((char *)&dword_4051D8 + 2) != -1 )
{
if ( *(_BYTE *)a2 && strlen((const char *)a2) + 45 <= 0x400 )
{
v4 = (int)v15;
v3 = 0;
do
{
v5 = *(_BYTE *)(v3 + 4283492);
v15[v3++] = v5;
}
while ( v5 );
do
{
v6 = *(_BYTE *)v2;
v2 = (char *)v2 + 1;
}
while ( v6 );
v7 = v2 - a2; //Ошибка 83 error C2036: const void *: неизвестный размер
v8 = (char *)&v14 + 3;
do
{
v9 = *((_BYTE *)v8 + 1);
v8 = (char *)v8 + 1;
}
while ( v9 );
memcpy(v8, a2, v7);
v10 = strlen((const char *)0x415C80) + 1;
v11 = (char *)&v14 + 3;
do
{
v12 = *((_BYTE *)v11 + 1);
v11 = (char *)v11 + 1;
}
while ( v12 );
memcpy(v11, (const void *)0x415C80, v10);
}
else
{
v4 = 4283932;
}
sub_401E20(v14, dword_4051D8, 2, v4);
}
return sub_40343D((unsigned int)&v17 ^ v16);
}
// 40343D: using guessed type int __thiscall sub_40343D(_DWORD);
// 4051E8: using guessed type int (__fastcall *dword_4051E8)(_DWORD, _DWORD);
// 402240: using guessed type char var_404[1024];
//----- (0040234E) --------------------------------------------------------
void __thiscall sub_40234E(void *this)
{
if ( this != dword_4051E4 )
JUMPOUT(*(unsigned int *)loc_401046);
}
// 401046: using guessed type int loc_401046();
// 4051E4: using guessed type int (__stdcall *dword_4051E4)(_DWORD, _DWORD);
//----- (00402363) --------------------------------------------------------
int __cdecl sub_402363()
{
return v41718c;
}
//----- (00402372) --------------------------------------------------------
int __cdecl sub_402372()
{
return v41718c;
}
//----- (004023A1) --------------------------------------------------------
bool __cdecl sub_4023A1(int a1)
{
bool result; // eax@2
int v2; // [sp+0h] [bp-Ch]@3
if ( *(_WORD *)a1 == 23117 )
{
v2 = *(_DWORD *)(a1 + 60) + a1;
if ( *(_DWORD *)v2 == 17744 )
result = *(_WORD *)(v2 + 24) == 267;
else
result = 0;
}
else
{
result = 0;
}
return result;
}
//----- (00402E90) --------------------------------------------------------
void __cdecl sub_402E90()
{
;
}
//#error "There were 4 decompilation failure(s) on 22 function(s)"