Function at 0x10040a80
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa0
push esi
cmp dword [ebp + 8], 0xfffffffe
jne 0x10040ab0
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 9
or eax, 0xffffffff
jmp 0x10041431
cmp dword [ebp + 8], 0
jl 0x10040aca
mov eax, dword [ebp + 8]
cmp eax, dword [0x10073d88]
jae 0x10040aca
mov dword [ebp - 0x24], 1
jmp 0x10040ad1
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x28], ecx
cmp dword [ebp - 0x28], 0
jne 0x10040b03
push str.fh___0___unsigned_fh____unsigned__nhandle
push 0x1005be10
push 0
push 0x19e
push 0x10067a70
push 2
call fcn.1001da70
add esp, 0x18
cmp eax, 1
jne 0x10040b03
int3
cmp dword [ebp - 0x28], 0
jne 0x10040b45
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 9
push 0
push 0x19e
push 0x10067a70
push str._read_nolock
push str.fh___0___unsigned_fh____unsigned__nhandle
call fcn.1001c440
add esp, 0x14
or eax, 0xffffffff
jmp 0x10041431
mov eax, dword [ebp + 8]
sar eax, 6
mov ecx, dword [ebp + 8]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x10073b88]
movzx ecx, byte [eax + edx + 0x28]
and ecx, 1
je 0x10040b6e
mov dword [ebp - 0x2c], 1
jmp 0x10040b75
mov dword [ebp - 0x2c], 0
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x30], edx
cmp dword [ebp - 0x30], 0
jne 0x10040ba7
push str._osfile_fh___FOPEN
push 0x1005be10
push 0
push 0x19f
push 0x10067a70
push 2
call fcn.1001da70
add esp, 0x18
cmp eax, 1
jne 0x10040ba7
int3
cmp dword [ebp - 0x30], 0
jne 0x10040be9
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 9
push 0
push 0x19f
push 0x10067a70
push str._read_nolock
push str._osfile_fh___FOPEN
call fcn.1001c440
add esp, 0x14
or eax, 0xffffffff
jmp 0x10041431
cmp dword [ebp + 0x10], 0x7fffffff
ja 0x10040bfb
mov dword [ebp - 0x34], 1
jmp 0x10040c02
mov dword [ebp - 0x34], 0
mov ecx, dword [ebp - 0x34]
mov dword [ebp - 0x38], ecx
cmp dword [ebp - 0x38], 0
jne 0x10040c34
push str.result_buffer_size___INT_MAX
push 0x1005be10
push 0
push 0x1a0
push 0x10067a70
push 2
call fcn.1001da70
add esp, 0x18
cmp eax, 1
jne 0x10040c34
int3
cmp dword [ebp - 0x38], 0
jne 0x10040c76
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 0x16
push 0
push 0x1a0
push 0x10067a70
push str._read_nolock
push str.result_buffer_size___INT_MAX
call fcn.1001c440
add esp, 0x14
or eax, 0xffffffff
jmp 0x10041431
cmp dword [ebp + 0x10], 0
je 0x10040c9c
mov eax, dword [ebp + 8]
sar eax, 6
mov ecx, dword [ebp + 8]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x10073b88]
movzx ecx, byte [eax + edx + 0x28]
and ecx, 2
je 0x10040ca3
xor eax, eax
jmp 0x10041431
cmp dword [ebp + 0xc], 0
je 0x10040cb2
mov dword [ebp - 0x3c], 1
jmp 0x10040cb9
mov dword [ebp - 0x3c], 0
mov edx, dword [ebp - 0x3c]
mov dword [ebp - 0x40], edx
cmp dword [ebp - 0x40], 0
jne 0x10040ceb
push str.result_buffer___nullptr
push 0x1005be10
push 0
push 0x1a6
push 0x10067a70
push 2
call fcn.1001da70
add esp, 0x18
cmp eax, 1
jne 0x10040ceb
int3
cmp dword [ebp - 0x40], 0
jne 0x10040d2d
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 0x16
push 0
push 0x1a6
push 0x10067a70
push str._read_nolock
push str.result_buffer___nullptr
call fcn.1001c440
add esp, 0x14
or eax, 0xffffffff
jmp 0x10041431
mov ecx, dword [ebp + 8]
sar ecx, 6
mov edx, dword [ebp + 8]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x10073b88]
mov edx, dword [ecx + eax + 0x18]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp + 8]
sar eax, 6
mov ecx, dword [ebp + 8]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x10073b88]
mov cl, byte [eax + edx + 0x29]
mov byte [ebp - 1], cl
push 0
lea ecx, [ebp - 0x14]
call fcn.10012420
mov dl, byte [ebp - 1]
mov byte [ebp - 0x44], dl
cmp byte [ebp - 0x44], 1
je 0x10040d8c
cmp byte [ebp - 0x44], 2
je 0x10040f0d
jmp 0x10040fbe
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ecx, 2
div ecx
test edx, edx
jne 0x10040da5
mov dword [ebp - 0x48], 1
jmp 0x10040dac
mov dword [ebp - 0x48], 0
mov edx, dword [ebp - 0x48]
mov dword [ebp - 0x4c], edx
cmp dword [ebp - 0x4c], 0
jne 0x10040dde
push str.result_buffer_size___2__0
push 0x1005be10
push 0
push 0x1c6
push 0x10067a70
push 2
call fcn.1001da70
add esp, 0x18
cmp eax, 1
jne 0x10040dde
int3
cmp dword [ebp - 0x4c], 0
jne 0x10040e2f
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 0x16
push 0
push 0x1c6
push 0x10067a70
push str._read_nolock
push str.result_buffer_size___2__0
call fcn.1001c440
add esp, 0x14
mov dword [ebp - 0x64], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x64]
jmp 0x10041431
mov ecx, dword [ebp + 0x10]
shr ecx, 1
cmp ecx, 4
jae 0x10040e42
mov dword [ebp - 0x50], 4
jmp 0x10040e4a
mov edx, dword [ebp + 0x10]
shr edx, 1
mov dword [ebp - 0x50], edx
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0xc], eax
push 0x1cc
push str.minkernelcrtsucrt_src_appcrtlowio_read.cpp
push 2
mov ecx, dword [ebp - 0xc]
push ecx
call fcn.100206e0
add esp, 0x10
push eax
lea ecx, [ebp - 0x68]
call fcn.10012420
push eax
lea ecx, [ebp - 0x14]
call fcn.1002c140
lea ecx, [ebp - 0x68]
call fcn.100128f0
lea ecx, [ebp - 0x14]
call fcn.10012490
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x10040ec0
call fcn.10025a70
mov dword [eax], 0xc
call fcn.10025a40
mov dword [eax], 8
mov dword [ebp - 0x6c], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x6c]
jmp 0x10041431
push 1
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.100418b0
add esp, 0x10
mov dword [ebp - 0x9c], eax
mov dword [ebp - 0x98], edx
mov eax, dword [ebp + 8]
sar eax, 6
mov ecx, dword [ebp + 8]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x10073b88]
mov ecx, dword [ebp - 0x9c]
mov esi, dword [ebp - 0x98]
mov dword [eax + edx + 0x20], ecx
mov dword [eax + edx + 0x24], esi
jmp 0x10040fca
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ecx, 2
div ecx
test edx, edx
jne 0x10040f26
mov dword [ebp - 0x54], 1
jmp 0x10040f2d
mov dword [ebp - 0x54], 0
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x58], edx
cmp dword [ebp - 0x58], 0
jne 0x10040f5f
push str._result_buffer_size___2___0
push 0x1005be10
push 0
push 0x1da
push 0x10067a70
push 2
call fcn.1001da70
add esp, 0x18
cmp eax, 1
jne 0x10040f5f
int3
cmp dword [ebp - 0x58], 0
jne 0x10040fb0
call fcn.10025a40
mov dword [eax], 0
call fcn.10025a70
mov dword [eax], 0x16
push 0
push 0x1da
push 0x10067a70
push str._read_nolock
push str._result_buffer_size___2___0
call fcn.1001c440
add esp, 0x14
mov dword [ebp - 0x70], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x70]
jmp 0x10041431
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 0xc]
mov dword [ebp - 8], edx
jmp 0x10040fca
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 8]
mov dword [ebp - 0x60], edx
mov dword [ebp - 0x10], 0
mov eax, dword [ebp + 8]
sar eax, 6
mov ecx, dword [ebp + 8]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x10073b88]
movzx ecx, byte [eax + edx + 0x28]
and ecx, 0x48
je 0x100411db
mov edx, dword [ebp + 8]
sar edx, 6
mov eax, dword [ebp + 8]
and eax, 0x3f
imul ecx, eax, 0x38
mov edx, dword [edx*4 + 0x10073b88]
add edx, ecx
mov eax, 1
imul ecx, eax, 0
movsx edx, byte [edx + ecx + 0x2a]
cmp edx, 0xa
je 0x100411db
cmp dword [ebp - 0xc], 0
je 0x100411db
mov eax, dword [ebp + 8]
sar eax, 6
mov ecx, dword [ebp + 8]
and ecx, 0x3f
imul edx, ecx, 0x38
add edx, dword [eax*4 + 0x10073b88]
mov eax, 1
imul ecx, eax, 0
mov eax, dword [ebp - 8]
mov cl, byte [edx + ecx + 0x2a]
mov byte [eax], cl
mov edx, dword [ebp - 8]
add edx, 1
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0xc]
sub ecx, 1
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 8]
sar edx, 6
mov eax, dword [ebp + 8]
and eax, 0x3f
imul ecx, eax, 0x38
add ecx, dword [edx*4 + 0x10073b88]
mov edx, 1
imul eax, edx, 0
mov byte [ecx + eax + 0x2a], 0xa
cmp byte [ebp - 1], 0
je 0x100411db
mov ecx, dword [ebp + 8]
sar ecx, 6
mov edx, dword [ebp + 8]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x10073b88]
add ecx, eax
mov edx, 1
shl edx, 0
movsx eax, byte [ecx + edx + 0x2a]
cmp eax, 0xa
je 0x100411db
cmp dword [ebp - 0xc], 0
je 0x100411db
mov ecx, dword [ebp + 8]
sar ecx, 6
mov edx, dword [ebp + 8]
and edx, 0x3f
imul eax, edx, 0x38
add eax, dword [ecx*4 + 0x10073b88]
mov ecx, 1
shl ecx, 0
mov edx, dword [ebp - 8]
mov al, byte [eax + ecx + 0x2a]
mov byte [edx], al
mov ecx, dword [ebp - 8]
add ecx, 1
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0xc]
sub eax, 1
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp + 8]
sar ecx, 6
mov edx, dword [ebp + 8]
and edx, 0x3f
imul eax, edx, 0x38
add eax, dword [ecx*4 + 0x10073b88]
mov ecx, 1
shl ecx, 0
mov byte [eax + ecx + 0x2a], 0xa
cmp byte [ebp - 1], 1
jne 0x100411db
mov edx, dword [ebp + 8]
sar edx, 6
mov eax, dword [ebp + 8]
and eax, 0x3f
imul ecx, eax, 0x38
mov edx, dword [edx*4 + 0x10073b88]
add edx, ecx
mov eax, 1
shl eax, 1
movsx ecx, byte [edx + eax + 0x2a]
cmp ecx, 0xa
je 0x100411db
cmp dword [ebp - 0xc], 0
je 0x100411db
mov edx, dword [ebp + 8]
sar edx, 6
mov eax, dword [ebp + 8]
and eax, 0x3f
imul ecx, eax, 0x38
add ecx, dword [edx*4 + 0x10073b88]
mov edx, 1
shl edx, 1
mov eax, dword [ebp - 8]
mov cl, byte [ecx + edx + 0x2a]
mov byte [eax], cl
mov edx, dword [ebp - 8]
add edx, 1
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0xc]
sub ecx, 1
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 8]
sar edx, 6
mov eax, dword [ebp + 8]
and eax, 0x3f
imul ecx, eax, 0x38
add ecx, dword [edx*4 + 0x10073b88]
mov edx, 1
shl edx, 1
mov byte [ecx + edx + 0x2a], 0xa
mov eax, dword [ebp + 8]
push eax
call fcn.100518d0
add esp, 4
test eax, eax
je 0x10041229
mov ecx, dword [ebp + 8]
sar ecx, 6
mov edx, dword [ebp + 8]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x10073b88]
movzx edx, byte [ecx + eax + 0x28]
and edx, 0x80
je 0x10041229
lea eax, [ebp - 0xa0]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x10041229
mov byte [ebp - 0x15], 1
jmp 0x1004122d
mov byte [ebp - 0x15], 0
mov dl, byte [ebp - 0x15]
mov byte [ebp - 0x16], dl
movzx eax, byte [ebp - 0x16]
test eax, eax
je 0x10041296
cmp byte [ebp - 1], 2
jne 0x10041296
push 0
lea ecx, [ebp - 0x78]
push ecx
mov edx, dword [ebp - 0xc]
shr edx, 1
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x10041285
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.100259c0
add esp, 4
mov dword [ebp - 0x74], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x74]
jmp 0x10041431
mov edx, dword [ebp - 0x78]
mov eax, dword [ebp - 0x10]
lea ecx, [eax + edx*2]
mov dword [ebp - 0x10], ecx
jmp 0x1004134c
push 0
lea edx, [ebp - 0x5c]
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100412be
mov eax, dword [ebp - 0x5c]
cmp eax, dword [ebp + 0x10]
jbe 0x10041343
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 5
jne 0x100412fb
call fcn.10025a70
mov dword [eax], 9
call fcn.10025a40
mov ecx, dword [ebp - 0x1c]
mov dword [eax], ecx
mov dword [ebp - 0x7c], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x7c]
jmp 0x10041431
cmp dword [ebp - 0x1c], 0x6d
jne 0x1004131a
mov dword [ebp - 0x80], 0
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x80]
jmp 0x10041431
mov edx, dword [ebp - 0x1c]
push edx
call fcn.100259c0
add esp, 4
mov dword [ebp - 0x84], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x84]
jmp 0x10041431
mov eax, dword [ebp - 0x10]
add eax, dword [ebp - 0x5c]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp + 8]
sar ecx, 6
mov edx, dword [ebp + 8]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x10073b88]
movzx edx, byte [ecx + eax + 0x28]
and edx, 0x80
jne 0x1004138b
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x88], eax
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x88]
jmp 0x10041431
cmp byte [ebp - 1], 2
je 0x100413c7
mov ecx, dword [ebp + 0x10]
shr ecx, 1
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.10040410
add esp, 0x14
mov dword [ebp - 0x8c], eax
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x8c]
jmp 0x10041431
movzx eax, byte [ebp - 0x16]
test eax, eax
je 0x100413fd
mov ecx, dword [ebp - 0x10]
shr ecx, 1
push ecx
mov edx, dword [ebp - 0x60]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.100406a0
add esp, 0xc
mov dword [ebp - 0x90], eax
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x90]
jmp 0x10041431
mov ecx, dword [ebp - 0x10]
shr ecx, 1
push ecx
mov edx, dword [ebp - 0x60]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.10040030
add esp, 0xc
mov dword [ebp - 0x94], eax
lea ecx, [ebp - 0x14]
call fcn.100128f0
mov eax, dword [ebp - 0x94]
jmp 0x10041431
pop esi
mov esp, ebp
pop ebp
ret