Function at 0x420980
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48eef8
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x4c7084]
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 esi, ecx
mov ebx, dword [ebp + 8]
mov edx, 0xffff
cmp dx, bx
jne 0x4209c1
xor eax, eax
jmp 0x420b88
mov eax, dword [esi + 0x20]
mov ecx, dword [eax]
test ecx, ecx
je 0x4209f5
mov edx, dword [esi + 0x30]
mov edi, dword [edx]
lea eax, [ecx + edi*2]
cmp ecx, eax
jae 0x4209f0
lea ecx, [edi - 1]
mov ax, bx
mov dword [edx], ecx
mov edx, dword [esi + 0x20]
mov esi, dword [edx]
lea ecx, [esi + 2]
mov dword [edx], ecx
mov word [esi], bx
jmp 0x420b88
mov edx, 0xffff
cmp dword [esi + 0x4c], 0
jne 0x420a03
mov ax, dx
jmp 0x420b88
mov edi, dword [esi + 0xc]
lea eax, [esi + 0x3c]
cmp dword [edi], eax
jne 0x420a23
mov edx, dword [esi + 0x54]
mov ecx, dword [esi + 0x50]
sub edx, ecx
mov dword [edi], ecx
mov eax, dword [esi + 0x1c]
sar edx, 1
mov dword [eax], ecx
mov eax, dword [esi + 0x2c]
mov dword [eax], edx
cmp dword [esi + 0x38], 0
jne 0x420a4d
push dword [esi + 0x4c]
push ebx
call fcn.0046fa29
mov ecx, 0xffff
add esp, 8
cmp ax, cx
movzx eax, bx
jne 0x420b88
mov eax, ecx
jmp 0x420b88
push 0
movzx eax, bx
lea ecx, [ebp - 0x28]
push 8
mov dword [ebp - 0x2c], eax
call fcn.0041bd70
mov dword [ebp - 4], 0
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 0x28]
call fcn.00408690
lea ecx, [ebp - 0x28]
mov edi, dword [eax]
lea eax, [ebp - 0x3c]
push eax
call fcn.00408690
lea ecx, [ebp - 0x28]
mov ebx, dword [eax]
call fcn.00401750
mov ecx, dword [esi + 0x38]
add eax, edi
lea edi, [esi + 0x40]
mov edx, dword [ecx]
lea ecx, [ebp - 0x30]
push ecx
mov ecx, dword [esi + 0x38]
push eax
push ebx
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x2a]
push eax
lea eax, [ebp - 0x2c]
push eax
push edi
call dword [edx + 0x1c]
test eax, eax
js 0x420b71
cmp eax, 1
jg 0x420bd4
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x28]
call fcn.00408690
mov edi, dword [ebp - 0x30]
sub edi, dword [eax]
je 0x420af5
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x28]
call fcn.00408690
push dword [esi + 0x4c]
push edi
push 1
push dword [eax]
call fcn.004702b3
add esp, 0x10
cmp edi, eax
jne 0x420ba6
lea eax, [ebp - 0x2c]
mov byte [esi + 0x3e], 1
cmp dword [ebp - 0x34], eax
jne 0x420bc3
test edi, edi
jne 0x420b25
lea ecx, [ebp - 0x28]
call fcn.00401750
cmp eax, 0x20
jae 0x420bb6
push edi
push 8
lea ecx, [ebp - 0x28]
call fcn.004178d0
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 0x28]
call fcn.00408690
lea ecx, [ebp - 0x28]
mov edi, dword [eax]
lea eax, [ebp - 0x3c]
push eax
call fcn.00408690
lea ecx, [ebp - 0x28]
mov ebx, dword [eax]
call fcn.00401750
mov ecx, dword [esi + 0x38]
add eax, edi
lea edi, [ebp - 0x30]
push edi
push eax
mov edx, dword [ecx]
lea eax, [ebp - 0x34]
push ebx
push eax
lea eax, [ebp - 0x2a]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [esi + 0x40]
push eax
call dword [edx + 0x1c]
test eax, eax
jns 0x420ab5
mov esi, 0xffff
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
call fcn.00408790
mov ax, si
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.0044b43a
mov esp, ebp
pop ebp
ret 4
mov eax, 0xffff
movzx eax, ax
movzx eax, ax
movzx esi, ax
jmp 0x420b76
mov eax, 0xffff
movzx eax, ax
movzx esi, ax
jmp 0x420b76
mov eax, dword [ebp + 8]
movzx eax, ax
movzx eax, ax
movzx eax, ax
movzx esi, ax
jmp 0x420b76
cmp eax, 3
jne 0x420b71
push dword [esi + 0x4c]
push dword [ebp - 0x2c]
call fcn.0046fa29
mov ecx, 0xffff
add esp, 8
cmp ax, cx
je 0x420bff
mov eax, dword [ebp + 8]
movzx eax, ax
movzx esi, ax
jmp 0x420b76
mov eax, ecx
movzx esi, ax
jmp 0x420b76