Function at 0x40d6b0
Capabilities:
Check if file exists
Create process on windows
Delete file
Extract resource via kernel32 functions
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x461b8c
mov eax, dword fs:[0]
push eax
sub esp, 0x884
mov eax, dword [0x4786a0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [0x478034]
mov edx, dword [eax + 0xc]
mov esi, ecx
xor ebx, ebx
mov ecx, 0x478034
mov dword [ebp - 0x814], esi
mov byte [ebp - 0x815], bl
call edx
add eax, 0x10
mov dword [ebp - 0x824], eax
mov dword [ebp - 4], ebx
mov eax, dword [0x478034]
mov edx, dword [eax + 0xc]
mov ecx, 0x478034
call edx
lea edi, [eax + 0x10]
mov dword [ebp - 0x820], edi
mov byte [ebp - 4], 1
mov eax, dword [0x478034]
mov edx, dword [eax + 0xc]
mov ecx, 0x478034
call edx
add eax, 0x10
mov dword [ebp - 0x81c], eax
push 0x7fe
lea ecx, [ebp - 0x80e]
xor eax, eax
push ebx
mov byte [ebp - 4], 2
push ecx
mov word [ebp - 0x810], ax
call fcn.00449910
add esp, 0xc
xor eax, eax
push 0x44
lea edx, [ebp - 0x890]
push ebx
push edx
mov dword [ebp - 0x83c], eax
mov dword [ebp - 0x838], eax
mov dword [ebp - 0x834], eax
mov dword [ebp - 0x830], eax
call fcn.00449910
mov eax, dword [0x478034]
mov edx, dword [eax + 0xc]
add esp, 0xc
mov ecx, 0x478034
call edx
add eax, 0x10
mov dword [ebp - 0x82c], eax
mov byte [ebp - 4], 3
mov eax, dword [esi + 0x90]
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ebx, [ebp - 0x824]
call fcn.00420540
mov eax, dword [esi + 0xb4]
mov ecx, dword [eax - 0xc]
push ecx
push eax
call fcn.00420540
mov ecx, dword [ebp - 0x824]
lea eax, [ecx - 0x10]
lea ebx, [edi - 0x10]
mov dword [ebp - 0x840], eax
cmp eax, ebx
je 0x40d834
cmp dword [ebx + 0xc], 0
lea edi, [ebx + 0xc]
jl 0x40d824
mov edx, dword [eax]
cmp edx, dword [ebx]
jne 0x40d824
call fcn.004218e0
mov dword [ebp - 0x828], eax
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x40d813
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
mov ecx, dword [ebp - 0x828]
add ecx, 0x10
mov dword [ebp - 0x820], ecx
jmp 0x40d834
mov ebx, dword [ecx - 0xc]
push ecx
lea edx, [ebp - 0x820]
push edx
call fcn.00401330
push 0xa
push str._setup.exe
lea ebx, [ebp - 0x820]
call fcn.00420540
mov edi, dword [ebp - 0x81c]
mov eax, dword [ebp - 0x840]
add edi, 0xfffffff0
cmp eax, edi
je 0x40d8b0
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x40d89a
mov ecx, dword [eax]
cmp ecx, dword [edi]
jne 0x40d89a
call fcn.004218e0
mov dword [ebp - 0x828], eax
or edx, 0xffffffff
lock xadd dword [ebx], edx
dec edx
test edx, edx
jg 0x40d889
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov eax, dword [ebp - 0x828]
add eax, 0x10
mov dword [ebp - 0x81c], eax
jmp 0x40d8b0
mov eax, dword [ebp - 0x824]
mov ebx, dword [eax - 0xc]
push eax
lea ecx, [ebp - 0x81c]
push ecx
call fcn.00401330
push 1
push 0x46ce9c
lea ebx, [ebp - 0x81c]
call fcn.00420540
mov eax, dword [0x47b708]
mov ecx, dword [eax - 0xc]
push ecx
push eax
call fcn.00420540
mov ebx, dword [ebp - 0x820]
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40d907
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
lea edi, [esi + 0x100]
push str.Failed_to_install_prerequisites._The__s_file_doesnt_exists.
mov dword [esi + 0x104], eax
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
push 0x91
push 0x468fc0
lea edi, [ebp - 0x82c]
call fcn.00422e30
mov edx, dword [ebp - 0x82c]
add esp, 8
push 0x468fc8
push edx
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
jne 0x40d95e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x104], eax
lea eax, [esi + 0x100]
push str.Failed_to_install_prerequisites._The_specified_resource_doesnt_exist.
push eax
lea ebx, [edi + 0x46]
call fcn.00401330
jmp 0x40dcd7
push edi
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x40d98c
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esi + 0x100]
mov edx, str.Failed_to_install_prerequisites._Cant_load_the_specified_resource.
mov dword [esi + 0x104], eax
call fcn.004011b0
jmp 0x40dcd7
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebx, eax
test ebx, ebx
jne 0x40d9ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esi + 0x100]
mov edx, str.Failed_to_install_prerequisites._Cant_lock_the_specified_resource.
mov dword [esi + 0x104], eax
call fcn.004011b0
jmp 0x40dcd7
push edi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, dword [ebp - 0x81c]
push ebx
mov ecx, edi
call fcn.00419fc0
test eax, eax
jne 0x40da0d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x104], eax
lea edi, [esi + 0x100]
test eax, eax
je 0x40d9fe
push eax
push str.Failed_to_save_the_specified_resource._Error:__d.
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
mov edx, str.Failed_to_save_the_specified_resource.
call fcn.004011b0
jmp 0x40dcd7
mov eax, dword [esi + 0x124]
push eax
mov eax, edi
mov ebx, esi
call fcn.00408c70
test al, al
je 0x40dcd7
call fcn.0040f3d0
test al, al
je 0x40dcd5
xor eax, eax
push 0x44
push eax
lea ecx, [ebp - 0x890]
push ecx
mov dword [ebp - 0x83c], eax
mov dword [ebp - 0x838], eax
mov dword [ebp - 0x834], eax
mov dword [ebp - 0x830], eax
call fcn.00449910
mov ebx, dword [ebp - 0x820]
add esp, 0xc
push ebx
lea edx, [ebp - 0x810]
push 0x400
push edx
call fcn.004461f0
mov esi, dword [ebp - 0x814]
mov ecx, dword [esi + 0xf4]
mov edx, dword [esi + 0xf0]
add esp, 0xc
push 1
push ecx
push edx
push 0
push 0
push 0
mov eax, 6
push 0
push ecx
mov word [ebp - 0x860], ax
lea eax, [ebx - 0x10]
mov dword [ebp - 0x890], 0x44
mov dword [ebp - 0x864], 1
mov dword [ebp - 0x828], esp
mov edi, esp
call fcn.004218e0
push 0x1003
add eax, 0x10
push esi
mov dword [edi], eax
call fcn.0040cf30
test al, al
je 0x40dcd7
lea eax, [ebp - 0x83c]
push eax
xor edi, edi
lea ecx, [ebp - 0x890]
push ecx
push edi
push edi
push 0x20
push edi
push edi
push edi
lea edx, [ebp - 0x810]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x40db43
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
cmp eax, edi
mov dword [ecx + 0x104], eax
lea edi, [ecx + 0x100]
je 0x40db34
push eax
push str.Failed_to_run_setup.exe._Error:__d.
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
mov edx, str.Failed_to_run_setup.exe.
call fcn.004011b0
jmp 0x40dcd7
mov eax, dword [ebp - 0x83c]
mov ebx, dword [ebp - 0x834]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40db96
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
cmp eax, edi
mov dword [ecx + 0x104], eax
lea edi, [ecx + 0x100]
je 0x40db87
push eax
push str.Failed_to_wait_for_setup.exe_process_to_complete._Error:__d.
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
mov edx, str.Failed_to_wait_for_setup.exe_process_to_complete.
call fcn.004011b0
jmp 0x40dcd7
mov edx, dword [ebp - 0x83c]
lea ecx, [ebp - 0x844]
push ecx
push edx
mov dword [ebp - 0x844], edi
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
jne 0x40dbee
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
cmp eax, edi
mov dword [ecx + 0x104], eax
lea edi, [ecx + 0x100]
je 0x40dbdf
push eax
push str.Failed_to_get_setup.exe_return_code._Error:__d.
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
mov edx, str.Failed_to_get_setup.exe_return_code.
call fcn.004011b0
jmp 0x40dcd7
mov eax, dword [ebp - 0x844]
cmp eax, edi
je 0x40dc34
cmp eax, 0x642
mov eax, esi
mov dword [eax + 0x104], edi
lea esi, [eax + 0x100]
je 0x40dc1d
call fcn.004013e0
mov esi, dword [ebp - 0x814]
jmp 0x40dcd7
mov byte [eax + 0x109], 1
call fcn.004013e0
mov esi, dword [ebp - 0x814]
jmp 0x40dcd7
mov eax, dword [esi + 0x84]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, edi
jne 0x40dc52
mov byte [ebp - 0x815], 1
jmp 0x40dcd7
cmp eax, 0x102
jne 0x40dc9c
push ebx
call fcn.0040df90
test al, al
je 0x40dc78
push ebx
call fcn.0040de00
push edi
mov ecx, esi
call fcn.0040e1f0
call fcn.00408c40
jmp 0x40dcd7
push 0x80004005
push str.The_time_out_interval_elapsed_for_setup.exe._Error:__d.
lea edi, [esi + 0x100]
mov dword [esi + 0x104], 0x80004005
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
cmp eax, 0xffffffff
jne 0x40dcd7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
mov dword [ecx + 0x104], eax
lea edi, [ecx + 0x100]
test eax, eax
je 0x40dcc9
push eax
push str.Failed_to_wait_the_setup.exe_return_code._Error:__d.
call fcn.00422e30
add esp, 8
jmp 0x40dcd7
mov edx, str.Failed_to_wait_the_setup.exe_return_code.
call fcn.004011b0
jmp 0x40dcd7
mov esi, ebx
mov eax, dword [ebp - 0x83c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40dcea
push eax
call edi
mov eax, dword [ebp - 0x838]
test eax, eax
je 0x40dcf7
push eax
call edi
mov ebx, dword [ebp - 0x81c]
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40dd0f
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
call fcn.0040fa60
mov eax, dword [esi + 0x148]
test eax, eax
je 0x40dd4c
push 0x4e20
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esi + 0x148]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov edx, dword [esi + 0x148]
push edx
call edi
mov dword [esi + 0x148], 0
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x82c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dd72
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dd92
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x820]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ddb8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x840]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ddde
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, byte [ebp - 0x815]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00445447
mov esp, ebp
pop ebp
ret