Function at 0x401e70
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x92c
lea eax, [esp + 0x20]
push ebx
push ebp
push esi
push edi
push eax
call fcn.004025d0
add esp, 4
test eax, eax
je 0x40233f
lea ecx, [esp + 0x28]
lea edx, [esp + 0x30]
push ecx
push edx
call fcn.004023a0
mov esi, eax
add esp, 8
test esi, esi
mov dword [esp + 0x14], esi
je 0x40233f
mov ebp, dword [esp + 0x940]
mov ecx, 0x202
xor eax, eax
lea edi, [esp + 0x134]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x134]
push 1
push eax
push 0x402520
push esi
mov dword [esp + 0x144], ebp
call fcn.00404ce0
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
mov dword [esp + 0x2c], edi
lea ecx, [edi + 0x400]
push ecx
call dword [sym.imp.MSVCRT.dll_malloc]
mov edx, dword [esp + 0x14c]
mov ebx, eax
add esp, 0x14
lea ecx, [esp + 0x13c]
xor eax, eax
mov dword [esp + 0x18], ecx
test edx, edx
mov dword [esp + 0x10], eax
jle 0x4020c2
mov edx, dword [esp + 0x944]
mov dword [esp + 0x20], eax
jmp 0x401f37
mov ecx, dword [esp + 0x18]
mov edi, dword [ecx]
mov ecx, dword [ecx + 4]
cmp edi, eax
mov dword [esp + 0x24], ecx
jle 0x401f6f
mov ecx, edi
add esi, eax
sub ecx, eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2c], ecx
lea edi, [eax + ebx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, eax
mov eax, dword [esp + 0x10]
add eax, ecx
mov dword [esp + 0x10], eax
or ecx, 0xffffffff
xor eax, eax
mov edi, 0x40b0a4
mov esi, 0x40b0a4
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
not ecx
dec ecx
lea edi, [eax + ebx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, 0x40b0a4
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
mov edi, ebp
not ecx
dec ecx
mov esi, ebp
add eax, ecx
or ecx, 0xffffffff
mov dword [esp + 0x10], eax
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
not ecx
dec ecx
lea edi, [eax + ebx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
mov edi, 0x40b0a0
not ecx
dec ecx
mov esi, 0x40b0a0
add eax, ecx
or ecx, 0xffffffff
mov dword [esp + 0x10], eax
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
not ecx
dec ecx
lea edi, [eax + ebx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40b0a0
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
mov edi, edx
not ecx
dec ecx
mov esi, edx
add eax, ecx
or ecx, 0xffffffff
mov dword [esp + 0x10], eax
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
not ecx
dec ecx
lea edi, [eax + ebx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x24]
not ecx
dec ecx
add esi, ecx
mov ecx, dword [esp + 0x18]
add ecx, 8
mov dword [esp + 0x10], esi
mov esi, dword [esp + 0x138]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x20]
inc ecx
cmp ecx, esi
mov esi, dword [esp + 0x14]
mov dword [esp + 0x20], ecx
jl 0x401f33
mov edi, dword [esp + 0x1c]
cmp edi, eax
jle 0x40229e
mov edx, dword [esp + 0x10]
mov ecx, edi
sub ecx, eax
add esi, eax
lea edi, [edx + ebx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
sub ecx, eax
jmp 0x402290
test edi, edi
jle 0x4021b6
mov ecx, edi
mov edi, ebx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [esp + 0x10]
or ecx, 0xffffffff
add edx, eax
mov edi, 0x40b09c
xor eax, eax
mov dword [esp + 0x10], edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [edx + ebx]
mov edx, ecx
mov esi, 0x40b09c
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, 0x40b09c
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x10]
mov edi, 0x40b0a4
not ecx
dec ecx
mov esi, 0x40b0a4
add edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [edx + ebx]
mov eax, ecx
mov dword [esp + 0x10], edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40b0a4
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x10]
mov edi, ebp
not ecx
dec ecx
mov esi, ebp
add edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x10], edx
lea edi, [edx + ebx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x10]
mov edi, 0x40b0a0
not ecx
dec ecx
add edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov dword [esp + 0x10], edx
not ecx
dec ecx
mov esi, 0x40b0a0
mov eax, ecx
lea edi, [edx + ebx]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
jmp 0x402242
or ecx, 0xffffffff
mov edi, 0x40b0a4
xor eax, eax
mov esi, 0x40b0a4
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40b0a4
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x10]
mov edi, ebp
not ecx
dec ecx
mov esi, ebp
add edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [edx + ebx]
mov eax, ecx
mov dword [esp + 0x10], edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x10]
mov edi, 0x40b0a0
not ecx
dec ecx
mov esi, 0x40b0a0
add edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x10], edx
lea edi, [edx + ebx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
xor eax, eax
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40b0a0
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ebp, dword [esp + 0x10]
mov edx, dword [esp + 0x944]
not ecx
dec ecx
mov edi, edx
add ebp, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, edx
mov eax, ecx
lea edi, [ebx + ebp]
shr ecx, 2
mov dword [esp + 0x10], ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
add eax, ecx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40234c
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x10]
push ecx
push edx
push ebx
call fcn.00405710
mov edi, eax
add esp, 0xc
test edi, edi
je 0x402330
mov eax, dword [esp + 0x10]
test eax, eax
jle 0x402327
lea eax, [esp + 0x30]
push 0x40b098
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x402305
mov ecx, dword [esp + 0x10]
push ebp
push ecx
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fwrite]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
push edi
call fcn.004058f0
add esp, 0x18
jmp 0x40237e
push edi
call fcn.004058f0
push esi
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
push ebx
call esi
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x92c
ret
push edi
call fcn.004058f0
add esp, 4
push esi
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
push ebx
call esi
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x92c
ret
lea edx, [esp + 0x30]
push 0x40b098
push edx
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x402330
mov eax, dword [esp + 0x10]
push edi
push eax
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_fwrite]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
push esi
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
push ebx
call esi
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x92c
ret