Function at 0x51e1ec
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x24], 0xc
mov dword [ebp - 0x20], 0
mov eax, dword [ebp + 0xc]
and eax, 0x80
test eax, eax
je 0x51e12d
mov dword [ebp - 0x1c], 0
mov byte [ebp - 0x38], 0x10
jmp 0x51e138
mov dword [ebp - 0x1c], 1
mov byte [ebp - 0x38], 0
mov ecx, dword [ebp + 0xc]
and ecx, 0x8000
test ecx, ecx
jne 0x51e171
mov edx, dword [ebp + 0xc]
and edx, 0x4000
test edx, edx
je 0x51e15c
mov al, byte [ebp - 0x38]
or al, 0x80
mov byte [ebp - 0x38], al
jmp 0x51e171
cmp dword [0x64e620], 0x8000
je 0x51e171
mov cl, byte [ebp - 0x38]
or cl, 0x80
mov byte [ebp - 0x38], cl
mov edx, dword [ebp + 0xc]
and edx, 3
mov dword [ebp - 0x40], edx
cmp dword [ebp - 0x40], 0
je 0x51e18e
cmp dword [ebp - 0x40], 1
je 0x51e197
cmp dword [ebp - 0x40], 2
je 0x51e1a0
jmp 0x51e1a9
mov dword [ebp - 0x34], 0x80000000
jmp 0x51e1c5
mov dword [ebp - 0x34], 0x40000000
jmp 0x51e1c5
mov dword [ebp - 0x34], 0xc0000000
jmp 0x51e1c5
mov dword [0x64e33c], 0x16
mov dword [0x64e340], 0
or eax, 0xffffffff
jmp 0x51e5a7
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
sub ecx, 0x10
mov dword [ebp - 0x44], ecx
cmp dword [ebp - 0x44], 0x30
ja case.0x51e1e5.4
mov eax, dword [ebp - 0x44]
xor edx, edx
mov dl, byte [eax + 0x51e5bf]
jmp dword [edx*4 + 0x51e5ab]
mov dword [ebp - 8], 0
jmp 0x51e22c
mov dword [ebp - 8], 1
jmp 0x51e22c
mov dword [ebp - 8], 2
jmp 0x51e22c
mov dword [ebp - 8], 3
jmp 0x51e22c
mov dword [0x64e33c], 0x16
mov dword [0x64e340], 0
or eax, 0xffffffff
jmp 0x51e5a7
mov ecx, dword [ebp + 0xc]
and ecx, 0x700
mov dword [ebp - 0x48], ecx
cmp dword [ebp - 0x48], 0x400
jg 0x51e278
cmp dword [ebp - 0x48], 0x400
je 0x51e295
cmp dword [ebp - 0x48], 0x200
jg 0x51e26d
cmp dword [ebp - 0x48], 0x200
je 0x51e2b0
cmp dword [ebp - 0x48], 0
je 0x51e295
cmp dword [ebp - 0x48], 0x100
je 0x51e29e
jmp 0x51e2c2
cmp dword [ebp - 0x48], 0x300
je 0x51e2b9
jmp 0x51e2c2
cmp dword [ebp - 0x48], 0x500
je 0x51e2a7
cmp dword [ebp - 0x48], 0x600
je 0x51e2b0
cmp dword [ebp - 0x48], 0x700
je 0x51e2a7
jmp 0x51e2c2
mov dword [ebp - 0x18], 3
jmp 0x51e2de
mov dword [ebp - 0x18], 4
jmp 0x51e2de
mov dword [ebp - 0x18], 1
jmp 0x51e2de
mov dword [ebp - 0x18], 5
jmp 0x51e2de
mov dword [ebp - 0x18], 2
jmp 0x51e2de
mov dword [0x64e33c], 0x16
mov dword [0x64e340], 0
or eax, 0xffffffff
jmp 0x51e5a7
mov dword [ebp - 0x28], 0x80
mov edx, dword [ebp + 0xc]
and edx, 0x100
test edx, edx
je 0x51e32f
lea eax, [ebp + 0x14]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
add ecx, 4
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x2c]
mov eax, dword [edx - 4]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x2c], 0
mov ecx, dword [0x64e344]
not ecx
mov edx, dword [ebp - 0x10]
and edx, ecx
and edx, 0x80
test edx, edx
jne 0x51e32f
mov dword [ebp - 0x28], 1
mov eax, dword [ebp + 0xc]
and eax, 0x40
test eax, eax
je 0x51e351
mov ecx, dword [ebp - 0x28]
or ecx, 0x4000000
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x34]
or edx, 0x10000
mov dword [ebp - 0x34], edx
mov eax, dword [ebp + 0xc]
and eax, 0x1000
test eax, eax
je 0x51e366
mov ecx, dword [ebp - 0x28]
or ch, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp + 0xc]
and edx, 0x20
test edx, edx
je 0x51e37d
mov eax, dword [ebp - 0x28]
or eax, 0x8000000
mov dword [ebp - 0x28], eax
jmp 0x51e393
mov ecx, dword [ebp + 0xc]
and ecx, 0x10
test ecx, ecx
je 0x51e393
mov edx, dword [ebp - 0x28]
or edx, 0x10000000
mov dword [ebp - 0x28], edx
call fcn.00524770
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x51e3bd
mov dword [0x64e33c], 0x18
mov dword [0x64e340], 0
or eax, 0xffffffff
jmp 0x51e5a7
push 0
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x51e3fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.005246e0
add esp, 4
or eax, 0xffffffff
jmp 0x51e5a7
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x51e431
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.005246e0
add esp, 4
or eax, 0xffffffff
jmp 0x51e5a7
cmp dword [ebp - 0xc], 2
jne 0x51e442
mov dl, byte [ebp - 0x38]
or dl, 0x40
mov byte [ebp - 0x38], dl
jmp 0x51e450
cmp dword [ebp - 0xc], 3
jne 0x51e450
mov al, byte [ebp - 0x38]
or al, 8
mov byte [ebp - 0x38], al
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.005248a0
add esp, 8
mov al, byte [ebp - 0x38]
or al, 1
mov byte [ebp - 0x38], al
mov ecx, dword [ebp - 0x14]
sar ecx, 5
mov edx, dword [ebp - 0x14]
and edx, 0x1f
mov eax, dword [ecx*4 + 0x64fd40]
mov cl, byte [ebp - 0x38]
mov byte [eax + edx*8 + 4], cl
movsx edx, byte [ebp - 0x38]
and edx, 0x48
test edx, edx
jne 0x51e55e
movsx eax, byte [ebp - 0x38]
and eax, 0x80
test eax, eax
je 0x51e55e
mov ecx, dword [ebp + 0xc]
and ecx, 2
test ecx, ecx
je 0x51e55e
push 2
push 0xffffffffffffffff
mov edx, dword [ebp - 0x14]
push edx
call fcn.0051d690
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0xffffffff
jne 0x51e4eb
cmp dword [0x64e340], 0x83
je 0x51e4e9
mov eax, dword [ebp - 0x14]
push eax
call fcn.0051ded0
add esp, 4
or eax, 0xffffffff
jmp 0x51e5a7
jmp 0x51e55e
mov byte [ebp - 0x30], 0
push 1
lea ecx, [ebp - 0x30]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.0051d230
add esp, 0xc
test eax, eax
jne 0x51e534
movsx eax, byte [ebp - 0x30]
cmp eax, 0x1a
jne 0x51e534
mov ecx, dword [ebp - 0x3c]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.00524c20
add esp, 8
cmp eax, 0xffffffff
jne 0x51e534
mov eax, dword [ebp - 0x14]
push eax
call fcn.0051ded0
add esp, 4
or eax, 0xffffffff
jmp 0x51e5a7
push 0
push 0
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.0051d690
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0xffffffff
jne 0x51e55e
mov edx, dword [ebp - 0x14]
push edx
call fcn.0051ded0
add esp, 4
or eax, 0xffffffff
jmp 0x51e5a7
movsx eax, byte [ebp - 0x38]
and eax, 0x48
test eax, eax
jne 0x51e5a4
mov ecx, dword [ebp + 0xc]
and ecx, 8
test ecx, ecx
je 0x51e5a4
mov edx, dword [ebp - 0x14]
sar edx, 5
mov eax, dword [ebp - 0x14]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x64fd40]
mov dl, byte [ecx + eax*8 + 4]
or dl, 0x20
mov eax, dword [ebp - 0x14]
sar eax, 5
mov ecx, dword [ebp - 0x14]
and ecx, 0x1f
mov eax, dword [eax*4 + 0x64fd40]
mov byte [eax + ecx*8 + 4], dl
mov eax, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret