Function at 0x478740
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5e0418
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
push esi
push edi
mov eax, dword [0x64c874]
xor eax, esp
push eax
lea eax, [esp + 0x58]
mov dword fs:[0], eax
mov esi, ecx
cmp byte [ebx], 0
jne 0x478a33
mov dword [esp + 0x14], 0xffffffff
xor edi, edi
mov dword [esp + 0x60], edi
mov eax, esi
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], edi
mov word [esp + 0x3c], di
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4787a0
sub eax, edx
sar eax, 1
push eax
push esi
lea esi, [esp + 0x40]
call fcn.00402770
mov eax, dword [esp + 0x3c]
mov edi, 8
cmp dword [esp + 0x50], edi
jae 0x4787cd
lea eax, [esp + 0x3c]
push 0
push 0x80
push 3
push 0
push 3
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
setne al
test al, al
sete byte [esp + 0x13]
cmp dword [esp + 0x50], edi
mov dword [esp + 0x14], esi
jb 0x47880c
mov eax, dword [esp + 0x3c]
push eax
call fcn.0059b877
add esp, 4
cmp byte [esp + 0x13], 0
je 0x478837
cmp esi, 0xffffffff
je 0x478a50
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [esp + 0x58]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
lea edi, [esp + 0x2c]
lea eax, [esp + 0x14]
call fcn.00431680
test al, al
je 0x478813
lea eax, [ebx + 8]
xor edi, edi
cmp eax, edi
je 0x478813
cmp esi, 0xffffffff
je 0x478a50
push edi
lea ecx, [esp + 0x1c]
push ecx
push 0x2678
push eax
push esi
mov dword [esp + 0x2c], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x478813
mov ecx, dword [esp + 0x18]
cmp ecx, edi
seta al
test al, al
je 0x478813
cmp ecx, 0x2678
jne 0x478a47
mov eax, dword [ebx + 0x2678]
lea eax, [eax + eax*4]
lea eax, [eax*8 + 0x2678]
xor ecx, ecx
cmp eax, dword [esp + 0x2c]
jne 0x478a47
cmp ecx, dword [esp + 0x30]
jne 0x478a47
mov eax, dword [ebx + 0x2690]
xor esi, esi
cmp eax, edi
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
je 0x4788df
push eax
call fcn.0059b877
add esp, 4
mov dword [ebx + 0x2690], edi
mov eax, dword [ebx + 0x2678]
xor ecx, ecx
mov edx, 0x28
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0059b872
add esp, 4
cmp dword [ebx + 0x2678], edi
mov dword [ebx + 0x2690], eax
mov dword [esp + 0x20], edi
jbe 0x4789ef
xor esi, esi
jmp 0x478920
mov eax, dword [ebx + 0x2690]
add eax, esi
je 0x478a47
mov edx, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x20]
push ecx
push 0x28
push eax
push edx
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x478a47
mov ecx, dword [esp + 0x1c]
test ecx, ecx
seta al
test al, al
je 0x478a47
cmp ecx, 0x28
jne 0x478a47
mov eax, dword [ebx + 0x2690]
mov ecx, dword [eax + esi + 8]
mov edx, dword [eax + esi + 0xc]
mov edi, dword [eax + esi + 0x14]
add eax, esi
add dword [esp + 0x2c], ecx
adc dword [esp + 0x30], edx
add ecx, dword [eax]
adc edx, dword [eax + 4]
cmp edi, edx
jg 0x478a47
jl 0x4789a3
mov edx, dword [eax + 0x10]
cmp edx, ecx
ja 0x478a47
mov edx, dword [eax + 0x1c]
mov edi, dword [eax + 0x18]
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
cmp edx, eax
jg 0x478a47
jl 0x4789c1
cmp edi, ecx
ja 0x478a47
sub ecx, edi
sbb eax, edx
add dword [esp + 0x24], ecx
adc dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
add eax, 1
add esi, 0x28
cmp eax, dword [ebx + 0x2678]
mov dword [esp + 0x20], eax
jb 0x478920
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
cmp ecx, dword [ebx + 0x2668]
jne 0x478a47
mov eax, dword [esp + 0x30]
cmp eax, dword [ebx + 0x266c]
jne 0x478a47
test edi, edi
jl 0x478a47
jg 0x478a11
test esi, esi
jb 0x478a47
cmp edi, eax
jg 0x478a47
jl 0x478a1b
cmp esi, ecx
ja 0x478a47
mov dword [ebx + 0x2670], esi
lea esi, [esp + 0x14]
mov dword [ebx + 0x2674], edi
mov byte [ebx], 1
call fcn.004315a0
mov al, 1
mov ecx, dword [esp + 0x58]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
lea esi, [esp + 0x14]
call fcn.004315a0
xor al, al
mov ecx, dword [esp + 0x58]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret