Function at 0x407770
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5423ac
mov eax, dword fs:[0]
push eax
sub esp, 0x80
mov eax, dword [0x583f80]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edx, ecx
mov dword [ebp - 0x50], edx
mov ebx, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x5c], eax
cmp ebx, 0xffffffff
je 0x407a8e
mov eax, dword [edx + 0x20]
mov ecx, dword [eax]
test ecx, ecx
je 0x4077e4
mov esi, dword [edx + 0x30]
mov edi, dword [esi]
lea eax, [edi + ecx]
cmp ecx, eax
jae 0x4077e4
lea eax, [edi - 1]
mov dword [esi], eax
mov ecx, dword [edx + 0x20]
mov edx, dword [ecx]
lea eax, [edx + 1]
mov dword [ecx], eax
mov byte [edx], bl
mov eax, ebx
jmp 0x407a8e
cmp dword [edx + 0x50], 0
jne 0x4077f2
or eax, 0xffffffff
jmp 0x407a8e
mov esi, dword [edx + 0xc]
lea eax, [edx + 0x44]
cmp dword [esi], eax
jne 0x407810
mov eax, dword [edx + 0x38]
mov ecx, dword [edx + 0x3c]
mov dword [esi], eax
mov eax, dword [edx + 0x1c]
mov dword [eax], ecx
mov eax, dword [edx + 0x2c]
sub ecx, ecx
mov dword [eax], ecx
cmp dword [edx + 0x40], 0
jne 0x407834
push dword [edx + 0x50]
movsx eax, bl
push eax
call fcn.00503bc0
or ecx, 0xffffffff
add esp, 8
cmp eax, ecx
cmovne ecx, ebx
mov eax, ecx
jmp 0x407a8e
push 0
push 8
lea ecx, [ebp - 0x40]
mov byte [ebp - 0x14], bl
call fcn.004052e0
lea eax, [ebp - 0x68]
push eax
lea ecx, [ebp - 0x40]
mov dword [ebp - 4], 0
call fcn.00403930
mov edi, eax
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x40]
call fcn.00403930
mov esi, eax
mov ecx, edi
mov byte [ebp - 4], 2
call fcn.00408800
mov edi, dword [ebp - 0x2c]
mov ecx, esi
mov ebx, eax
call fcn.00408800
mov edx, dword [ebp - 0x50]
add edx, 0x48
mov ecx, dword [edx - 8]
mov dword [ebp - 0x58], edx
mov esi, dword [ecx]
lea edx, [ebp - 0x44]
push edx
lea edx, [edi + ebx]
push edx
push eax
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x13]
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x58]
call dword [esi + 0x1c]
push 3
lea ecx, [ebp - 0x1c]
mov esi, eax
mov byte [ebp - 4], 1
call fcn.0053dac0
lea ecx, [ebp - 0x74]
call fcn.00402ad0
lea ecx, [ebp - 0x1c]
call fcn.0053db60
push 3
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 0
call fcn.0053dac0
lea ecx, [ebp - 0x68]
call fcn.00402ad0
lea ecx, [ebp - 0x18]
call fcn.0053db60
test esi, esi
js 0x407a81
lea esp, [esp]
cmp esi, 1
jg 0x407ab1
lea eax, [ebp - 0x80]
push eax
lea ecx, [ebp - 0x40]
call fcn.00403930
mov ecx, eax
mov byte [ebp - 4], 3
call fcn.00408800
mov esi, dword [ebp - 0x44]
push 3
lea ecx, [ebp - 0x20]
sub esi, eax
mov byte [ebp - 4], 0
call fcn.0053dac0
lea ecx, [ebp - 0x80]
call fcn.00402ad0
lea ecx, [ebp - 0x20]
call fcn.0053db60
test esi, esi
je 0x407979
lea eax, [ebp - 0x8c]
push eax
lea ecx, [ebp - 0x40]
call fcn.00403930
mov byte [ebp - 4], 4
mov ebx, dword [ebp - 0x54]
or ebx, 1
mov ecx, eax
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x5c], ebx
call fcn.00408800
mov edi, dword [ebp - 0x50]
push dword [edi + 0x50]
push esi
push 1
push eax
call fcn.005021c0
add esp, 0x10
cmp esi, eax
je 0x40797f
mov byte [ebp - 0x49], 1
jmp 0x407983
mov ebx, dword [ebp - 0x54]
mov edi, dword [ebp - 0x50]
mov byte [ebp - 0x49], 0
mov dword [ebp - 4], 0
test bl, 1
je 0x4079b2
and ebx, 0xfffffffe
push 3
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x54], ebx
call fcn.0053dac0
lea ecx, [ebp - 0x8c]
call fcn.00402ad0
lea ecx, [ebp - 0x24]
call fcn.0053db60
cmp byte [ebp - 0x49], 0
jne 0x407a81
lea eax, [ebp - 0x14]
mov byte [edi + 0x45], 1
cmp dword [ebp - 0x48], eax
jne 0x407aac
test esi, esi
jne 0x4079e5
cmp dword [ebp - 0x2c], 0x20
jae 0x407a81
push esi
push 8
lea ecx, [ebp - 0x40]
call fcn.00402000
lea eax, [ebp - 0x68]
push eax
lea ecx, [ebp - 0x40]
call fcn.00403930
mov edi, eax
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x40]
call fcn.00403930
mov esi, eax
mov ecx, edi
mov byte [ebp - 4], 2
call fcn.00408800
mov edi, dword [ebp - 0x2c]
mov ecx, esi
mov ebx, eax
call fcn.00408800
mov ecx, dword [ebp - 0x50]
lea edx, [ebp - 0x44]
mov ecx, dword [ecx + 0x40]
push edx
mov esi, dword [ecx]
lea edx, [edi + ebx]
push edx
push eax
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x13]
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x58]
call dword [esi + 0x1c]
push 3
lea ecx, [ebp - 0x1c]
mov esi, eax
mov byte [ebp - 4], 1
call fcn.0053dac0
lea ecx, [ebp - 0x74]
call fcn.00402ad0
lea ecx, [ebp - 0x1c]
call fcn.0053db60
push 3
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 0
call fcn.0053dac0
lea ecx, [ebp - 0x68]
call fcn.00402ad0
lea ecx, [ebp - 0x18]
call fcn.0053db60
test esi, esi
jns 0x4078f0
or esi, 0xffffffff
lea ecx, [ebp - 0x40]
call fcn.00401e20
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004fcf30
mov esp, ebp
pop ebp
ret 4
mov esi, dword [ebp + 8]
jmp 0x407a84
cmp esi, 3
jne 0x407a81
mov eax, dword [ebp - 0x50]
push dword [eax + 0x50]
push dword [ebp - 0x14]
call fcn.00407420
or ecx, 0xffffffff
add esp, 8
test al, al
cmovne ecx, dword [ebp + 8]
mov esi, ecx
jmp 0x407a84