Function at 0x513630
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x56f790]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
mov dword [ebp - 0x20], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x28], ebx
cmp ebx, 0xffffffff
je 0x513877
mov edi, dword [esi + 0x414]
lea eax, [ebp - 0x18]
push 0
push eax
push 2
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x513870
cmp dword [ebp - 0x18], 2
jne 0x513870
push 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x1c], 1
push eax
push 2
lea eax, [ebp - 0x1c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x513870
cmp dword [ebp - 0x18], 2
jne 0x513870
movzx eax, di
push 0
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 0x1c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x513870
cmp dword [ebp - 0x18], 2
jne 0x513870
mov edx, dword [esi + 0x414]
xor ebx, ebx
mov dword [ebp - 0x1c], ebx
test edx, edx
je 0x5137ff
lea ecx, [esi + 0x41c]
mov dword [ebp - 0x18], ecx
nop dword [eax + eax]
movzx eax, byte [ecx - 4]
mov byte [ebp - 0x14], al
movzx eax, byte [ecx]
mov byte [ebp - 0x13], al
mov eax, dword [ecx + 0x10]
mov byte [ebp - 0x11], 0
movzx ecx, word [eax + 0xc]
mov word [ebp - 0x10], cx
movzx eax, word [eax + 0xe]
mov esi, eax
mov word [ebp - 0xe], ax
imul esi, ecx
cmp esi, 8
jl 0x513754
mov byte [ebp - 0x12], 0
jmp 0x51375d
mov al, 1
mov ecx, esi
shl al, cl
mov byte [ebp - 0x12], al
mov eax, dword [ebp - 0x18]
xor esi, esi
shl edx, 4
xor edi, edi
add edx, 6
mov eax, dword [eax + 0xc]
mov dword [ebp - 0xc], eax
xor eax, eax
cmp ebx, 2
jb 0x5137a1
mov eax, dword [ebp - 0x20]
lea ecx, [ebx - 2]
shr ecx, 1
add eax, 0x448
inc ecx
lea ebx, [ecx + ecx]
mov dword [ebp - 0x2c], ebx
mov ebx, dword [ebp - 0x1c]
nop
add esi, dword [eax - 0x20]
lea eax, [eax + 0x40]
add edi, dword [eax - 0x40]
sub ecx, 1
jne 0x513790
mov eax, dword [ebp - 0x2c]
cmp eax, ebx
jae 0x5137b2
mov ecx, dword [ebp - 0x20]
shl eax, 5
add edx, dword [eax + ecx + 0x428]
lea eax, [edi + esi]
add eax, edx
push 0
mov dword [ebp - 8], eax
lea eax, [ebp - 0x24]
push eax
push 0x10
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x513877
cmp dword [ebp - 0x24], 0x10
jne 0x513877
mov esi, dword [ebp - 0x20]
inc ebx
mov ecx, dword [ebp - 0x18]
add ecx, 0x20
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], ecx
mov edx, dword [esi + 0x414]
cmp ebx, edx
jb 0x513720
xor edi, edi
test edx, edx
je 0x513851
add esi, 0x428
nop dword [eax + eax]
mov eax, dword [esi + 4]
push 0
mov ebx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
lea eax, [ebp - 0x24]
push eax
push dword [esi]
push dword [esi - 4]
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x513877
mov eax, dword [ebp - 0x24]
cmp eax, dword [esi]
jne 0x513877
mov eax, dword [esi + 4]
inc edi
add esi, 0x20
mov dword [eax + 0x14], ebx
mov eax, dword [ebp - 0x20]
cmp edi, dword [eax + 0x414]
jb 0x513810
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ac4b8
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004ac4b8
mov esp, ebp
pop ebp
ret