Function at 0x457160
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 0x45717b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
push esi
call fcn.00459790
add esp, 4
test eax, eax
jne 0x457190
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 0x457420
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 0x4571ca
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 0x4573e5
mov edx, eax
mov dword [esp + 0x24], edx
push 0x1000
call fcn.0045cdfe
mov ecx, dword [esp + 0x28]
add esp, 4
cmp ecx, 0x1000
mov dword [esp + 0x38], eax
jl 0x457222
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 0x457363
mov ecx, dword [esp + 0x18]
xor ebp, ebp
xor esi, esi
test ecx, ecx
jbe 0x4572fd
mov edx, dword [esp + 0x38]
mov al, byte [esi + edx]
test al, al
je 0x457267
cmp al, 0xa
je 0x45728a
cmp al, 0xd
je 0x4572af
inc esi
cmp esi, ecx
jb 0x45724e
jmp 0x4572fd
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 0x4572fd
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 0x4572fd
lea eax, [esi + 1]
cmp eax, ecx
jne 0x45734b
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 0x4572f2
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.00457980
test ebp, ebp
jne 0x45737d
mov eax, dword [esp + 0x18]
mov ecx, 0x1000
cmp eax, ecx
jne 0x45737d
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 0x457200
jmp 0x45737d
cmp byte [esi + edx + 1], 0xa
jne 0x4572db
mov ecx, dword [esp + 0x14]
lea eax, [esi + ebx]
push 0
push 0
lea edx, [eax + ecx + 2]
jmp 0x4572ea
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x38]
push edx
call fcn.0045cb06
add esp, 4
test ebx, ebx
jle 0x4573e1
lea eax, [ebx + 1]
push eax
call fcn.00452730
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 0x4573dd
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.0045cb06
mov eax, dword [esp + 0x4c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x4573a1
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 0x457403
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 0x4573ef
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x44]
push ecx
call fcn.00467dd4
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret
cmp eax, 2
jne 0x4574b7
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 0x457468
mov cl, byte [ebp]
cmp cl, 0xd
je 0x457468
cmp cl, 0xa
je 0x457468
inc edi
inc ebp
cmp edi, eax
jl 0x457455
lea eax, [edi + 1]
push eax
call fcn.00452730
mov ecx, dword [esp + 0x34]
mov ebx, eax
mov al, byte [ebp]
add esp, 4
add ecx, edi
cmp al, 0xd
je 0x457487
cmp al, 0xa
jne 0x457490
mov al, byte [ebp + 1]
inc ecx
cmp al, 0xa
jne 0x457490
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.0045cd00
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 0x4574ad
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 0x4574ee
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 0x457931
mov dword [esp + 0x28], eax
push 0x1000
call fcn.0045cdfe
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 0x457550
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 0x4578b7
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.00459040
mov ecx, dword [esp + 0x2c]
add esp, 0x18
xor esi, esi
test ecx, ecx
jbe 0x4576a1
mov edx, dword [esp + 0x38]
mov al, byte [esi + edx]
test al, al
je 0x4575c2
cmp al, 0xa
je 0x4575eb
cmp al, 0xd
je 0x457616
inc esi
cmp esi, ecx
jb 0x4575a9
jmp 0x4576a1
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 0x4576a1
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 0x4576a1
lea eax, [esi + 1]
cmp eax, ecx
jne 0x4576e6
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.00459040
mov al, byte [esp + 0x2b]
add esp, 0x18
cmp al, 0xa
je 0x45768d
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 0x4577ca
mov ecx, dword [esp + 0x44]
test ecx, ecx
je 0x45771f
sub eax, ecx
sar eax, 3
cmp eax, 1
jbe 0x45771f
lea ecx, [esp + 0x40]
call fcn.00457bd0
mov edi, eax
jmp 0x457724
mov al, byte [esi + edx + 1]
push 0
cmp al, 0xa
push 0
jne 0x457707
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 0x457693
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 0x457693
mov edi, 1
lea ecx, [esp + 0x40]
call fcn.00457bd0
add eax, edi
mov dword [esp + 0x34], eax
jns 0x457737
xor eax, eax
lea edx, [eax*8]
push edx
call fcn.00467dab
add esp, 4
mov edi, eax
mov eax, dword [esp + 0x44]
lea ecx, [esp + 0x40]
push edi
push esi
push eax
call fcn.00457bf0
lea ecx, [esp + 0x38]
mov ebp, eax
push ecx
push 1
push ebp
lea ecx, [esp + 0x4c]
call fcn.00457c30
mov edx, dword [esp + 0x48]
add ebp, 8
push ebp
push edx
push esi
lea ecx, [esp + 0x4c]
call fcn.00457bf0
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
push eax
push ecx
lea ecx, [esp + 0x48]
call fcn.00457970
mov edx, dword [esp + 0x44]
push edx
call fcn.00467dd4
mov eax, dword [esp + 0x38]
add esp, 4
lea ecx, [edi + eax*8]
mov dword [esp + 0x4c], ecx
lea ecx, [esp + 0x40]
call fcn.00457bd0
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 0x457880
xor ecx, ecx
mov dword [esp + 0x34], ecx
sar ecx, 3
cmp ecx, 1
jae 0x457829
lea ecx, [eax + 8]
push ecx
push eax
push eax
lea ecx, [esp + 0x4c]
call fcn.00457bf0
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.00457c30
mov ecx, dword [esp + 0x48]
mov eax, esi
cmp esi, ecx
je 0x45787b
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 0x457813
jmp 0x45787b
lea ecx, [eax - 8]
push eax
push eax
mov dword [esp + 0x3c], ecx
push ecx
lea ecx, [esp + 0x4c]
call fcn.00457bf0
mov eax, dword [esp + 0x48]
mov ecx, eax
add eax, 0xfffffff8
cmp esi, eax
je 0x45785e
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 0x457849
lea ecx, [esi + 8]
mov eax, esi
cmp esi, ecx
je 0x45787b
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 0x457867
add dword [esp + 0x48], 8
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x4578cd
mov eax, dword [esp + 0x14]
mov ecx, 0x1000
cmp eax, ecx
jne 0x4578cd
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 0x457524
jmp 0x4578cd
push 2
push 0
push 0
push ebx
call edi
mov eax, dword [esp + 0x38]
push eax
call fcn.0045cb06
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
jle 0x457931
mov ecx, eax
inc ecx
push ecx
call fcn.00452730
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 0x457929
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.0045cb06
mov eax, dword [esp + 0x4c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x4578f3
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 0x457953
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 0x45793f
mov edx, dword [esp + 0x44]
mov dword [esp + 0x48], ecx
push edx
call fcn.00467dd4
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret