Function at 0x50dff0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
mov esi, ecx
xor ebp, ebp
push edi
mov eax, dword [esi + 0x10c]
sub eax, ebp
je 0x50e131
dec eax
jne 0x50e28b
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0x118]
push ebp
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esi + 0x110]
add esp, 0xc
mov dword [esp + 0x10], ebp
cmp eax, ebp
mov ebp, dword [sym.imp.MSVCRT.dll_fwrite]
jle 0x50e0f3
xor ebx, ebx
mov edi, dword [esi + 0x114]
mov edx, dword [esi + 0x118]
add edi, ebx
or ecx, 0xffffffff
xor eax, eax
push edx
repne scasb al, byte es:[edi]
push 1
lea eax, [esp + 0x1c]
not ecx
push 4
push eax
mov dword [esp + 0x24], ecx
call ebp
mov ecx, dword [esi + 0x118]
mov eax, dword [esi + 0x114]
mov edx, dword [esp + 0x24]
push ecx
push 1
add eax, ebx
push edx
push eax
call ebp
mov ecx, dword [esi + 0x118]
mov edx, dword [esi + 0x114]
push ecx
push 1
lea eax, [edx + ebx + 0x104]
push 4
push eax
call ebp
mov ecx, dword [esi + 0x118]
mov edx, dword [esi + 0x114]
push ecx
push 1
lea eax, [edx + ebx + 0x108]
push 4
push eax
call ebp
mov ecx, dword [esi + 0x118]
mov edx, dword [esi + 0x114]
add esp, 0x40
lea eax, [edx + ebx + 0x10c]
push ecx
push 1
push 4
push eax
call ebp
mov eax, dword [esp + 0x20]
mov ecx, dword [esi + 0x110]
add esp, 0x10
inc eax
add ebx, 0x110
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x50e03f
mov ecx, dword [esi + 0x118]
lea edi, [esi + 4]
push ecx
push 1
push 0x108
push edi
call ebp
mov edx, dword [esi + 0x118]
lea eax, [esi + 0x110]
push edx
push 1
push 4
push eax
call ebp
mov eax, dword [esi + 0x118]
push eax
push 1
push 4
push edi
call ebp
add esp, 0x30
jmp 0x50e289
cmp byte [esi], 0
je 0x50e28b
mov edi, dword [esi + 8]
mov ecx, dword [esi + 0x118]
push ebp
push edi
push ecx
mov dword [esp + 0x20], edi
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esi + 0x110]
mov ebx, dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0xc
cmp eax, ebp
mov dword [esp + 0x18], ebp
jle 0x50e232
mov edi, dword [esi + 0x114]
mov edx, dword [esi + 0x118]
add edi, ebp
or ecx, 0xffffffff
xor eax, eax
push edx
repne scasb al, byte es:[edi]
push 1
lea eax, [esp + 0x18]
not ecx
push 4
push eax
mov dword [esp + 0x20], ecx
call ebx
mov ecx, dword [esi + 0x118]
mov eax, dword [esi + 0x114]
mov edx, dword [esp + 0x20]
push ecx
push 1
add eax, ebp
push edx
push eax
call ebx
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov eax, dword [esi + 0x118]
lea edi, [edx + ecx + 4]
mov ecx, dword [esi + 0x114]
push eax
push 1
lea edx, [ecx + ebp + 0x104]
push 4
push edx
call ebx
mov eax, dword [esi + 0x118]
mov ecx, dword [esi + 0x114]
push eax
push 1
lea edx, [ecx + ebp + 0x108]
push 4
push edx
call ebx
mov eax, dword [esi + 0x118]
mov ecx, dword [esi + 0x114]
add esp, 0x40
lea edx, [ecx + ebp + 0x10c]
push eax
push 1
push 4
push edx
call ebx
mov eax, dword [esp + 0x28]
mov ecx, dword [esi + 0x110]
add esp, 0x10
add edi, 0xc
inc eax
add ebp, 0x110
cmp eax, ecx
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], eax
jl 0x50e16b
mov eax, dword [esi + 0x118]
lea ebp, [esi + 4]
push eax
push 1
push 0x108
push ebp
call ebx
mov ecx, dword [esi + 0x118]
lea eax, [esi + 0x110]
push ecx
push 1
push 4
push eax
call ebx
mov edx, dword [esi + 0x118]
push edx
push 1
push 4
push ebp
call ebx
mov eax, dword [esi + 0x118]
push eax
call dword [sym.imp.MSVCRT.dll__fileno]
add edi, 0x110
push edi
push eax
call dword [sym.imp.MSVCRT.dll__chsize]
add esp, 0x3c
mov byte [esi], 0
xor ebp, ebp
mov eax, dword [esi + 0x118]
cmp eax, ebp
je 0x50e2a5
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [esi + 0x118], ebp
mov eax, dword [esi + 0x114]
mov edi, dword [sym.imp.MSVCRT.dll_free]
cmp eax, ebp
je 0x50e2c1
push eax
call edi
add esp, 4
mov dword [esi + 0x114], ebp
mov eax, dword [esi + 0x11c]
cmp eax, ebp
je 0x50e2dd
push eax
call edi
add esp, 4
mov dword [esi + 0x11c], ebp
mov dword [esi + 0x120], ebp
mov dword [esi + 0x110], ebp
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0xc
ret