I am trying to make a password manager in python and ahve ran into a issue, i cannot load a different dll once i have loaded one type of dll, in this example i have loaded a dll and am trying to decrypt encrypted password data and it works fine until i load another DIFFERENT nss3.dll file at which point it gives me an error:
“The procedure entry point HeapAlloc could not be located in the dynamic link library C:Program FilesWaterfoxnss3.dll”
I only get this error after loading multiple nss3.dll files for example:
def DecryptFirefoxBased(Type,EncryptedPassword):
EncryptedPassword = base64.b64decode(EncryptedPassword)
nss3 = ctypes.CDLL(Paths[Type][1])
nss_init = nss3.NSS_Init
nss_init.argtypes = [ctypes.c_char_p]
nss_init.restype = ctypes.c_int
nss_init(ProfileDirectory.encode())
pk11_sdr_decrypt = nss3.PK11SDR_Decrypt
pk11_sdr_decrypt.argtypes = [ctypes.POINTER(SecItem), ctypes.POINTER(SecItem), ctypes.c_int]
pk11_sdr_decrypt.restype = ctypes.c_int
EncryptedItem = SecItem()
EncryptedItem.data = ctypes.create_string_buffer(EncryptedPassword)
EncryptedItem.len = len(EncryptedPassword)
DecryptedItem = SecItem()
decrypted_buffer = ctypes.create_string_buffer(len(EncryptedPassword))
DecryptedItem.data = ctypes.cast(decrypted_buffer, ctypes.POINTER(ctypes.c_char))
DecryptedItem.len = len(EncryptedPassword)
ret = pk11_sdr_decrypt(ctypes.byref(EncryptedItem), ctypes.byref(DecryptedItem), 0)
if ret != 0:
input("PK11SDR_Decrypt failed")
return ctypes.string_at(DecryptedItem.data, DecryptedItem.len).decode()
In the reference above that is being called more than once with a different dll being loaded each time on the second time it breaks, that’s really all information i can give, if anybody knows why i get this error please help me out or hint to why this is happening cus its really starting to irritate me.
mrneedhelp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.