Giter VIP home page Giter VIP logo

mifare's People

Contributors

f-israel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mifare's Issues

Runtime error System.EntryPointNotFoundException: 'SCardListReadersA'

Maybe some version mismatch in package 1.0.0.0, but I cannot use last version (as it shows message that it requires newer Win10 version (16299) than my phone can support (15254)).

Error in sample MiFareReader.UWP, file MainPage.xaml.cs, GetDevices method, line:
Reader = await CardReader.FindAsync();

Runtime error System.EntryPointNotFoundException: 'Unable to find an entry point named 'SCardListReadersA' in DLL 'WinScard.dll'.'

Imported project not was not found

I keep getting the following error whenever I try to build the project

Severity Code Description Project File Line Suppression State Error The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\16.0\Bin\Microsoft.CSharp.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\16.0\Bin\Microsoft.CSharp.targets" is correct, and that the file exists on disk. MiFareReader.Desktop

Sample for read and write Mifare 1k with KeyA and KeyB

I want to use this project to read and write Mifare 1k cards, I know the values for KeyA and KeyB but I can't find the proper combination to perform the read and write over the card.

There is a way for achieve this, I can't see a sample who uses such values.

I try to put together that but I'm stuck with the order of the actions.

After the card is detected and the card object is filled, I try for sector 9:

From the Card Added Event I have:

this.Card = args.SmartCard.CreateMiFareCard();

Outside the event on a button I want to get the sector to Authenticate with the keys

var sector = Card.GetSector(9);

But the authentication fails with Message:

System.AggregateException: One or more errors occurred. ---> MiFare.Classic.CardLoginException: Unable to login in sector 9 with key A or B
   at MiFare.Classic.Sector.<GetDataBlockInt>d__25.MoveNext() in C:\Users\Oren\Source\Git\MiFareRT\src\MiFare.Shared\Classic\Sector.cs:line 222
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at MiFare.Classic.Sector.set_KeyA(String value) in C:\Users\Oren\Source\Git\MiFareRT\src\MiFare.Shared\Classic\Sector.cs:line 67
   at SpeeronCheckIn.Hardware.CardReadersWriters.Iso14443_PcSc_Implementation.Write(LogMetaDataEntity callerData, String[] text) in C:\Users\Speeron\Documents\SpeeronTemp\TestProjects\EncodersTest\SpeeronCheckIn.Hardware.CardReadersWriters\Iso14443_PcSc_Implementation.cs:line 262
---> (Inner Exception #0) MiFare.Classic.CardLoginException: Unable to login in sector 9 with key A or B
   at MiFare.Classic.Sector.<GetDataBlockInt>d__25.MoveNext() in C:\Users\Oren\Source\Git\MiFareRT\src\MiFare.Shared\Classic\Sector.cs:line 222<---

Looks like I can write the cards and something is missing but I can't find the way, any sugestion to make it work in Mifare 1K?

Question: Integrate MIFARE ENCODER MF-ECD03 to c#

Hi, Im trying to integrate this device MIFARE ENCODER MF-ECD03 into our application which is written in c#. I'm not really sure where could i start. I tried this library but it cannot detect the encoder.
Can anyone please point me out to the right direction.

Thank you so much.

Missing condition/check regarding GetData()

Guess this shouldn't be that way but trying to dump my card I stumpled over some bug.
Easy to replicate: (for shortening here I didn't use await)
byte[] rawDataS0B0 = card.GetSector(sector).GetData(0).Result; card.Flush().Wait();
throws Exception "CardWriteException: Unable to write in sector 0, block 0".

Only guessing but every GetData also sets the blocks changed property to true? This would extremly shorten the lifespan. Please check into this. Not sure but could be related to #3

MiFare DesFire EV1 support

I want to use this library to read/write from MiFare DesFire EV1.
It currently support only Mifare Ultralight EV1

I can work and contribute, But I need help, any ideas please how and where to start.

not work

2022-11-24_18-04-44
You can read and write with this library
Is there a documentary?
Thankful

MiFare.CardReader.FindAsync is not async and cannot be awaited

If you attempt calling SmartCardReader reader = await CardReader.FindAsync() and no card reader is connected, you will get "System.NullReferenceException: Object reference not set to an instance of an object.", because it attempts to await null. It should either return Task.FromResult(null), or be rewritten so it's actually async.

The workaround I had to use is SmartCardReader reader = CardReader.FindAsync()?.Result;

Compilation errors with project taken as-is

Hi,

The projects do not compile in an updated VS2017 with NET framework 4.7.2.

The errors gotten:

1 -> Error Code: CS0006 | Description: Metadata file 'C:\Users\XXXX\Downloads\MiFare-master\src\MiFare\bin\Debug\net45\MiFare.dll' could not be found | Project: MiFare.Desktop.Tests | File: C:\Users\XXXX\Downloads\MiFare-master\tests\MiFare.Desktop.Tests\CSC | Line: 1 | Suppression State: Active

2 -> Error Code: CS0006 | Description: Metadata file 'C:\Users\XXXX\Downloads\MiFare-master\src\MiFare\bin\Debug\net45\MiFare.dll' could not be found | Project: MiFareReader.Desktop | File: C:\Users\XXXX\Downloads\MiFare-master\samples\MiFareReader.Desktop\CSC | Line: 1 | Suppression State: Active

3 -> Error Code: | Description: Unable to locate repository containing directory 'C:\Users\XXXX\Downloads\MiFare-master\src\MiFare'. | Project: MiFare | File: C:\Users\X.Gisbert.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets | Line: 20 | Suppression State:

4 -> Error Code: | Description: Unable to locate repository containing directory 'C:\Users\X.Gisbert\Downloads\MiFare-master\src\MiFare'. | Project: MiFare | File: C:\Users\X.Gisbert.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets | Line: 20 | Suppression State:

fail

I have removed my user from the captions.

I infer that the .dll is created when compiling the source code, but it looks like there it's having the repository location problem. I can't see where to hardcode the parent directory to the repository, not in the project properties. Any help to get it running and maybe commit the default config to the master branch?
Thanks

DataBlock isChanged is not correct

MiFare.Classic.DataBlock

public bool IsChanged => (!data.Equals(origData));

is maybe

public bool IsChanged => (!data.SequenceEqual(origData));

Key location count

I'm using ACS ACR122U as reader/writer. According to their docs there are just two key locations (00h~01h). The source code assumes an incrementing location index.

So the question: are just two key locations common for card reader? If so I'd submit a PR for this case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.