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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov byte [ebp - 1], dl
mov ebx, eax
movsx eax, bl
mov edx, dword [0x4becf0]
cmp word [edx + eax*2 + 0x54], 0x930
jne 0x49ed24
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 8]
mov eax, ebx
call fcn.00414050
mov byte [ebp - 9], al
jmp 0x49f124
mov byte [ebp - 9], 0
mov byte [ebp - 0x1b], 0
mov edx, dword [0x4becf0]
movzx esi, word [edx + eax*2 + 0x54]
mov eax, dword [ebp + 0xc]
and eax, 0x80000003
jns 0x49ed46
dec eax
or eax, 0xfffffffc
inc eax
test eax, eax
je 0x49ed73
movsx eax, bl
mov edx, dword [0x4beb88]
cmp byte [edx + eax + 0x2a], 1
je 0x49ed80
mov eax, dword [ebp + 0xc]
and eax, 0x80000001
jns 0x49ed69
dec eax
or eax, 0xfffffffe
inc eax
test eax, eax
jne 0x49ed80
cmp byte [ebp - 0x1b], 0
jne 0x49ed80
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x14], eax
jmp 0x49ede4
mov eax, esi
imul dword [ebp + 0x10]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
push eax
push 0x40
call sub.kernel32.dll_GlobalAlloc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x49edd0
mov eax, dword [ebp + 0x10]
xor edx, edx
push edx
push eax
mov eax, esi
cdq
call fcn.0040548c
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], edx
fild qword [ebp - 0x38]
add esp, 0xfffffff8
fistp qword [esp]
wait
call fcn.004b1e30
mov edx, eax
mov ax, 0xb
call fcn.004acdac
jmp 0x49f124
cmp byte [ebp - 1], 0
je 0x49ede4
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x18]
call fcn.004066dc
mov eax, dword [ebp - 0x18]
and eax, 0x80000003
jns 0x49edf3
dec eax
or eax, 0xfffffffc
inc eax
test eax, eax
sete byte [ebp - 0x1a]
lea edx, [ebp - 0x2e]
mov eax, ebx
call fcn.004138d0
push 0
call sub.kernel32.dll_SetLastError
cmp byte [ebp - 1], 0
je 0x49ee9c
cmp byte [0x4c254d], 0
jne 0x49ee3f
push 0
push 0x20000000
push 3
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0x2e]
push eax
call sub.kernel32.dll_CreateFileA_1
mov edi, eax
jmp 0x49ef0f
cmp dword [0x4c2544], 0
jne 0x49ee94
push 0
push 0x20000000
push 3
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0x2e]
push eax
call sub.kernel32.dll_CreateFileA_1
mov edi, eax
mov dword [0x4c2544], edi
cmp byte [0x4c254f], 0
je 0x49ef0f
mov dl, 1
mov eax, edi
call fcn.0049ebd8
test al, al
jne 0x49ef0f
push edi
call sub.kernel32.dll_CloseHandle_1
jmp 0x49f101
mov edi, dword [0x4c2544]
jmp 0x49ef0f
cmp byte [0x4c254e], 0
je 0x49eeb6
cmp dword [0x4c2548], 0
je 0x49eed5
cmp bl, byte [0x4c254c]
je 0x49eed5
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
lea eax, [ebp - 0x2e]
push eax
call sub.kernel32.dll_CreateFileA_1
mov edi, eax
jmp 0x49ef0f
cmp dword [0x4c2548], 0
jne 0x49ef09
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
lea eax, [ebp - 0x2e]
push eax
call sub.kernel32.dll_CreateFileA_1
mov edi, eax
mov dword [0x4c2548], edi
mov byte [0x4c254c], bl
jmp 0x49ef0f
mov edi, dword [0x4c2548]
cmp edi, 0xffffffff
jne 0x49ef75
cmp byte [ebp - 1], 0
jne 0x49ef28
mov eax, dword [0x4be84c]
cmp byte [eax], 0
jne 0x49f101
call sub.kernel32.dll_GetLastError_1
mov ebx, eax
mov eax, ebx
call fcn.004ae200
cmp ebx, 5
jne 0x49ef62
mov eax, dword [0x4bedb0]
call fcn.004ab7d8
mov eax, dword [0x4bedb0]
call fcn.004ab7d8
mov eax, dword [0x4beab0]
mov eax, dword [eax]
push eax
mov eax, dword [0x4bedb0]
push eax
call sub.kernel32.dll_lstrcatA
mov edx, dword [0x4bedb0]
mov eax, dword [ebp + 8]
call fcn.004b81b0
jmp 0x49f101
mov eax, dword [ebp - 8]
call fcn.004aef80
mov dword [ebp - 0x3c], esi
fild dword [ebp - 0x3c]
fmulp st(1)
mov eax, dword [0x4be4c4]
fistp qword [eax]
wait
push 0
mov eax, dword [0x4be4c4]
call fcn.004af014
push eax
mov eax, dword [0x4be4c4]
push dword [eax + 4]
push dword [eax]
call fcn.004af008
push eax
push edi
call sub.kernel32.dll_SetFilePointer_1
call sub.kernel32.dll_GetLastError_1
test eax, eax
jne 0x49f02e
cmp byte [ebp - 1], 0
je 0x49efe0
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp + 0x10]
imul esi
push eax
mov eax, dword [ebp - 0x18]
push eax
push edi
call sub.kernel32.dll_WriteFile_1
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x19], al
jmp 0x49efff
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp + 0x10]
imul esi
push eax
mov eax, dword [ebp - 0x18]
push eax
push edi
call sub.kernel32.dll_ReadFile_1
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x19], al
mov eax, esi
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
xor edx, edx
call fcn.0040548c
push edx
push eax
mov eax, dword [ebp - 0x10]
xor edx, edx
cmp edx, dword [esp + 4]
jne 0x49f024
cmp eax, dword [esp]
pop edx
pop eax
jae 0x49f032
jmp 0x49f028
pop edx
pop eax
jge 0x49f032
mov byte [ebp - 0x19], 0
jmp 0x49f032
mov byte [ebp - 0x19], 0
movsx eax, bl
mov edx, dword [0x4beb88]
cmp byte [edx + eax + 0x2a], 0
jne 0x49f08b
cmp byte [ebp - 0x19], 0
jne 0x49f05d
cmp byte [ebp - 0x1a], 0
jne 0x49f05d
cmp byte [ebp - 0x1b], 0
jne 0x49f05d
mov byte [ebp - 0x1b], 1
jmp 0x49ed37
cmp byte [ebp - 0x19], 0
je 0x49f08b
cmp byte [ebp - 0x1b], 0
je 0x49f077
movsx eax, bl
mov edx, dword [0x4beb88]
mov byte [edx + eax + 0x2a], 1
cmp byte [ebp - 0x1a], 0
jne 0x49f08b
movsx eax, bl
mov edx, dword [0x4beb88]
mov byte [edx + eax + 0x2a], 2
cmp byte [ebp - 0x19], 0
jne 0x49f0a9
call sub.kernel32.dll_GetLastError_1
call fcn.004ae200
mov edx, dword [0x4bedb0]
mov eax, dword [ebp + 8]
call fcn.004b81b0
cmp byte [ebp - 1], 0
jne 0x49f0c9
cmp byte [0x4c254e], 0
je 0x49f0d8
cmp dword [0x4c2548], 0
je 0x49f0c9
cmp bl, byte [0x4c254c]
jne 0x49f0d8
cmp byte [ebp - 1], 0
je 0x49f0de
cmp byte [0x4c254d], 0
jne 0x49f0de
push edi
call sub.kernel32.dll_CloseHandle_1
cmp byte [ebp - 0x19], 0
je 0x49f0f8
mov eax, esi
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
xor edx, edx
call fcn.0040548c
cmp eax, dword [ebp - 0x10]
jbe 0x49f0fc
xor eax, eax
jmp 0x49f0fe
mov al, 1
mov byte [ebp - 9], al
cmp dword [ebp - 0x14], 0
jbe 0x49f124
cmp byte [ebp - 1], 0
jne 0x49f11b
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp + 0xc]
call fcn.004066dc
mov eax, dword [ebp - 0x18]
push eax
call sub.kernel32.dll_GlobalFree
mov al, byte [ebp - 9]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc