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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
mov eax, 0x10e0
call fcn.00426960
mov ecx, dword [ebp + 8]
mov eax, dword [0x43e00c]
xor eax, ebp
mov dword [esp + 0x10d8], eax
mov dword [esp + 0x24], 0
xorps xmm0, xmm0
movaps xmmword [esp + 0x40], xmm0
movaps xmmword [esp + 0x30], xmm0
test ecx, ecx
je 0x40bb1e
cmp dword [ebp + 0xc], 0
je 0x40bb1e
cmp dword [ebp + 0x10], 0
je 0x40bb1e
cmp dword [ebp + 0x14], 0
je 0x40bb1e
cmp dword [ecx], 0
je 0x40bb52
lea esi, [esp + 0x24]
push 0xf0000000
push 0x18
push str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x40ba1a
push 0xf0000008
push 0x18
push str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x40ba1a
sub esp, 0x14
movaps xmm0, xmmword [0x435430]
movups xmmword [esp + 4], xmm0
mov dword [esp], esi
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x40ba1a
sub esp, 0x14
movaps xmm0, xmmword [0x435440]
movups xmmword [esp + 4], xmm0
mov dword [esp], esi
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
je 0x40bbfd
xor ebx, ebx
lea edi, [esp + 0x30]
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + ebx*4]
test eax, eax
je 0x40bb2f
mov esi, dword [esp + 0x24]
test esi, esi
je 0x40bb2f
mov ecx, dword [ebp + 0x10]
mov ecx, dword [ecx + ebx*4]
mov dword [esp + 0xb0], ecx
mov dword [esp + 0xb4], eax
sub esp, 0x2c
lea eax, [esp + 0x10dc]
mov dword [esp + 0x28], eax
xorps xmm0, xmm0
movups xmmword [esp + 0x18], xmm0
movaps xmm0, xmmword [0x435450]
movups xmmword [esp + 8], xmm0
lea eax, [esp + 0xdc]
mov dword [esp + 4], eax
mov dword [esp], 2
call dword [sym.imp.CRYPT32.dll_CryptQueryObject]
test eax, eax
je 0x40bb2f
mov eax, dword [esp + 0x10b0]
mov eax, dword [eax + 0xc]
add eax, 0x38
push edi
push eax
push 0x10001
push esi
call dword [sym.imp.CRYPT32.dll_CryptImportPublicKeyInfo]
mov esi, eax
push dword [esp + 0x10b0]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test esi, esi
je 0x40bb2f
inc ebx
add edi, 4
cmp dword [ebp + 0x14], ebx
jne 0x40ba20
mov edi, dword [esp + 0x24]
mov eax, dword [ebp + 8]
mov esi, dword [eax]
xorps xmm0, xmm0
movaps xmmword [esp + 0x70], xmm0
movaps xmmword [esp + 0x80], xmm0
movaps xmmword [esp + 0x50], xmm0
movaps xmmword [esp + 0x60], xmm0
test esi, esi
je 0x40bb9e
xor eax, eax
push 2
push eax
push eax
push esi
call fcn.0041a037
add esp, 0x10
test eax, eax
je 0x40bbaf
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_seek_to_the_end_of_the_MAR_file._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Invalid_parameter_specified._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_load_public_key._n
push eax
call fcn.00401220
add esp, 8
xor edi, edi
dec edi
cmp dword [ebp + 0x14], 0
jne 0x40bb6d
jmp 0x40bb86
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_MAR_file_is_not_open._n
push eax
call fcn.00401220
add esp, 8
xor edi, edi
dec edi
xor esi, esi
mov ebx, dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [esp + esi*4 + 0x30]
test eax, eax
je 0x40bb80
push eax
call ebx
inc esi
cmp dword [ebp + 0x14], esi
jne 0x40bb75
mov ecx, dword [esp + 0x10d8]
xor ecx, ebp
call fcn.00412b41
mov eax, edi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Invalid_file_pointer_passed._n
jmp 0x40bb3e
push esi
call fcn.0041acfe
add esp, 4
cmp eax, 0x1f400001
sbb edx, 0
jl 0x40bbd6
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_MAR_file_is_too_large_to_be_verified._n
jmp 0x40bb3e
xor eax, eax
push eax
push eax
push 0x10
push esi
call fcn.0041a037
add esp, 0x10
test eax, eax
je 0x40bc19
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_seek_to_the_signature_block._n
jmp 0x40bb3e
mov dword [esp + 0x24], 0
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_init_crytpo_library._n
jmp 0x40bb61
lea eax, [esp + 0x2c]
push esi
push 1
push 4
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40bc62
push dword [esp + 0x2c]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [esp + 0x2c], eax
cmp eax, 8
jbe 0x40bc76
push 2
call fcn.004121ed
add esp, 4
push 8
push str.ERROR:_At_most__d_signatures_can_be_specified._n
push eax
call fcn.00401220
add esp, 0xc
jmp 0x40bb47
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_read_number_of_signatures._n
jmp 0x40bb3e
mov dword [esp + 0x18], edi
mov dword [esp + 0xc], eax
test eax, eax
je 0x40bd43
lea edi, [esp + 0x50]
lea ebx, [esp + 0x70]
mov eax, dword [esp + 0xc]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], edi
push esi
push 1
push 4
push ebx
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40be0a
push dword [ebx]
mov edi, dword [sym.imp.WSOCK32.dll_ntohl]
call edi
mov dword [esp + 0x14], eax
mov dword [ebx], eax
push esi
push 1
push 4
lea eax, [esp + 0x34]
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40be1e
mov dword [esp + 0x20], ebx
push dword [esp + 0x28]
call edi
mov dword [esp + 0x28], eax
cmp eax, 0x801
jae 0x40be32
mov ebx, eax
push eax
call fcn.0041f4bf
add esp, 4
mov edi, dword [esp + 0x10]
mov dword [edi], eax
test eax, eax
je 0x40be46
push esi
push 1
push ebx
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40be5a
cmp dword [esp + 0x14], 2
mov ebx, dword [esp + 0x20]
jne 0x40be91
add edi, 4
add ebx, 4
dec dword [esp + 0x1c]
jne 0x40bc96
push esi
call fcn.0041acfe
add esp, 4
and edx, eax
xor edi, edi
dec edi
cmp edx, 0xffffffff
je 0x40bb4a
xorps xmm0, xmm0
movaps xmmword [esp + 0x10b0], xmm0
movaps xmmword [esp + 0x10c0], xmm0
movaps xmmword [esp + 0x90], xmm0
movaps xmmword [esp + 0xa0], xmm0
cmp dword [esp + 0xc], 0
je 0x40bdf6
cmp dword [esp + 0x18], 0
lea eax, [esp + 0x10b0]
je 0x40bde2
mov ebx, dword [esp + 0xc]
mov edi, eax
xor ecx, ecx
mov dword [edi], ecx
push edi
push ecx
push ecx
push 0x800d
push dword [esp + 0x28]
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
je 0x40bde2
add edi, 4
dec ebx
jne 0x40bd98
xor eax, eax
push eax
push eax
push eax
push esi
call fcn.0041a037
add esp, 0x10
test eax, eax
je 0x40bec8
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_seek_to_start_of_the_file_n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_initialize_signature_handle._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_There_must_be_at_least_one_signature._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_read_signatures_algorithm_ID._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_read_signatures_length._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Signature_length_is_too_large_to_verify._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_allocate_buffer_for_signature._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_read_extracted_signature._n
push eax
call fcn.00401220
add esp, 8
xor esi, esi
xor edi, edi
dec edi
mov ebx, dword [esp + 0xc]
push dword [esp + esi*4 + 0x50]
call fcn.0041f035
add esp, 4
inc esi
cmp ebx, esi
jne 0x40be7b
jmp 0x40bb4a
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Unknown_signature_algorithm_ID._n
push eax
call fcn.00401220
add esp, 8
xor esi, esi
xor edi, edi
dec edi
mov ebx, dword [esp + 0xc]
push dword [esp + esi*4 + 0x50]
call fcn.0041f035
add esp, 4
inc esi
cmp ebx, esi
jne 0x40beb2
jmp 0x40bb4a
lea eax, [esp + 0x10b0]
lea edx, [esp + 0xb0]
mov ecx, esi
push str.signature_block
push dword [esp + 0x10]
push eax
push 0x14
call fcn.0040b880
add esp, 0x10
test eax, eax
jne 0x40bb47
xor ebx, ebx
inc ebx
mov eax, dword [esp + 0xc]
test eax, eax
cmovne ebx, eax
lea edi, [esp + 0x90]
mov dword [esp + 0x14], ebx
mov ecx, esi
lea edx, [esp + 0xb0]
push str.signature_algorithm_ID
push dword [esp + 0x10]
lea eax, [esp + 0x10b8]
push eax
push 4
call fcn.0040b880
add esp, 0x10
test eax, eax
jne 0x40bb47
mov ecx, esi
mov edx, edi
push str.signature_length
push dword [esp + 0x10]
lea eax, [esp + 0x10b8]
push eax
push 4
call fcn.0040b880
add esp, 0x10
test eax, eax
jne 0x40bb47
push dword [edi]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [edi], eax
cmp eax, 0x801
jae 0x40bf89
push 1
push 0
push eax
push esi
call fcn.0041a037
add esp, 0x10
test eax, eax
jne 0x40bf9d
add edi, 4
dec ebx
jne 0x40bf0b
jmp 0x40c005
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Embedded_signature_length_is_too_large._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Could_not_seek_past_signature._n
jmp 0x40bb3e
push esi
push 0x1000
push 1
lea eax, [esp + 0xbc]
push eax
call fcn.0041ee3f
add esp, 0x10
mov edi, eax
push esi
call fcn.0041ea86
add esp, 4
test eax, eax
jne 0x40c10b
xor ebx, ebx
push 0
push edi
lea eax, [esp + 0xb8]
push eax
push dword [esp + ebx*4 + 0x10bc]
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40c0f7
inc ebx
cmp dword [esp + 0x14], ebx
jne 0x40bfde
push esi
call fcn.0041ea5b
add esp, 4
test eax, eax
je 0x40bfb1
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x10]
mov esi, dword [esp + eax*4 + 0x90]
test esi, esi
je 0x40c0e3
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + eax*4 + 0x50]
test ebx, ebx
je 0x40c0e3
push esi
call fcn.0041f4bf
add esp, 4
test eax, eax
je 0x40c0e3
mov edi, eax
dec ebx
xor eax, eax
mov cl, byte [ebx + esi]
mov byte [edi + eax], cl
inc eax
dec ebx
cmp esi, eax
jne 0x40c053
xor eax, eax
push eax
push eax
mov eax, dword [esp + 0x18]
push dword [esp + eax*4 + 0x38]
push esi
push edi
push dword [esp + eax*4 + 0x10c4]
call dword [sym.imp.ADVAPI32.dll_CryptVerifySignatureA]
mov esi, eax
push edi
call fcn.0041f035
add esp, 4
test esi, esi
je 0x40c0e3
mov ecx, dword [esp + 0x10]
inc ecx
mov eax, ecx
mov dword [esp + 0x10], ecx
cmp ecx, dword [esp + 0x14]
jne 0x40c01a
xor esi, esi
push dword [esp + esi*4 + 0x50]
call fcn.0041f035
add esp, 4
inc esi
cmp dword [esp + 0xc], esi
jne 0x40c09c
xor edi, edi
mov eax, dword [esp + 0x14]
cmp eax, dword [ebp + 0x14]
je 0x40bb4a
push 2
call fcn.004121ed
add esp, 4
push dword [esp + 0xc]
push dword [esp + 0x18]
push str.ERROR:_Only__d_of__d_signatures_were_verified._n
push eax
call fcn.00401220
add esp, 0x10
jmp 0x40bb47
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Error_verifying_signature._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Error_updating_verify_context_with_data_block._n
jmp 0x40bb3e
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_Error_reading_data_block._n
jmp 0x40bb3e