Function at 0x403f50
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov dword [esp + 0x20], ebx
mov eax, dword [edi + 0x68]
cmp eax, dword [edi + 0x6c]
je 0x403f70
mov dword [edi + 0x6c], eax
mov ecx, dword [ebx + 0x2a4]
mov eax, 0x67b23a55
sub ecx, dword [ebx + 0x2a0]
imul ecx
xor eax, eax
sar edx, 7
mov ecx, edx
mov dword [esp + 0x1c], eax
shr ecx, 0x1f
add ecx, edx
mov dword [esp + 0x18], ecx
test ecx, ecx
jle 0x4041ab
mov edx, dword [esp + 0x18]
xor ecx, ecx
mov dword [esp + 0x10], ecx
nop dword [eax]
mov ebx, dword [ebx + 0x2a0]
add ebx, ecx
mov dword [esp + 0x24], ebx
je 0x404123
mov esi, dword [edi + 0x5c]
xor ecx, ecx
mov dword [esp + 0x14], ecx
mov eax, 0x2aaaaaab
mov ecx, dword [edi + 0x60]
sub ecx, esi
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
test eax, eax
jle 0x40403c
lea ecx, [ebx + 1]
xor ebx, ebx
mov dword [esp + 0x34], ecx
nop
cmp dword [esi + ebx + 0x14], 0xf
lea eax, [esi + ebx]
jbe 0x403ffc
mov eax, dword [eax]
push ecx
push eax
call fcn.00415bd4
add esp, 8
test eax, eax
je 0x404117
mov ecx, dword [edi + 0x60]
mov eax, 0x2aaaaaab
mov esi, dword [edi + 0x5c]
add ebx, 0x18
inc dword [esp + 0x14]
sub ecx, esi
imul ecx
mov ecx, dword [esp + 0x34]
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [esp + 0x14], eax
jl 0x403ff0
mov ebx, dword [esp + 0x24]
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push ebx
push dword [esp + 0x28]
mov ecx, edi
push dword [esp + 0x28]
call fcn.004038d0
test eax, eax
je 0x404359
mov eax, dword [esp + 0x14]
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40410e
mov eax, dword [edi + 0x3c]
xor ebx, ebx
mov esi, dword [edi + 0x38]
sub eax, esi
sar eax, 2
mov dword [esp + 0x34], eax
test eax, eax
jle 0x4040b3
mov eax, dword [esp + 0x24]
mov eax, dword [eax + 0x100]
mov dword [esp + 0x38], eax
mov ecx, dword [esi]
push eax
call fcn.00407150
mov dword [esp + 0x28], eax
cmp eax, 0xffffffff
jne 0x4040cc
mov eax, dword [esp + 0x38]
inc ebx
add esi, 4
cmp ebx, dword [esp + 0x34]
jl 0x404094
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x40410e
push dword [esp + 0x24]
mov ecx, edi
push dword [esp + 0x20]
call fcn.00403b20
jmp 0x404111
push dword [esp + 0x24]
mov ecx, dword [esp + 0x24]
call fcn.004064d0
mov esi, eax
test esi, esi
je 0x404359
mov ecx, dword [edi + 0x38]
push 1
push dword [esp + 0x2c]
mov ecx, dword [ecx + ebx*4]
push esi
call fcn.004072e0
mov ecx, dword [esi]
push 1
mov edx, dword [ecx]
mov ecx, esi
test al, al
je 0x404357
call edx
mov eax, 1
jmp 0x4040b7
inc dword [edi + 0x74]
cmp dword [edi + 0x34], 0
jne 0x40413f
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
inc eax
add ecx, 0x13c
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], ecx
cmp eax, edx
jge 0x4041ab
mov ebx, dword [esp + 0x20]
jmp 0x403fb0
mov eax, dword [edi + 0x3c]
xor esi, esi
mov ecx, dword [edi + 0x38]
sub eax, ecx
test eax, 0xfffffffc
jle 0x404194
xor ebx, ebx
mov dword [esp + 0x10], ebx
mov ecx, dword [ecx + ebx]
call fcn.00405c20
mov eax, dword [edi + 0x38]
mov ecx, dword [esp + 0x10]
mov ecx, dword [ecx + eax]
test ecx, ecx
je 0x40417c
mov eax, dword [ecx]
push 1
call dword [eax]
mov eax, dword [edi + 0x38]
mov dword [eax + esi*4], 0
mov eax, dword [edi + 0x3c]
inc esi
mov ecx, dword [edi + 0x38]
add ebx, 4
add dword [esp + 0x10], 4
sub eax, ecx
sar eax, 2
cmp esi, eax
jl 0x404156
mov ecx, dword [esp + 0x20]
call fcn.00405c20
mov eax, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 0x3c]
xor edx, edx
mov ecx, dword [edi + 0x38]
sub eax, ecx
mov dword [esp + 0x10], edx
test eax, 0xfffffffc
jle 0x4042f3
xor esi, esi
mov dword [esp + 0x18], esi
nop word [eax + eax]
mov ebx, dword [esi + ecx]
cmp byte [ebx + 4], 0
jne 0x4042d4
cmp byte [ebx + 0x118], 0
je 0x4042d4
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x404222
mov eax, dword [ebx + 0x114]
lea edx, [esp + 0x3c]
push 0
push edx
push eax
push ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x38], eax
cmp eax, 0xffffffff
jne 0x404222
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebx + 8], 0xffffffff
je 0x40426b
mov esi, dword [ebx + 0x2a0]
lea eax, [esp + 0x28]
mov ecx, dword [ebx + 0x2a4]
push 0
push eax
sub ecx, esi
mov dword [esp + 0x30], 0
mov eax, 0x67b23a55
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
imul eax, eax, 0x13c
push eax
push esi
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [esp + 0x18]
mov eax, dword [ebx + 8]
mov byte [ebx + 0x118], 0
cmp eax, 0xffffffff
je 0x4042a2
push 0
lea ecx, [esp + 0x30]
xorps xmm0, xmm0
push ecx
push 0
push eax
movlpd qword [esp + 0x38], xmm0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x28], eax
cmp eax, 0xffffffff
jne 0x4042a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x4042c9
push 0
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0
push eax
push 0x110
lea eax, [ebx + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x10]
mov byte [ebx + 0x118], 0
mov eax, dword [edi + 0x3c]
inc edx
mov ecx, dword [edi + 0x38]
add esi, 4
sub eax, ecx
mov dword [esp + 0x10], edx
sar eax, 2
mov dword [esp + 0x18], esi
cmp edx, eax
jl 0x4041d0
mov esi, dword [edi + 0x68]
cmp esi, dword [edi + 0x6c]
je 0x404349
nop dword [eax + eax]
imul eax, dword [esi + 4], 0x13c
mov ecx, dword [esp + 0x20]
add eax, dword [ecx + 0x2a0]
push eax
call fcn.004064d0
mov ebx, eax
test ebx, ebx
je 0x404359
mov edx, dword [esi]
mov ecx, dword [edi + 0x38]
push 0
push dword [esi + 8]
mov ecx, dword [ecx + edx*4]
push ebx
call fcn.004072e0
mov ecx, dword [ebx]
push 1
mov edx, dword [ecx]
mov ecx, ebx
test al, al
je 0x404357
call edx
inc dword [edi + 0x74]
add esi, 0xc
cmp esi, dword [edi + 0x6c]
jne 0x404300
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
call edx
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4