Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown when trying to get ApplicationID(s) #34

Closed
c3rebro opened this issue Sep 16, 2013 · 7 comments
Closed

Exception thrown when trying to get ApplicationID(s) #34

c3rebro opened this issue Sep 16, 2013 · 7 comments
Assignees
Milestone

Comments

@c3rebro
Copy link

c3rebro commented Sep 16, 2013

Dear ISLOG team,

when i try to list the Apps on a blank DesFire EV1 chip with
List vector = new List();
vector.Add(Convert.ToInt16(dcmd.GetApplicationIDs()));

i get an error like:

System.Runtime.InteropServices.SEHException (0x80004005): An external
component throws an exception.
at LibLogicalAccess.IDESFireEV1Commands.GetApplicationIDs()

could you please lead me to the right direction?

Thanks, Steven.

@ghost ghost assigned Maxhy Sep 16, 2013
@Maxhy
Copy link
Member

Maxhy commented Sep 16, 2013

Ok there was an issue with GetApplicationIDs and GetFileIDs located in COM wrapper. It should be fixed now.
Could you try again after replacing liblogicalaccess.com.dll located under %CommonProgramFiles%\ISLOG\LibLogicalAccess\1.68.0913\ by this one:
http:https://download.islog.com/liblogicalaccess/tests/liblogicalaccess.com.dll-1.68.0913.2

And let me know if it fix the problem. If so it will be fixed in 1.69 release.

@c3rebro
Copy link
Author

c3rebro commented Sep 16, 2013

unfortunately i've missed to mention i have a x64 system. do you have a x64 release of 1.68.0913 .com.dll ?

this one is 32bit and returns the following error when trying to intatiate:

IReaderProvider readerProvider = new PCSCReaderProvider();

800700c1 is not a valid Win32-Executable. (Exception from HRESULT: 0x800700C1).

@c3rebro c3rebro closed this as completed Sep 16, 2013
@c3rebro c3rebro reopened this Sep 16, 2013
@Maxhy
Copy link
Member

Maxhy commented Sep 16, 2013

Ok I recreated the full installer.
Please uninstall current LibLogicalAccess 1.68 installer and install this one: http:https://download.islog.com/liblogicalaccess/tests/liblogicalaccess-exe-1.68.0916.zip

@c3rebro
Copy link
Author

c3rebro commented Sep 17, 2013

Thanks for your time!

But iam sorry to say it did not work.

I've uninstalled Build 0906 and installed 0916. I deleted interop.liblogicalaccess.dll from my project folder to ensure the new build is used. The Error Message is still the same like above.

I also tried the following Methods wich all seem to has worked (as i partially has checked the card contents with a self created "GetApplications()" method using winscard.dll):

dcmd.CreateApplication(0x332211,DESFireKeySettings.KS_FREE_CREATE_DELETE_WITHOUT_MK,5);
dcmd.SelectApplication(0x332211);
dcmd.Authenticate((byte)0,deskey);
dcmd.GetKeySettings(out keySettings, out maxNbKeys);
dcmd.ChangeKeySettings(keySettings);
dcmd.DeleteApplication(0x332211); (after auth to master application)
dcmd.Erase(); (after auth to master application)

@Maxhy
Copy link
Member

Maxhy commented Sep 19, 2013

Indeed, the error still occurs in some cases. I'm investing the problem.

@Maxhy
Copy link
Member

Maxhy commented Sep 19, 2013

Ok the error was wrong memory allocation for application id list. Depending the number of Application IDs on your card, it was working or crashing. This is now fixed.
You can test it on current development version if you want (you will need to update your project reference to LibLogicalAccess 1.69): http:https://download.islog.com/liblogicalaccess/liblogicalaccess-exe-1.69-SNAPSHOT.zip

@Maxhy Maxhy closed this as completed Sep 19, 2013
@c3rebro
Copy link
Author

c3rebro commented Sep 19, 2013

Indeed, it now does work!

I used:

...
object appIDsAsObject = dcmd.GetApplicationIDs();
UInt32[] appIDsAsArray = (appIDsAsObject as UInt32[]);
...

Thank you very much.
Nice Project btw.

Greetings from Germany,
Steven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants