Function at 0x53d670
Capabilities:
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b0f5d
mov eax, dword fs:[0]
push eax
sub esp, 0x598
mov eax, dword [0x676664]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x1c]
mov esi, dword [ebp + 0x20]
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
push str.msPadAndSignHash
push esi
lea ecx, [ebp - 0x590]
mov dword [ebp - 0x594], eax
call fcn.0044ec60
mov dword [ebp - 4], 0
test edi, edi
je 0x53d75e
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x53d75e
cmp eax, 0x80
ja 0x53d75e
push eax
lea ecx, [ebp - 0x90]
push edi
push ecx
call fcn.00417410
add esp, 0xc
lea ecx, [ebp - 0x304]
call fcn.00444390
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x304]
push edx
push eax
mov byte [ebp - 4], 1
call fcn.00470150
add esp, 8
lea ecx, [ebp - 0x304]
push ecx
push str.hashAlg
mov ecx, esi
call fcn.0044e520
mov ecx, dword [ebp - 0x594]
call fcn.00410b40
push esi
mov ecx, ebx
call fcn.004e6e80
mov edi, eax
test edi, edi
jne 0x53d777
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.Failed_to_get_MsCertificate.
mov ecx, esi
call eax
lea ecx, [ebp - 0x304]
mov byte [ebp - 4], 0
call fcn.00444450
lea ecx, [ebp - 0x590]
mov dword [ebp - 4], 0xffffffff
call fcn.0044ecf0
xor al, al
jmp 0x53dbcb
lea ecx, [ebp - 0x3ec]
call fcn.00444390
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 2
call fcn.00444390
push esi
lea ecx, [ebp - 0x3ec]
push ecx
mov ecx, edi
mov byte [ebp - 4], 3
call fcn.00540660
lea edx, [ebp - 0x3ec]
push edx
push str.cert_key_container
mov ecx, esi
call fcn.0044e520
push esi
lea eax, [ebp - 0x378]
push eax
mov ecx, edi
call fcn.005406a0
lea ecx, [ebp - 0x378]
push ecx
push str.cert_def_provider
mov ecx, esi
call fcn.0044e520
push esi
push 0
mov ecx, edi
call fcn.00540710
test eax, eax
je 0x53d9da
mov ecx, eax
call fcn.00410b60
lea ecx, [ebp - 0x504]
mov dword [ebp - 0x598], eax
call fcn.0040c500
push esi
lea edx, [ebp - 0x504]
push edx
mov ecx, ebx
mov byte [ebp - 4], 4
call fcn.004e5610
test al, al
je 0x53d8ae
lea ecx, [ebp - 0x504]
call fcn.0040d1f0
mov dword [ebp - 0x580], eax
lea eax, [edi + 0x18]
push eax
lea ecx, [ebp - 0x504]
call fcn.0040dd10
test al, al
jne 0x53d8ae
mov eax, dword [ebp - 0x580]
mov ecx, dword [ebp - 0x598]
push esi
push 0
push eax
push 0x21
push ecx
call fcn.00581ca0
add esp, 0x14
test eax, eax
jne 0x53d89f
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.CryptSetProvParam_failed.
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.Failed_to_set_the_smartcard_PIN.__2_
mov ecx, esi
call eax
mov ecx, esi
call fcn.0044ea80
mov edx, dword [esi]
mov eax, dword [edx + 0x18]
push str.Incorrect_Smartcard_PIN
mov ecx, esi
call eax
cmp byte [ebx + 0x150], 0
jne 0x53d9cb
lea ecx, [ebp - 0x504]
push ecx
lea ecx, [edi + 0x18]
call fcn.0040cb80
mov eax, dword [ebp + 0xc]
cmp eax, 0x10
jne 0x53d8c2
mov dword [ebp - 0x580], 0x8008
jmp 0x53d8d1
push eax
call fcn.0053d620
add esp, 4
mov dword [ebp - 0x580], eax
mov eax, dword [ebp - 0x580]
mov ecx, dword [ebp - 0x598]
lea edx, [ebp - 0x57c]
push edx
push 0
push 0
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x53da54
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp + 0xc]
push edx
push str.hashAlg
mov ecx, esi
mov ebx, eax
call fcn.0044e8c0
mov eax, dword [ebp - 0x580]
push eax
push str.algId
mov ecx, esi
call fcn.0044e8c0
mov ecx, esi
call fcn.0044ea80
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.Failed_to_create_HCRYPTHASH
mov ecx, esi
call eax
cmp ebx, 0x80090008
jne 0x53d9cb
mov eax, dword [ebp + 0xc]
cmp eax, 7
je 0x53d956
cmp eax, 2
je 0x53d956
cmp eax, 3
jne 0x53d9cb
push str.retryWithEnhancedRsaAesCsp
push esi
lea ecx, [ebp - 0x5a4]
call fcn.0044ec60
lea ecx, [ebp - 0x578]
mov byte [ebp - 4], 5
call fcn.00444390
lea ebx, [edi + 0x134]
push ebx
lea ecx, [ebp - 0x578]
mov byte [ebp - 4], 6
call fcn.00445f20
push str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
mov ecx, ebx
call fcn.00445fe0
mov ecx, edi
call fcn.0053e780
push esi
push 0
mov ecx, edi
call fcn.00540710
test eax, eax
jne 0x53d9fd
lea ecx, [ebp - 0x578]
mov byte [ebp - 4], 5
call fcn.00444450
lea ecx, [ebp - 0x5a4]
mov byte [ebp - 4], 4
call fcn.0044ecf0
lea ecx, [ebp - 0x504]
mov byte [ebp - 4], 3
call fcn.0040c590
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 2
call fcn.00444450
lea ecx, [ebp - 0x3ec]
mov byte [ebp - 4], 1
call fcn.00444450
jmp 0x53d74f
mov ecx, eax
call fcn.00410b60
mov edx, dword [ebp - 0x580]
lea ecx, [ebp - 0x57c]
push ecx
push 0
push 0
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x53da36
mov ecx, esi
call fcn.0044ea80
mov eax, dword [esi]
mov edx, dword [eax + 0x14]
push str.Failed_to_create_HCRYPTHASH
mov ecx, esi
call edx
lea ecx, [ebp - 0x578]
mov byte [ebp - 4], 5
call fcn.00444450
lea ecx, [ebp - 0x5a4]
mov byte [ebp - 4], 4
call fcn.0044ecf0
mov ecx, dword [ebp - 0x57c]
push 0
lea eax, [ebp - 0x90]
push eax
push 2
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptSetHashParam]
test eax, eax
jne 0x53da97
mov ecx, esi
call fcn.0044ea80
mov edx, dword [ebp - 0x57c]
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov eax, dword [esi]
mov edx, dword [eax + 0x14]
push str.Failed_to_CryptSetHashParam
mov ecx, esi
call edx
jmp 0x53d9cb
cmp byte [ebp + 0x18], 0
mov eax, 1
lea edi, [eax + 1]
mov ebx, str.AT_SIGNATURE
je 0x53dab4
mov eax, edi
lea edi, [eax - 1]
mov ebx, str.AT_KEYEXCHANGE
lea ecx, [ebp - 0x584]
push ecx
lea edx, [ebp - 0x290]
push edx
push 0
push 0
push eax
mov eax, dword [ebp - 0x57c]
push eax
mov dword [ebp - 0x584], 0x200
call dword [sym.imp.ADVAPI32.dll_CryptSignHashA]
test eax, eax
jne 0x53db2c
lea ecx, [ebp - 0x584]
push ecx
lea edx, [ebp - 0x290]
push edx
push eax
push eax
mov eax, dword [ebp - 0x57c]
push edi
push eax
call dword [sym.imp.ADVAPI32.dll_CryptSignHashA]
test eax, eax
jne 0x53db2c
mov ecx, esi
call fcn.0044ea80
mov ecx, dword [ebp - 0x57c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov edx, dword [esi]
mov eax, dword [edx + 0x2c]
push ebx
push str.failedToSignWith
mov ecx, esi
call eax
jmp 0x53d9cb
cmp byte [esi + 0x125], 0
je 0x53db48
mov ecx, dword [ebp - 0x584]
push ecx
push str.cryptSigSize
mov ecx, esi
call fcn.0044e8c0
mov edx, dword [ebp - 0x584]
mov esi, dword [ebp - 0x594]
push edx
lea eax, [ebp - 0x290]
push eax
mov ecx, esi
call fcn.00411e60
mov ecx, esi
call fcn.00411110
mov eax, dword [ebp - 0x57c]
test eax, eax
je 0x53db7b
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
lea ecx, [ebp - 0x504]
mov byte [ebp - 4], 3
call fcn.0040c590
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 2
call fcn.00444450
lea ecx, [ebp - 0x3ec]
mov byte [ebp - 4], 1
call fcn.00444450
lea ecx, [ebp - 0x304]
mov byte [ebp - 4], 0
call fcn.00444450
lea ecx, [ebp - 0x590]
mov dword [ebp - 4], 0xffffffff
call fcn.0044ecf0
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0059af98
mov esp, ebp
pop ebp
ret