Function at 0x516ec0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34c
push ebx
push esi
mov ebx, eax
or esi, 0xffffffff
push edi
cmp dword [ebx + 4], esi
je 0x516edd
mov edi, dword [ebx]
call fcn.00515e50
mov edi, dword [ebp + 8]
mov dword [ebx + 4], esi
mov esi, dword [ebx]
cmp edi, dword [esi + 4]
jl 0x516ef8
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp edi, dword [esi + 0x10]
jge 0x516f02
call fcn.005161a0
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jge 0x516f5d
lea esp, [esp]
mov esi, dword [ebx]
test esi, esi
je 0x516f56
cmp dword [esi + 0x18], 0
je 0x516f56
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x516f56
mov ecx, dword [esi + 0x50]
add ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
push 0
lea ecx, [ecx + edx + 0x2e]
add dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
push 0
lea edx, [esi + 0x78]
push edx
lea eax, [esi + 0x28]
push eax
mov eax, esi
call fcn.00515660
add esp, 0x10
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], edi
jl 0x516f10
lea edx, [ebp - 0x240]
push edx
push edi
push ebx
call fcn.005165e0
test byte [ebp - 0x138], 0x10
je 0x516fbc
mov ecx, dword [ebp + 0xc]
mov al, byte [ecx]
cmp al, 0x2f
je 0x516f8b
cmp al, 0x5c
je 0x516f8b
test al, al
je 0x516fa1
cmp byte [ecx + 1], 0x3a
jne 0x516fa1
push ecx
push 0
call fcn.00512b40
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push ecx
add ebx, 0x140
push ebx
call fcn.00512b40
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, dword [ebp + 0xc]
mov al, byte [esi]
mov edi, esi
mov ecx, esi
test al, al
je 0x516fe3
lea esp, [esp]
cmp al, 0x2f
je 0x516fd8
cmp al, 0x5c
jne 0x516fdb
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x516fd0
lea edx, [ebp - 0x110]
mov eax, esi
sub edx, esi
lea ecx, [ecx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x516ff0
cmp edi, esi
jne 0x51706e
mov byte [ebp - 0x110], cl
push edi
lea ecx, [ebp - 0x110]
push ecx
lea esi, [ebx + 0x140]
push esi
lea edx, [ebp - 0x348]
push str._s_s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea eax, [ebp - 0x110]
push eax
push esi
call fcn.00512b40
add esp, 8
mov ecx, dword [ebp - 0x138]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
lea edx, [ebp - 0x348]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x5170cd
mov eax, 0x200
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, edi
sub eax, esi
mov byte [ebp + eax - 0x110], 0
mov al, byte [ebp - 0x110]
cmp al, 0x2f
je 0x51709d
cmp al, 0x5c
je 0x51709d
test al, al
je 0x517004
cmp byte [ebp - 0x10f], 0x3a
jne 0x517004
push edi
lea ecx, [ebp - 0x110]
push ecx
lea edx, [ebp - 0x348]
push str._s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x110]
push eax
push 0
call fcn.00512b40
add esp, 0x18
jmp 0x517038
mov eax, dword [ebx + 0x138]
push eax
mov eax, dword [ebx]
call fcn.00516bd0
add esp, 4
cmp dword [ebx + 0x13c], 0
jne 0x5170fa
push 0x4000
call fcn.004048de
add esp, 4
mov dword [ebx + 0x13c], eax
mov dword [ebp + 8], 0
mov edx, dword [ebx + 0x13c]
mov eax, dword [ebx]
lea ecx, [ebp + 0xf]
push ecx
push edx
mov ecx, 0x4000
call fcn.00515ee0
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x517154
test esi, esi
js 0x51714b
jle 0x517141
mov ecx, dword [ebx + 0x13c]
push 0
lea eax, [ebp - 4]
push eax
push esi
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x51715d
cmp byte [ebp + 0xf], 0
jne 0x517166
test esi, esi
jne 0x517101
mov dword [ebp + 8], 0x5000000
jmp 0x517182
mov dword [ebp + 8], 0x1000
jmp 0x517182
mov dword [ebp + 8], 0x400
jmp 0x517182
lea edx, [ebp - 0x124]
push edx
lea eax, [ebp - 0x134]
push eax
lea ecx, [ebp - 0x12c]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebx]
call fcn.00515e50
mov eax, dword [ebp + 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8