Function at 0x514d97
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
push edi
xor edi, edi
push edi
mov esi, ecx
push 0x80
push 2
push edi
push edi
lea eax, [esi + 0x7c]
push 0x40000000
push eax
mov dword [ebp - 0x24], edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
jne 0x514dea
mov ecx, esi
call fcn.00512f20
lea eax, [ebp - 0x24]
push 0x5af2c0
push eax
mov dword [ebp - 0x24], 0x4001
call fcn.00529cc7
cmp dword [esi + 0x14], edi
mov eax, dword [esi + 0x30]
je 0x514df4
shl eax, 1
push eax
call fcn.005444b9
cmp dword [esi + 0x14], edi
mov edx, eax
pop ecx
mov dword [ebp - 0x20], edx
jne 0x514e18
xor eax, eax
cmp dword [esi + 0x30], edi
jbe 0x514e2e
mov byte [eax + edx], 0x20
inc eax
cmp eax, dword [esi + 0x30]
jb 0x514e0c
jmp 0x514e2e
xor ecx, ecx
cmp dword [esi + 0x30], edi
jbe 0x514e2e
mov eax, edx
mov word [eax], 0x20
inc ecx
inc eax
inc eax
cmp ecx, dword [esi + 0x30]
jb 0x514e21
push 4
push 0x1000
push 0xa0000
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, edi
mov dword [esi + 0x18c], eax
jne 0x514e57
mov dword [esi + 0x10], 0x201
jmp 0x51510c
mov ecx, dword [esi + 0x18]
mov eax, dword [esi + 0x1c]
mov ebx, ecx
mov dword [ebp - 0x10], edi
lea edx, [eax + ecx]
mov dword [ebp - 8], ebx
cmp ebx, edx
jae 0x515110
lea edx, [ebx + 1]
mov dword [ebp - 0xc], edx
lea edx, [ebx + 2]
mov dword [ebp - 0x1c], edx
cmp dword [esi + 0x20], edi
je 0x514eac
mov edx, ebx
mov dword [ebp - 0x30], eax
sub edx, ecx
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edx
push edi
fild dword [ebp - 0x28]
fmul dword [0x58de4c]
fild qword [ebp - 0x30]
fdivp st(1)
call fcn.00528c4c
push eax
push 5
mov ecx, esi
call fcn.00514cf7
cmp dword [esi + 0x14], edi
jne 0x514fae
mov al, byte [ebx]
mov ecx, ebx
cmp al, byte [esi + 0x28]
sete dl
sub ecx, dword [ebp - 8]
cmp ecx, 0x4e20
jge 0x514ede
cmp al, 0xd
jne 0x514ed6
mov ecx, dword [ebp - 0xc]
cmp byte [ecx], 0xa
je 0x514ede
cmp al, 0xa
je 0x514ede
test al, al
jne 0x514f03
cmp al, 0xd
mov dword [ebp - 8], ebx
mov dword [ebp - 0x10], edi
jne 0x514ef5
mov ecx, dword [ebp - 0xc]
cmp byte [ecx], 0xa
jne 0x514ef5
mov eax, dword [ebp - 0x1c]
jmp 0x514f00
cmp al, 0xa
je 0x514efd
test al, al
jne 0x514f03
mov eax, dword [ebp - 0xc]
mov dword [ebp - 8], eax
test dl, dl
je 0x514f0c
mov eax, dword [esi + 0x30]
jmp 0x514f0f
push 1
pop eax
mov ecx, dword [ebp - 4]
add eax, ecx
cmp eax, 0xa0000
jb 0x514f46
lea eax, [ebp - 0x14]
push edi
push eax
push ecx
push dword [esi + 0x18c]
mov dword [ebp - 0x14], edi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5150f3
mov eax, dword [ebp - 0x14]
mov dword [ebp - 4], edi
add dword [ebp - 0x24], eax
jmp 0x514fa2
test dl, dl
jne 0x514f63
mov eax, dword [esi + 0x18c]
push 1
add eax, ecx
push ebx
push eax
call fcn.005244d0
add esp, 0xc
inc dword [ebp - 4]
jmp 0x514fa2
mov ecx, dword [ebp - 0x10]
mov edi, dword [esi + 0x30]
sub ecx, dword [ebp - 8]
xor edx, edx
add ecx, ebx
mov eax, ecx
div edi
mov edi, eax
mov eax, dword [esi + 0x18c]
inc edi
add eax, dword [ebp - 4]
imul edi, dword [esi + 0x30]
sub edi, ecx
push edi
push dword [ebp - 0x20]
push eax
call fcn.005244d0
mov eax, dword [ebp - 0x10]
add dword [ebp - 4], edi
add esp, 0xc
lea eax, [eax + edi - 1]
xor edi, edi
mov dword [ebp - 0x10], eax
inc ebx
inc dword [ebp - 0x1c]
inc dword [ebp - 0xc]
jmp 0x5150bf
mov ax, word [ebx]
mov ecx, ebx
cmp ax, word [esi + 0x28]
sete dl
sub ecx, dword [ebp - 8]
cmp ecx, 0x4e20
jge 0x514fdf
cmp ax, 0xd
jne 0x514fd4
mov ecx, dword [ebp - 0xc]
cmp word [ecx], 0xa
je 0x514fdf
cmp ax, 0xa
je 0x514fdf
cmp ax, di
jne 0x51500a
cmp ax, 0xd
mov dword [ebp - 8], ebx
mov dword [ebp - 0x10], edi
jne 0x514ff9
mov ecx, dword [ebp - 0xc]
cmp word [ecx], 0xa
jne 0x514ff9
mov eax, dword [ebp - 0x1c]
jmp 0x515007
cmp ax, 0xa
je 0x515004
cmp ax, di
jne 0x51500a
mov eax, dword [ebp - 0xc]
mov dword [ebp - 8], eax
test dl, dl
je 0x515013
mov eax, dword [esi + 0x30]
jmp 0x515016
push 1
pop eax
mov ecx, dword [ebp - 4]
lea eax, [ecx + eax*2]
cmp eax, 0xa0000
jb 0x51504e
lea eax, [ebp - 0x14]
push edi
push eax
push ecx
push dword [esi + 0x18c]
mov dword [ebp - 0x14], edi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5150f3
mov eax, dword [ebp - 0x14]
mov dword [ebp - 4], edi
add dword [ebp - 0x24], eax
jmp 0x5150b5
test dl, dl
jne 0x51506b
mov eax, dword [esi + 0x18c]
push 2
add eax, ecx
push ebx
push eax
call fcn.005244d0
add esp, 0xc
inc dword [ebp - 4]
jmp 0x5150b5
mov ecx, ebx
mov edi, dword [esi + 0x30]
sub ecx, dword [ebp - 8]
xor edx, edx
shr ecx, 1
add ecx, dword [ebp - 0x10]
mov eax, ecx
div edi
mov edi, eax
inc edi
imul edi, dword [esi + 0x30]
sub edi, ecx
lea eax, [edi + edi]
mov dword [ebp - 0x28], eax
push eax
mov eax, dword [esi + 0x18c]
push dword [ebp - 0x20]
add eax, dword [ebp - 4]
push eax
call fcn.005244d0
mov eax, dword [ebp - 0x28]
add esp, 0xc
add dword [ebp - 4], eax
mov eax, dword [ebp - 0x10]
lea eax, [eax + edi - 1]
xor edi, edi
mov dword [ebp - 0x10], eax
add dword [ebp - 0x1c], 2
inc ebx
inc ebx
add dword [ebp - 0xc], 2
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x18]
lea edx, [eax + ecx]
cmp ebx, edx
jb 0x514e7c
cmp dword [ebp - 4], edi
jbe 0x515110
lea eax, [ebp - 0x14]
push edi
push eax
mov dword [ebp - 0x14], edi
push dword [ebp - 4]
push dword [esi + 0x18c]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x515110
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x20]
mov dword [esi + 0x10], 0x401
call fcn.005444e2
pop ecx
xor al, al
jmp 0x515145
push dword [ebp - 0x20]
call fcn.005444e2
pop ecx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x8000
push edi
push dword [esi + 0x18c]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [esi + 0x18c], edi
mov al, 1
pop edi
pop esi
pop ebx
leave
ret