Function at 0x401540
Capabilities:
Get file size
Hash data using sha256
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
mov esi, ecx
mov ebx, edx
mov dword [ebp - 0xc], ebx
xorps xmm0, xmm0
mov dword [ebp - 4], esi
movlpd qword [ebp - 0x18], xmm0
push edi
test esi, esi
je 0x4018db
test ebx, ebx
je 0x4018db
cmp dword [ebp + 8], 0
je 0x4018db
lea eax, [ebp - 0x18]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4018dd
mov ecx, dword [ebx + 0xc]
mov edi, dword [ebp - 0x14]
add ecx, 0x20c
add ecx, dword [ebx + 4]
test edi, edi
jl 0x4018db
mov edx, dword [ebp - 0x18]
jg 0x4015ac
cmp edx, ecx
jbe 0x4018db
mov ecx, 0xfffffdfc
mov eax, 0xffffffff
sub ecx, dword [ebx + 0xc]
push 0x8068
sbb eax, 0
add edx, ecx
mov dword [ebp - 0x18], edx
adc edi, eax
mov dword [ebp - 0x14], edi
call fcn.00521140
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4018db
mov ecx, dword [ebp - 0xc]
lea edi, [ebx + 0x68]
push 0
xorps xmm0, xmm0
mov dword [ebx], 0x6a09e667
push 0
mov eax, dword [ecx]
movlpd qword [ebp - 0x20], xmm0
push dword [ebp - 0x1c]
mov dword [ebx + 4], 0xbb67ae85
push dword [ebp - 0x20]
mov dword [ebx + 8], 0x3c6ef372
push esi
mov dword [ebx + 0xc], 0xa54ff53a
mov dword [ebx + 0x10], 0x510e527f
mov dword [ebx + 0x14], 0x9b05688c
mov dword [ebx + 0x18], 0x1f83d9ab
mov dword [ebx + 0x1c], 0x5be0cd19
mov dword [ebx + 0x20], 0
mov dword [ebx + 0x24], 0
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov esi, eax
test esi, esi
je 0x40168c
push 0
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 8]
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
mov eax, dword [ebp - 8]
test esi, esi
je 0x4018c9
cmp eax, dword [ebp - 0x10]
je 0x40168f
push ebx
xor esi, esi
call fcn.00515acf
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
test esi, esi
je 0x4018c9
push 0
push eax
mov edx, edi
mov ecx, ebx
call fcn.00402e40
push 0
push 4
mov edx, edi
mov dword [edi], 0
mov ecx, ebx
call fcn.00402e40
mov ecx, dword [ebp - 0xc]
add esp, 0x10
mov dword [ebp - 0x10], 0
mov eax, dword [ecx]
mov ecx, dword [ecx + 4]
add eax, 4
push 0
push 0
push 0
push eax
push dword [ebp - 4]
sub ecx, eax
mov dword [ebp - 8], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov esi, eax
test esi, esi
je 0x40171f
push 0
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 8]
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
mov eax, dword [ebp - 8]
test esi, esi
je 0x4018c9
cmp eax, dword [ebp - 0x10]
je 0x401722
push ebx
xor esi, esi
call fcn.00515acf
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
test esi, esi
je 0x4018c9
push 0
push eax
mov edx, edi
mov ecx, ebx
call fcn.00402e40
xorps xmm0, xmm0
mov edx, edi
push 0
push 8
mov ecx, ebx
movq qword [edi], xmm0
call fcn.00402e40
mov ecx, dword [ebp - 0xc]
add esp, 0x10
mov edi, dword [ebp - 0x18]
mov eax, 0xfffffff8
mov edx, 0xffffffff
mov ecx, dword [ecx + 4]
sub eax, ecx
sbb edx, 0
add edi, eax
mov eax, dword [ebp - 0x14]
adc eax, edx
mov dword [ebp - 0x18], edi
add ecx, 8
mov dword [ebp - 0x14], eax
xor edx, edx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
test eax, eax
jl 0x401830
jg 0x401793
cmp edi, 0x8000
jb 0x401830
push 0
push 0
push edx
push ecx
push dword [ebp - 4]
mov dword [ebp - 0x10], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov esi, eax
lea edi, [ebx + 0x68]
test esi, esi
je 0x4018c9
push 0
lea eax, [ebp - 0x10]
push eax
push 0x8000
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
test esi, esi
je 0x4018c9
cmp dword [ebp - 0x10], 0x8000
jne 0x40170b
test esi, esi
je 0x4018c9
push 0
push 0x8000
mov edx, edi
mov ecx, ebx
call fcn.00402e40
mov ecx, dword [ebp - 0xc]
add esp, 8
mov edx, dword [ebp - 8]
add ecx, 0x8000
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp - 0x14]
adc edx, 0
add edi, 0xffff8000
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
adc eax, 0xffffffff
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], eax
jns 0x401785
push 0
push 0
push edx
push ecx
push dword [ebp - 4]
mov dword [ebp - 0x10], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov esi, eax
test esi, esi
je 0x4018c9
push 0
lea eax, [ebp - 0x10]
push eax
push edi
lea eax, [ebx + 0x68]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
test esi, esi
je 0x4018c9
cmp edi, dword [ebp - 0x10]
jne 0x40170b
test esi, esi
je 0x4018c9
push 0
push dword [ebp - 0x18]
lea esi, [ebx + 0x68]
mov ecx, ebx
mov edx, esi
call fcn.00402e40
push 0x200
push 0
push esi
call fcn.00511fb0
add esp, 0x14
mov edx, esi
mov ecx, ebx
push 0
push 0x200
call fcn.00402e40
push 0
push 4
mov edx, esi
mov dword [esi], 0x44444444
mov ecx, ebx
call fcn.00402e40
mov edx, dword [ebp + 8]
add esp, 0x10
mov ecx, ebx
call fcn.00402f30
mov esi, 1
push ebx
call fcn.00515acf
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret