Function at 0x407770
Capabilities:
Write file on windows

Disassembly:
sub esp, 0xc4
push ebx
push ebp
xor ebx, ebx
push esi
mov dword [esp + 0x10], ebx
call fcn.004238a0
mov esi, eax
mov eax, dword [esp + 0xdc]
mov ebp, dword [eax]
sub ebp, dword [esi + 0xc8]
add ebp, 0x1ff
and ebp, 0xfffffe00
cmp byte [esi + 0x441], bl
mov dword [esp + 0x14], ebp
je 0x4077e6
mov ecx, dword [esi + 0x43c]
mov edx, dword [ecx]
mov eax, dword [edx]
call eax
test al, al
je 0x4077e6
mov ecx, dword [esi + 0x43c]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esi + 0x43c]
mov edx, dword [ecx]
mov eax, dword [esi + 0xc8]
mov edx, dword [edx + 0x28]
push ebp
push eax
call edx
xor ebp, ebp
jmp 0x407b33
cmp ebp, ebx
mov eax, dword [esi + 0xc8]
mov dword [esp + 0xc], eax
jbe 0x407b33
push edi
lea esp, [esp]
mov eax, dword [esi + 0x80]
mov edi, 2
cmp dword [eax + 8], edi
jne 0x407881
mov eax, dword [eax + 4]
cmp dword [eax + 0x30], ebx
jne 0x407881
cmp dword [eax], ebx
je 0x40787a
mov ecx, dword [esi + 0x2ec]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x78]
cmp eax, ebx
je 0x407848
mov edx, dword [eax + 0x34]
cmp edx, dword [esi + 0x2ec]
jne 0x407842
mov dword [eax + 0x34], 0xffffffff
mov eax, dword [eax]
cmp eax, ebx
jne 0x407830
mov eax, dword [esi + 0x80]
mov ecx, dword [eax + 4]
mov dword [ecx + 0x34], 0xffffffff
mov eax, dword [esi + 0x80]
mov edx, dword [eax + 4]
mov ecx, dword [edx]
mov dword [eax + 4], ecx
mov edx, dword [esi + 0x80]
mov eax, dword [edx + 4]
mov ecx, dword [eax + 0x34]
mov dword [esi + 0x2ec], ecx
jmp 0x407881
mov dword [eax + 0x30], 0xffffffff
mov eax, dword [esi + 0x80]
cmp dword [eax + 8], edi
jne 0x407896
mov edx, dword [eax + 4]
mov eax, dword [edx + 0x30]
cmp eax, ebp
jb 0x407898
mov eax, ebp
mov edx, dword [esp + 0x10]
push ebx
lea ecx, [esp + 0x18]
push ecx
push eax
mov eax, dword [esi + 0x2ec]
push edx
push eax
xor edi, edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4078bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov ecx, dword [esi + 0xd4]
mov dword [esi + 0xc8], ecx
mov eax, dword [esp + 0x14]
cmp eax, ebx
jbe 0x407904
add dword [esi + 0xb8], eax
adc dword [esi + 0xbc], ebx
call fcn.004064b0
mov eax, dword [esi + 0x80]
cmp dword [eax + 8], 2
jne 0x407939
mov ecx, dword [eax + 4]
cmp dword [ecx + 0x30], ebp
jae 0x4078fd
mov dword [ecx + 0x30], ebx
jmp 0x407939
mov eax, ecx
sub dword [eax + 0x30], ebp
jmp 0x407939
je 0x40794c
cmp edi, 0x70
je 0x40794c
cmp edi, 0x27
je 0x40794c
call dword [sym.imp.MSVCR80.dll__errno]
cmp dword [eax], 4
je 0x407939
lea edx, [esp + 0x1c]
push edx
push 0xdd
push ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0xd8], ebx
call fcn.00402910
add esp, 0xc
mov eax, dword [esp + 0x14]
cmp ebp, eax
jae 0x407a4b
mov eax, ebp
jmp 0x407a47
mov eax, dword [esi + 0x80]
cmp dword [eax + 8], 2
jne 0x407a5c
mov eax, dword [eax + 4]
cmp dword [eax], ebx
je 0x407a26
mov ecx, dword [esi + 0x2ec]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x78]
cmp eax, ebx
je 0x407998
jmp 0x407980
mov edx, dword [eax + 0x34]
cmp edx, dword [esi + 0x2ec]
jne 0x407992
mov dword [eax + 0x34], 0xffffffff
mov eax, dword [eax]
cmp eax, ebx
jne 0x407980
mov eax, dword [esi + 0x80]
mov ecx, dword [eax + 4]
mov dword [ecx + 0x34], 0xffffffff
mov eax, dword [esi + 0x80]
mov ecx, dword [eax + 4]
mov edx, dword [ecx]
mov edx, dword [edx + 0x28]
mov ecx, dword [ecx + 0x28]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0xcc], ebx
mov eax, dword [eax + 4]
push edx
mov edx, dword [eax + 0x30]
push edx
push ecx
lea ecx, [esp + 0x28]
call fcn.0042bde0
mov ecx, eax
call fcn.0042bce0
mov ecx, eax
call fcn.0042bde0
push eax
push 0x110
push ebx
call fcn.00402090
mov eax, dword [esi + 0x80]
mov eax, dword [eax + 4]
mov ecx, dword [eax]
mov edx, dword [eax + 0x30]
add esp, 0xc
add dword [ecx + 0x30], edx
mov eax, dword [esi + 0x80]
mov ecx, dword [eax + 4]
mov edx, dword [ecx]
mov dword [eax + 4], edx
mov eax, dword [esi + 0x80]
mov ecx, dword [eax + 4]
mov edx, dword [ecx + 0x34]
mov dword [esi + 0x2ec], edx
jmp 0x407a45
lea eax, [esp + 0x1c]
push eax
push 1
push 0x10e
mov dword [esp + 0x28], ebx
mov dword [esp + 0xd8], ebx
call fcn.00402830
add esp, 0xc
xor eax, eax
mov dword [esp + 0x14], eax
add dword [esp + 0x10], eax
sub ebp, eax
jne 0x407800
jmp 0x407b32
mov ecx, dword [esi + 0x43c]
mov edx, dword [ecx]
mov eax, dword [edx]
call eax
test al, al
je 0x407a8b
lea ecx, [esp + 0x1c]
push ecx
push 1
push 0x10e
mov dword [esp + 0x28], ebx
mov dword [esp + 0xd8], ebx
call fcn.00402830
add esp, 0xc
cmp ebp, dword [esp + 0x18]
je 0x407aa6
mov edx, dword [esp + 0x10]
mov eax, dword [esi + 0xd4]
push ebp
push edx
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
mov ecx, dword [esi + 0xd4]
sub ecx, dword [esi + 0xd0]
mov ebx, 0x40000000
add ebp, ecx
cmp ebp, dword [esi + 0xac]
mov ecx, dword [esi + 0x2ec]
setae byte [esp + 0x10]
mov edx, dword [esp + 0x10]
push edx
call fcn.00407310
add esp, 4
cmp byte [esp + 0x10], 0
mov dword [esi + 0x2ec], eax
je 0x407b26
mov eax, dword [esi + 0xac]
mov ecx, dword [esi + 0xd0]
mov edx, dword [esi + 0xd4]
sub ebp, eax
push ebp
add ecx, eax
push ecx
push edx
call sub.MSVCR80.dll_memcpy
mov eax, dword [esi + 0xac]
mov ecx, dword [esi + 0xd4]
add esp, 0xc
add dword [esi + 0xb8], eax
mov dword [esi + 0xc8], ecx
adc dword [esi + 0xbc], 0
jmp 0x407b32
mov edx, dword [esi + 0xd0]
mov dword [esi + 0xc8], edx
pop edi
mov eax, dword [esi + 0xb0]
mov ecx, dword [esi + 0xc8]
mov edx, dword [esp + 0xdc]
mov dword [esi + 0xac], eax
mov al, byte [esp + 0xd4]
add ecx, ebp
mov byte [ecx], al
add ecx, 1
mov dword [edx], ecx
mov ecx, dword [esi + 0xac]
mov edx, dword [esp + 0xd8]
sub ecx, ebp
pop esi
sub ecx, 1
pop ebp
mov dword [edx], ecx
pop ebx
add esp, 0xc4
ret