Function at 0x40a590
Capabilities:
Get common file path
Identify system language via api
Read .ini file
Terminate process

Disassembly:
push ebp
lea ebp, [esp - 0x208]
sub esp, 0x208
push 0xfffffffffffffffe
push 0x428ed0
push 0x40be90
mov eax, dword fs:[0]
push eax
sub esp, 0x10
mov eax, dword [0x42b008]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x204], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov edi, dword [ebp + 0x210]
mov esi, dword [ebp + 0x218]
push 3
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push fcn.00409dd0
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 0
push 0x42c4e0
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push str._HD3_Data
push 0x42c4e0
push str._s_s
push 0x42c820
call fcn.0040ac40
push 0x42c820
push str._sCompability
push 0x42c5e8
call fcn.0040ac40
push 0x42c820
push str._sLang
push 0x430c68
call fcn.0040ac40
push 0x42c820
push str._sPacks
push 0x430a38
call fcn.0040ac40
push 0x42c820
push str._sSettings
push 0x430b50
call fcn.0040ac40
add esp, 0x40
push 0x42c4e0
push str._sHotA_settings.ini
call fcn.004015c0
add esp, 8
lea edx, [ebp]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
lea eax, [eax + 1]
test cl, cl
jne 0x40a694
lea eax, [ebp]
push eax
push 0xffffffffffffffff
push str.Language
push str.Global_Settings
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
mov dword [0x42b964], eax
lea eax, [ebp]
push eax
push 0xff
lea eax, [ebp + 0x104]
push eax
push str.true
push str.Activate_Test_Updates
push str.Global_Settings
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push str.true
lea eax, [ebp + 0x104]
push eax
call fcn.004110d3
add esp, 8
test eax, eax
jne 0x40a711
lea eax, [ebp]
push eax
push str.false
push str.Activate_Test_Updates
push str.Global_Settings
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
call fcn.004047b0
test eax, eax
jne 0x40a73f
call fcn.004014d0
test eax, eax
mov ecx, 0x428420
jne 0x40a72d
mov ecx, str.HD_compatible_executables_not_found__r_n_r_nHoMM3_HD_should_be_installed_in_the_game_folder._HoMM3_HD_is_not_compatible_with__Restoration_of_Erathia____Armaggeddons_Blade____Heroes_Chronicles_.
mov edx, 0x30
call fcn.004030f0
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
call fcn.00404e70
mov ecx, esi
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a750
sub ecx, edx
je 0x40a798
cmp byte [esi], 0x3a
jne 0x40a76f
cmp byte [esi + 1], 0x75
jne 0x40a798
mov byte [0x42c4dc], 1
jmp 0x40a798
mov ecx, esi
call fcn.0040a350
test eax, eax
je 0x40a78b
mov dword [ebp - 4], 0xfffffffe
mov eax, 1
jmp 0x40a87e
mov edx, esi
xor ecx, ecx
call fcn.00405bb0
test eax, eax
jne 0x40a77a
push 0x66
push edi
mov esi, dword [sym.imp.USER32.dll_LoadIconA]
call esi
mov dword [0x430d7c], eax
push 0x67
push edi
call esi
mov dword [0x42c80c], eax
mov dword [0x430d90], edi
push str._HD3_.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
test edi, edi
je 0x40a7f7
push str.HdCommon_Get
push edi
call ebx
test eax, eax
je 0x40a7e9
push 0
push str.HD.Version.Dword
call eax
mov dword [0x42b960], eax
push edi
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
call esi
push edi
call esi
jmp 0x40a7fd
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0x42c820
push str._shUpdate.dll
call fcn.004015c0
add esp, 8
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x42c6f0], eax
test eax, eax
je 0x40a82c
push str.TryUpdate
push eax
call ebx
mov dword [0x430d84], eax
push 0
push 0x408c70
push 0
push 0x417
push dword [0x430d90]
call dword [sym.imp.USER32.dll_DialogBoxParamA]
mov edi, eax
mov dword [ebp - 0x1c], edi
push dword [0x42c6f0]
call esi
mov dword [0x42c6f0], 0
mov dword [ebp - 4], 0xfffffffe
jmp 0x40a87c
mov eax, edi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x204]
xor ecx, ebp
call fcn.0040acdd
lea esp, [ebp + 0x208]
pop ebp
ret 0x10