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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x542250
mov eax, dword fs:[0]
push eax
sub esp, 0x130
mov eax, dword [0x5bc684]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x134], ecx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x130], ebx
xor esi, esi
mov dword [ebp - 0x120], esi
mov dword [ebp - 0x11c], esi
mov byte [ebp - 0x118], 0
add ecx, 0x250
push ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], esi
mov ecx, ebx
lea edx, [ebp - 0x118]
lea ecx, [ecx]
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x49d700
lea edi, [ebp - 0x118]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x49d711
mov eax, dword [0x572be4]
mov dword [edi], eax
lea ecx, [ebp - 0x118]
push ecx
call fcn.0049c1d0
add esp, 4
call fcn.0049b860
lea edx, [ebp - 0x118]
push edx
push ebx
call dword [0x5c1f94]
call fcn.0049b800
push esi
push 2
push 3
push esi
push esi
push SysReAllocString
lea eax, [ebp - 0x118]
push eax
call dword [0x5c1f8c]
mov edi, eax
mov dword [ebp - 0x120], edi
cmp edi, 0xffffffff
je 0x49d8e5
call fcn.0049b800
push esi
push 2
push 2
push esi
push esi
push 0xc0000000
push ebx
call dword [0x5c1f8c]
mov dword [ebp - 0x11c], eax
cmp eax, 0xffffffff
je 0x49d8de
mov dword [ebp - 0x124], esi
mov ebx, 1
mov dword [ebp - 0x13c], ebx
mov dword [ebp - 0x128], 0x8000
push 2
push esi
mov ecx, dword [ebp + 0xc]
neg ecx
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x8001
call fcn.004fc6be
add esp, 4
mov esi, eax
jmp 0x49d7e0
cmp dword [ebp - 0x128], 0x8000
jne 0x49d88f
push 0
lea edx, [ebp - 0x128]
push edx
push 0x8000
push esi
mov eax, dword [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x49d885
mov edi, dword [ebp - 0x128]
test edi, edi
je 0x49d88f
mov dword [ebp - 0x138], edi
mov eax, esi
mov byte [esi + edi], 0
test ebx, ebx
je 0x49d853
push 0x560e54
push esi
call fcn.004fee10
add esp, 8
test eax, eax
je 0x49d885
add eax, 2
mov ecx, esi
sub ecx, eax
add edi, ecx
mov dword [ebp - 0x138], edi
xor ebx, ebx
mov dword [ebp - 0x13c], ebx
mov dword [ebp - 0x12c], 0
push 0
lea edx, [ebp - 0x12c]
push edx
push edi
push eax
mov eax, dword [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x49d885
cmp edi, dword [ebp - 0x12c]
je 0x49d7e0
mov dword [ebp - 0x124], 1
push esi
call fcn.004808a0
add esp, 4
mov ecx, dword [ebp - 0x134]
cmp dword [ecx + 0x3c], 0
je 0x49d8b3
mov edx, dword [ebp - 0x11c]
push edx
call fcn.0049d520
add esp, 4
mov eax, dword [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x124], 0
je 0x49d8d8
mov ecx, dword [ebp - 0x130]
push ecx
call fcn.0049c1d0
add esp, 4
mov edi, dword [ebp - 0x120]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [ebp - 0x118]
push edx
call fcn.0049c1d0
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x134]
add ecx, 0x250
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004fe1f5
mov esp, ebp
pop ebp
ret 8