Function at 0x140049820
Capabilities:
Create new key via cryptacquirecontext
Hash data via wincrypt
Initialize hashing via wincrypt
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0xfb0]
mov eax, 0x10b0
call fcn.1400b0a80
sub rsp, rax
mov rax, qword [0x1400db098]
xor rax, rsp
mov qword [rbp + 0xfa0], rax
mov rdi, rdx
mov rbx, rcx
mov qword [rsp + 0x60], rcx
xor esi, esi
mov dword [rsp + 0x40], esi
mov dword [rsp + 0x6c], reloc.WLDAP32.dll_Ordinal_32
mov dword [rsp + 0x20], 0xf0000000
lea r9d, [rsi + 0x18]
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x140049c31
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, 0x800c
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
je 0x140049bff
cmp qword [rdi + 0x18], 8
jb 0x1400498c3
mov rdi, qword [rdi]
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
lea r8d, [r9 + 1]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x140049bf6
mov dword [rsp + 0x68], esi
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x68]
mov r8d, 0x1000
lea rdx, [rbp - 0x60]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140049965
nop
mov r8d, dword [rsp + 0x68]
test r8d, r8d
je 0x140049965
xor r9d, r9d
lea rdx, [rbp - 0x60]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x140049af0
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x68]
mov r8d, 0x1000
lea rdx, [rbp - 0x60]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140049920
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x20], esi
lea r9, [rsp + 0x6c]
lea r8, [rbp - 0x80]
mov edx, 2
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CryptGetHashParam]
test eax, eax
je 0x140049bb9
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
xor edx, edx
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
xor edx, edx
mov r8d, 0xe8
lea rcx, [rbp - 0x60]
call sub.VCRUNTIME140.dll_memset
lea rax, [0x1400ca088]
mov qword [rbp - 0x60], rax
lea rcx, [rbp + 0x28]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov dword [rsp + 0x40], 8
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp - 0x58]
lea rcx, [rbp - 0x60]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char______ptr64__bool____ptr64]
nop
mov rax, qword [rbp - 0x60]
movsxd rcx, dword [rax + 4]
lea r14, vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rbp + rcx - 0x60], r14
mov rax, qword [rbp - 0x60]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov dword [rbp + rcx - 0x64], edx
lea rcx, [rbp - 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void____ptr64]
lea rax, vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rbp - 0x58], rax
mov qword [rbp + 0x10], rsi
mov dword [rbp + 0x18], 4
lea rdx, [0x140043400]
lea rcx, [rbp - 0x60]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov rcx, qword [rax]
movsxd rdx, dword [rcx + 4]
mov byte [rdx + rax + 0x58], Ordinal_50
mov edi, esi
cmp dword [rsp + 0x6c], esi
jbe 0x140049aa2
nop word [rax + rax]
mov edx, 2
lea rcx, [rsp + 0x48]
call qword [sym.imp.MSVCP140.dll_struct_std::_Smanip_long_long___int64_____cdecl_std::setw_long_long___int64__]
mov r8, qword [rax]
mov rcx, qword [rbp - 0x60]
movsxd rdx, dword [rcx + 4]
lea rcx, [rbp - 0x60]
add rcx, rdx
mov rdx, qword [rax + 8]
call r8
mov eax, edi
movzx edx, byte [rbp + rax - 0x80]
lea rcx, [rbp - 0x60]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
inc edi
cmp edi, dword [rsp + 0x6c]
jb 0x140049a60
xorps xmm0, xmm0
movups xmmword [rbx], xmm0
mov qword [rbx + 0x10], rsi
mov qword [rbx + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rbx], 0
mov dword [rsp + 0x40], recv
movups xmmword [rsp + 0x48], xmm0
mov ecx, dword [rbp + 0x18]
mov eax, ecx
and al, 0x22
cmp al, 2
je 0x140049b39
mov rax, qword [rbp - 0x18]
mov r8, qword [rax]
test r8, r8
je 0x140049b39
mov rax, qword [rbp - 0x38]
mov rdx, qword [rax]
cmp r8, qword [rbp + 0x10]
cmovb r8, qword [rbp + 0x10]
sub r8, rdx
jmp 0x140049b6a
lea rdx, str.Error_hashing_file_data.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.14004d420
lea rdx, [0x14004d5f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
xor edx, edx
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140049c54
test cl, 4
jne 0x140049b60
mov rax, qword [rbp - 0x20]
mov rcx, qword [rax]
test rcx, rcx
je 0x140049b60
mov rax, qword [rbp - 0x40]
mov rdx, qword [rax]
mov rax, qword [rbp - 8]
movsxd r8, dword [rax]
add r8, rcx
sub r8, rdx
jmp 0x140049b6a
mov r8, qword [rsp + 0x50]
mov rdx, qword [rsp + 0x48]
test rdx, rdx
je 0x140049b78
mov rcx, rbx
call fcn.14004cd70
nop
mov rax, qword [rbp - 0x60]
movsxd rcx, dword [rax + 4]
mov qword [rbp + rcx - 0x60], r14
mov rax, qword [rbp - 0x60]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov dword [rbp + rcx - 0x64], edx
lea rcx, [rbp - 0x58]
call fcn.14004c3a0
lea rcx, [rbp - 0x50]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::destructor_void____ptr64]
lea rcx, [rbp + 0x28]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::destructor_void____ptr64]
jmp 0x140049c74
lea rdx, str.Error_retrieving_hash_value.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.14004d420
lea rdx, [0x14004d5f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
xor edx, edx
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x140049c54
lea rdx, str.Error_opening_file_for_hashing.
jmp 0x140049bc0
lea rdx, str.Error_creating_hash_object.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.14004d420
lea rdx, [0x14004d5f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor edx, edx
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x140049c54
lea rdx, str.Error_acquiring_cryptographic_context.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.14004d420
lea rdx, [0x14004d5f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xorps xmm0, xmm0
movups xmmword [rbx], xmm0
mov qword [rbx + 0x10], rsi
mov qword [rbx + 0x18], rsi
xor r8d, r8d
lea rdx, [0x1400c36b6]
mov rcx, rbx
call fcn.14004db60
mov rax, rbx
mov rcx, qword [rbp + 0xfa0]
xor rcx, rsp
call fcn.1400afce0
lea r11, [rsp + 0x10b0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret