Function at 0x10021f80
Capabilities:
Read file on windows

Disassembly:
mov eax, 4
call fcn.100bf140
push esi
xor esi, esi
cmp dword [0x10116f98], esi
jne 0x10021fb8
push 0x6c
push str..cryptodesenc_read.c
push 0x4004
call sym.LIBEAY32.dll_CRYPTO_malloc
add esp, 0xc
mov dword [0x10116f98], eax
test eax, eax
jne 0x10021fb8
or eax, 0xffffffff
pop esi
pop ecx
ret
mov ecx, dword [0x10116f88]
test ecx, ecx
jne 0x10021fe2
push 0x71
push str..cryptodesenc_read.c
push 0x4004
call sym.LIBEAY32.dll_CRYPTO_malloc
mov ecx, eax
add esp, 0xc
mov dword [0x10116f88], ecx
test ecx, ecx
je 0x10021fb2
mov edx, dword [0x10116f8c]
test edx, edx
jne 0x10022012
push 0x76
push str..cryptodesenc_read.c
push 0x4004
call sym.LIBEAY32.dll_CRYPTO_malloc
mov edx, eax
add esp, 0xc
mov dword [0x10116f8c], edx
test edx, edx
je 0x10021fb2
mov ecx, dword [0x10116f88]
push ebx
push edi
mov edi, dword [0x10116f94]
test edi, edi
je 0x1002207e
mov ebx, dword [esp + 0x1c]
cmp edi, ebx
jge 0x1002204e
mov eax, dword [0x10116f90]
push edi
add eax, edx
push eax
push dword [esp + 0x20]
call sub.MSVCR120.dll_memcpy
add esp, 0xc
mov dword [0x10116f94], esi
mov eax, edi
mov dword [0x10116f90], esi
pop edi
pop ebx
pop esi
pop ecx
ret
mov esi, dword [0x10116f90]
push ebx
lea eax, [esi + edx]
push eax
push dword [esp + 0x20]
call sub.MSVCR120.dll_memcpy
add esp, 0xc
add esi, ebx
sub edi, ebx
mov dword [0x10116f90], esi
mov dword [0x10116f94], edi
mov edi, ebx
mov eax, edi
pop edi
pop ebx
pop esi
pop ecx
ret
mov eax, dword [esp + 0x1c]
mov edx, 0x4000
mov ebx, dword [sym.imp.MSVCR120.dll__errno]
cmp eax, edx
cmovg eax, edx
mov dword [esp + 0xc], eax
mov eax, 4
sub eax, esi
push eax
lea eax, [ecx + esi]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.MSVCR120.dll__read]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x100220c2
call ebx
cmp dword [eax], 4
je 0x100220c8
pop edi
pop ebx
xor eax, eax
pop esi
pop ecx
ret
test eax, eax
jle 0x100220bb
add esi, eax
cmp esi, 4
jge 0x100220d5
mov ecx, dword [0x10116f88]
jmp 0x10022096
mov ebx, dword [0x10116f88]
movzx esi, byte [ebx]
movzx eax, byte [ebx + 1]
movzx ecx, byte [ebx + 2]
shl esi, 0x18
shl eax, 0x10
or esi, eax
shl ecx, 8
movzx eax, byte [ebx + 3]
or ecx, eax
or esi, ecx
cmp esi, 0x4000
ja 0x1002222c
push ebp
cmp esi, 8
jge 0x10022112
mov ebp, 8
jmp 0x1002211f
lea eax, [esi + 7]
cdq
and edx, 7
lea ebp, [edx + eax]
and ebp, 0xfffffff8
xor edi, edi
test ebp, ebp
jle 0x10022163
mov eax, ebp
sub eax, edi
push eax
lea eax, [ebx + edi]
push eax
push dword [esp + 0x20]
call dword [sym.imp.MSVCR120.dll__read]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x10022153
call dword [sym.imp.MSVCR120.dll__errno]
cmp dword [eax], 4
je 0x10022159
pop ebp
pop edi
pop ebx
xor eax, eax
pop esi
pop ecx
ret
test eax, eax
jle 0x1002214b
add edi, eax
mov ebx, dword [0x10116f88]
cmp edi, ebp
jl 0x10022125
mov edi, dword [esp + 0x10]
push 0
push dword [esp + 0x2c]
push dword [esp + 0x2c]
push esi
cmp edi, esi
jge 0x100221c0
test byte [0x10111134], 1
push dword [0x10116f8c]
push ebx
je 0x1002218d
call sym.LIBEAY32.dll_DES_pcbc_encrypt
jmp 0x10022192
call sym.LIBEAY32.dll_DES_cbc_encrypt
add esp, 0x18
push edi
push dword [0x10116f8c]
push dword [esp + 0x24]
call sub.MSVCR120.dll_memcpy
add esp, 0xc
mov dword [0x10116f90], edi
sub esi, edi
mov dword [0x10116f94], esi
mov esi, edi
mov eax, esi
pop ebp
pop edi
pop ebx
pop esi
pop ecx
ret
cmp edi, ebp
jge 0x100221fe
test byte [0x10111134], 1
push dword [0x10116f98]
push ebx
je 0x100221db
call sym.LIBEAY32.dll_DES_pcbc_encrypt
jmp 0x100221e0
call sym.LIBEAY32.dll_DES_cbc_encrypt
add esp, 0x18
push esi
push dword [0x10116f98]
push dword [esp + 0x24]
call sub.MSVCR120.dll_memcpy
add esp, 0xc
mov eax, esi
pop ebp
pop edi
pop ebx
pop esi
pop ecx
ret
test byte [0x10111134], 1
push dword [esp + 0x2c]
push ebx
je 0x1002221c
call sym.LIBEAY32.dll_DES_pcbc_encrypt
add esp, 0x18
mov eax, esi
pop ebp
pop edi
pop ebx
pop esi
pop ecx
ret
call sym.LIBEAY32.dll_DES_cbc_encrypt
add esp, 0x18
mov eax, esi
pop ebp
pop edi
pop ebx
pop esi
pop ecx
ret
pop edi
pop ebx
or eax, 0xffffffff
pop esi
pop ecx
ret