Function at 0x404940
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa4
mov eax, dword [0x436008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov esi, edx
xorps xmm0, xmm0
push 0x438c08
push esi
mov edi, ecx
movlpd qword [ebp - 0x98], xmm0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x70], ebx
test ebx, ebx
jne 0x4049b1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push esi
push str.ERROR:_Unable_to_open_filesystem_image__s:__s_n
call fcn.00404d10
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fseeki64]
push 2
push 0
push 0
push ebx
call esi
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__ftelli64]
add esp, 0x14
mov dword [ebp - 0x8c], eax
mov dword [ebp - 0x80], edx
push 0
push 0
push 0
push ebx
call esi
push 0x20000
mov dword [ebp - 0x78], 0
xor esi, esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 0x14
mov ebx, eax
cmp byte [edi + 4], 0
je 0x404a08
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.LIBEAY32.dll_Ordinal_503]
add esp, 4
mov ecx, dword [ebp - 0x80]
mov edx, dword [ebp - 0x8c]
mov eax, edx
mov dword [ebp - 0x90], edx
mov dword [ebp - 0x74], ecx
test ecx, ecx
ja 0x404a28
test edx, edx
je 0x404bd5
mov edx, dword [ebp - 0x94]
mov dword [ebp - 0x88], edx
mov edx, dword [ebp - 0x98]
mov dword [ebp - 0x84], edx
mov esi, 0x20000
test ecx, ecx
ja 0x404a51
jb 0x404a4f
cmp eax, esi
jae 0x404a51
mov esi, eax
xor eax, eax
mov dword [ebp - 0x7c], eax
cmp byte [edi + 4], al
je 0x404a79
mov ecx, dword [ebp - 0x78]
mov dword [ebp - 0x7c], eax
lea eax, [esi + ecx]
cmp eax, 0x20000
jl 0x404a79
mov esi, 0x20000
mov dword [ebp - 0x7c], 1
sub esi, ecx
push dword [ebp - 0x70]
push esi
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
cmp eax, esi
jne 0x404c78
mov ecx, dword [edi]
lea eax, [ebp - 0x6c]
push eax
push esi
mov edx, ebx
mov dword [ebp - 0x6c], 0
call fcn.0041fdb0
add esp, 8
test eax, eax
mov eax, dword [ebp - 0x6c]
jne 0x404c62
cmp eax, esi
jne 0x404c62
cmp byte [edi + 4], 0
je 0x404b26
push esi
lea eax, [ebp - 0x68]
push ebx
push eax
call dword [sym.imp.LIBEAY32.dll_Ordinal_504]
add dword [ebp - 0x78], esi
add esp, 0xc
cmp dword [ebp - 0x7c], 0
je 0x404b26
lea eax, [ebp - 0x68]
push eax
push ebx
call dword [sym.imp.LIBEAY32.dll_Ordinal_502]
mov ecx, dword [edi]
lea eax, [ebp - 0x6c]
push eax
push 0x14
mov edx, ebx
mov dword [ebp - 0x6c], 0
call fcn.0041fdb0
add esp, 0x10
test eax, eax
mov eax, dword [ebp - 0x6c]
jne 0x404c22
cmp eax, 0x14
jne 0x404c22
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.LIBEAY32.dll_Ordinal_503]
add esp, 4
mov dword [ebp - 0x78], 0
mov eax, esi
mov esi, dword [ebp - 0x84]
cdq
add esi, eax
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x88]
mov ecx, edx
adc eax, ecx
mov dword [ebp - 0x94], ecx
mov edx, eax
mov dword [ebp - 0x84], esi
mov ecx, esi
mov dword [ebp - 0x88], eax
call fcn.00430150
mov edx, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x8c]
movsd qword [ebp - 0xa0], xmm0
call fcn.00430150
movsd xmm1, qword [ebp - 0xa0]
mov eax, dword [edi + 0xc]
divsd xmm1, xmm0
test eax, eax
je 0x404ba9
movaps xmm0, xmm1
mulsd xmm0, qword [0x432db8]
cvttsd2si esi, xmm0
cmp esi, dword [edi + 8]
jle 0x404ba9
push dword [edi + 0x10]
sub esp, 8
movsd qword [esp], xmm1
call eax
add esp, 0xc
mov dword [edi + 8], esi
mov eax, dword [ebp - 0x90]
sub eax, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x74]
sbb ecx, dword [ebp - 0x94]
mov dword [ebp - 0x90], eax
mov dword [ebp - 0x74], ecx
jne 0x404a40
test eax, eax
jne 0x404a40
mov esi, dword [ebp - 0x7c]
cmp byte [edi + 4], 0
je 0x404c39
test esi, esi
jne 0x404c39
lea eax, [ebp - 0x68]
push eax
push ebx
call dword [sym.imp.LIBEAY32.dll_Ordinal_502]
mov ecx, dword [edi]
lea eax, [ebp - 0x74]
push eax
push 0x14
mov edx, ebx
mov dword [ebp - 0x74], esi
call fcn.0041fdb0
add esp, 0x10
test eax, eax
mov eax, dword [ebp - 0x74]
jne 0x404c0b
cmp eax, 0x14
je 0x404c39
push 0x14
push eax
push str.ERROR:_Unable_to_send_data_to_ASR._Sent__u_of__u_bytes._n
call fcn.00404d10
add esp, 0xc
push str.ERROR:_Unable_to_send_chunk_checksum_n
jmp 0x404c7d
push 0x14
push eax
push str.ERROR:_Unable_to_send_data_to_ASR._Sent__u_of__u_bytes._n
call fcn.00404d10
add esp, 0xc
push 0x438c84
jmp 0x404c7d
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [ebp - 0x70]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret
push esi
push eax
push str.ERROR:_Unable_to_send_data_to_ASR._Sent__u_of__u_bytes._n
call fcn.00404d10
add esp, 0xc
push str.ERROR:_Unable_to_send_filesystem_payload_n
jmp 0x404c7d
push str.Error_reading_filesystem_n
call fcn.00404d10
add esp, 4
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [ebp - 0x70]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
or eax, 0xffffffff
pop edi
pop esi
pop ebx
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret