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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1c54
call fcn.004188b0
mov eax, dword [0x434c24]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x42d858
call fcn.00401000
pop ecx
xor eax, eax
mov esi, 0x206
push esi
mov word [ebp - 0x350], ax
xor ebx, ebx
lea eax, [ebp - 0x34e]
push ebx
push eax
call fcn.00416400
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0xdf8], ax
lea eax, [ebp - 0xdf6]
push ebx
push eax
call fcn.00416400
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0xbf0], ax
lea eax, [ebp - 0xbee]
push ebx
push eax
call fcn.00416400
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 - 0x3d0], ax
lea eax, [ebp - 0x3ce]
push ebx
push eax
call fcn.00416400
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0xc8], ax
lea eax, [ebp - 0xc6]
push ebx
push eax
call fcn.00416400
add esp, 0xc
xor eax, eax
push 0x7e
mov word [ebp - 0x148], ax
lea eax, [ebp - 0x146]
push ebx
push eax
mov dword [ebp - 0x1c38], ebx
call fcn.00416400
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0x7e0], ax
lea eax, [ebp - 0x7de]
push ebx
push eax
mov dword [ebp - 0x1c3c], ebx
call fcn.00416400
add esp, 0xc
xor eax, eax
push 7
mov word [ebp - 0x44], ax
pop ecx
lea edi, [ebp - 0x42]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [ebp - 0x1c34], ebx
push 0x200
lea eax, [ebp - 0x17f8]
push ebx
push eax
mov dword [ebp - 0x1c48], ebx
call fcn.00416400
add esp, 0xc
push 1
lea edi, [ebp - 0x17f8]
call fcn.004062a2
pop ecx
push ebx
lea edi, [ebp - 0x1c30]
mov dword [ebp - 0x1c50], eax
call fcn.004062a2
pop ecx
mov dword [ebp - 0x1c4c], eax
mov edi, 0x104
push edi
lea eax, [ebp - 0xdf8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x350]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0x42d898
lea eax, [ebp - 0x350]
push edi
push eax
call fcn.00413fb9
lea eax, [ebp - 0x350]
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x4017f8
sub eax, ecx
sar eax, 1
je 0x401827
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401827
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x1c50], ebx
je 0x401b0c
push 0x42d8b0
call fcn.00401000
pop ecx
lea eax, [ebp - 0x350]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x350]
push edi
push eax
call fcn.00413fb9
add esp, 0xc
mov esi, 0x42d830
push esi
lea eax, [ebp - 0x350]
push edi
push eax
call fcn.00413fb9
lea eax, [ebp - 0x350]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x401882
sub eax, edx
sar eax, 1
je 0x4018f9
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4018f9
xor eax, eax
movzx ecx, word [ebp + eax - 0x1670]
mov word [ebp + eax - 0x1a08], cx
inc eax
inc eax
cmp cx, bx
jne 0x4018a6
push esi
lea eax, [ebp - 0x1a08]
push edi
push eax
call fcn.00413fb9
add esp, 0xc
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
lea eax, [ebp - 0x350]
push eax
je 0x4018ed
push 0x42d8e0
jmp 0x4018f2
push 0x42d8f8
call fcn.00401000
pop ecx
pop ecx
lea eax, [ebp - 0x1650]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00413daa
add esp, 0xc
lea ebx, [ebp - 0x350]
lea edi, [ebp - 0x1650]
call fcn.00403922
mov esi, edi
call fcn.004014f2
cmp eax, 1
jne 0x40193d
push 0x42d910
call fcn.00401000
pop ecx
xor eax, eax
jmp 0x40205f
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.00416400
add esp, 0xc
xor eax, eax
push esi
mov word [ebp - 0x9e8], ax
lea eax, [ebp - 0x9e6]
push ebx
push eax
call fcn.00416400
add esp, 0xc
xor eax, eax
movzx ecx, word [ebp + eax - 0x1650]
mov word [ebp + eax - 0x5d8], cx
inc eax
inc eax
cmp cx, bx
jne 0x40197a
xor eax, eax
movzx ecx, word [ebp + eax - 0x1650]
mov word [ebp + eax - 0x9e8], cx
inc eax
inc eax
cmp cx, bx
jne 0x401993
lea edi, [ebp - 0x9e8]
dec edi
dec edi
mov ax, word [edi + 2]
inc edi
inc edi
cmp ax, bx
jne 0x4019b2
mov esi, 0x42d7e8
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 0x401a3f
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]
test eax, eax
jne 0x401a09
push 0x42d934
call fcn.00401000
pop ecx
and dword [ebp - 0x1c34], 0
jmp 0x401a2f
cmp dword [ebp - 0x1c34], 5
jge 0x401a3f
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 0x401a12
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
mov eax, 0x42d95c
jne 0x401a65
mov eax, 0x42d964
push eax
lea eax, [ebp - 0x350]
push eax
push 0x42d96c
call fcn.00401000
add esp, 0xc
xor eax, eax
movzx ecx, word [ebp + eax - 0x1772]
mov word [ebp + eax - 0x3d0], cx
inc eax
inc eax
test cx, cx
jne 0x401a7c
xor eax, eax
movzx ecx, word [ebp + eax - 0x17f4]
mov word [ebp + eax - 0xc8], cx
inc eax
inc eax
test cx, cx
jne 0x401a95
movzx eax, word [ebp - 0x1774]
mov dword [ebp - 0x1c38], eax
xor eax, eax
movzx ecx, word [ebp + eax - 0x1752]
mov word [ebp + eax - 0x148], cx
inc eax
inc eax
test cx, cx
jne 0x401abb
movzx eax, word [ebp - 0x16d2]
mov dword [ebp - 0x1c3c], eax
mov eax, dword [ebp - 0x1630]
mov dword [ebp - 0x1c34], eax
lea eax, [ebp - 0x1670]
push eax
lea eax, [ebp - 0x44]
push 0x10
push eax
call fcn.00413daa
add esp, 0xc
xor ebx, ebx
mov edi, 0x104
jmp 0x401bb9
cmp dword [0x435f90], 3
jne 0x401bb9
push 0x236
lea eax, [ebp - 0x1a30]
push ebx
push eax
call fcn.00416400
add esp, 0xc
lea esi, [ebp - 0x1a30]
call fcn.0040403c
mov dword [ebp - 0x1c48], eax
cmp eax, ebx
je 0x401bb9
xor eax, eax
movzx ecx, word [ebp + eax - 0x1922]
mov word [ebp + eax - 0x3d0], cx
inc eax
inc eax
cmp cx, bx
jne 0x401b45
mov edx, dword [ebp - 0x192a]
lea esi, [ebp - 0xc8]
call fcn.0040369e
movzx eax, word [ebp - 0x1926]
mov edx, dword [ebp - 0x1930]
lea esi, [ebp - 0x148]
mov dword [ebp - 0x1c38], eax
call fcn.0040369e
movzx eax, word [ebp - 0x192c]
mov dword [ebp - 0x1c3c], eax
mov eax, dword [ebp - 0x1a28]
mov dword [ebp - 0x1c34], eax
lea eax, [ebp - 0x1902]
push eax
lea eax, [ebp - 0x24]
push 0x10
push eax
call fcn.00413daa
add esp, 0xc
cmp dword [ebp - 0x1c4c], ebx
je 0x401ca0
xor eax, eax
movzx ecx, word [ebp + eax - 0x1baa]
mov word [ebp + eax - 0x3d0], cx
inc eax
inc eax
cmp cx, bx
jne 0x401bc7
xor eax, eax
movzx ecx, word [ebp + eax - 0x1c2c]
mov word [ebp + eax - 0xc8], cx
inc eax
inc eax
cmp cx, bx
jne 0x401be0
movzx eax, word [ebp - 0x1bac]
mov dword [ebp - 0x1c38], eax
xor eax, eax
movzx ecx, word [eax + 0x42d980]
mov word [ebp + eax - 0x148], cx
inc eax
inc eax
cmp cx, bx
jne 0x401c06
cmp dword [0x435f90], 3
movzx esi, word [ebp - 0x1b0a]
mov dword [ebp - 0x1c34], 5
lea eax, [ebp - 0x7e0]
je 0x401c46
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
jmp 0x401c63
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x42d7e4
lea eax, [ebp - 0x7e0]
push edi
push eax
call fcn.00413fb9
add esp, 0xc
xor eax, eax
movzx ecx, word [ebp + eax - 0x7e0]
mov word [ebp + eax - 0xbf0], cx
inc eax
inc eax
cmp cx, bx
jne 0x401c65
push 0x42d99c
lea eax, [ebp - 0xbf0]
push edi
push eax
call fcn.00413fb9
add esp, 0xc
lea eax, [ebp - 0xbf0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x401ca6
mov esi, dword [ebp - 0x1c3c]
push 0x200
lea eax, [ebp - 0x17f8]
push ebx
push eax
call fcn.00416400
add esp, 0xc
push 0x51
pop eax
mov word [ebp - 0x1774], ax
mov dword [ebp - 0x17f8], 0x504d534d
xor eax, eax
movzx ecx, word [eax + 0x42d9b4]
mov word [ebp + eax - 0x17f4], cx
inc eax
inc eax
cmp cx, bx
jne 0x401cd1
mov eax, 0x2b66
mov word [ebp - 0x16d2], ax
xor eax, eax
movzx ecx, word [eax + 0x42d980]
mov word [ebp + eax - 0x1752], cx
inc eax
inc eax
cmp cx, bx
jne 0x401cf5
xor eax, eax
movzx ecx, word [eax + 0x42d9d0]
mov word [ebp + eax - 0x1772], cx
inc eax
inc eax
cmp cx, bx
jne 0x401d0d
mov dword [ebp - 0x1630], 5
cmp dword [ebp - 0x1c50], ebx
jne 0x401d45
cmp dword [ebp - 0x1c48], ebx
jne 0x401d45
cmp dword [ebp - 0x1c4c], ebx
je 0x401dc0
lea eax, [ebp - 0x3d0]
push eax
push 0x10
pop edi
lea eax, [ebp - 0x1772]
push edi
push eax
call fcn.00413daa
add esp, 0xc
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x17f4]
push 0x40
push eax
call fcn.00413daa
mov ax, word [ebp - 0x1c38]
mov word [ebp - 0x1774], ax
add esp, 0xc
lea eax, [ebp - 0x148]
push eax
lea eax, [ebp - 0x1752]
push 0x40
push eax
call fcn.00413daa
mov eax, dword [ebp - 0x1c34]
add esp, 0xc
mov word [ebp - 0x16d2], si
mov dword [ebp - 0x1630], eax
cmp eax, ebx
jne 0x401dc3
mov dword [ebp - 0x1630], 5
jmp 0x401dc3
push 0x10
pop edi
cmp word [ebp - 0x17f4], bx
je 0x402040
cmp word [ebp - 0x1774], bx
jbe 0x402040
mov dword [ebp - 0x17f8], 0x504d534d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.00414e94
xor eax, eax
mov word [ebp - 0x15f8], ax
mov dword [esp], 0x7fe
lea eax, [ebp - 0x15f6]
push ebx
push eax
call fcn.00416400
add esp, 0xc
cmp word [ebp - 0x16d0], bx
jne 0x401e40
lea eax, [ebp - 0x15f8]
push eax
call fcn.004031bb
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x16d0]
push edi
push eax
call fcn.00413daa
add esp, 0xc
cmp word [ebp - 0x16b0], bx
jne 0x401e6d
lea eax, [ebp - 0x15f8]
push eax
call fcn.004031bb
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x16b0]
push edi
push eax
call fcn.00413daa
add esp, 0xc
cmp word [ebp - 0x1670], bx
jne 0x401e9a
lea eax, [ebp - 0x15f8]
push eax
call fcn.004031bb
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1670]
push edi
push eax
call fcn.00413daa
add esp, 0xc
cmp word [ebp - 0x1650], bx
jne 0x401ef1
lea eax, [ebp - 0x15f8]
push eax
call fcn.004031bb
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1650]
push edi
push eax
call fcn.00413daa
lea eax, [ebp - 0x24]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x401ecd
sub eax, edx
sar eax, 1
je 0x401ef1
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1650]
push edi
push eax
call fcn.00413daa
add esp, 0xc
lea eax, [ebp - 0x44]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x401ef7
sub eax, edx
sar eax, 1
je 0x401f1b
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x1690]
push edi
push eax
call fcn.00413daa
add esp, 0xc
cmp word [ebp - 0x1690], bx
jne 0x401f48
lea eax, [ebp - 0x15f8]
push eax
call fcn.004031bb
pop ecx
lea eax, [ebp - 0x15f8]
push eax
lea eax, [ebp - 0x1690]
push edi
push eax
call fcn.00413daa
add esp, 0xc
mov dword [ebp - 0x162c], 0x10001d0
cmp dword [ebp - 0x1630], ebx
jne 0x401f64
mov dword [ebp - 0x1630], 5
lea eax, [ebp - 0x17f8]
push eax
call fcn.0040633b
pop ecx
test eax, eax
jne 0x401f85
push 0x42d9fc
call fcn.00401000
pop ecx
jmp 0x40205c
lea ebx, [ebp - 0x350]
lea edi, [ebp - 0x1650]
call fcn.00403922
mov eax, ebx
push eax
lea eax, [ebp - 0xdf8]
push eax
push 0x42da28
call fcn.00401000
add esp, 0xc
mov eax, ebx
push eax
lea eax, [ebp - 0xdf8]
push eax
call fcn.004015af
pop ecx
pop ecx
lea eax, [ebp - 0x1c44]
push eax
push 3
xor esi, esi
push esi
push 0x42da50
push connect
mov dword [ebp - 0x1c44], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x402027
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x401fe9
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
lea eax, [ebp - 0x350]
push eax
push 1
push esi
push 0x42dabc
push dword [ebp - 0x1c44]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x402027
push dword [ebp - 0x1c44]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 1
push esi
push 0x42dca8
lea eax, [ebp - 0x350]
push eax
push esi
push esi
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
jmp 0x40205c
movzx eax, word [ebp - 0x1774]
push eax
lea eax, [ebp - 0x17f4]
push eax
push 0x42d9dc
call fcn.00401000
add esp, 0xc
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413d9b
leave
ret