Function at 0x40d330
Capabilities:
Hash data using sha1
Hash data using sha1 via wincrypt
Hash data via wincrypt
Import public key
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2620
call fcn.00415110
mov eax, dword [0x426004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
lea eax, [ebp - 0x261c]
lea ecx, [ebp - 0x260c]
mov edx, str.3082035C308202C5A0030201020209009CDC6FE700CFADB4300D06092A864886F70D0101050500307D310B3009060355040613024E4C311330110603550408130A4F766572696A7373656C3111300F06035504071308456E7363686564653111300F060355040A1308536563757265573231143012060355040B130B446576656C6F706D656E74311D301B060355040313146C6963656E73652E73656375726577322E636F6D301E170D3130303530343037353130345A170D3230303530313037353130345A307D310B3009060355040613024E4C311330110603550408130A4F766572696A7373656C3111300F06035504071308456E7363686564653111300F060355040A1308536563757265573231143012060355040B130B446576656C6F706D656E74311D301B060355040313146C6963656E73652E73656375726577322E636F6D30819F300D06092A864886F70D010101050003818D0030818902818100C08CC139EA9217DBE4D7126BD96A87CBB5E43AF533A6D2EC87DA8862DE0752393CBB6C510150F361E7EB7B95B56D9F7B99208F44DB6B16E869D757809438A6C139218EB5F5B03FF045583BE2381B013FC330B79B136F14FE261C8C5E6E85F1055338E373C217696A69B405A061384DA055E162EAEDDFA09CF34D55C136791F0B0203010001A381E33081E0301D0603551D0E041604147C0B29196A5193760DEB8CB4ECC06E2263347B453081B00603551D230481A83081A580147C0B29196A5193760DEB8CB4ECC06E2263347B45A18181A47F307D310B3009060355040613024E4C311330110603550408130A4F766572696A7373656C3111300F06035504071308456E7363686564653111300F060355040A1308536563757265573231143012060355040B130B446576656C6F706D656E74311D301B060355040313146C6963656E73652E73656375726577322E636F6D8209009CDC6FE700CFADB4300C0603551D13040530030101FF300D06092A864886F70D0101050500038181009BCAFF1A067C0A69773B8F592C19A3C9D6572F364F240A0D4569C7D7FD0F9489333A4FAB141920C95CBC09F3E021A534269F077CF8EA7F15326B6B2217EAB7045421C59DCDD389F76E8A7C8C81FE688EB3EC237F4E56724AFDD9E10D5BE465D1CD0BDF6D2F0BCC4CA86AD36F639E4ACCEEB7727C21484B433045A1ABDD3729AB
call fcn.0040c670
test eax, eax
jne 0x40da49
mov eax, dword [ebp - 0x260c]
mov ecx, dword [ebp - 0x261c]
push esi
push eax
push ecx
push 0x10001
call dword [sym.imp.CRYPT32.dll_CertCreateCertificateContext]
mov esi, eax
mov dword [ebp - 0x2620], esi
test esi, esi
je 0x40da18
push 0xf0000000
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
push 0
lea edx, [ebp - 0x260c]
push edx
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x40d3cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_WARNING
push str.__23s::SW2CryptAcquireContext__::CryptAcquireContext_CRYPT_VERIFYCONTEXT_::_FAILED___ld_
mov eax, 0x20000
call fcn.0040b690
add esp, 0xc
mov ecx, dword [esi + 0xc]
mov edx, dword [ebp - 0x260c]
lea eax, [ebp - 0x2618]
push eax
add ecx, 0x38
push ecx
push 0x10001
push edx
call dword [sym.imp.CRYPT32.dll_CryptImportPublicKeyInfo]
test eax, eax
je 0x40d9d7
push edi
push 0x100
lea eax, [ebp - 0x104]
push 0
push eax
call fcn.00410110
push 0x100
lea ecx, [ebp - 0x204]
push 0
push ecx
call fcn.00410110
push 0x100
lea edx, [ebp - 0x304]
push 0
push edx
call fcn.00410110
push 0x100
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00410110
push 0x200
lea ecx, [ebp - 0x604]
push 0
push ecx
call fcn.00410110
add esp, 0x3c
cmp dword [ebp - 0x2618], 0
je 0x40d9ab
push 0x100
lea edx, [ebp - 0x104]
push 0
push edx
call fcn.00410110
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
add esp, 0xc
push 0
push 0
push 0x100
lea eax, [ebp - 0x104]
push eax
push 0xffffffffffffffff
lea ecx, [ebx + 0x618]
push ecx
push 0
push 0xfde9
call edi
test eax, eax
jle 0x40d4d2
lea eax, [ebp - 0x104]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d4b2
sub eax, edx
push eax
lea edx, [ebp - 0x104]
push edx
lea eax, [ebp - 0x1604]
push eax
call fcn.00410190
add esp, 0xc
push 0x100
lea ecx, [ebp - 0x204]
push 0
push ecx
call fcn.00410110
add esp, 0xc
push 0
push 0
push 0x100
lea edx, [ebp - 0x204]
push edx
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call edi
test eax, eax
jle 0x40d546
lea eax, [ebp - 0x204]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d511
sub eax, edx
mov edx, eax
lea eax, [ebp - 0x104]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d525
push edx
sub eax, esi
lea ecx, [ebp - 0x204]
push ecx
lea edx, [ebp + eax - 0x1604]
push edx
call fcn.00410190
add esp, 0xc
push 0x100
lea eax, [ebp - 0x304]
push 0
push eax
call fcn.00410110
add esp, 0xc
push 0
push 0
push 0x100
lea ecx, [ebp - 0x304]
push ecx
push 0xffffffffffffffff
lea edx, [ebx + 0x200]
push edx
push 0
push 0xfde9
call edi
test eax, eax
jle 0x40d5db
lea eax, [ebp - 0x304]
lea edx, [eax + 1]
jmp 0x40d590
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d590
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x104]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d5a4
sub eax, edx
mov edx, eax
lea eax, [ebp - 0x204]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d5b8
sub eax, esi
push edi
lea ecx, [ebp - 0x304]
add eax, edx
push ecx
lea edx, [ebp + eax - 0x1604]
push edx
call fcn.00410190
add esp, 0xc
mov dl, byte [ebx + 0x40c]
mov cl, byte [ebx + 0x40d]
xor eax, eax
mov word [ebp - 0x2608], ax
lea eax, [ebp - 0x104]
mov byte [ebp - 0x2607], dl
mov byte [ebp - 0x2608], cl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d605
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x204]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d620
sub eax, edx
mov edx, eax
lea eax, [ebp - 0x304]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d634
movzx ecx, word [ebp - 0x2608]
sub eax, esi
add eax, edx
add eax, edi
mov word [ebp + eax - 0x1604], cx
movzx ecx, byte [ebx + 0x411]
xor edx, edx
mov word [ebp - 0x2608], dx
movzx edx, byte [ebx + 0x410]
mov byte [ebp - 0x2608], cl
mov byte [ebp - 0x2607], dl
movzx ecx, word [ebp - 0x2608]
mov word [ebp + eax - 0x1602], cx
movzx ecx, byte [ebx + 0x415]
xor edx, edx
mov word [ebp - 0x2608], dx
movzx edx, byte [ebx + 0x414]
mov byte [ebp - 0x2608], cl
mov byte [ebp - 0x2607], dl
movzx ecx, word [ebp - 0x2608]
mov word [ebp + eax - 0x1600], cx
movzx ecx, byte [ebx + 0x405]
xor edx, edx
mov word [ebp - 0x2608], dx
movzx edx, byte [ebx + 0x404]
mov byte [ebp - 0x2608], cl
mov byte [ebp - 0x2607], dl
movzx ecx, word [ebp - 0x2608]
mov word [ebp + eax - 0x15fe], cx
lea ecx, [ebx + 0xa18]
mov eax, ecx
lea esi, [eax + 2]
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x40d6f1
sub eax, esi
sar eax, 1
je 0x40d7a3
push 0
push 0
push 0x100
lea edx, [ebp - 0x404]
push edx
push 0xffffffffffffffff
push ecx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jle 0x40d7a3
lea eax, [ebp - 0x404]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d733
sub eax, edx
mov dword [ebp - 0x2608], eax
lea eax, [ebp - 0x104]
lea edx, [eax + 1]
jmp 0x40d750
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d750
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x204]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d764
sub eax, edx
mov edx, eax
lea eax, [ebp - 0x304]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d778
mov ecx, dword [ebp - 0x2608]
sub eax, esi
push ecx
add eax, edx
lea ecx, [ebp - 0x404]
add eax, edi
push ecx
lea edx, [ebp + eax - 0x15fc]
push edx
call fcn.00410190
add esp, 0xc
lea eax, [ebp - 0x104]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d7b0
sub eax, edx
mov dword [ebp - 0x2610], eax
lea eax, [ebp - 0x204]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d7c8
sub eax, edx
mov dword [ebp - 0x2608], eax
lea eax, [ebp - 0x304]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d7e0
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x404]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d7f4
sub eax, edx
push 0x200
mov esi, eax
lea eax, [ebp - 0x604]
push 0
push eax
call fcn.00410110
add esp, 0xc
push 0
push 0
push 0x200
lea ecx, [ebp - 0x604]
push ecx
push 0xffffffffffffffff
add ebx, 0xc18
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov eax, dword [ebp - 0x260c]
lea edx, [ebp - 0x2614]
push edx
push 0
push 0
push 0x8004
push eax
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
je 0x40d98b
mov ecx, dword [ebp - 0x2610]
add esi, edi
add esi, dword [ebp - 0x2608]
push 0
lea edx, [esi + ecx + 8]
mov ecx, dword [ebp - 0x2614]
push edx
lea eax, [ebp - 0x1604]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40d94b
lea eax, [ebp - 0x2608]
lea ecx, [ebp - 0x2610]
lea edx, [ebp - 0x604]
call fcn.0040c670
mov ebx, eax
test ebx, ebx
jne 0x40d96e
mov edi, dword [ebp - 0x2610]
mov edx, dword [ebp - 0x2608]
lea ecx, [edi + edx - 1]
lea eax, [ebp - 0x2604]
test edi, edi
jle 0x40d8d9
mov esi, edi
mov edi, edi
mov dl, byte [ecx]
mov byte [eax], dl
inc eax
dec ecx
dec esi
jne 0x40d8d0
mov eax, dword [ebp - 0x2618]
mov edx, dword [ebp - 0x2614]
push 0
push 0
push eax
push edi
lea ecx, [ebp - 0x2604]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CryptVerifySignatureW]
test eax, eax
jne 0x40d920
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2VerifySignature__::CryptVerifySignature_Failed__ld
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
mov ebx, 0x1770
lea eax, [ebp - 0x2608]
call fcn.0040bb70
mov eax, dword [ebp - 0x2614]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov ecx, dword [ebp - 0x2618]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
pop edi
jmp 0x40d9fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2VerifySignature__::CryptHashData_Failed___ld_
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
mov ebx, 0x1770
mov eax, dword [ebp - 0x2614]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov ecx, dword [ebp - 0x2618]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
pop edi
jmp 0x40d9fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2VerifySignature__::CryptCreateHash_Failed___ld_
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
jmp 0x40d9c2
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2VerifySignature__::hKey_invalid
mov eax, 0x10000
call fcn.0040b690
add esp, 8
mov ecx, dword [ebp - 0x2618]
push ecx
mov ebx, 0x1770
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
pop edi
jmp 0x40d9fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2VerifySignature__::CryptImportPublicKeyInfo_Failed__ld
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
mov ebx, 0x1770
mov edx, dword [ebp - 0x260c]
push 0
push edx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [ebp - 0x2620]
push eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
jmp 0x40da3b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2VerifySignature__::CertCreateCertificateContext_Failed__ld
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
mov ebx, 0x1770
lea eax, [ebp - 0x261c]
call fcn.0040bb70
mov eax, ebx
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0040f43d
mov esp, ebp
pop ebp
ret