Function at 0x450680
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 0x45069b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
push esi
call fcn.00452740
add esp, 4
test eax, eax
jne 0x4506b0
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 0x450940
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 0x4506ea
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 0x450905
mov edx, eax
mov dword [esp + 0x24], edx
push 0x1000
call fcn.00453b5e
mov ecx, dword [esp + 0x28]
add esp, 4
cmp ecx, 0x1000
mov dword [esp + 0x38], eax
jl 0x450742
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 0x450883
mov ecx, dword [esp + 0x18]
xor ebp, ebp
xor esi, esi
test ecx, ecx
jbe 0x45081d
mov edx, dword [esp + 0x38]
mov al, byte [esi + edx]
test al, al
je 0x450787
cmp al, 0xa
je 0x4507aa
cmp al, 0xd
je 0x4507cf
inc esi
cmp esi, ecx
jb 0x45076e
jmp 0x45081d
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 0x45081d
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 0x45081d
lea eax, [esi + 1]
cmp eax, ecx
jne 0x45086b
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 0x450812
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.00450080
test ebp, ebp
jne 0x45089d
mov eax, dword [esp + 0x18]
mov ecx, 0x1000
cmp eax, ecx
jne 0x45089d
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 0x450720
jmp 0x45089d
cmp byte [esi + edx + 1], 0xa
jne 0x4507fb
mov ecx, dword [esp + 0x14]
lea eax, [esi + ebx]
push 0
push 0
lea edx, [eax + ecx + 2]
jmp 0x45080a
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x38]
push edx
call fcn.00453893
add esp, 4
test ebx, ebx
jle 0x450901
lea eax, [ebx + 1]
push eax
call fcn.0044b8d0
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 0x4508fd
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.00453893
mov eax, dword [esp + 0x4c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x4508c1
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 0x450923
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 0x45090f
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x44]
push ecx
call fcn.0045eb09
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret
cmp eax, 2
jne 0x4509d7
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 0x450988
mov cl, byte [ebp]
cmp cl, 0xd
je 0x450988
cmp cl, 0xa
je 0x450988
inc edi
inc ebp
cmp edi, eax
jl 0x450975
lea eax, [edi + 1]
push eax
call fcn.0044b8d0
mov ecx, dword [esp + 0x34]
mov ebx, eax
mov al, byte [ebp]
add esp, 4
add ecx, edi
cmp al, 0xd
je 0x4509a7
cmp al, 0xa
jne 0x4509b0
mov al, byte [ebp + 1]
inc ecx
cmp al, 0xa
jne 0x4509b0
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.00453a60
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 0x4509cd
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 0x450a0e
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 0x450e51
mov dword [esp + 0x28], eax
push 0x1000
call fcn.00453b5e
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 0x450a70
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 0x450dd7
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.00451e50
mov ecx, dword [esp + 0x2c]
add esp, 0x18
xor esi, esi
test ecx, ecx
jbe 0x450bc1
mov edx, dword [esp + 0x38]
mov al, byte [esi + edx]
test al, al
je 0x450ae2
cmp al, 0xa
je 0x450b0b
cmp al, 0xd
je 0x450b36
inc esi
cmp esi, ecx
jb 0x450ac9
jmp 0x450bc1
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 0x450bc1
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 0x450bc1
lea eax, [esi + 1]
cmp eax, ecx
jne 0x450c06
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.00451e50
mov al, byte [esp + 0x2b]
add esp, 0x18
cmp al, 0xa
je 0x450bad
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 0x450cea
mov ecx, dword [esp + 0x44]
test ecx, ecx
je 0x450c3f
sub eax, ecx
sar eax, 3
cmp eax, 1
jbe 0x450c3f
lea ecx, [esp + 0x40]
call fcn.00450ea0
mov edi, eax
jmp 0x450c44
mov al, byte [esi + edx + 1]
push 0
cmp al, 0xa
push 0
jne 0x450c27
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 0x450bb3
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 0x450bb3
mov edi, 1
lea ecx, [esp + 0x40]
call fcn.00450ea0
add eax, edi
mov dword [esp + 0x34], eax
jns 0x450c57
xor eax, eax
lea edx, [eax*8]
push edx
call fcn.0045eae0
add esp, 4
mov edi, eax
mov eax, dword [esp + 0x44]
lea ecx, [esp + 0x40]
push edi
push esi
push eax
call fcn.00450ec0
lea ecx, [esp + 0x38]
mov ebp, eax
push ecx
push 1
push ebp
lea ecx, [esp + 0x4c]
call fcn.00450f00
mov edx, dword [esp + 0x48]
add ebp, 8
push ebp
push edx
push esi
lea ecx, [esp + 0x4c]
call fcn.00450ec0
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
push eax
push ecx
lea ecx, [esp + 0x48]
call fcn.00450e90
mov edx, dword [esp + 0x44]
push edx
call fcn.0045eb09
mov eax, dword [esp + 0x38]
add esp, 4
lea ecx, [edi + eax*8]
mov dword [esp + 0x4c], ecx
lea ecx, [esp + 0x40]
call fcn.00450ea0
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 0x450da0
xor ecx, ecx
mov dword [esp + 0x34], ecx
sar ecx, 3
cmp ecx, 1
jae 0x450d49
lea ecx, [eax + 8]
push ecx
push eax
push eax
lea ecx, [esp + 0x4c]
call fcn.00450ec0
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.00450f00
mov ecx, dword [esp + 0x48]
mov eax, esi
cmp esi, ecx
je 0x450d9b
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 0x450d33
jmp 0x450d9b
lea ecx, [eax - 8]
push eax
push eax
mov dword [esp + 0x3c], ecx
push ecx
lea ecx, [esp + 0x4c]
call fcn.00450ec0
mov eax, dword [esp + 0x48]
mov ecx, eax
add eax, 0xfffffff8
cmp esi, eax
je 0x450d7e
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 0x450d69
lea ecx, [esi + 8]
mov eax, esi
cmp esi, ecx
je 0x450d9b
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 0x450d87
add dword [esp + 0x48], 8
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x450ded
mov eax, dword [esp + 0x14]
mov ecx, 0x1000
cmp eax, ecx
jne 0x450ded
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 0x450a44
jmp 0x450ded
push 2
push 0
push 0
push ebx
call edi
mov eax, dword [esp + 0x38]
push eax
call fcn.00453893
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
jle 0x450e51
mov ecx, eax
inc ecx
push ecx
call fcn.0044b8d0
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 0x450e49
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.00453893
mov eax, dword [esp + 0x4c]
add ebp, 8
add esp, 4
cmp ebp, eax
jne 0x450e13
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 0x450e73
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 0x450e5f
mov edx, dword [esp + 0x44]
mov dword [esp + 0x48], ecx
push edx
call fcn.0045eb09
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret