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

Disassembly:
push ebp
mov ebp, esp
push 0
push 0
push 0
push ebx
push esi
push edi
mov ebx, eax
xor eax, eax
push ebp
push 0x4bf8c3
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x4d5d70]
cmp byte [eax + 0x39c2], 0
jne 0x4bf8a8
xor eax, eax
mov dword [ebp - 4], eax
mov byte [ebx + 0x5c4], 0x55
push 0
lea eax, [ebx + 0x3974]
push eax
push 4
lea eax, [ebx + 0x5c4]
push eax
mov eax, dword [ebx + 0x3e0]
push eax
call sub.kernel32.dll_WriteFile_1
push 0
lea eax, [ebx + 0x3978]
push eax
push 4
lea eax, [ebx + 0x560]
push eax
mov eax, dword [ebx + 0x3e0]
push eax
call sub.kernel32.dll_ReadFile_1
mov al, byte [ebx + 0x560]
and al, 7
mov esi, eax
and esi, 0xff
cmp esi, 7
je 0x4bf69a
mov eax, dword [0x4d5d70]
mov byte [eax + 0x39c2], 1
mov eax, dword [ebx + 0x39ac]
cmp eax, 0x16
je 0x4bf8a8
cmp eax, 8
je 0x4bf8a8
cmp eax, 0xa
je 0x4bf8a8
mov eax, dword [0x4d5d70]
mov eax, dword [eax + 0x3c4]
mov edx, 0x4bf8dc
call fcn.00462360
jmp 0x4bf8a8
mov byte [ebx + 0x5c4], 0x55
push 0
lea eax, [ebx + 0x3974]
push eax
push 4
lea eax, [ebx + 0x5c4]
push eax
mov eax, dword [ebx + 0x3e0]
push eax
call sub.kernel32.dll_WriteFile_1
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_Sleep_1
xor edx, edx
mov eax, dword [ebx + 0x36c]
call fcn.00462360
mov byte [ebx + 0x5c4], 0x86
push 0
lea eax, [ebx + 0x3974]
push eax
push 4
lea eax, [ebx + 0x5c4]
push eax
mov eax, dword [ebx + 0x3e0]
push eax
call sub.kernel32.dll_WriteFile_1
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_Sleep_1
lea eax, [ebp - 8]
call fcn.00404b98
mov eax, dword [0x4d5d70]
mov byte [eax + 0x39c2], 0
xor edi, edi
push 0
lea eax, [ebx + 0x3978]
push eax
push 8
lea eax, [ebx + 0x560]
push eax
mov eax, dword [ebx + 0x3e0]
push eax
call sub.kernel32.dll_ReadFile_1
movzx esi, byte [ebx + 0x560]
push dword [ebp - 8]
push 0x4bf8ec
lea edx, [ebp - 0xc]
mov eax, esi
and eax, 0xf
call fcn.00409200
push dword [ebp - 0xc]
lea eax, [ebp - 8]
mov edx, 3
call fcn.00404f18
and esi, 0xf
cmp edi, 1
jne 0x4bf770
cmp esi, 0xf
je 0x4bf77a
cmp edi, 2
jne 0x4bf786
cmp esi, 0xf
jne 0x4bf786
mov eax, dword [0x4d5d70]
mov byte [eax + 0x39c2], 1
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_Sleep_1
cmp edi, 4
jne 0x4bf7de
cmp byte [ebx + 0x39c2], 0
jne 0x4bf7de
test esi, 8
je 0x4bf7ae
mov byte [ebx + 0x39c3], 1
jmp 0x4bf7b5
mov byte [ebx + 0x39c3], 0
test esi, 4
je 0x4bf7c6
mov byte [ebx + 0x39c4], 1
jmp 0x4bf7cd
mov byte [ebx + 0x39c4], 0
mov eax, esi
and eax, 3
mov edx, dword [0x4d5d70]
mov dword [edx + 0x39c8], eax
cmp edi, 5
jne 0x4bf7f7
cmp byte [ebx + 0x39c2], 0
jne 0x4bf7f7
mov eax, dword [0x4d5d70]
mov dword [eax + 0x39d0], esi
cmp edi, 6
jne 0x4bf813
cmp byte [ebx + 0x39c2], 0
jne 0x4bf813
and esi, 7
mov eax, dword [0x4d5d70]
mov dword [eax + 0x39cc], esi
inc edi
cmp edi, 8
jne 0x4bf719
mov byte [ebx + 0x5c4], 0x80
push 0
lea eax, [ebx + 0x3974]
push eax
push 4
lea eax, [ebx + 0x5c4]
push eax
mov eax, dword [ebx + 0x3e0]
push eax
call sub.kernel32.dll_WriteFile_1
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_Sleep_1
mov edx, dword [ebp - 8]
mov eax, dword [ebx + 0x36c]
call fcn.00462360
mov eax, dword [0x4d5d70]
cmp byte [eax + 0x39c2], 0
je 0x4bf8a8
mov eax, dword [ebx + 0x39ac]
cmp eax, 0x16
je 0x4bf893
cmp eax, 8
je 0x4bf893
cmp eax, 0xa
je 0x4bf893
mov eax, dword [0x4d5d70]
mov eax, dword [eax + 0x3c4]
mov edx, 0x4bf8dc
call fcn.00462360
jmp 0x4bf8a8
mov eax, dword [0x4d5d70]
mov eax, dword [eax + 0x3c4]
mov edx, 0x4bf8f8
call fcn.00462360
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4bf8ca
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.00404bbc
ret