Function at 0x401670
Capabilities:
Create directory
Delete file

Disassembly:
push 0xffffffffffffffff
push 0x402f7b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x228
push ebx
mov ebx, dword [esp + 0x23c]
push ebp
push esi
mov eax, dword [ebx]
push edi
mov dword [esp + 0x1c], eax
push 4
mov ebp, dword [eax + 0x3c]
lea eax, [esp + 0x18]
push eax
mov ecx, ebx
mov byte [esp + 0x1b], 1
call ebp
cmp eax, 4
jne 0x4018d1
lea ecx, [esp + 0x1a]
push 2
push ecx
mov ecx, ebx
call ebp
cmp eax, 2
jne 0x4018d1
mov dx, word [esp + 0x1a]
test dx, dx
jl 0x4018d1
cmp dx, 0x104
jge 0x4018d1
movsx esi, dx
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x134]
movsx edx, dx
rep stosd dword es:[edi], eax
lea eax, [esp + 0x134]
push edx
push eax
mov ecx, ebx
call ebp
cmp eax, esi
jne 0x4018d1
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x401774
mov cl, byte [esp + esi + 0x133]
lea eax, [esp + esi + 0x133]
cmp cl, 0x5c
jne 0x401774
lea ecx, [esp + 0x30]
push 0x405420
push ecx
mov byte [eax], 0
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea edx, [esp + 0x30]
push 0x405034
push edx
call esi
lea eax, [esp + 0x134]
lea ecx, [esp + 0x30]
push eax
push ecx
call esi
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.MSVCRT.dll__mkdir]
add esp, 4
mov al, 1
jmp 0x4018d3
lea eax, [esp + 0x30]
push 0x405420
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x30]
push 0x405034
push ecx
call esi
lea edx, [esp + 0x134]
lea eax, [esp + 0x30]
push edx
push eax
call esi
lea ecx, [esp + 0x30]
push 0x1001
push ecx
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CFile::CFile_1
push 0x8000
push 0x42
mov dword [esp + 0x248], 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
push edi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov esi, eax
test esi, esi
je 0x40183e
mov eax, dword [esp + 0x14]
cmp eax, 0x8000
jl 0x40181a
push 0x8000
push esi
mov ecx, ebx
call ebp
cmp eax, 0x8000
jne 0x40182c
push eax
push esi
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CFile::Write
mov eax, dword [esp + 0x14]
sub eax, 0x8000
cmp eax, 0x8000
mov dword [esp + 0x14], eax
jge 0x4017ea
test eax, eax
jle 0x40183e
push eax
push esi
mov ecx, ebx
call ebp
mov ecx, dword [esp + 0x14]
cmp eax, ecx
je 0x401833
mov byte [esp + 0x13], 0
jmp 0x40183e
push ecx
push esi
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CFile::Write
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CFile::Close
test esi, esi
je 0x4018ad
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov bl, byte [esp + 0x13]
test bl, bl
je 0x401895
lea edi, [esp + 0x30]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [esp + ecx + 0x2f], 0x5f
jne 0x401895
lea edx, [esp + 0x30]
push edx
call fcn.00401030
add esp, 4
test eax, eax
je 0x401895
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.MSVCRT.dll_remove]
add esp, 4
lea ecx, [esp + 0x20]
mov dword [esp + 0x240], 0xffffffff
call sub.MFC42.DLL_CFile::CFile
mov al, bl
jmp 0x4018d3
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
push 1
push ecx
mov ecx, ebx
call dword [edx + 0x30]
lea ecx, [esp + 0x20]
mov dword [esp + 0x240], 0xffffffff
call sub.MFC42.DLL_CFile::CFile
xor al, al
mov ecx, dword [esp + 0x238]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x234
ret