Function at 0x408044
Capabilities:
Check if file exists
Create process on windows
Delete file
Get common file path
Get file attributes
Set registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1c4c
call fcn.00412560
mov eax, dword [0x41f044]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov ebx, 0x206
push ebx
mov word [ebp - 0x3d0], ax
xor esi, esi
lea eax, [ebp - 0x3ce]
push esi
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
push ebx
mov word [ebp - 0xdf8], ax
lea eax, [ebp - 0xdf6]
push esi
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
push ebx
mov word [ebp - 0xbf0], ax
lea eax, [ebp - 0xbee]
push esi
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
push 7
mov word [ebp - 0x24], ax
pop ecx
lea edi, [ebp - 0x22]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
push 0x7e
mov word [ebp - 0x148], ax
lea eax, [ebp - 0x146]
push esi
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0xc8], ax
lea eax, [ebp - 0xc6]
push esi
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0x1c8], ax
lea eax, [ebp - 0x1c6]
push esi
push eax
mov dword [ebp - 0x1c38], esi
call fcn.00410730
add esp, 0xc
xor eax, eax
push ebx
mov word [ebp - 0x7e0], ax
lea eax, [ebp - 0x7de]
push esi
push eax
mov dword [ebp - 0x1c34], esi
call fcn.00410730
add esp, 0xc
push 7
xor eax, eax
pop ecx
mov word [ebp - 0x44], ax
lea edi, [ebp - 0x42]
rep stosd dword es:[edi], eax
push 0x200
stosw word es:[edi], ax
xor edi, edi
mov dword [ebp - 0x1c44], esi
push esi
lea eax, [ebp - 0x17f8]
push eax
call fcn.00410730
add esp, 0xc
push 1
lea ebx, [ebp - 0x17f8]
call fcn.00403e42
pop ecx
push esi
lea ebx, [ebp - 0x1c30]
mov dword [ebp - 0x1c4c], eax
call fcn.00403e42
pop ecx
mov dword [ebp - 0x1c48], eax
mov ebx, 0x104
push ebx
lea eax, [ebp - 0xdf8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x3d0]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0x41d534
lea eax, [ebp - 0x3d0]
push ebx
push eax
call fcn.00409aa9
lea eax, [ebp - 0x3d0]
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
add eax, 2
cmp dx, si
jne 0x4081ce
sub eax, ecx
sar eax, 1
je 0x4081fe
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4081fe
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x1c4c], esi
je 0x40847b
lea eax, [ebp - 0x3d0]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x3d0]
push ebx
push eax
call fcn.00409aa9
add esp, 0xc
mov edi, 0x41b434
push edi
lea eax, [ebp - 0x3d0]
push ebx
push eax
call fcn.00409aa9
lea eax, [ebp - 0x3d0]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x40824e
sub eax, edx
sar eax, 1
je 0x4082a9
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4082a9
xor eax, eax
movzx ecx, word [ebp + eax - 0x1670]
mov word [ebp + eax - 0x1a08], cx
add eax, 2
cmp cx, si
jne 0x408273
push edi
lea eax, [ebp - 0x1a08]
push ebx
push eax
call fcn.00409aa9
add esp, 0xc
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x1650]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00409022
add esp, 0xc
lea ebx, [ebp - 0x3d0]
lea edi, [ebp - 0x1650]
call fcn.004017a4
mov esi, edi
call fcn.00407ef9
cmp eax, 1
jne 0x4082e2
xor eax, eax
jmp 0x40898a
xor eax, eax
mov esi, 0x206
push esi
mov word [ebp - 0x5d8], ax
xor ebx, ebx
lea eax, [ebp - 0x5d6]
push ebx
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0x9e8], ax
lea eax, [ebp - 0x9e6]
push ebx
push eax
call fcn.00410730
add esp, 0xc
xor eax, eax
movzx ecx, word [ebp + eax - 0x1650]
mov word [ebp + eax - 0x5d8], cx
add eax, 2
cmp cx, bx
jne 0x40831f
xor eax, eax
movzx ecx, word [ebp + eax - 0x1650]
mov word [ebp + eax - 0x9e8], cx
add eax, 2
cmp cx, bx
jne 0x408339
lea edi, [ebp - 0x9e8]
sub edi, 2
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x40835a
mov esi, 0x41d4dc
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x5d8]
push eax
movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.KERNEL32.dll_OpenEventW]
push ebx
mov edi, 0x20000
push edi
call esi
cmp eax, ebx
je 0x4083d9
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call ebx
lea eax, [ebp - 0x9e8]
push eax
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
and dword [ebp - 0x1c34], 0
jmp 0x4083c9
cmp dword [ebp - 0x1c34], 5
jge 0x4083d9
push eax
call ebx
inc dword [ebp - 0x1c34]
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x5d8]
push eax
push 0
push edi
call esi
test eax, eax
jne 0x4083ac
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
xor eax, eax
movzx ecx, word [ebp + eax - 0x1772]
mov word [ebp + eax - 0x148], cx
add eax, 2
test cx, cx
jne 0x4083f3
xor eax, eax
movzx ecx, word [ebp + eax - 0x17f4]
mov word [ebp + eax - 0xc8], cx
add eax, 2
test cx, cx
jne 0x40840d
movzx eax, word [ebp - 0x1774]
mov dword [ebp - 0x1c38], eax
xor eax, eax
movzx ecx, word [ebp + eax - 0x1752]
mov word [ebp + eax - 0x1c8], cx
add eax, 2
test cx, cx
jne 0x408434
movzx eax, word [ebp - 0x16d2]
mov edi, dword [ebp - 0x1630]
mov dword [ebp - 0x1c34], eax
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x44]
push 0x10
push eax
call fcn.00409022
mov ebx, 0x104
jmp 0x408520
cmp dword [0x41ff30], 3
jne 0x408525
push 0x236
lea eax, [ebp - 0x1a30]
push esi
push eax
call fcn.00410730
add esp, 0xc
lea esi, [ebp - 0x1a30]
call fcn.00401c14
mov dword [ebp - 0x1c44], eax
test eax, eax
je 0x408523
xor eax, eax
movzx ecx, word [ebp + eax - 0x1922]
mov word [ebp + eax - 0x148], cx
add eax, 2
test cx, cx
jne 0x4084b4
mov edx, dword [ebp - 0x192a]
lea esi, [ebp - 0xc8]
call fcn.00401522
movzx eax, word [ebp - 0x1926]
mov edx, dword [ebp - 0x1930]
lea esi, [ebp - 0x1c8]
mov dword [ebp - 0x1c38], eax
call fcn.00401522
movzx eax, word [ebp - 0x192c]
mov edi, dword [ebp - 0x1a28]
mov dword [ebp - 0x1c34], eax
lea eax, [ebp - 0x1902]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00409022
add esp, 0xc
xor esi, esi
cmp dword [ebp - 0x1c48], esi
je 0x40860d
xor eax, eax
movzx ecx, word [ebp + eax - 0x1baa]
mov word [ebp + eax - 0x148], cx
add eax, 2
cmp cx, si
jne 0x408533
xor eax, eax
movzx ecx, word [ebp + eax - 0x1c2c]
mov word [ebp + eax - 0xc8], cx
add eax, 2
cmp cx, si
jne 0x40854d
movzx eax, word [ebp - 0x1bac]
mov dword [ebp - 0x1c38], eax
xor eax, eax
movzx ecx, word [eax + 0x41d510]
mov word [ebp + eax - 0x1c8], cx
add eax, 2
cmp cx, si
jne 0x408574
cmp dword [0x41ff30], 3
movzx eax, word [ebp - 0x1b0a]
push 5
mov dword [ebp - 0x1c34], eax
pop edi
lea eax, [ebp - 0x7e0]
je 0x4085b4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
jmp 0x4085d1
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x41b29c
lea eax, [ebp - 0x7e0]
push ebx
push eax
call fcn.00409aa9
add esp, 0xc
xor eax, eax
movzx ecx, word [ebp + eax - 0x7e0]
mov word [ebp + eax - 0xbf0], cx
add eax, 2
cmp cx, si
jne 0x4085d3
push 0x41b418
lea eax, [ebp - 0xbf0]
push ebx
push eax
call fcn.00409aa9
add esp, 0xc
lea eax, [ebp - 0xbf0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x200
lea eax, [ebp - 0x17f8]
push esi
push eax
call fcn.00410730
add esp, 0xc
push 0x51
pop eax
mov word [ebp - 0x1774], ax
mov dword [ebp - 0x17f8], 0x504d534d
xor eax, eax
movzx ecx, word [eax + 0x41d4e8]
mov word [ebp + eax - 0x17f4], cx
add eax, 2
cmp cx, si
jne 0x408638
mov eax, 0x2b66
mov word [ebp - 0x16d2], ax
xor eax, eax
movzx ecx, word [eax + 0x41d510]
mov word [ebp + eax - 0x1752], cx
add eax, 2
cmp cx, si
jne 0x40865d
xor eax, eax
movzx ecx, word [eax + 0x41d504]
mov word [ebp + eax - 0x1772], cx
add eax, 2
cmp cx, si
jne 0x408676
mov dword [ebp - 0x1630], 5
cmp dword [ebp - 0x1c4c], esi
jne 0x4086af
cmp dword [ebp - 0x1c44], esi
jne 0x4086af
cmp dword [ebp - 0x1c48], esi
je 0x40872b
lea eax, [ebp - 0x148]
push eax
push 0x10
pop ebx
lea eax, [ebp - 0x1772]
push ebx
push eax
call fcn.00409022
add esp, 0xc
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x17f4]
push 0x40
push eax
call fcn.00409022
mov ax, word [ebp - 0x1c38]
mov word [ebp - 0x1774], ax
add esp, 0xc
lea eax, [ebp - 0x1c8]
push eax
lea eax, [ebp - 0x1752]
push 0x40
push eax
call fcn.00409022
mov ax, word [ebp - 0x1c34]
add esp, 0xc
mov word [ebp - 0x16d2], ax
mov dword [ebp - 0x1630], edi
cmp edi, esi
jne 0x40872e
mov dword [ebp - 0x1630], 5
jmp 0x40872e
push 0x10
pop ebx
cmp word [ebp - 0x17f4], si
je 0x408987
cmp word [ebp - 0x1774], si
jbe 0x408987
mov dword [ebp - 0x17f8], 0x504d534d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.004090b3
xor eax, eax
mov word [ebp - 0x15f8], ax
mov dword [esp], 0x7fe
lea eax, [ebp - 0x15f6]
push esi
push eax
call fcn.00410730
add esp, 0xc
cmp word [ebp - 0x16d0], si
jne 0x4087ab
lea eax, [ebp - 0x15f8]
push eax
call fcn.0040102e
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x16d0]
push ebx
push eax
call fcn.00409022
add esp, 0xc
cmp word [ebp - 0x16b0], si
jne 0x4087d8
lea eax, [ebp - 0x15f8]
push eax
call fcn.0040102e
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x16b0]
push ebx
push eax
call fcn.00409022
add esp, 0xc
cmp word [ebp - 0x1670], si
jne 0x408805
lea eax, [ebp - 0x15f8]
push eax
call fcn.0040102e
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1670]
push ebx
push eax
call fcn.00409022
add esp, 0xc
cmp word [ebp - 0x1650], si
jne 0x40885d
lea eax, [ebp - 0x15f8]
push eax
call fcn.0040102e
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1650]
push ebx
push eax
call fcn.00409022
lea eax, [ebp - 0x24]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x408838
sub eax, edx
sar eax, 1
je 0x40885d
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1650]
push ebx
push eax
call fcn.00409022
add esp, 0xc
lea eax, [ebp - 0x44]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x408863
sub eax, edx
sar eax, 1
je 0x408888
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x1690]
push ebx
push eax
call fcn.00409022
add esp, 0xc
cmp word [ebp - 0x1690], si
jne 0x4088b5
lea eax, [ebp - 0x15f8]
push eax
call fcn.0040102e
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1690]
push ebx
push eax
call fcn.00409022
add esp, 0xc
mov dword [ebp - 0x162c], 0x10001f2
cmp dword [ebp - 0x1630], esi
jne 0x4088d1
mov dword [ebp - 0x1630], 5
lea eax, [ebp - 0x17f8]
push eax
call fcn.00403ece
pop ecx
test eax, eax
je 0x408987
lea ebx, [ebp - 0x3d0]
lea edi, [ebp - 0x1650]
call fcn.004017a4
mov eax, ebx
push eax
lea eax, [ebp - 0xdf8]
push eax
call fcn.00407f94
pop ecx
pop ecx
lea eax, [ebp - 0x1c40]
push eax
push 3
push esi
push 0x41d550
push connect
mov dword [ebp - 0x1c40], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x408970
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x408931
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
lea eax, [ebp - 0x3d0]
push eax
push 1
push esi
push 0x41d5bc
push dword [ebp - 0x1c40]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x408970
push dword [ebp - 0x1c40]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 1
push esi
push 0x41b430
lea eax, [ebp - 0x3d0]
push eax
push esi
push esi
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00409013
leave
ret