Function at 0x402000
Capabilities:
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6c4
mov eax, dword [0x40d004]
xor eax, esp
mov dword [esp + 0x6c0], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x10]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_FindClose]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x4020cc
lea ecx, [esp + 0x2b8]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov edx, 0x104
lea eax, [esp + 0x2b8]
mov edi, edi
cmp word [eax], 0
je 0x40206e
add eax, 2
dec edx
jne 0x402060
jmp 0x402096
test edx, edx
je 0x402096
mov ecx, 0x104
sub ecx, edx
mov eax, 0x104
sub eax, ecx
push 0x40b9f8
lea ecx, [esp + ecx*2 + 0x2bc]
mov edx, 0x7fffffff
call fcn.004010e0
lea edx, [esp + 0x68]
push edx
lea eax, [esp + 0x2bc]
push eax
call esi
cmp eax, 0xffffffff
je 0x4020af
push eax
call edi
jmp 0x4020bf
push 0
lea ecx, [esp + 0x2bc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea edx, [esp + 0x2b8]
mov dword [esp + 0x10], edx
mov eax, edx
lea ecx, [esp + 0x68]
push ecx
push eax
call esi
cmp eax, 0xffffffff
je 0x4021b4
push eax
call edi
push 0x104
lea edx, [esp + 0x4c4]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x68]
push eax
lea ecx, [esp + 0x4c4]
push ecx
call esi
cmp eax, 0xffffffff
je 0x40211f
lea edx, [esp + 0x1c]
test edx, edx
je 0x40211c
mov ecx, dword [esp + 0x88]
mov dword [esp + 0x1c], ecx
push eax
call edi
mov edx, dword [ebp + 8]
mov eax, edx
shl eax, 4
add eax, edx
xor esi, esi
xor edi, edi
lea ecx, [eax*4 + 0xc]
xor ebx, ebx
mov dword [esp + 0x18], ecx
cmp edx, 2
jl 0x40215d
mov eax, dword [esp + 0x14]
lea ecx, [edx - 2]
shr ecx, 1
inc ecx
lea ebx, [ecx + ecx]
lea esp, [esp]
add esi, dword [eax]
add edi, dword [eax + 0x44]
add eax, 0x88
dec ecx
jne 0x402150
cmp ebx, edx
jae 0x402173
mov eax, dword [esp + 0x14]
mov edx, ebx
shl edx, 4
add edx, ebx
mov ecx, dword [eax + edx*4]
add dword [esp + 0x18], ecx
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea edx, [esp + 0x4d8]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4021ce
mov eax, 0x7d1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6c0]
xor ecx, esp
call fcn.00402b02
mov esp, ebp
pop ebp
ret
mov eax, 0x7d0
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6c0]
xor ecx, esp
call fcn.00402b02
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x1c]
mov ecx, dword [0x40ba14]
mov edx, dword [0x40ba18]
sub eax, esi
sub eax, edi
sub eax, dword [esp + 0x18]
push 0x34
mov dword [esp + 0x24], eax
mov eax, dword [str.p.exe]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x34]
push 0
push eax
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], edx
call fcn.004064c0
mov ecx, dword [esp + 0x1c]
push ecx
push ebx
lea edi, [esp + 0x34]
call fcn.00401ec0
add esp, 0x14
test eax, eax
jne 0x402240
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x7d2
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6c0]
xor ecx, esp
call fcn.00402b02
mov esp, ebp
pop ebp
ret
xor esi, esi
cmp dword [ebp + 8], esi
jbe 0x40226b
mov edi, dword [esp + 0x14]
jmp 0x402250
mov edx, dword [esp + 0x10]
push edx
push ebx
call fcn.00401ec0
add esp, 8
test eax, eax
je 0x4022a2
inc esi
add edi, 0x44
cmp esi, dword [ebp + 8]
jb 0x402250
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [0x40ddb0], 0
je 0x40228b
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
add ecx, 4
call fcn.00401d10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6c0]
xor ecx, esp
call fcn.00402b02
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x6cc]
pop edi
lea eax, [esi + 0x7d3]
pop esi
pop ebx
xor ecx, esp
call fcn.00402b02
mov esp, ebp
pop ebp
ret