Function at 0x47e920
Capabilities:
Check if file exists
Read file on windows

Disassembly:
sub esp, 0x30
push ebx
push ebp
push esi
mov esi, dword [esp + 0x40]
xor ebp, ebp
cmp esi, ebp
mov dword [esp + 0x18], ebp
je 0x47e9b8
cmp byte [esi], 0
je 0x47e9b8
push 0x51ecf0
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x47e9b8
push ebp
push 0x80
push 3
push ebp
push 1
push SysReAllocString
push esi
mov dword [esp + 0x2c], ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x14], esi
je 0x47ec5b
push esi
call fcn.0047e720
mov ebx, eax
mov eax, dword [esp + 0x48]
add esp, 4
mov dword [esp + 0x24], edx
cmp dword [eax + 0x92c], ebp
je 0x47e99a
cmp dword [eax + 0x930], ebp
je 0x47e9cb
cmp edx, ebp
jl 0x47e9d6
jg 0x47e9a5
cmp ebx, 0xffffffff
jb 0x47e9cb
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
pop ebp
mov eax, 8
pop ebx
add esp, 0x30
ret
mov dword [esp + 0x10], 0xd
pop esi
mov eax, dword [esp + 0xc]
pop ebp
pop ebx
add esp, 0x30
ret
cmp edx, ebp
jg 0x47ea01
jl 0x47e9d6
cmp ebx, 0x16
jae 0x47e9e9
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
pop ebp
mov eax, 0xb
pop ebx
add esp, 0x30
ret
cmp edx, ebp
jg 0x47ea01
jl 0x47e9f7
cmp ebx, 0x1002b
jae 0x47ea01
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], edx
jmp 0x47ea0d
mov dword [esp + 0x2c], 0x1002b
mov dword [esp + 0x30], ebp
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x30]
mov esi, ebx
push edi
sub esi, ecx
mov edi, edx
sbb edi, eax
mov eax, dword [esp + 0x18]
push 0
push edi
push esi
push eax
call fcn.0047e6b0
add esp, 0x10
cmp eax, esi
jne 0x47ea37
cmp edx, edi
je 0x47ea45
mov esi, dword [esp + 0x30]
mov dword [esp + 0x14], 0xb
jmp 0x47ea97
mov esi, dword [esp + 0x30]
push esi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x47ea8f
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebp, eax
test ebp, ebp
je 0x47ea8f
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x2c]
push 0
push ecx
push esi
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47ea85
cmp dword [esp + 0x2c], esi
je 0x47ea97
mov dword [esp + 0x14], 0xb
jmp 0x47ea97
mov dword [esp + 0x14], 4
xor eax, eax
cmp ebx, 0x16
mov dword [esp + 0x38], 0x12
mov dword [esp + 0x3c], eax
jne 0x47eab8
cmp dword [esp + 0x28], eax
jne 0x47eab8
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], eax
mov ecx, dword [esp + 0x38]
mov edi, dword [esp + 0x34]
mov eax, dword [esp + 0x3c]
sub esi, ecx
sbb edi, eax
mov dword [esp + 0x20], 3
mov dword [esp + 0x24], 0
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x47ebfa
test edi, edi
jl 0x47ebfa
jg 0x47eaf6
test esi, esi
jb 0x47ebfa
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x3c]
cmp ecx, eax
jg 0x47ebfa
jl 0x47eb18
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0x30]
cmp ecx, eax
ja 0x47ebfa
mov eax, esi
mov edx, edi
add eax, 1
mov bl, byte [esi + ebp]
adc edx, 0
mov cl, byte [eax + ebp]
add eax, 1
mov byte [esp + 0x13], cl
mov ecx, 0x12
adc edx, 0
sub ecx, dword [esp + 0x20]
test ecx, ecx
jle 0x47eba0
mov dword [esp + 0x20], ecx
mov cl, byte [eax + ebp]
add eax, 1
adc edx, 0
cmp bl, 0x50
jne 0x47eb8d
cmp byte [esp + 0x13], 0x4b
jne 0x47eb8d
cmp cl, 5
jne 0x47eb8d
cmp byte [eax + ebp], 6
jne 0x47eb8d
mov bl, byte [eax + ebp + 1]
test bl, bl
jne 0x47eb85
mov bl, byte [eax + ebp + 2]
test bl, bl
jne 0x47eb85
mov dword [esp + 0x14], 0
mov dword [esp + 0x24], 1
jmp 0x47eb8d
mov dword [esp + 0x14], 0x15
mov bl, byte [esp + 0x13]
mov byte [esp + 0x13], cl
mov ecx, dword [esp + 0x20]
dec ecx
mov dword [esp + 0x20], ecx
jne 0x47eb43
mov edx, dword [esp + 0x24]
test edx, edx
jne 0x47ebba
test edi, edi
jg 0x47ebba
jl 0x47ebb2
test esi, esi
ja 0x47ebba
mov dword [esp + 0x14], 0xb
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x34]
add eax, 0x12
mov dword [esp + 0x20], 0
adc ecx, 0
sub esi, eax
sbb edi, ecx
mov dword [esp + 0x38], eax
test edi, edi
mov dword [esp + 0x3c], ecx
jg 0x47ebf2
jl 0x47ebee
test esi, esi
jae 0x47ebf2
xor esi, esi
xor edi, edi
test edx, edx
je 0x47ead8
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
pop edi
cmp eax, 0xb
jne 0x47ec36
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
push eax
push ecx
call fcn.004839c0
add esp, 4
push eax
call fcn.00482a40
add esp, 8
test eax, eax
je 0x47ec36
mov dword [esp + 0x10], 0x15
mov esi, dword [esp + 0x18]
test ebp, ebp
je 0x47ec45
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
test esi, esi
je 0x47ec50
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x10]
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x47ec78
cmp eax, 3
ja 0x47ec78
mov dword [esp + 0x10], ebp
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
mov dword [esp + 0x10], 0x12
pop esi
mov eax, dword [esp + 0xc]
pop ebp
pop ebx
add esp, 0x30
ret