Function at 0x421d80
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x24
mov ebx, edx
mov esi, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x40]
cmp eax, 1
jne 0x421d9f
mov edi, dword [ecx + 0xc]
jmp 0x421daf
test eax, eax
js 0x421dab
mov edi, dword [ecx + 0xc]
imul edi, eax
jmp 0x421daf
mov edi, eax
neg edi
mov eax, edi
sar eax, 0x1f
mov dword [esp], edi
add dword [ebx + 0xf8], edi
adc dword [ebx + 0xfc], eax
mov eax, dword [ecx + 0xc]
mov ebp, eax
sar ebp, 0x1f
imul esi, eax
mov dword [esp + 4], eax
mov edi, edx
mul edx
add edx, esi
mov dword [esp + 8], ebp
mov esi, ebp
imul esi, edi
mov ebp, ecx
add esi, edx
add eax, dword [ebx + 0x18]
mov ecx, eax
adc esi, dword [ebx + 0x1c]
mov eax, dword [esp + 0x44]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x60]
mov dword [esp + 0xc], ebx
test byte [ebx + 8], 8
jne 0x421e70
test eax, eax
mov edi, dword [esp + 4]
je 0x421e20
mov ebx, eax
add eax, 0xffffffff
test dword [esp + 0x44], eax
jne 0x421e7a
mov edx, eax
and edx, ecx
jne 0x421e7a
and eax, dword [esp]
jne 0x421e7a
push 0
push esi
push ecx
mov ebx, dword [esp + 0x18]
push dword [ebx + 4]
call fcn.004399d0
add esp, 0x10
test edx, edx
mov dword [esp + 0x14], ebp
js 0x422000
mov esi, dword [esp]
push esi
push dword [esp + 0x48]
push dword [ebx + 4]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__write
add esp, 0xc
mov ebp, eax
test eax, eax
js 0x42200d
mov eax, 0x7f2bb725
xor edi, edi
cmp ebp, esi
jne 0x422038
jmp 0x42205c
test eax, eax
mov ebx, eax
mov edi, dword [esp + 4]
je 0x421e80
cmp edi, ebx
jg 0x421e90
jmp 0x421e9d
mov dword [ebp + 0x60], 1
mov ebx, 1
cmp edi, ebx
jle 0x421e9d
mov eax, edi
cdq
idiv ebx
test edx, edx
je 0x422029
mov eax, ebx
sar eax, 0x1f
mov dword [esp + 8], eax
mov eax, dword [esp]
test eax, eax
jle 0x421ffc
mov dword [esp + 0x14], ebp
push dword [esp + 8]
push ebx
push esi
mov edi, ecx
push ecx
call fcn.00434a60
mov ecx, dword [esp + 0x10]
add esp, 0x10
mov esi, eax
mov dword [esp + 4], edx
imul eax, ebx
sub edi, eax
xor ebp, ebp
nop word [eax + eax]
cmp ecx, ebx
mov dword [esp], ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x1c], esi
jl 0x421f10
test edi, edi
jne 0x421f10
mov eax, esi
mul ebx
mov dword [esp + 0x18], eax
imul esi, dword [esp + 8]
add esi, edx
mov edi, dword [esp + 4]
imul edi, ebx
add edi, esi
jmp 0x421f84
mov eax, esi
mul ebx
imul esi, dword [esp + 8]
add esi, edx
mov edi, dword [esp + 4]
imul edi, ebx
add edi, esi
push 0
push edi
mov dword [esp + 0x20], eax
push eax
mov esi, ebx
mov ebx, dword [esp + 0x18]
push dword [ebx + 4]
call fcn.004399d0
add esp, 0x10
test edx, edx
js 0x422017
push esi
push dword [ebx + 0xe0]
push dword [ebx + 4]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
add esp, 0xc
mov ebp, eax
mov eax, esi
sub eax, ebp
mov ebx, esi
je 0x421f81
test ebp, ebp
js 0x42200d
mov ecx, dword [esp + 0xc]
mov ecx, dword [ecx + 0xe0]
add ecx, ebp
push eax
push 0
push ecx
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
add esp, 0xc
mov ecx, dword [esp]
cmp ecx, ebx
mov ebp, ecx
cmovg ebp, ebx
mov eax, dword [esp + 0x20]
sub ebp, eax
mov esi, ebx
mov ebx, dword [esp + 0xc]
add eax, dword [ebx + 0xe0]
push ebp
push dword [esp + 0x14]
push eax
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
push 0
push edi
push dword [esp + 0x20]
push dword [ebx + 4]
call fcn.004399d0
add esp, 0x10
test edx, edx
js 0x422017
push esi
push dword [ebx + 0xe0]
push dword [ebx + 4]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__write
add esp, 0xc
test eax, eax
js 0x42200d
cmp eax, esi
jne 0x422030
mov ebx, esi
add dword [esp + 0x10], ebp
mov esi, dword [esp + 0x1c]
add esi, 1
adc dword [esp + 4], 0
xor edi, edi
mov ecx, dword [esp]
sub ecx, ebp
jg 0x421ee0
jmp 0x42205c
xor edi, edi
jmp 0x42205c
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
xor ebp, ebp
cmp dword [eax], 0
je 0x422022
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [eax]
jmp 0x422035
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [eax], 0
jne 0x42200d
mov eax, 0x7f2bb745
jmp 0x422035
mov ebx, edi
jmp 0x421ea6
mov eax, 0x7f2bb725
mov esi, dword [esp]
mov edx, dword [esp + 0x14]
mov ecx, dword [edx + 0x14]
test ecx, ecx
je 0x42205a
push eax
push ebp
push esi
push dword [esp + 0x1c]
push dword [esp + 0x50]
push dword [esp + 0x4c]
push edx
call ecx
add esp, 0x40
jmp 0x422061
mov edi, eax
mov eax, edi
add esp, 0x24
pop esi
pop edi
pop ebx
pop ebp
ret