Function at 0x539da0
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x130
mov eax, dword [0x661850]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
cmp byte [ebx + 0x42], 0
push esi
mov esi, dword [ebp + 8]
je 0x539dd4
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054514c
mov esp, ebp
pop ebp
ret 4
test esi, esi
jne 0x539dec
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054514c
mov esp, ebp
pop ebp
ret 4
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x539df1
sub eax, edx
cmp eax, 3
jbe 0x539dd8
push edi
push 0x104
lea edi, [ebx + 0x177]
push 0
push edi
call fcn.005454d0
add esp, 0xc
cmp byte [esi], 0x2e
jne 0x539ee1
push 0x103
lea eax, [ebp - 0x108]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [ebp - 0x108]
push 0x5c
push ecx
call fcn.00546f20
push esi
lea edx, [ebp - 0x108]
push edx
push 0x57b284
push edi
mov byte [eax + 1], 0
call fcn.005456a9
push 0x2e
push edi
call fcn.00546f20
mov ecx, dword [str..wtl]
mov dword [eax], ecx
mov dl, byte [0x589054]
push esi
lea ecx, [ebp - 0x108]
push ecx
mov byte [eax + 4], dl
lea eax, [ebx + 0x73]
push 0x57b284
push eax
call fcn.005456a9
add esp, 0x30
mov eax, esi
lea esp, [esp]
mov cl, byte [esi]
inc esi
test cl, cl
jne 0x539e90
sub esi, eax
lea edi, [ebp - 0x108]
mov edx, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x539ea2
mov ecx, edx
shr ecx, 2
mov esi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [ebp - 0x108]
and ecx, 3
push 0x2e
push edx
rep movsb byte es:[edi], byte [esi]
call fcn.00546f20
mov ecx, dword [str..wix]
mov dword [eax], ecx
mov dl, byte [0x58904c]
add esp, 8
mov byte [eax + 4], dl
jmp 0x539f66
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x539ee6
sub eax, edx
add eax, 0xfffffffd
push eax
push esi
lea edi, [ebx + 0x177]
push edi
call fcn.00545160
add esp, 0xc
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x539f04
mov eax, dword [0x589044]
push esi
lea ecx, [ebp - 0x108]
push 0x104
push ecx
mov dword [edi], eax
call fcn.005477d6
lea eax, [ebp - 0x108]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x539f31
sub eax, edx
mov edx, 0x107
sub edx, eax
push 0x589040
push edx
lea eax, [ebp + eax - 0x10b]
push eax
call fcn.005477d6
push esi
lea eax, [ebx + 0x73]
push 0x104
push eax
call fcn.005477d6
add esp, 0x18
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
lea esi, [ebx + 0x177]
push esi
call edi
test eax, eax
je 0x539f82
mov byte [ebx + 0x27b], 1
jmp 0x539f90
lea eax, [ebx + 0x73]
push eax
call edi
test eax, eax
je 0x53a224
cmp byte [ebx + 0x27b], 0
push 0
push 0x80
push 3
push 0
push 1
push closesocket
je 0x53a0b0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x53a224
push 0x574a98
push esi
call fcn.00546285
add esp, 8
push 0
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebx + 0x3e], eax
cmp eax, 0x24
jbe 0x53a081
push 0
push 0
push esi
call fcn.0054aa89
push esi
push 0x20
lea ecx, [ebx + 0x27c]
push 1
push ecx
call fcn.005461ac
mov edx, 0x1770
add esp, 0x1c
cmp word [ebx + 0x292], dx
jne 0x53a021
mov eax, dword [ebx + 0x298]
mov ecx, edx
mov dword [ebx + 0x3a], eax
mov word [ebx + 0x38], cx
mov eax, dword [ebx + 0x298]
xor ecx, ecx
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00542ae0
mov ecx, dword [ebx + 0x298]
add ecx, ecx
add ecx, ecx
push ecx
push 0
push eax
mov dword [ebx + 0x29c], eax
call fcn.005454d0
push 0
push 0x20
push esi
call fcn.0054aa89
mov edx, dword [ebx + 0x298]
mov eax, dword [ebx + 0x29c]
add edx, edx
push esi
add edx, edx
push edx
push 1
push eax
call fcn.005461ac
add esp, 0x2c
mov byte [ebx + 0x42], 1
push esi
call fcn.00545eee
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebx + 0x42], 0
je 0x53a224
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054514c
mov esp, ebp
pop ebp
ret 4
lea ecx, [ebp - 0x108]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x53a224
push 0
push 0x80
push 3
push 0
push 1
push closesocket
lea edi, [ebx + 0x73]
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x130], eax
cmp eax, 0xffffffff
je 0x53a224
push 0x574a98
push edi
call fcn.00546285
mov edx, dword [ebp - 0x130]
add esp, 8
push 0
push edx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebx + 0x3e], eax
xor eax, eax
push edi
push 0x20
mov dword [ebp - 0x128], eax
mov dword [ebp - 0x124], eax
mov dword [ebp - 0x120], eax
mov dword [ebp - 0x11c], eax
mov dword [ebp - 0x118], eax
mov dword [ebp - 0x114], eax
mov dword [ebp - 0x110], eax
mov dword [ebp - 0x10c], eax
lea eax, [ebp - 0x128]
push 1
push eax
call fcn.005461ac
mov eax, dword [ebp - 0x114]
mov cx, word [ebp - 0x112]
mov edx, dword [ebp - 0x110]
add esp, 0x10
mov word [ebx + 0x38], cx
mov dword [ebx + 0x3a], edx
cmp al, 0x6f
jne 0x53a185
cmp ah, 0x6b
jne 0x53a185
mov byte [ebx + 0x2a4], 1
push 0
cmp cx, 0x11
jne 0x53a19c
lea eax, [ebp - 0x12c]
push eax
push 0x18
lea ecx, [ebx + 0x43]
push ecx
jmp 0x53a1a9
lea edx, [ebp - 0x12c]
push edx
push 0x1c
lea eax, [ebx + 0x43]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebx + 0x57]
xor ecx, ecx
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00542ae0
mov ecx, dword [ebx + 0x57]
add ecx, ecx
add ecx, ecx
push ecx
push 0
push eax
mov dword [ebx + 0x5f], eax
call fcn.005454d0
mov eax, dword [ebx + 0x57]
mov ecx, dword [ebx + 0x5f]
add esp, 0x10
push 0
lea edx, [ebp - 0x12c]
add eax, eax
push edx
add eax, eax
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call fcn.00545eee
add esp, 4
push esi
mov byte [ebx + 0x42], 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054514c
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.0054514c
mov esp, ebp
pop ebp
ret 4