Function at 0x402060
Capabilities:
Create directory
Get common file path
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x5305b8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x18
mov eax, dword fs:[0x2c]
push ebx
mov ebx, dword [eax]
mov eax, dword [ebx + 8]
push esi
xor esi, esi
cmp eax, esi
mov dword [esp + 0x14], ebx
jne 0x402272
push edi
push 0x104
lea ecx, [esp + 0x18]
push ecx
mov dword [ebx + 8], 1
mov dword [esp + 0x1c], esi
call fcn.004029c0
mov eax, dword [esp + 0x34]
lea edx, [esp + 0xc]
push edx
mov dword [esp + 0x30], esi
mov edi, dword [esp + 0x18]
push edi
push 0x104
push eax
call dword [sym.imp.KERNEL32.DLL_GetFullPathNameA]
cmp eax, esi
mov dword [esp + 0x10], eax
je 0x402338
mov eax, dword [0x58d23c]
mov ecx, dword [eax - 0xc]
push ecx
push eax
push edi
call fcn.004bacee
add esp, 0xc
test eax, eax
jne 0x402338
mov eax, dword [esp + 0x10]
cmp eax, 4
jbe 0x40210d
lea eax, [eax + edi - 4]
call fcn.00403570
test eax, eax
jne 0x402338
mov ecx, dword [0x58d23c]
mov eax, dword [ecx - 0xc]
mov ecx, dword [0x58d188]
mov edx, dword [ecx]
push ebp
lea eax, [eax + edi - 1]
push eax
call dword [edx + 4]
mov ebp, eax
cmp ebp, esi
je 0x402309
cmp ebp, 0xffffffff
je 0x402309
test dword [esp + 0x3c], 0x40000000
jne 0x4021eb
lea esi, [esp + 0x24]
call fcn.00402840
lea esi, [esp + 0x20]
call fcn.00402840
mov byte [esp + 0x30], 2
mov esi, dword [esp + 0x24]
push esi
push 0x104
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
mov ebx, dword [esp + 0x20]
push ebx
push 0
push 0x55d524
push esi
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
test eax, eax
jne 0x4021a1
push 0x104
push esi
call dword [sym.imp.KERNEL32.DLL_GetSystemDirectoryA]
push ebx
push 0
push 0x55d524
push esi
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
push 0
or eax, 0x4000100
push eax
mov eax, dword [esp + 0x44]
push 2
push ecx
push edx
or eax, 0x40000000
push eax
push ebx
call dword [0x58d234]
mov ebx, dword [esp + 0x4c]
lea esi, [esp + 0x20]
mov dword [ebx], eax
call fcn.00402860
lea esi, [esp + 0x24]
mov byte [esp + 0x30], 0
call fcn.00402860
xor esi, esi
jmp 0x402251
mov eax, dword [0x58d23c]
mov eax, dword [eax - 0xc]
add eax, edi
mov dword [esp + 0x10], eax
mov cl, byte [eax]
test cl, cl
je 0x402227
mov ebx, dword [sym.imp.KERNEL32.DLL_CreateDirectoryA]
cmp cl, 0x5c
jne 0x40221c
push esi
push edi
mov byte [eax], 0
call ebx
mov ecx, dword [esp + 0x10]
mov byte [ecx], 0x5c
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
mov cl, byte [eax]
test cl, cl
jne 0x402205
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
push esi
push edx
mov edx, dword [esp + 0x44]
push 2
push eax
mov eax, dword [esp + 0x48]
push ecx
push edx
push eax
call dword [0x58d234]
mov ecx, dword [esp + 0x4c]
mov dword [ecx], eax
mov ebx, ecx
cmp dword [ebx], 0xffffffff
mov ecx, ebp
jne 0x402283
mov edx, dword [ebp]
push 1
call dword [edx + 4]
mov eax, dword [esp + 0x1c]
mov dword [eax + 8], esi
lea esi, [esp + 0x18]
call fcn.00402860
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
add esp, 0x24
ret
push 4
mov dword [esp + 0x18], esi
mov edx, dword [ebp]
push edi
call dword [edx + 0x34]
cmp eax, esi
mov dword [esp + 0x14], eax
je 0x4022c7
mov esi, dword [sym.imp.KERNEL32.DLL_WriteFile]
mov edi, edi
mov edx, dword [ebx]
push 0
lea ecx, [esp + 0x18]
push ecx
push eax
push edi
push edx
call esi
test eax, eax
je 0x4022e6
mov eax, dword [ebp]
push 4
push edi
mov ecx, ebp
call dword [eax + 0x34]
test eax, eax
mov dword [esp + 0x14], eax
jne 0x4022a0
xor esi, esi
mov edx, dword [ebp]
push 1
mov ecx, ebp
call dword [edx + 4]
mov eax, dword [ebx]
push esi
push esi
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov ecx, dword [esp + 0x1c]
mov dword [ecx + 8], esi
jmp 0x402267
mov ecx, dword [ebx]
push ecx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov edx, dword [ebp]
push 1
mov ecx, ebp
call dword [edx + 4]
mov eax, dword [esp + 0x1c]
mov dword [eax + 8], 0
jmp 0x402267
cmp edi, esi
mov dword [ebx + 8], esi
mov dword [esp + 0x30], 0xffffffff
je 0x402270
push edi
call fcn.0051fe99
add esp, 4
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
add esp, 0x24
ret
cmp edi, esi
mov dword [ebx + 8], esi
mov dword [esp + 0x2c], 0xffffffff
je 0x402271
push edi
call fcn.0051fe99
mov ecx, dword [esp + 0x28]
add esp, 4
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x24
ret