Skip to content

Commit

Permalink
Merge pull request #92 from noproto/dev
Browse files Browse the repository at this point in the history
Update MFKey to version 2.1
  • Loading branch information
xMasterX authored Mar 25, 2024
2 parents 8f812c3 + d58b555 commit de11574
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion base_pack/mfkey/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ App(
fap_icon_assets="images",
fap_weburl="https://github.com/noproto/FlipperMfkey",
fap_description="MIFARE Classic key recovery tool",
fap_version="2.0",
fap_version="2.1",
)

App(
Expand Down
20 changes: 0 additions & 20 deletions base_pack/mfkey/common.h

This file was deleted.

4 changes: 2 additions & 2 deletions base_pack/mfkey/init_plugin.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <furi_hal.h>
#include <inttypes.h>
#include <toolbox/keys_dict.h>
#include <bit_lib/bit_lib.h>
#include <toolbox/stream/buffered_file_stream.h>
#include <nfc/protocols/mf_classic/mf_classic.h>
#include "mfkey.h"
#include "common.h"
#include "crypto1.h"
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
Expand Down Expand Up @@ -34,7 +34,7 @@ bool key_already_found_for_nonce_in_dict(KeysDict* dict, MfClassicNonce* nonce)
uint8_t key_bytes[sizeof(MfClassicKey)];
keys_dict_rewind(dict);
while(keys_dict_get_next_key(dict, key_bytes, sizeof(MfClassicKey))) {
uint64_t k = napi_nfc_util_bytes2num(key_bytes, sizeof(MfClassicKey));
uint64_t k = bit_lib_bytes_to_num_be(key_bytes, sizeof(MfClassicKey));
struct Crypto1State temp = {0, 0};
for(int i = 0; i < 24; i++) {
(&temp)->odd |= (BIT(k, 2 * i + 1) << (i ^ 3));
Expand Down
4 changes: 2 additions & 2 deletions base_pack/mfkey/mfkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#include "mfkey_icons.h"
#include <inttypes.h>
#include <toolbox/keys_dict.h>
#include <bit_lib/bit_lib.h>
#include <toolbox/stream/buffered_file_stream.h>
#include <dolphin/dolphin.h>
#include <notification/notification_messages.h>
#include <nfc/protocols/mf_classic/mf_classic.h>
#include "mfkey.h"
#include "common.h"
#include "crypto1.h"
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
Expand Down Expand Up @@ -483,7 +483,7 @@ bool key_already_found_for_nonce_in_solved(
int keyarray_size,
MfClassicNonce* nonce) {
for(int k = 0; k < keyarray_size; k++) {
uint64_t key_as_int = napi_nfc_util_bytes2num(keyarray[k].data, sizeof(MfClassicKey));
uint64_t key_as_int = bit_lib_bytes_to_num_be(keyarray[k].data, sizeof(MfClassicKey));
struct Crypto1State temp = {0, 0};
for(int i = 0; i < 24; i++) {
(&temp)->odd |= (BIT(key_as_int, 2 * i + 1) << (i ^ 3));
Expand Down

0 comments on commit de11574

Please sign in to comment.