Function at 0x405780
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x58
mov eax, dword [0x437478]
xor eax, esp
mov dword [esp + 0x54], eax
push ebx
mov ebx, dword [esp + 0x64]
push ebp
push esi
mov esi, dword [esp + 0x68]
xor ebp, ebp
push edi
mov edi, dword [esp + 0x78]
push esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], ebp
call sub.nss3.dll_PK11_NeedLogin
add esp, 4
test eax, eax
je 0x4057f5
push edi
push 1
push esi
call sub.nss3.dll_PK11_Authenticate
add esp, 0xc
test eax, eax
je 0x4057f5
push esi
call sub.nss3.dll_PK11_GetTokenName
push eax
push str.could_not_authenticate_to_token__s.
push dword [0x439ae8]
call fcn.0040bfd0
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.00410fde
add esp, 0x58
ret
test ebx, ebx
je 0x40580b
cmp byte [ebx], 0
je 0x40580b
push edi
push ebx
push esi
call sub.nss3.dll_PK11_ListPrivKeysInSlot
add esp, 0xc
jmp 0x405814
push esi
call sub.nss3.dll_PK11_ListPrivateKeysInSlot
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x405845
push str.problem_listing_keys
push dword [0x439ae8]
call fcn.0040bfd0
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.00410fde
add esp, 0x58
ret
mov ebx, dword [eax]
mov esi, dword [sym.imp.nspr4.dll_PR_GetSpecialFD]
mov dword [esp + 0x14], ebx
cmp ebx, eax
je 0x405a62
mov ecx, dword [esp + 0x74]
lea ecx, [ecx]
test ecx, ecx
je 0x405870
mov eax, dword [ebx + 8]
cmp ecx, dword [eax + 4]
jne 0x405a46
push dword [ebx + 8]
call sub.nss3.dll_PK11_GetPrivateKeyNickname
mov edi, eax
add esp, 4
test edi, edi
je 0x405886
cmp byte [edi], 0
jne 0x4058d7
push edi
call sub.nssutil3.dll_PORT_Free_Util
push dword [ebx + 8]
xor edi, edi
call sub.nss3.dll_PK11_GetCertFromPrivateKey
mov esi, eax
add esp, 8
test esi, esi
je 0x4058d1
mov eax, dword [esi + 0x154]
test eax, eax
je 0x4058ae
cmp byte [eax], 0
jne 0x4058bd
mov eax, dword [esi + 0x118]
test eax, eax
je 0x4058c8
cmp byte [eax], 0
je 0x4058c8
push eax
call sub.nssutil3.dll_PORT_Strdup_Util
mov edi, eax
add esp, 4
push esi
call sub.nss3.dll_CERT_DestroyCertificate
add esp, 4
mov esi, dword [sym.imp.nspr4.dll_PR_GetSpecialFD]
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4058ff
test edi, edi
je 0x4058f1
push eax
push edi
call sub.plc4.dll_PL_strcmp
add esp, 8
test eax, eax
je 0x4058ff
push edi
call sub.nssutil3.dll_PORT_Free_Util
add esp, 4
jmp 0x405a42
test edi, edi
jne 0x405908
mov edi, str._orphan_
mov ebp, dword [ebx + 8]
push 1
mov dword [esp + 0x28], ebp
call esi
push ebp
mov dword [esp + 0x30], eax
call sub.nss3.dll_PK11_GetLowLevelKeyIDForPrivateKey
mov ebp, eax
add esp, 8
mov dword [esp + 0x10], ebp
test ebp, ebp
jne 0x40594d
mov ecx, dword [str._no_CKA_ID_]
mov dword [esp + 0x38], ecx
mov ecx, dword [0x4276c4]
mov dword [esp + 0x3c], ecx
mov ecx, dword [0x4276c8]
mov dword [esp + 0x40], ecx
jmp 0x4059f9
mov esi, dword [ebp + 8]
mov ecx, esi
mov edx, dword [ebp + 4]
test ecx, ecx
je 0x405970
lea esp, [esp]
mov al, byte [edx]
lea edx, [edx + 1]
sub al, 0x20
dec ecx
cmp al, 0x5e
ja 0x4059a8
test ecx, ecx
jne 0x405960
cmp esi, 0x28
jbe 0x40597a
mov esi, 0x28
push esi
mov byte [esp + 0x3c], 0x22
lea eax, [esp + 0x3d]
push dword [ebp + 4]
push eax
call fcn.00411cf0
mov byte [esp + esi + 0x45], 0x22
add esp, 0xc
add esi, 2
cmp esi, 0x2c
jae 0x405ab6
mov byte [esp + esi + 0x38], 0
jmp 0x4059f9
mov esi, dword [esp + 0x10]
mov ebp, dword [ebp + 4]
mov esi, dword [esi + 8]
cmp esi, 0x14
jbe 0x4059bc
mov esi, 0x14
lea ebx, [esp + 0x38]
test ebp, ebp
je 0x4059f1
test esi, esi
je 0x4059ee
jmp 0x4059d0
movzx eax, byte [ebp]
push eax
push str._02x
push ebx
call fcn.0040b060
add esp, 0xc
lea ebp, [ebp + 1]
add ebx, 2
sub esi, 1
jne 0x4059d0
mov byte [ebx], 0
mov ebp, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
lea eax, [esp + 0x38]
push edi
push eax
mov eax, dword [esp + 0x2c]
mov eax, dword [eax + 4]
push dword [eax*4 + 0x4266a8]
push esi
push str.__2d____8.8s___42.42s__s_n
push dword [esp + 0x3c]
call dword [sym.imp.nspr4.dll_PR_fprintf]
push 1
push ebp
call sub.nssutil3.dll_SECITEM_ZfreeItem_Util
add esp, 0x20
cmp edi, str._orphan_
je 0x405a3d
push edi
call sub.nssutil3.dll_PORT_Free_Util
add esp, 4
inc esi
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0x74]
mov ebx, dword [ebx]
mov eax, dword [esp + 0x1c]
mov esi, dword [sym.imp.nspr4.dll_PR_GetSpecialFD]
mov dword [esp + 0x14], ebx
cmp ebx, eax
jne 0x405860
mov ebp, dword [esp + 0x18]
push eax
call sub.nss3.dll_SECKEY_DestroyPrivateKeyList
add esp, 4
test ebp, ebp
jne 0x405aa1
push dword [0x439ae8]
push str._s:_no_keys_found_n
push 1
call esi
add esp, 4
push eax
call dword [sym.imp.nspr4.dll_PR_fprintf]
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.00410fde
add esp, 0x58
ret
mov ecx, dword [esp + 0x64]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00410fde
add esp, 0x58
ret
call fcn.00411113
int3