Function at 0x407850
Capabilities:
Copy file
Create process on windows
Create thread
Delete file
Get common file path
Move file

Disassembly:
mov eax, 0x1588
call fcn.0040fae0
mov eax, dword [str._q_]
xor eax, esp
push ebx
mov ebx, dword [esp + 0x1590]
push ebp
push esi
mov esi, ecx
mov dword [esp + 0x1590], eax
mov eax, dword [esp + 0x15a0]
lea ebp, [esi + 0xd8]
push eax
mov ecx, ebp
mov dword [esp + 0x10], eax
call fcn.00405260
test eax, eax
jne 0x40782d
mov eax, dword [esi + 0xdc]
test eax, eax
push edi
je 0x407654
cmp dword [ebp], 0
jne 0x40748f
mov eax, dword [esi + 0x138]
test eax, eax
jne 0x40748f
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
push 0x104
lea eax, [esp + 0x198]
push eax
push 0x6b
push ebx
call edi
push 0x200
lea ecx, [esp + 0x398]
push ecx
push 0x6c
push ebx
call edi
mov eax, dword [esi + 0xe8]
test eax, eax
jne 0x40748f
push 1
lea edx, [esp + 0x198]
push edx
lea eax, [esp + 0x39c]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
jne 0x40748f
push str.Setup_is_cancelled_by_user.
push ebp
call fcn.00404120
add esp, 8
mov eax, 0x642
jmp 0x40782c
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x104
lea ecx, [esp + 0x94]
push ecx
push 0
call edi
lea edx, [esp + 0x90]
push 0x5c
push edx
call fcn.0040f216
mov cl, byte [eax]
add esp, 8
test cl, cl
je 0x4074c1
mov byte [eax], 0
mov eax, dword [esi + 0xfc]
push 1
push eax
lea ecx, [esp + 0x98]
push ecx
call fcn.00401990
add esp, 0xc
test eax, eax
je 0x407654
push 0x104
lea edx, [esp + 0x94]
push edx
push 0
call edi
lea eax, [esp + 0x394]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [esp + 0x194]
push ecx
push 0
push 0x41c134
lea edx, [esp + 0x3a0]
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea eax, [esp + 0x194]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [esp + 0x194]
push 0x2e
push ecx
call fcn.0040f216
add esp, 8
test eax, eax
je 0x40754a
mov byte [eax], 0
lea edi, [esp + 0x194]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x407552
mov edx, dword [str..exe]
mov al, byte [0x41c130]
push 0
mov dword [edi], edx
lea ecx, [esp + 0x198]
push ecx
lea edx, [esp + 0x98]
push edx
mov byte [edi + 4], al
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x40763b
mov eax, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x198]
push ecx
lea edx, [esp + 0x59c]
push str.__s___t__s
push edx
call fcn.0040f6f9
lea eax, [esp + 0x5a4]
push eax
push str.Run___s__to_perform_uninstallation.
lea ebp, [esi + 0xd8]
push ebp
call fcn.00404120
add esp, 0x1c
xor eax, eax
mov ecx, 0x11
lea edi, [esp + 0x4c]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x50]
push edx
push eax
push eax
push 0x20
push eax
push eax
push eax
lea eax, [esp + 0x5b4]
push eax
push 0
mov dword [esp + 0x74], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x40762e
mov ecx, dword [esp + 0x20]
push 0x2710
push ecx
call dword [sym.imp.USER32.dll_WaitForInputIdle]
mov edx, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov eax, dword [esp + 0x20]
push eax
call esi
push str.Process_is_started.
push ebp
jmp 0x407822
push str.New_process_is_not_started._Continue_to_uninstallation_in_same_process.
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40764c
push str.Couldnt_copy_file._Continue_to_uninstallation_in_same_process.
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebp, [esi + 0xd8]
mov ecx, ebp
push eax
call fcn.004041b0
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
push 0x64
lea ecx, [esi + 0x10]
push ecx
push 0x67
push ebx
call edi
push 0x64
lea edx, [esi + 0x74]
push edx
push 0x6d
push ebx
call edi
push ebx
mov ecx, esi
call fcn.00407330
lea eax, [esp + 0x14]
push eax
mov dword [esp + 0x18], 8
mov dword [esp + 0x1c], 0xff
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
mov ecx, dword [esp + 0x15a8]
push ecx
push ebx
mov ecx, esi
call fcn.00407000
test eax, eax
jne 0x4076bd
push str.Failed_to_initialize_the_window_instance_
push ebp
call fcn.00404120
add esp, 8
or eax, 0xffffffff
jmp 0x40782c
lea edx, [esp + 0x1c]
push edx
push 0
push 0
push 0x406ed0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov edi, eax
test edi, edi
mov dword [esp + 0x10], edi
jne 0x4076f5
push str.Failed_to_create_installation_thread_
push ebp
call fcn.00404120
add esp, 8
or eax, 0xffffffff
jmp 0x40782c
push 0
push 0
push 0
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.USER32.dll_GetMessageA]
test eax, eax
je 0x40775e
mov edi, dword [sym.imp.USER32.dll_IsWindow]
mov ebp, dword [sym.imp.USER32.dll_IsDialogMessageA]
mov eax, dword [esi + 0xc]
push eax
call edi
test eax, eax
je 0x40772f
mov eax, dword [esi + 0xc]
lea ecx, [esp + 0x30]
push ecx
push eax
call ebp
test eax, eax
jne 0x407745
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 0
push 0
push 0
lea ecx, [esp + 0x3c]
push ecx
call dword [sym.imp.USER32.dll_GetMessageA]
test eax, eax
jne 0x407716
mov edi, dword [esp + 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x138]
test eax, eax
je 0x4077b4
push 0x104
lea edx, [esp + 0x94]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov eax, dword [esi + 0x12c]
test eax, eax
jne 0x4077a2
push 4
push 0
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
jmp 0x4077b4
lea ecx, [esp + 0x90]
push ecx
push 0
call fcn.00402200
add esp, 8
mov eax, dword [esi + 0xd8]
test eax, eax
lea edi, [esi + 0xd8]
jne 0x40781c
mov eax, dword [esi + 0xe8]
test eax, eax
jne 0x40781c
mov eax, dword [esi + 0x134]
test eax, eax
je 0x40781c
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
push 0x104
lea edx, [esp + 0x398]
push edx
push 0x67
push ebx
call esi
push 0x200
lea eax, [esp + 0x198]
push eax
push 0x7e
push ebx
call esi
push 0
lea ecx, [esp + 0x398]
push ecx
lea edx, [esp + 0x19c]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push str.Agent_setup_finished_
push edi
call fcn.00404120
add esp, 8
xor eax, eax
pop edi
mov ecx, dword [esp + 0x1590]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040f175
add esp, 0x1588
ret 0x10
mov ecx, 0x4224e8
jmp 0x4073c0