Function at 0x401954
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.004156a0
mov eax, dword [0x422044]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov esi, 0x206
push esi
mov word [ebp - 0x3d0], ax
xor ebx, ebx
lea eax, [ebp - 0x3ce]
push ebx
push eax
call fcn.00408de0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0xdf8], ax
lea eax, [ebp - 0xdf6]
push ebx
push eax
call fcn.00408de0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0xbf0], ax
lea eax, [ebp - 0xbee]
push ebx
push eax
call fcn.00408de0
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 ebx
push eax
call fcn.00408de0
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0xc8], ax
lea eax, [ebp - 0xc6]
push ebx
push eax
call fcn.00408de0
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0x1c8], ax
lea eax, [ebp - 0x1c6]
push ebx
push eax
mov dword [ebp - 0x1c3c], ebx
call fcn.00408de0
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0x7e0], ax
lea eax, [ebp - 0x7de]
push ebx
push eax
mov dword [ebp - 0x1c34], ebx
call fcn.00408de0
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
mov dword [ebp - 0x1c38], ebx
mov dword [ebp - 0x1c4c], ebx
push ebx
lea eax, [ebp - 0x17f8]
push eax
call fcn.00408de0
add esp, 0xc
push 1
lea edi, [ebp - 0x17f8]
call fcn.00408c16
pop ecx
push ebx
lea edi, [ebp - 0x1c30]
mov dword [ebp - 0x1c44], eax
call fcn.00408c16
pop ecx
mov dword [ebp - 0x1c48], eax
mov edi, 0x104
push edi
lea eax, [ebp - 0xdf8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp dword [ebp - 0x1c44], ebx
je 0x401d57
mov ebx, dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x3d0]
push eax
push edi
call ebx
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x3d0]
push edi
push eax
call fcn.00408f0a
add esp, 0xc
mov esi, 0x41dd08
push esi
lea eax, [ebp - 0x3d0]
push edi
push eax
call fcn.00408f0a
lea eax, [ebp - 0x3d0]
add esp, 0xc
push eax
call fcn.00409eec
pop ecx
test eax, eax
jbe 0x401b53
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401b53
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x1a08]
push eax
call fcn.00408eb4
push esi
lea eax, [ebp - 0x1a08]
push edi
push eax
call fcn.00408f0a
add esp, 0x14
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x3d0]
push eax
push edi
call ebx
push 0x41dd24
lea eax, [ebp - 0x3d0]
push edi
push eax
call fcn.00408f0a
lea eax, [ebp - 0x3d0]
add esp, 0xc
push eax
call fcn.00409eec
pop ecx
test eax, eax
jbe 0x401ba2
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401ba2
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea esi, [ebp - 0x1650]
call fcn.00401808
cmp eax, 1
jne 0x401bb9
xor eax, eax
jmp 0x40226b
lea eax, [ebp - 0x1650]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00409325
add esp, 0xc
lea ebx, [ebp - 0x3d0]
lea edi, [ebp - 0x1650]
call fcn.004031a3
xor eax, eax
mov edi, 0x206
push edi
mov word [ebp - 0x5d8], ax
xor esi, esi
lea eax, [ebp - 0x5d6]
push esi
push eax
call fcn.00408de0
add esp, 0xc
xor eax, eax
push edi
mov word [ebp - 0x9e8], ax
lea eax, [ebp - 0x9e6]
push esi
push eax
call fcn.00408de0
add esp, 0xc
lea eax, [ebp - 0x1650]
push eax
lea eax, [ebp - 0x5d8]
push eax
call fcn.00408eb4
lea eax, [ebp - 0x1650]
push eax
lea eax, [ebp - 0x9e8]
push eax
call fcn.00408eb4
lea eax, [ebp - 0x9e8]
push 0x41dc9c
push eax
call fcn.00408e86
mov edi, dword [sym.imp.KERNEL32.dll_OpenEventW]
add esp, 0x18
lea eax, [ebp - 0x5d8]
push eax
push esi
mov ebx, 0x20000
push ebx
call edi
cmp eax, esi
je 0x401cbf
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
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 0x401caf
cmp dword [ebp - 0x1c34], 5
jge 0x401cbf
push eax
call esi
inc dword [ebp - 0x1c34]
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x5d8]
push eax
push 0
push ebx
call edi
test eax, eax
jne 0x401c92
push 0x5dc
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x1772]
push eax
lea eax, [ebp - 0x148]
push eax
call fcn.00408eb4
lea eax, [ebp - 0x17f4]
push eax
lea eax, [ebp - 0xc8]
push eax
call fcn.00408eb4
movzx eax, word [ebp - 0x1774]
mov dword [ebp - 0x1c3c], eax
lea eax, [ebp - 0x1752]
push eax
lea eax, [ebp - 0x1c8]
push eax
call fcn.00408eb4
movzx eax, word [ebp - 0x16d2]
mov dword [ebp - 0x1c34], eax
mov eax, dword [ebp - 0x1630]
mov dword [ebp - 0x1c38], eax
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x44]
push 0x10
push eax
call fcn.00409325
add esp, 0x24
xor ebx, ebx
mov edi, 0x104
jmp 0x401e0a
cmp dword [0x423040], 3
jne 0x401e0a
push 0x236
lea eax, [ebp - 0x1a30]
push ebx
push eax
call fcn.00408de0
add esp, 0xc
lea esi, [ebp - 0x1a30]
call fcn.0040377b
mov dword [ebp - 0x1c4c], eax
cmp eax, ebx
je 0x401e0a
lea eax, [ebp - 0x1922]
push eax
lea eax, [ebp - 0x148]
push eax
call fcn.00408eb4
mov edx, dword [ebp - 0x192a]
lea esi, [ebp - 0xc8]
call fcn.00402f19
movzx eax, word [ebp - 0x1926]
mov edx, dword [ebp - 0x1930]
lea esi, [ebp - 0x1c8]
mov dword [ebp - 0x1c3c], eax
call fcn.00402f19
movzx eax, word [ebp - 0x192c]
mov dword [ebp - 0x1c34], eax
push 4
lea eax, [ebp - 0x1a28]
push eax
lea eax, [ebp - 0x1c38]
push eax
call fcn.00408fc0
add esp, 0x14
lea eax, [ebp - 0x1902]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00409325
add esp, 0xc
mov esi, 0x41dce4
cmp dword [ebp - 0x1c48], ebx
je 0x401ee0
lea eax, [ebp - 0x1baa]
push eax
lea eax, [ebp - 0x148]
push eax
call fcn.00408eb4
lea eax, [ebp - 0x1c2c]
push eax
lea eax, [ebp - 0xc8]
push eax
call fcn.00408eb4
movzx eax, word [ebp - 0x1bac]
mov dword [ebp - 0x1c3c], eax
lea eax, [ebp - 0x1c8]
push esi
push eax
call fcn.00408eb4
movzx eax, word [ebp - 0x1b0a]
add esp, 0x18
cmp dword [0x423040], 3
mov dword [ebp - 0x1c34], eax
mov dword [ebp - 0x1c38], 5
lea eax, [ebp - 0x7e0]
je 0x401e8e
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
jmp 0x401eab
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x41dc88
lea eax, [ebp - 0x7e0]
push edi
push eax
call fcn.00408f0a
add esp, 0xc
lea eax, [ebp - 0x7e0]
push eax
lea eax, [ebp - 0xbf0]
push eax
call fcn.00408eb4
push 0x41dd3c
lea eax, [ebp - 0xbf0]
push edi
push eax
call fcn.00408f0a
add esp, 0x14
lea eax, [ebp - 0xbf0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x200
lea eax, [ebp - 0x17f8]
push ebx
push eax
call fcn.00408de0
add esp, 0xc
push 0x51
pop eax
mov word [ebp - 0x1774], ax
lea eax, [ebp - 0x17f4]
push 0x41dcbc
mov edi, 0x504d534d
push eax
mov dword [ebp - 0x17f8], edi
call fcn.00408eb4
mov eax, 0x2b66
mov word [ebp - 0x16d2], ax
lea eax, [ebp - 0x1752]
push esi
push eax
call fcn.00408eb4
lea eax, [ebp - 0x1772]
push 0x41dcd8
push eax
call fcn.00408eb4
add esp, 0x18
mov dword [ebp - 0x1630], 5
cmp dword [ebp - 0x1c44], ebx
jne 0x401f6a
cmp dword [ebp - 0x1c4c], ebx
jne 0x401f6a
cmp dword [ebp - 0x1c48], ebx
je 0x401fe8
lea eax, [ebp - 0x148]
push eax
lea eax, [ebp - 0x1772]
push 0x10
push eax
call fcn.00409325
add esp, 0xc
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x17f4]
push 0x40
push eax
call fcn.00409325
mov ax, word [ebp - 0x1c3c]
mov word [ebp - 0x1774], ax
add esp, 0xc
lea eax, [ebp - 0x1c8]
push eax
lea eax, [ebp - 0x1752]
push 0x40
push eax
call fcn.00409325
mov ax, word [ebp - 0x1c34]
mov word [ebp - 0x16d2], ax
mov eax, dword [ebp - 0x1c38]
add esp, 0xc
mov dword [ebp - 0x1630], eax
cmp eax, ebx
jne 0x401fe8
mov dword [ebp - 0x1630], 5
lea eax, [ebp - 0x1752]
push esi
push eax
call fcn.00408eb4
pop ecx
pop ecx
cmp word [ebp - 0x17f4], bx
je 0x402268
cmp word [ebp - 0x1774], bx
jbe 0x402268
mov dword [ebp - 0x17f8], edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.00408f87
xor eax, eax
mov word [ebp - 0x15f8], ax
mov dword [esp], 0x7fe
lea eax, [ebp - 0x15f6]
push ebx
push eax
call fcn.00408de0
add esp, 0xc
cmp word [ebp - 0x16d0], bx
jne 0x40207d
lea eax, [ebp - 0x15f8]
push eax
push 6
push 5
pop esi
push esi
call fcn.00402a55
add esp, 0xc
lea eax, [ebp - 0x15f8]
push eax
push 0x10
pop edi
lea eax, [ebp - 0x16d0]
push edi
push eax
call fcn.00409325
add esp, 0xc
jmp 0x402083
push 5
pop esi
push 0x10
pop edi
cmp word [ebp - 0x16b0], bx
jne 0x4020b5
lea eax, [ebp - 0x15f8]
push eax
push 6
push esi
call fcn.00402a55
add esp, 0xc
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x16b0]
push edi
push eax
call fcn.00409325
add esp, 0xc
cmp word [ebp - 0x1670], bx
jne 0x4020e7
lea eax, [ebp - 0x15f8]
push eax
push 6
push esi
call fcn.00402a55
add esp, 0xc
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1670]
push edi
push eax
call fcn.00409325
add esp, 0xc
cmp word [ebp - 0x1650], bx
jne 0x40213b
lea eax, [ebp - 0x15f8]
push eax
push 6
push esi
call fcn.00402a55
add esp, 0xc
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1650]
push edi
push eax
call fcn.00409325
lea eax, [ebp - 0x24]
add esp, 0xc
push eax
call fcn.00409eec
pop ecx
test eax, eax
jbe 0x40213b
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1650]
push edi
push eax
call fcn.00409325
add esp, 0xc
lea eax, [ebp - 0x44]
push eax
call fcn.00409eec
pop ecx
test eax, eax
je 0x40215d
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x1690]
push edi
push eax
call fcn.00409325
add esp, 0xc
cmp word [ebp - 0x1690], bx
jne 0x40218f
lea eax, [ebp - 0x15f8]
push eax
push 6
push esi
call fcn.00402a55
add esp, 0xc
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1690]
push edi
push eax
call fcn.00409325
add esp, 0xc
mov dword [ebp - 0x162c], 0x10001cb
cmp dword [ebp - 0x1630], ebx
jne 0x4021a7
mov dword [ebp - 0x1630], esi
lea eax, [ebp - 0x17f8]
push eax
call fcn.00408ca2
pop ecx
test eax, eax
je 0x402268
lea ebx, [ebp - 0x3d0]
lea edi, [ebp - 0x1650]
call fcn.004031a3
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.00408f87
pop ecx
push 0x32
push 0x64
pop eax
call fcn.00402a27
pop ecx
mov ecx, ebx
push ecx
lea ecx, [ebp - 0xdf8]
push ecx
call fcn.004018a3
pop ecx
pop ecx
lea eax, [ebp - 0x1c40]
push eax
push 3
xor esi, esi
push esi
push 0x41dd58
push closesocket
mov dword [ebp - 0x1c40], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x402251
mov eax, ebx
push eax
call fcn.00409eec
pop ecx
lea eax, [eax + eax + 2]
push eax
mov eax, ebx
push eax
push 1
push esi
push 0x41ddc4
push dword [ebp - 0x1c40]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x402251
push dword [ebp - 0x1c40]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 1
push esi
push 0x41de3c
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.00408dc8
leave
ret