Function at 0x422070
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov ebp, edx
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
test eax, eax
js 0x42208d
mov edx, dword [ecx + 0xc]
imul edx, eax
jmp 0x422091
mov edx, eax
neg edx
mov eax, edx
sar eax, 0x1f
mov dword [esp + 4], edx
add dword [ebp + 0xf0], edx
adc dword [ebp + 0xf4], eax
mov eax, dword [ecx + 0xc]
mov edi, eax
sar edi, 0x1f
imul esi, eax
mov dword [esp], eax
mov edx, dword [esp + 0x24]
mul edx
mov ebx, eax
add edx, esi
mov eax, ebp
mov ebp, edi
imul ebp, dword [esp + 0x24]
add ebp, edx
add ebx, dword [eax + 0x18]
adc ebp, dword [eax + 0x1c]
mov dword [esp + 0xc], ecx
mov ecx, dword [ecx + 0x60]
mov dword [esp + 8], eax
test byte [eax + 8], 8
jne 0x42213d
test ecx, ecx
mov esi, dword [esp + 4]
je 0x4220fb
lea eax, [ecx - 1]
test dword [esp + 0x30], eax
jne 0x422145
mov edx, eax
and edx, ebx
jne 0x422145
and eax, esi
jne 0x422145
push 0
push ebp
push ebx
mov edi, dword [esp + 0x14]
push dword [edi + 4]
call fcn.004399d0
add esp, 0x10
test edx, edx
js 0x422218
push esi
mov eax, dword [esp + 0x34]
mov dword [esp + 4], eax
push dword [esp + 0x34]
push dword [edi + 4]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
add esp, 0xc
xor ebx, ebx
cmp eax, esi
jne 0x42224a
jmp 0x422298
test ecx, ecx
mov esi, dword [esp + 4]
je 0x42214c
cmp dword [esp], ecx
jg 0x422161
jmp 0x422172
mov eax, dword [esp + 0xc]
mov dword [eax + 0x60], 1
mov ecx, 1
cmp dword [esp], ecx
jle 0x422172
mov eax, dword [esp]
cdq
idiv ecx
mov eax, dword [esp]
test edx, edx
je 0x42223a
mov edi, ecx
sar edi, 0x1f
push edi
mov dword [esp + 8], ecx
push ecx
push ebp
mov edi, ebx
push ebx
call fcn.004399e0
add esp, 0x10
mov ebx, eax
sub edi, eax
sbb ebp, edx
push 0
push ebp
push edi
mov edi, dword [esp + 0x14]
push dword [edi + 4]
call fcn.004399d0
add esp, 0x10
test edx, edx
js 0x422218
test esi, esi
jle 0x422229
mov eax, dword [esp + 0x30]
mov dword [esp], eax
xor eax, eax
mov ebp, dword [esp + 4]
nop word [eax + eax]
mov dword [esp + 4], eax
push ebp
mov eax, dword [esp + 0xc]
push dword [eax + 0xe0]
push dword [eax + 4]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
add esp, 0xc
cmp eax, ebp
jne 0x422241
cmp esi, ebp
mov edi, esi
cmovg esi, ebp
sub esi, ebx
mov eax, dword [esp + 8]
add ebx, dword [eax + 0xe0]
push esi
push ebx
mov ebx, dword [esp + 8]
push ebx
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov eax, dword [esp + 4]
add eax, esi
add ebx, esi
mov dword [esp], ebx
xor ebx, ebx
sub edi, esi
mov esi, edi
jg 0x4221c0
jmp 0x422298
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [eax], 0
je 0x42222d
mov edi, dword [esp + 0x30]
jmp 0x422256
xor ebx, ebx
jmp 0x422298
xor eax, eax
mov ebx, 0x7f2bb745
mov edi, dword [esp + 0x30]
jmp 0x422260
mov ecx, eax
jmp 0x422177
mov eax, dword [esp + 4]
sub dword [esp], eax
add esi, eax
mov ebx, 0x7f2bb724
test eax, eax
mov edi, dword [esp]
jns 0x422260
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ebx, dword [eax]
xor eax, eax
mov edx, esi
sub edx, eax
jle 0x422279
lea ecx, [edi + eax]
push edx
push 0
push ecx
mov ebp, eax
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov eax, ebp
add esp, 0xc
mov edx, dword [esp + 0xc]
mov ecx, dword [edx + 0x10]
test ecx, ecx
je 0x422298
push ebx
push eax
push esi
push edi
push dword [esp + 0x3c]
push dword [esp + 0x38]
push edx
call ecx
add esp, 0x2c
jmp 0x42229d
mov eax, ebx
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret