Function at 0x4038d0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, ecx
test ebx, ebx
je 0x403aba
mov eax, dword [edi + 0x3c]
xor esi, esi
mov ecx, dword [edi + 0x38]
sub eax, ecx
test eax, 0xfffffffc
jle 0x403918
mov ecx, dword [ecx + esi*4]
push ebx
call fcn.004065f0
mov ecx, dword [edi + 0x38]
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
jne 0x403926
mov eax, dword [edi + 0x3c]
inc esi
sub eax, ecx
sar eax, 2
cmp esi, eax
jl 0x4038f7
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
imul edx, eax, 0x13c
mov eax, dword [ecx + esi*4]
mov eax, dword [eax + 0x2a0]
mov dword [ebp - 4], edx
mov eax, dword [eax + edx + 0x108]
cmp eax, dword [ebx + 0x100]
jb 0x403ac5
mov ecx, dword [ebp + 0xc]
push ebx
call fcn.004064d0
mov dword [ebp + 0xc], eax
test eax, eax
je 0x403aba
cmp dword [ebp - 8], 0
mov ecx, dword [edi + 0x38]
mov eax, dword [ecx + esi*4]
mov dword [ebp + 0x10], eax
jl 0x403a28
mov edx, dword [eax + 0x2a0]
mov ecx, dword [eax + 0x2a4]
mov eax, 0x67b23a55
sub ecx, edx
mov dword [ebp - 0x10], edx
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [ebp - 8], eax
jge 0x403a28
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x10]
mov dword [eax + edx + 0x100], 0
mov eax, dword [ecx + 0x2a0]
mov dword [eax + edx + 0x104], 0
cmp dword [ecx + 8], 0xffffffff
je 0x403a28
mov eax, dword [ecx + 0x114]
add eax, edx
mov dword [ebp - 0x14], 0
push 0
lea edx, [ebp - 0x14]
mov dword [ebp - 0x18], eax
push edx
push eax
push dword [ecx + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0x4039f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 4]
cmp dword [ecx + 8], 0xffffffff
je 0x403a28
push 0
lea eax, [ebp + 0x10]
mov dword [ebp + 0x10], 0
push eax
mov eax, dword [ecx + 0x2a0]
push 0x13c
add eax, edx
push eax
push dword [ecx + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [edi + 0x38]
push dword [ebx + 0x100]
mov eax, dword [eax + esi*4]
mov ecx, eax
mov dword [ebp + 0x10], eax
call fcn.00407150
mov ecx, dword [ebp + 0x10]
cmp eax, 0xffffffff
jne 0x403aa2
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x14], eax
call fcn.00407220
mov ecx, dword [edi + 0x6c]
mov edx, eax
mov dword [ebp - 0x10], edx
cmp ecx, dword [edi + 0x70]
je 0x403a93
mov eax, dword [ebp + 8]
mov dword [ecx], esi
mov dword [ecx + 4], eax
mov dword [ecx + 8], edx
add dword [edi + 0x6c], 0xc
mov esi, dword [ebp + 0xc]
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax]
mov eax, dword [ebp + 0x14]
mov dword [eax], 1
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
lea eax, [ebp - 0x18]
push eax
push ecx
lea ecx, [edi + 0x68]
call fcn.004051e0
jmp 0x403a71
mov esi, dword [ebp + 0xc]
push 1
push eax
push esi
call fcn.004072e0
test al, al
jne 0x403a74
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [edi + 0x3c]
xor esi, esi
sub eax, ecx
mov dword [ebp + 0x10], esi
test eax, 0xfffffffc
jle 0x403aba
xor eax, eax
mov dword [ebp + 8], eax
nop dword [eax + eax]
mov ecx, dword [eax + ecx]
push ebx
call fcn.004075e0
mov edx, dword [ebp + 0x10]
test al, al
mov ecx, dword [edi + 0x38]
mov eax, 1
cmovne esi, eax
mov eax, dword [edi + 0x3c]
add dword [ebp + 8], 4
sub eax, ecx
inc edx
sar eax, 2
cmp edx, eax
mov dword [ebp + 0x10], edx
mov eax, dword [ebp + 8]
jl 0x403ae0
xor eax, eax
test esi, esi
pop edi
pop esi
setne al
pop ebx
mov esp, ebp
pop ebp
ret 0x10