Function at 0x407280
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov eax, dword [0x591a60]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ebx, edx
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x48], 0
cmp ebx, 8
jne 0x4072ae
mov dword [ebp - 0x48], 0x400
mov eax, esi
imul eax, ebx
cdq
and edx, 7
add eax, edx
sar eax, 3
add eax, 3
cdq
and edx, 3
add eax, edx
sar eax, 2
add eax, eax
add eax, eax
push 0x56a008
push ecx
mov dword [ebp - 0x50], eax
call fcn.00516728
add esp, 8
mov dword [ebp - 0x58], eax
test eax, eax
jne 0x4072f9
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.005162b5
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [ebp - 0x48]
mov ecx, 0x4d42
mov word [ebp - 0x18], cx
mov ecx, edi
imul ecx, dword [ebp - 0x50]
mov dword [ebp - 0x50], ecx
lea ecx, [ecx + edx + 0x36]
push eax
add edx, 0x36
push 1
mov dword [ebp - 0xe], edx
mov dword [ebp - 0x16], ecx
xor ecx, ecx
lea edx, [ebp - 0x18]
push 0xe
push edx
mov word [ebp - 0x12], cx
mov word [ebp - 0x10], cx
call fcn.00516896
mov edx, dword [ebp - 0x50]
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x58]
push eax
mov ecx, 1
push ecx
mov word [ebp - 0x34], cx
lea ecx, [ebp - 0x40]
push 0x28
push ecx
mov word [ebp - 0x32], bx
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x40], 0x28
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x3c], esi
call fcn.00516896
push 0x400
call fcn.00516910
add esp, 0x24
mov edx, eax
mov dword [ebp - 0x44], edx
cmp ebx, 8
jne 0x4073be
xor eax, eax
lea ecx, [edx + 2]
mov byte [ecx - 2], al
mov byte [ecx - 1], al
mov byte [ecx], al
mov byte [ecx + 1], 0
inc eax
add ecx, 4
cmp eax, 0x100
jl 0x407390
mov eax, dword [ebp - 0x58]
push eax
push 0x100
push 4
push edx
call fcn.00516896
mov edx, dword [ebp - 0x44]
add esp, 0x10
push edx
call fcn.005169a4
mov eax, edi
imul eax, esi
lea eax, [eax + eax*2]
push eax
mov dword [ebp - 0x44], eax
call fcn.00516910
mov ecx, dword [ebp - 0x44]
push ecx
push 0
push eax
mov dword [ebp - 0x48], eax
call fcn.00518800
add esp, 0x14
cmp ebx, 0x18
jne 0x40743e
test edi, edi
jle 0x407487
mov edx, dword [ebp - 0x48]
lea ecx, [edi + edi*2 - 3]
imul ecx, esi
lea eax, [esi*4]
sub eax, esi
neg eax
add ecx, dword [ebp + 8]
lea ebx, [esi + esi*2]
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x4c], edi
test ebx, ebx
jle 0x407433
mov esi, ecx
mov eax, edx
sub esi, edx
mov edi, ebx
mov bl, byte [esi + eax]
mov byte [eax], bl
inc eax
dec edi
jne 0x407424
mov eax, dword [ebp - 0x44]
mov ebx, dword [ebp - 0x54]
add edx, ebx
add ecx, eax
dec dword [ebp - 0x4c]
jne 0x407418
jmp 0x407487
cmp ebx, 8
jne 0x407487
test edi, edi
jle 0x407487
mov edx, dword [ebp - 0x48]
lea ecx, [edi - 1]
imul ecx, esi
mov eax, esi
neg eax
add ecx, dword [ebp + 8]
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x44], edi
test esi, esi
jle 0x40747e
mov edi, ecx
mov eax, edx
sub edi, edx
mov dword [ebp - 0x4c], esi
lea ebx, [ebx]
mov bl, byte [edi + eax]
mov byte [eax], bl
inc eax
dec dword [ebp - 0x4c]
jne 0x407470
mov eax, dword [ebp - 0x54]
add edx, esi
add ecx, eax
dec dword [ebp - 0x44]
jne 0x40745d
mov edi, dword [ebp - 0x58]
mov edx, dword [ebp - 0x50]
mov esi, dword [ebp - 0x48]
push edi
push 1
push edx
push esi
call fcn.00516896
push edi
call fcn.00516a4b
push esi
call fcn.005169a4
mov ecx, dword [ebp - 8]
add esp, 0x18
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.005162b5
mov esp, ebp
pop ebp
ret 0xc