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

Disassembly:
sub esp, 0x40
push ebx
push ebp
push esi
mov esi, dword [esp + 0x54]
xor ebx, ebx
push edi
cmp esi, ebx
jne 0x45795b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
push esi
call fcn.00459f70
add esp, 4
test eax, eax
jne 0x457970
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret
mov eax, dword [esi]
mov dword [esp + 0x1c], ebx
cmp eax, 1
jne 0x457c00
mov edi, dword [esi + 4]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push ebx
push ebx
push edi
call ebp
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x14], esi
jne 0x4579aa
push 2
push ebx
push ebx
push edi
call ebp
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov cl, byte [esp + 0x58]
sub eax, esi
xor edx, edx
cmp eax, ebx
mov dword [esp + 0x20], eax
mov byte [esp + 0x40], cl
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], edx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x28], ebx
jle 0x457bc5
mov edx, eax
mov dword [esp + 0x24], edx
push 0x1000
call fcn.0045d5de
mov ecx, dword [esp + 0x28]
add esp, 4
cmp ecx, 0x1000
mov dword [esp + 0x38], eax
jl 0x457a02
mov ecx, 0x1000
lea edx, [esp + 0x18]
push 0
push edx
push ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x457b43
mov ecx, dword [esp + 0x18]
xor ebp, ebp
xor esi, esi
test ecx, ecx
jbe 0x457add
mov edx, dword [esp + 0x38]
mov al, byte [esi + edx]
test al, al
je 0x457a47
cmp al, 0xa
je 0x457a6a
cmp al, 0xd
je 0x457a8f
inc esi
cmp esi, ecx
jb 0x457a2e
jmp 0x457add
mov edx, dword [esp + 0x14]
mov dword [esp + 0x18], esi
add esi, ebx
push 0
add esi, edx
push 0
push esi
push edi
mov ebp, 1
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x18]
jmp 0x457add
mov eax, dword [esp + 0x14]
mov dword [esp + 0x18], esi
add esi, ebx
push 0
push 0
mov ebp, 1
lea ecx, [esi + eax + 1]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x18]
jmp 0x457add
lea eax, [esi + 1]
cmp eax, ecx
jne 0x457b2b
lea ecx, [esp + 0x18]
push 0
push ecx
lea edx, [esp + 0x60]
push 1
push edx
push edi
mov byte [esp + 0x6c], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp byte [esp + 0x58], 0xa
je 0x457ad2
mov ecx, dword [esp + 0x14]
lea eax, [esi + ebx]
push 0
push 0
lea edx, [eax + ecx + 1]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, esi
mov ebp, 1
mov dword [esp + 0x18], ecx
lea eax, [esp + 0x38]
mov dword [esp + 0x3c], ecx
add ebx, ecx
mov ecx, dword [esp + 0x48]
push eax
push 1
push ecx
lea ecx, [esp + 0x4c]
call fcn.00458160
test ebp, ebp
jne 0x457b5d
mov eax, dword [esp + 0x18]
mov ecx, 0x1000
cmp eax, ecx
jne 0x457b5d
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
add eax, ecx
sub edx, ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x28], eax
cmp eax, ecx
mov dword [esp + 0x24], edx
jl 0x4579e0
jmp 0x457b5d
cmp byte [esi + edx + 1], 0xa
jne 0x457abb
mov ecx, dword [esp + 0x14]
lea eax, [esi + ebx]
push 0
push 0
lea edx, [eax + ecx + 2]
jmp 0x457aca
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x38]
push edx
call fcn.0045d2e6
add esp, 4
test ebx, ebx
jle 0x457bc1
lea eax, [ebx + 1]
push eax
call fcn.00452f10
mov ebp, dword [esp + 0x48]
mov ecx, dword [esp + 0x4c]
add esp, 4
cmp ebp, ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x58], eax
je 0x457bbd
mov ecx, dword [ebp + 4]
mov eax, dword [esp + 0x58]
mov esi, dword [ebp]
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add eax, dword [ebp + 4]
mov dword [esp + 0x58], eax
mov eax, dword [ebp]
push eax
call fcn.0045d2e6
mov eax, dword [esp + 0x4c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x457b81
mov eax, dword [esp + 0x1c]
mov byte [ebx + eax], 0
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
mov eax, edx
cmp eax, edx
je 0x457be3
mov esi, dword [eax]
add eax, 8
mov dword [ecx], esi
mov esi, dword [eax - 4]
mov dword [ecx + 4], esi
add ecx, 8
cmp eax, edx
jne 0x457bcf
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x44]
push ecx
call fcn.004685b4
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret
cmp eax, 2
jne 0x457c97
mov esi, dword [esi + 4]
mov ecx, esi
mov edx, dword [esi]
call dword [edx + 0x14]
lea ecx, [esp + 0x34]
lea edx, [esp + 0x58]
push ecx
mov dword [esp + 0x34], eax
mov eax, dword [esi]
push edx
push 0xffffffffffffffff
push ebx
mov ecx, esi
call dword [eax + 0x30]
mov ebp, dword [esp + 0x58]
xor edi, edi
test eax, eax
jle 0x457c48
mov cl, byte [ebp]
cmp cl, 0xd
je 0x457c48
cmp cl, 0xa
je 0x457c48
inc edi
inc ebp
cmp edi, eax
jl 0x457c35
lea eax, [edi + 1]
push eax
call fcn.00452f10
mov ecx, dword [esp + 0x34]
mov ebx, eax
mov al, byte [ebp]
add esp, 4
add ecx, edi
cmp al, 0xd
je 0x457c67
cmp al, 0xa
jne 0x457c70
mov al, byte [ebp + 1]
inc ecx
cmp al, 0xa
jne 0x457c70
inc ecx
mov edx, dword [esi]
push 0
push ecx
mov ecx, esi
call dword [edx + 0x18]
mov eax, dword [esp + 0x58]
push edi
push eax
push ebx
call fcn.0045d4e0
add esp, 0xc
mov byte [edi + ebx], 0
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x40
ret
cmp eax, 3
jne 0x457c8d
mov ecx, dword [esp + 0x58]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor ebp, ebp
push 1
mov ebx, dword [ecx + 4]
push ebp
push ebp
push ebx
call edi
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x20], esi
jne 0x457cce
push 2
push ebp
push ebp
push ebx
call edi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dl, byte [esp + 0x58]
sub eax, esi
cmp eax, ebp
mov dword [esp + 0x30], eax
mov byte [esp + 0x40], dl
mov dword [esp + 0x44], ebp
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x2c], ebp
jle 0x458111
mov dword [esp + 0x28], eax
push 0x1000
call fcn.0045d5de
add esp, 4
mov dword [esp + 0x38], eax
push 1
push 0
push 0
push ebx
call edi
mov esi, eax
mov eax, dword [esp + 0x28]
cmp eax, 0x1000
jl 0x457d30
mov eax, 0x1000
mov edx, dword [esp + 0x38]
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x458097
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x24], 0
lea ebp, [ecx + 0x10]
lea eax, [ecx + 0x34]
mov ecx, dword [ecx + 0xc]
push ebp
push ecx
push eax
mov eax, dword [esp + 0x44]
push edx
push eax
push esi
call fcn.00459820
mov ecx, dword [esp + 0x2c]
add esp, 0x18
xor esi, esi
test ecx, ecx
jbe 0x457e81
mov edx, dword [esp + 0x38]
mov al, byte [esi + edx]
test al, al
je 0x457da2
cmp al, 0xa
je 0x457dcb
cmp al, 0xd
je 0x457df6
inc esi
cmp esi, ecx
jb 0x457d89
jmp 0x457e81
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
mov dword [esp + 0x14], esi
add esi, ecx
push 0
add esi, edx
push 0
push esi
push ebx
mov dword [esp + 0x34], 1
call edi
mov ecx, dword [esp + 0x14]
jmp 0x457e81
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x14], esi
add esi, edx
push 0
push 0
lea ecx, [esi + eax + 1]
mov dword [esp + 0x2c], 1
push ecx
push ebx
call edi
mov ecx, dword [esp + 0x14]
jmp 0x457e81
lea eax, [esi + 1]
cmp eax, ecx
jne 0x457ec6
push 1
push 0
push 0
push ebx
mov byte [esp + 0x23], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [esp + 0x1b]
push 1
push edx
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x58]
mov edx, dword [esp + 0x14]
push ebp
mov ecx, dword [eax + 0xc]
add eax, 0x34
push ecx
push eax
lea eax, [esp + 0x1f]
push edx
push eax
push edi
call fcn.00459820
mov al, byte [esp + 0x2b]
add esp, 0x18
cmp al, 0xa
je 0x457e6d
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
push 0
push 0
lea edx, [esi + ecx]
lea ecx, [edx + eax + 1]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, esi
mov dword [esp + 0x24], 1
mov dword [esp + 0x14], ecx
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x48]
mov dword [esp + 0x3c], ecx
add esi, ecx
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x18], esi
sub ecx, eax
mov esi, eax
sar ecx, 3
cmp ecx, 1
jae 0x457faa
mov ecx, dword [esp + 0x44]
test ecx, ecx
je 0x457eff
sub eax, ecx
sar eax, 3
cmp eax, 1
jbe 0x457eff
lea ecx, [esp + 0x40]
call fcn.004583b0
mov edi, eax
jmp 0x457f04
mov al, byte [esi + edx + 1]
push 0
cmp al, 0xa
push 0
jne 0x457ee7
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
lea eax, [esi + edx]
lea edx, [eax + ecx + 2]
push edx
push ebx
call edi
jmp 0x457e73
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x28]
lea ecx, [esi + eax]
lea eax, [ecx + edx + 1]
push eax
push ebx
call edi
jmp 0x457e73
mov edi, 1
lea ecx, [esp + 0x40]
call fcn.004583b0
add eax, edi
mov dword [esp + 0x34], eax
jns 0x457f17
xor eax, eax
lea edx, [eax*8]
push edx
call fcn.0046858b
add esp, 4
mov edi, eax
mov eax, dword [esp + 0x44]
lea ecx, [esp + 0x40]
push edi
push esi
push eax
call fcn.004583d0
lea ecx, [esp + 0x38]
mov ebp, eax
push ecx
push 1
push ebp
lea ecx, [esp + 0x4c]
call fcn.00458410
mov edx, dword [esp + 0x48]
add ebp, 8
push ebp
push edx
push esi
lea ecx, [esp + 0x4c]
call fcn.004583d0
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
push eax
push ecx
lea ecx, [esp + 0x48]
call fcn.00458150
mov edx, dword [esp + 0x44]
push edx
call fcn.004685b4
mov eax, dword [esp + 0x38]
add esp, 4
lea ecx, [edi + eax*8]
mov dword [esp + 0x4c], ecx
lea ecx, [esp + 0x40]
call fcn.004583b0
lea edx, [edi + eax*8 + 8]
mov dword [esp + 0x44], edi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x48], edx
jmp 0x458060
xor ecx, ecx
mov dword [esp + 0x34], ecx
sar ecx, 3
cmp ecx, 1
jae 0x458009
lea ecx, [eax + 8]
push ecx
push eax
push eax
lea ecx, [esp + 0x4c]
call fcn.004583d0
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x38]
mov ecx, eax
push edx
sub ecx, esi
mov edx, 1
sar ecx, 3
sub edx, ecx
lea ecx, [esp + 0x44]
push edx
push eax
call fcn.00458410
mov ecx, dword [esp + 0x48]
mov eax, esi
cmp esi, ecx
je 0x45805b
mov edx, dword [esp + 0x38]
mov dword [eax], edx
mov edx, dword [esp + 0x3c]
mov dword [eax + 4], edx
add eax, 8
cmp eax, ecx
jne 0x457ff3
jmp 0x45805b
lea ecx, [eax - 8]
push eax
push eax
mov dword [esp + 0x3c], ecx
push ecx
lea ecx, [esp + 0x4c]
call fcn.004583d0
mov eax, dword [esp + 0x48]
mov ecx, eax
add eax, 0xfffffff8
cmp esi, eax
je 0x45803e
mov edx, dword [eax - 8]
sub eax, 8
sub ecx, 8
cmp eax, esi
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
jne 0x458029
lea ecx, [esi + 8]
mov eax, esi
cmp esi, ecx
je 0x45805b
mov edx, dword [esp + 0x38]
mov dword [eax], edx
mov edx, dword [esp + 0x3c]
mov dword [eax + 4], edx
add eax, 8
cmp eax, ecx
jne 0x458047
add dword [esp + 0x48], 8
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x4580ad
mov eax, dword [esp + 0x14]
mov ecx, 0x1000
cmp eax, ecx
jne 0x4580ad
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
add eax, ecx
sub edx, ecx
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x2c], eax
cmp eax, ecx
mov dword [esp + 0x28], edx
jl 0x457d04
jmp 0x4580ad
push 2
push 0
push 0
push ebx
call edi
mov eax, dword [esp + 0x38]
push eax
call fcn.0045d2e6
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
jle 0x458111
mov ecx, eax
inc ecx
push ecx
call fcn.00452f10
mov ebp, dword [esp + 0x48]
mov ecx, dword [esp + 0x4c]
add esp, 4
cmp ebp, ecx
mov dword [esp + 0x1c], eax
mov ebx, eax
je 0x458109
mov ecx, dword [ebp + 4]
mov esi, dword [ebp]
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp]
mov edi, dword [ebp + 4]
push eax
add ebx, edi
call fcn.0045d2e6
mov eax, dword [esp + 0x4c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x4580d3
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
mov byte [ecx + eax], 0
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
cmp eax, eax
mov edx, eax
je 0x458133
mov esi, dword [eax]
add eax, 8
mov dword [ecx], esi
mov esi, dword [eax - 4]
mov dword [ecx + 4], esi
add ecx, 8
cmp eax, edx
jne 0x45811f
mov edx, dword [esp + 0x44]
mov dword [esp + 0x48], ecx
push edx
call fcn.004685b4
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret