Function at 0x499660
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c4
mov eax, dword [0x594ccc]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
push esi
push edi
xor esi, esi
push esi
push 0x80
push 3
push esi
mov edi, 1
push edi
mov dword [ebp - 0x188], ecx
mov ecx, dword [ebp + 0x14]
push SysReAllocString
push eax
mov dword [ebp - 0x1a0], edx
mov dword [ebp - 0x198], ecx
mov dword [ebp - 0x19c], esi
mov dword [ebp - 0x17c], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x180], eax
cmp eax, 0xffffffff
jne 0x4996d9
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051d23b
mov esp, ebp
pop ebp
ret
push ebx
lea edx, [ebp - 0x1a4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
xor eax, eax
mov dword [ebp - 0x184], eax
cmp ebx, eax
je 0x4996fb
cmp ebx, 0x20
jae 0x499706
mov dword [ebp - 0x17c], eax
jmp 0x49988d
mov edx, dword [ebp - 0x180]
push eax
lea eax, [ebp - 0x184]
push eax
push 0x20
lea ecx, [ebp - 0x1c4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x499731
cmp dword [ebp - 0x184], 0x20
je 0x49973c
mov dword [ebp - 0x17c], esi
jmp 0x49988d
cmp dword [ebp - 0x1c4], 0x54534346
je 0x499753
mov dword [ebp - 0x17c], esi
jmp 0x49988d
cmp dword [ebp - 0x1ac], edi
je 0x499766
mov dword [ebp - 0x17c], esi
jmp 0x49988d
mov edi, dword [ebp - 0x1bc]
cmp edi, ebx
je 0x49977b
mov dword [ebp - 0x17c], esi
jmp 0x49988d
mov ebx, dword [ebp - 0x1b8]
add edi, 0xffffffe0
push 0x5995a6
push edi
call fcn.0051f00a
mov esi, eax
xor eax, eax
add esp, 8
cmp esi, eax
jne 0x4997a0
mov dword [ebp - 0x17c], eax
cmp ebx, edi
jbe 0x4997af
mov dword [ebp - 0x17c], eax
jmp 0x49988d
cmp dword [ebp - 0x17c], 1
jne 0x49988d
mov ecx, dword [ebp - 0x180]
push 0
lea eax, [ebp - 0x19c]
push eax
push edi
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4997e3
mov dword [ebp - 0x17c], eax
jmp 0x49988d
mov edx, dword [ebp - 0x198]
mov eax, dword [ebp - 0x1a0]
push edx
push eax
lea ecx, [ebp - 0x178]
push 1
push ecx
call fcn.00439e50
push ebx
push esi
lea edx, [ebp - 0x178]
push esi
push edx
call fcn.0042b920
add esp, 0x20
cmp dword [ebp + 0x18], 1
jne 0x499880
lea eax, [ebp - 0x194]
push eax
xor edi, edi
push ebx
push esi
mov dword [ebp - 0x190], edi
mov dword [ebp - 0x194], edi
mov byte [ebp - 0x18c], 0
call fcn.00498960
add esp, 0xc
test eax, eax
jne 0x49985c
mov ecx, dword [ebp - 0x190]
mov edx, dword [ebp - 0x194]
push ecx
mov ecx, dword [ebp - 0x188]
push edx
call fcn.0044fa50
jmp 0x499862
mov dword [ebp - 0x17c], edi
cmp byte [ebp - 0x18c], 0
je 0x49988d
mov eax, dword [ebp - 0x194]
test eax, eax
je 0x49988d
push eax
call fcn.0051d538
add esp, 4
jmp 0x49988d
mov ecx, dword [ebp - 0x188]
push ebx
push esi
call fcn.0044fa50
mov eax, dword [ebp - 0x180]
pop ebx
test eax, eax
je 0x49989f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x4998ac
push esi
call fcn.0051d538
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x17c]
pop edi
xor ecx, ebp
pop esi
call fcn.0051d23b
mov esp, ebp
pop ebp
ret