Function at 0x50fbb0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov al, byte [ebp + 0x214]
test al, al
je 0x50fbc9
mov eax, dword [ebp]
call dword [eax + 0x10]
mov esi, dword [esp + 0x38]
lea eax, [ebp + 8]
push 0x104
push esi
push eax
call dword [sym.imp.MSVCRT.dll_strncpy]
lea ecx, [ebp + 0x10c]
push ecx
push esi
call fcn.0050f1b0
mov ebx, dword [esp + 0x50]
add esp, 0x14
test bl, 1
mov byte [esp + 0x14], 0
je 0x50fc29
mov edi, 0x5d3944
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, ebx
and eax, 2
mov dword [esp + 0x38], eax
je 0x50fc62
mov edi, 0x5d3940
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
test bl, 4
je 0x50fc95
mov edi, 0x5b9e80
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, ebx
lea edx, [esp + 0x14]
and eax, 8
mov edi, 0x5d393c
mov dword [esp + 0x3c], eax
jne 0x50fcae
mov edi, str.btwr
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x14]
mov ecx, edx
push eax
and ecx, 3
lea eax, [ebp + 8]
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebp + 4], eax
test eax, eax
jne 0x50fcf8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x24
ret 8
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x50fd6a
mov ecx, dword [esp + 0x3c]
mov dword [ebp + 0x210], ebx
test ecx, ecx
je 0x50fd3c
push eax
push 1
lea ecx, [esp + 0x18]
push 4
push ecx
mov dword [esp + 0x20], 0x54584f4d
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov byte [ebp + 0x214], 1
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret 8
push eax
push 1
lea edx, [esp + 0x18]
push 4
push edx
mov dword [esp + 0x20], 0x42584f4d
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov byte [ebp + 0x214], 1
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret 8
push eax
push 1
lea eax, [esp + 0x18]
and ebx, 0xffffffe7
push 4
push eax
mov dword [ebp + 0x210], ebx
call dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [esp + 0x20]
add esp, 0x10
cmp eax, 0x42584f4d
jne 0x50fdb2
mov eax, dword [ebp + 0x210]
pop edi
or al, 0x10
mov byte [ebp + 0x214], 1
mov dword [ebp + 0x210], eax
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x24
ret 8
cmp eax, 0x54584f4d
jne 0x50fdda
mov eax, dword [ebp + 0x210]
pop edi
or al, 8
mov byte [ebp + 0x214], 1
mov dword [ebp + 0x210], eax
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x24
ret 8
mov ebx, dword [ebp + 0x210]
mov ecx, dword [ebp + 4]
push 0
or ebx, 8
push 0
push ecx
mov dword [ebp + 0x210], ebx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
mov byte [ebp + 0x214], 1
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret 8