Function at 0x409840
Capabilities:
Check if file exists
Copy file
Create directory
Get common file path
Get file attributes
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x428d13
mov eax, dword fs:[0]
push eax
sub esp, 0x4bc
mov eax, dword [0x43800c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
sub esp, 0x18
mov ecx, esp
push 0x43912c
call fcn.00415600
lea ecx, [ebp - 0x494]
call fcn.004029b0
add esp, 0x18
mov esi, eax
lea eax, [ebp - 0x410]
mov dword [ebp - 4], 0
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [ebp - 0x410]
mov dword [ebp - 0x464], 0
mov dword [ebp - 0x460], 0xf
lea edx, [ecx + 1]
mov byte [ebp - 0x474], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4098c8
sub ecx, edx
lea eax, [ebp - 0x410]
push ecx
push eax
lea ecx, [ebp - 0x474]
call fcn.00415960
push esi
lea edx, [ebp - 0x474]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x440]
call fcn.00415ab0
add esp, 4
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x460]
cmp edx, 0x10
jb 0x40993b
mov ecx, dword [ebp - 0x474]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x409931
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d05
push edx
push ecx
call fcn.004171d4
add esp, 8
mov dword [ebp - 0x464], 0
mov dword [ebp - 0x460], 0xf
mov byte [ebp - 0x474], 0
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x480]
cmp edx, 0x10
jb 0x409994
mov ecx, dword [ebp - 0x494]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40998a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d05
push edx
push ecx
call fcn.004171d4
add esp, 8
sub esp, 0x18
mov dword [ebp - 0x484], 0
mov ecx, esp
mov dword [ebp - 0x480], 0xf
mov byte [ebp - 0x494], 0
push 0x438d24
call fcn.00415600
lea ecx, [ebp - 0x4c4]
call fcn.004029b0
mov esi, eax
push 0x433efc
lea edx, [ebp - 0x440]
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x4ac]
call fcn.00415e30
add esp, 0x1c
push esi
mov edx, eax
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x428]
call fcn.00415ab0
add esp, 4
mov byte [ebp - 4], 8
mov edx, dword [ebp - 0x498]
cmp edx, 0x10
jb 0x409a3b
mov ecx, dword [ebp - 0x4ac]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x409a31
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d0a
push edx
push ecx
call fcn.004171d4
add esp, 8
mov dword [ebp - 0x49c], 0
mov dword [ebp - 0x498], 0xf
mov byte [ebp - 0x4ac], 0
mov byte [ebp - 4], 9
mov edx, dword [ebp - 0x4b0]
cmp edx, 0x10
jb 0x409a94
mov ecx, dword [ebp - 0x4c4]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x409a8a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d0a
push edx
push ecx
call fcn.004171d4
add esp, 8
push 0x104
lea eax, [ebp - 0x118]
mov dword [ebp - 0x4b4], 0
push eax
push 0
mov dword [ebp - 0x4b0], 0xf
mov byte [ebp - 0x4c4], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [ebp - 0x118]
mov dword [ebp - 0x448], 0
mov dword [ebp - 0x444], 0xf
lea edx, [ecx + 1]
mov byte [ebp - 0x458], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x409ae7
sub ecx, edx
lea eax, [ebp - 0x118]
push ecx
push eax
lea ecx, [ebp - 0x458]
call fcn.00415960
lea edx, [ebp - 0x458]
mov byte [ebp - 4], 0xa
lea ecx, [ebp - 0x428]
call fcn.00415f80
test al, al
jne 0x409c07
cmp dword [ebp - 0x414], 0x10
lea eax, [ebp - 0x428]
push 0x433ef0
cmovae eax, dword [ebp - 0x428]
push eax
call fcn.0041a6cc
add esp, 8
test eax, eax
je 0x409b6c
push eax
call fcn.0041a75a
add esp, 4
lea eax, [ebp - 0x428]
cmp dword [ebp - 0x414], 0x10
cmovae eax, dword [ebp - 0x428]
push eax
call fcn.0041a9e7
add esp, 4
cmp dword [ebp - 0x414], 0x10
lea eax, [ebp - 0x428]
push 0x433ef0
cmovae eax, dword [ebp - 0x428]
push eax
call fcn.0041a6cc
add esp, 8
test eax, eax
je 0x409ba0
push eax
call fcn.0041a75a
add esp, 4
jmp 0x409d8d
cmp dword [ebp - 0x42c], 0x10
lea eax, [ebp - 0x440]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmovae eax, dword [ebp - 0x440]
push eax
call esi
cmp eax, 0xffffffff
je 0x409bc6
test al, 0x10
jne 0x409be3
cmp dword [ebp - 0x42c], 0x10
lea eax, [ebp - 0x440]
push 0
cmovae eax, dword [ebp - 0x440]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
cmp dword [ebp - 0x42c], 0x10
lea eax, [ebp - 0x440]
cmovae eax, dword [ebp - 0x440]
push eax
call esi
cmp eax, 0xffffffff
je 0x409c07
test al, 0x10
jne 0x409d0f
mov edx, dword [ebp - 0x444]
cmp edx, 0x10
jb 0x409c41
mov ecx, dword [ebp - 0x458]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x409c37
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d94
push edx
push ecx
call fcn.004171d4
add esp, 8
mov edx, dword [ebp - 0x414]
mov dword [ebp - 0x448], 0
mov dword [ebp - 0x444], 0xf
mov byte [ebp - 0x458], 0
cmp edx, 0x10
jb 0x409c96
mov ecx, dword [ebp - 0x428]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x409c8c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d94
push edx
push ecx
call fcn.004171d4
add esp, 8
mov edx, dword [ebp - 0x42c]
mov dword [ebp - 0x418], 0
mov dword [ebp - 0x414], 0xf
mov byte [ebp - 0x428], 0
cmp edx, 0x10
jb 0x409ceb
mov ecx, dword [ebp - 0x440]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x409ce1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409d94
push edx
push ecx
call fcn.004171d4
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00416b62
mov esp, ebp
pop ebp
ret
call fcn.0041b83c
call fcn.0041b83c
push 1
lea ecx, [ebp - 0x428]
call fcn.004154e0
push eax
lea ecx, [ebp - 0x458]
call fcn.004154e0
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
lea ecx, [ebp - 0x428]
call fcn.00404e00
test al, al
je 0x409d8d
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x45c], esp
push 0x43336b
call fcn.004155c0
sub esp, 0x18
mov byte [ebp - 4], 0xb
lea eax, [ebp - 0x428]
mov dword [ebp - 0x478], esp
mov ecx, esp
push eax
call fcn.00415600
sub esp, 0x18
mov byte [ebp - 4], 0xc
mov ecx, esp
push str.0123456789
call fcn.004155c0
mov byte [ebp - 4], 0xa
call fcn.00403780
add esp, 0x48
push 0
call fcn.0041a5ff
call fcn.0041b83c
int3