Git Product home page Git Product logo

Comments (3)

XazkerBoy avatar XazkerBoy commented on June 11, 2024 2

Okay, found the real problem. In MifareClassic.c you save DetectionCanary into working memory after UID and then read the whole block 0 from the same memory in CommandGetDetection function of Commands.c. The problem is that the UID is stored in card memory and you try to read it from working memory, where it never existed. Thus, on clear run the GUI becomes 8 bytes of FFs instead of the real UID (and SAK, ATQA, CRC). There are 2 solutions:

  1. Move canary into card memory. Then you can read block 0 with a single AppCardMemoryRead function and get both UID and canary
  2. Leave locations as they are and replace single AppWorkingMemoryRead function in CommandGetDetection (Commands.c) by AppCardMemoryRead to read first 8 bytes (UID, SAK, ATQA) from card memory and then AppWorkingMemoryRead to read the rest of block 0

from chameleonmini-rebooted.

XazkerBoy avatar XazkerBoy commented on June 11, 2024

So, the issue first appeared in the commit 6ec88b4, which was the last one to change MF_DETECTION implementation. Looks like moving it to working memory broke something and it didn't work properly any more. I temporarily fixed it by changing

[CONFIG_MF_CLASSIC_DETECTION]
...
    .CardMemorySize = MFCLASSIC_1K_MEM_SIZE,
    .WorkingMemorySize = DETECTION_MEM_APP_SIZE,
    .ReadOnly = false

to

[CONFIG_MF_CLASSIC_DETECTION]
...
    .CardMemorySize = DETECTION_MEM_APP_SIZE,
    .WorkingMemorySize = MEMORY_NO_MEMORY,
    .ReadOnly = true

in Configuration.c and renaming all AppWorkingMemory commands related to this mode back to AppCardMemory. Just look at the diff of the commit above for better understanding. This is a temporary fix, the real problem is somewhere in working memory

from chameleonmini-rebooted.

Related Issues (20)

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.