Function at 0x42ae20
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x18
push edi
mov edi, ecx
mov edx, dword [edi + 8]
cmp edx, 0xffffffff
mov dword [esp + 4], edi
jne 0x42ae43
push 6
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor al, al
pop edi
add esp, 0x18
ret 0x10
push ebx
mov ebx, dword [esp + 0x24]
push ebp
mov ebp, dword [esp + 0x2c]
push esi
mov esi, dword [esp + 0x38]
xor eax, eax
mov ecx, esi
add ecx, ebx
adc eax, ebp
cmp eax, dword [edi + 0x14]
jb 0x42ae6e
ja 0x42b03a
cmp ecx, dword [edi + 0x10]
ja 0x42b03a
mov eax, dword [0x4cf808]
test eax, eax
mov dword [esp + 0x38], 0
je 0x42afdb
mov edi, dword [esp + 0x34]
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
lea ecx, [esp + 0x14]
push ecx
mov dword [esp + 0x28], eax
lea eax, [esp + 0x3c]
push eax
push esi
push edi
push edx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x42b028
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x42aed8
cmp eax, 0x3e4
jne 0x42b042
mov eax, dword [esp + 0x10]
push 1
lea ecx, [esp + 0x3c]
push ecx
mov ecx, dword [eax + 8]
lea edx, [esp + 0x1c]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x42b028
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x5aa
jne 0x42b042
mov dword [esp + 0x34], edi
lea edi, [esi + 1]
shr edi, 1
test esi, esi
jbe 0x42b02c
lea esp, [esp]
test edi, edi
jbe 0x42afd7
cmp edi, esi
jbe 0x42af2e
mov edi, esi
xor edx, edx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], edx
lea eax, [esp + 0x14]
push eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], edx
lea ecx, [esp + 0x3c]
push ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x3c]
push edi
push edx
push ecx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x42afba
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x42af86
cmp eax, 0x3e4
jne 0x42b042
mov ecx, dword [esp + 0x10]
push 1
lea edx, [esp + 0x3c]
push edx
mov edx, dword [ecx + 8]
lea eax, [esp + 0x1c]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x42afba
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x5aa
jne 0x42b042
inc edi
shr edi, 1
jmp 0x42afcf
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
add ebx, eax
adc ebp, 0
add edx, eax
mov dword [esp + 0x34], edx
sub esi, eax
test esi, esi
ja 0x42af20
test esi, esi
jmp 0x42b02c
push 0
lea eax, [esp + 0x30]
push eax
push ebx
push edx
mov dword [esp + 0x3c], ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x42afff
call ebx
test eax, eax
jne 0x42b042
mov edx, dword [esp + 0x34]
mov eax, dword [edi + 8]
push 0
lea ecx, [esp + 0x3c]
push ecx
push esi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x42b028
call ebx
pop esi
pop ebp
pop ebx
xor al, al
pop edi
add esp, 0x18
ret 0x10
cmp dword [esp + 0x38], esi
jne 0x42b03a
pop esi
pop ebp
pop ebx
mov al, 1
pop edi
add esp, 0x18
ret 0x10
push 0x26
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop esi
pop ebp
pop ebx
xor al, al
pop edi
add esp, 0x18
ret 0x10