Compare commits
113 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae932778ce | |||
| 1e728c891c | |||
| f86cba8d56 | |||
| b319f9fbe1 | |||
| c0afa6bb32 | |||
| 17c40fe941 | |||
| 60f965bfe7 | |||
| 36307dcda0 | |||
| dcc17963b6 | |||
| d4519f8667 | |||
| c2514602e8 | |||
| c277844cf4 | |||
| f285f76a20 | |||
| 24adc08d84 | |||
| d56c5f8dc7 | |||
| 222f271a31 | |||
| 0c339e91af | |||
| 85ea3fd744 | |||
| d0bc6808d0 | |||
| 03d9c601fc | |||
| 5a8ab42281 | |||
| 12a0837c50 | |||
| d6f02e7a69 | |||
| 02a8fe03e3 | |||
| 3523c1eace | |||
| bac6207634 | |||
| ccb07651cc | |||
| f706d59c48 | |||
| 9e31496131 | |||
| a232e4ec83 | |||
| 1bec73d1ad | |||
| a8b1a4a82e | |||
| 03bb57ee58 | |||
| 15538a9892 | |||
| 466cd0ecc1 | |||
| 019afed198 | |||
| 799e00d66e | |||
| ae9e4d1a4f | |||
| c3aafc3d31 | |||
| fb8e1a6e1b | |||
| 90e4fde882 | |||
| 705c8de54c | |||
| aa6b93984c | |||
| 7f96c061dc | |||
| b8c4e8e339 | |||
| 4f10e3d75c | |||
| 63f3424871 | |||
| 24a6e1869b | |||
| 6baa09221e | |||
| 6e5f654cc5 | |||
| 83445c7eef | |||
| 5330ed8d14 | |||
| a56a503b23 | |||
| 77d8049738 | |||
| bf9b3fb076 | |||
| 6d3dd5056c | |||
| e687cc39fd | |||
| 3c3944d150 | |||
| 091b4f63d1 | |||
| 0c4220c9a5 | |||
| 986e9aacfe | |||
| ce262db52c | |||
| 73533608e6 | |||
| 2f38d3c8c5 | |||
| f2d00ee088 | |||
| 862f0775f8 | |||
| a7985c5c89 | |||
| a3e6aa787b | |||
| 1c273a6527 | |||
| 3f899845b7 | |||
| 475580c342 | |||
| 3a577bdd32 | |||
| f8d2bbb206 | |||
| d6beafe175 | |||
| f881a05fa3 | |||
| ad10a6e789 | |||
| bf8136a7fe | |||
| 6af85bffc0 | |||
| 3751349004 | |||
| 44c61a8202 | |||
| fbe8a5e51d | |||
| 41bbcd2c4a | |||
| 4dba7882e5 | |||
| 25d7886f2a | |||
| 7e4dedeff1 | |||
| 7dfabb60e9 | |||
| 46b3912e82 | |||
| fe8f8b2d51 | |||
| d15b8e21fc | |||
| eb5fa7ec9a | |||
| ef6ebea568 | |||
| 6f860111df | |||
| a935ff9703 | |||
| 02b0c312a4 | |||
| 946d0acb01 | |||
| a60b28ee66 | |||
| 43752bd5e4 | |||
| a77985824c | |||
| cd122b8959 | |||
| 87dddf4d3d | |||
| b2baaede5d | |||
| 7ea9c363fd | |||
| 241b0cdc29 | |||
| 3181848e75 | |||
| 5cccb7b8bb | |||
| 461c48fee9 | |||
| 2790afc193 | |||
| 5816d1b1b6 | |||
| fe8b9d6161 | |||
| afe2474fe3 | |||
| 0995e529ad | |||
| b44488fbed | |||
| 5f1df6782a |
@@ -1,73 +1,2 @@
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
*.a
|
||||
*.core
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
*.so
|
||||
*.so.*
|
||||
*_pch.h.cpp
|
||||
*_resource.rc
|
||||
*.qm
|
||||
.#*
|
||||
*.*#
|
||||
core
|
||||
!core/
|
||||
tags
|
||||
.DS_Store
|
||||
.directory
|
||||
*.debug
|
||||
Makefile*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
ui_*.h
|
||||
qrc_*.cpp
|
||||
Thumbs.db
|
||||
*.res
|
||||
*.rc
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# xemacs temporary files
|
||||
*.flc
|
||||
|
||||
# Vim temporary files
|
||||
.*.swp
|
||||
|
||||
# Visual Studio generated files
|
||||
*.ib_pdb_index
|
||||
*.idb
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.sln
|
||||
*.suo
|
||||
*.vcproj
|
||||
*vcproj.*.*.user
|
||||
*.ncb
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.vcxproj
|
||||
*vcxproj.*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
# Python byte code
|
||||
*.pyc
|
||||
|
||||
# Binaries
|
||||
# --------
|
||||
*.dll
|
||||
*.exe
|
||||
|
||||
/build*
|
||||
/data
|
||||
@@ -1,21 +1,504 @@
|
||||
MIT License
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (c) 2020 wh201906
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
Preamble
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random
|
||||
Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
@@ -1,33 +1,124 @@
|
||||
# Proxmark3GUI
|
||||
A GUI for [Proxmark3](https://github.com/Proxmark/proxmark3) client
|
||||

|
||||
|
||||
[中文](README/README.zh_CN.md)
|
||||
A cross-platform GUI for [Proxmark3](https://github.com/Proxmark/proxmark3) client
|
||||
|
||||
[中文介绍](doc/README/README_zh_CN.md)
|
||||
|
||||
***
|
||||
|
||||
## Features
|
||||
|
||||
+ Support raw commands of Proxmark3 client
|
||||
+ Easy to find available Serial Port
|
||||
+ Support raw commands of Proxmark3 client(Official/Iceman)
|
||||
+ Have a friendly UI to test Mifare cards
|
||||
+ Easy to edit Mifare data files
|
||||
+ Support different card size(MINI, 1K, 2K, 4K)
|
||||
+ Easy to edit Mifare block data
|
||||
+ Easy to read all/selected blocks with well-designed read logic
|
||||
+ Easy to write all/selected blocks
|
||||
+ Support binary(.bin .dump) files and text(.eml) files
|
||||
+ Analyze Access Bits
|
||||
+ Support Chinese Magic Card
|
||||
+ Have basic support for LF commands
|
||||
+ Customize UI
|
||||
+ ...
|
||||
|
||||
***
|
||||
|
||||
## Previews
|
||||

|
||||
## Preview
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
[more previews](doc/preview/previews.md)
|
||||
|
||||
***
|
||||
|
||||
## About Iceman fork/repo
|
||||
|
||||
The [Iceman fork/repo](https://github.com/RfidResearchGroup/proxmark3) has more powerful functions. These guys even developed a new hardware called Proxmark3 RDV4 with smart card support. But the official repo and the Iceman repo is not fully compatible.
|
||||
This GUI is compatible with Iceman/RRG repo(tested on v4.13441)
|
||||
|
||||
***
|
||||
|
||||
## About Compiled Windows clients
|
||||
|
||||
A cool guy [Gator96100](https://github.com/Gator96100) creates [ProxSpace](https://github.com/Gator96100/ProxSpace) and makes it possible to compile both the firmware and the client on Windows.
|
||||
Also, he makes the [pre-compiled Windows client](https://www.proxmarkbuilds.org/) so you can download it and run your PM3 client on Windows instantly.
|
||||
I included his compiled client in my releases so you can use the GUI on the fly, and you can also use the GUI with your prefered client.
|
||||
Great thanks to him.
|
||||
|
||||
***
|
||||
|
||||
## Build on Linux
|
||||
|
||||
cd ~
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-default libqt5serialport5 libqt5serialport5-dev
|
||||
git clone https://github.com/wh201906/Proxmark3GUI.git --depth=1
|
||||
cd Proxmark3GUI
|
||||
mkdir build && cd build
|
||||
qmake ../src
|
||||
make -j4 && make clean
|
||||
cp -r ../config ./
|
||||
./Proxmark3GUI
|
||||
|
||||
***
|
||||
## Tutorial
|
||||
|
||||
[1.Quickstart](doc/tutorial/Quickstart/quickstart.md)
|
||||
[2.Edit Mifare Classic data](doc/tutorial/Edit_Mifare_Classic_data/Edit_Mifare_Classic_data.md)(Proxmark3 hardware is not necessary)
|
||||
***
|
||||
|
||||
## Update Log:
|
||||
|
||||
### V0.2.4
|
||||
+ Clone EM410x card to T55xx card
|
||||
|
||||
### V0.2.3
|
||||
+ Fix bug [#27](https://github.com/wh201906/Proxmark3GUI/issues/27)
|
||||
+ Try to support Non-ASCII path
|
||||
|
||||
### V0.2.2
|
||||
+ Load command format from external json file
|
||||
+ Fix bug [#20](https://github.com/wh201906/Proxmark3GUI/issues/20), [#21](https://github.com/wh201906/Proxmark3GUI/issues/21), [#22](https://github.com/wh201906/Proxmark3GUI/issues/22)
|
||||
+ Support Iceman/RRG repo v4.13441
|
||||
|
||||
### V0.2.1
|
||||
+ Optimize MIFARE Classic reading logic
|
||||
+ Fix bug [#16](https://github.com/wh201906/Proxmark3GUI/issues/16)
|
||||
+ Fix bug [#15](https://github.com/wh201906/Proxmark3GUI/issues/15) partially (the path can contain spaces now)
|
||||
|
||||
### V0.2
|
||||
+ Use Dock widget for more flexible layout
|
||||
+ Support basic LF commands
|
||||
+ Fix a bug in RawCommand tab
|
||||
|
||||
### V0.1.4
|
||||
+ Optimize performance
|
||||
+ Optimize UI
|
||||
+ Search available ports automatically
|
||||
+ Add High-DPI support
|
||||
+ Support configuring environment variables by script
|
||||
(Useful when the client requires specific environment variables)
|
||||
+ All functions are compatible with Iceman/RRG repo(tested on v4.9237)
|
||||
+ Support specifying client working directory
|
||||
+ Fix some bugs
|
||||
|
||||
### V0.1.3
|
||||
+ Fix Trailer Decoder
|
||||
+ Add feedback when writing selected blocks
|
||||
|
||||
### V0.1.2
|
||||
+ Optimize read logic
|
||||
+ Make UI Customizable
|
||||
+ Save client path automatically
|
||||
+ Add Trailer Decoder(Deprecated, plz use V0.1.3 or higher version)
|
||||
+ Support read/write selected blocks
|
||||
+ Support a few Iceman functions
|
||||
+ Fix some bugs
|
||||
|
||||
### V0.1.1
|
||||
+ Complete Mifare module(support simulate and sniff)
|
||||
|
||||
### V0.1
|
||||
+ Able to deal with Mifare card and related files
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Proxmark3GUI
|
||||
一个自制的[Proxmark3](https://github.com/Proxmark/proxmark3) GUI
|
||||
|
||||
[English](../README.md)
|
||||
|
||||
***
|
||||
|
||||
## 特色功能
|
||||
|
||||
+ 支持直接输入PM3命令
|
||||
+ 有针对于Mifare卡(IC卡)的图形界面
|
||||
+ 支持编辑Mifare扇区数据文件
|
||||
+ 可以打开二进制/文本格式的扇区数据文件
|
||||
+ ...
|
||||
|
||||
***
|
||||
|
||||
## 预览图
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
***
|
||||
|
||||
## 更新日志:
|
||||
|
||||
### V0.1
|
||||
+ 支持处理Mifare卡片及相关数据文件
|
||||
|
||||
### V0.0.1
|
||||
+ 一个带串口选择框的实验版本
|
||||
|
Before Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 650 KiB |
|
Before Width: | Height: | Size: 637 KiB |
|
Before Width: | Height: | Size: 857 KiB |
@@ -1,52 +0,0 @@
|
||||
#include "util.h"
|
||||
|
||||
Util::Util(QObject *parent) : QObject(parent)
|
||||
{
|
||||
isRequiringOutput = false;
|
||||
requiredOutput = new QString();
|
||||
timeStamp = QTime::currentTime();
|
||||
}
|
||||
|
||||
void Util::processOutput(QString output)
|
||||
{
|
||||
// qDebug() << "Util::processOutput:" << output;
|
||||
if(isRequiringOutput)
|
||||
{
|
||||
requiredOutput->append(output);
|
||||
timeStamp = QTime::currentTime();
|
||||
}
|
||||
emit refreshOutput(output);
|
||||
}
|
||||
|
||||
void Util::execCMD(QString cmd)
|
||||
{
|
||||
qDebug() << cmd;
|
||||
emit write(cmd + "\r\n");
|
||||
}
|
||||
|
||||
QString Util::execCMDWithOutput(QString cmd, unsigned long timeout)
|
||||
{
|
||||
QTime currTime = QTime::currentTime();
|
||||
QTime targetTime = QTime::currentTime().addMSecs(timeout);
|
||||
isRequiringOutput = true;
|
||||
requiredOutput->clear();
|
||||
execCMD(cmd);
|
||||
while( QTime::currentTime() < targetTime)
|
||||
{
|
||||
QApplication::processEvents();
|
||||
if(timeStamp > currTime)
|
||||
{
|
||||
currTime = timeStamp;
|
||||
targetTime = timeStamp.addMSecs(timeout);
|
||||
}
|
||||
}
|
||||
isRequiringOutput = false;
|
||||
return *requiredOutput;
|
||||
}
|
||||
|
||||
void Util::delay(unsigned int msec)
|
||||
{
|
||||
QTime timer = QTime::currentTime().addMSecs(msec);
|
||||
while( QTime::currentTime() < timer )
|
||||
QApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
#include <QThread>
|
||||
#include <QApplication>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
|
||||
class Util : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Util(QObject *parent = nullptr);
|
||||
|
||||
void execCMD(QString cmd);
|
||||
QString execCMDWithOutput(QString cmd, unsigned long timeout = 2000);
|
||||
void delay(unsigned int msec);
|
||||
public slots:
|
||||
void processOutput(QString output);
|
||||
|
||||
private:
|
||||
bool isRequiringOutput;
|
||||
QString* requiredOutput;
|
||||
QTime timeStamp;
|
||||
signals:
|
||||
void refreshOutput(const QString& output);
|
||||
void write(QString data);
|
||||
};
|
||||
|
||||
#endif // UTIL_H
|
||||
@@ -0,0 +1,205 @@
|
||||
{
|
||||
"//": "Based on Proxmark3 official repo v3.1.0, commit 6116334",
|
||||
"//": "You can change this file if the command format of client changes",
|
||||
"mifare classic": {
|
||||
"nested": {
|
||||
"cmd": "hf mf nested <card type> *",
|
||||
"card type": {
|
||||
"mini": "0",
|
||||
"1k": "1",
|
||||
"2k": "2",
|
||||
"4k": "4"
|
||||
},
|
||||
"key pattern": "\\|\\s*\\d{3}\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|",
|
||||
"key A index": 2,
|
||||
"key B index": 4
|
||||
},
|
||||
"check": {
|
||||
"cmd": "hf mf chk *<card type> ?",
|
||||
"card type": {
|
||||
"mini": "0",
|
||||
"1k": "1",
|
||||
"2k": "2",
|
||||
"4k": "4"
|
||||
},
|
||||
"key pattern": "\\|\\s*\\d{3}\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|",
|
||||
"key A index": 2,
|
||||
"key B index": 3
|
||||
},
|
||||
"info": {
|
||||
"cmd": "hf 14a info"
|
||||
},
|
||||
"sniff": {
|
||||
"cmd": "hf mf sniff"
|
||||
},
|
||||
"sniff 14a": {
|
||||
"cmd": "hf 14a snoop"
|
||||
},
|
||||
"list": {
|
||||
"cmd": "hf list mf"
|
||||
},
|
||||
"dump": {
|
||||
"cmd": "hf mf dump"
|
||||
},
|
||||
"restore": {
|
||||
"cmd": "hf mf restore"
|
||||
},
|
||||
"emulator wipe": {
|
||||
"cmd": "hf mf eclr"
|
||||
},
|
||||
"Magic Card wipe": {
|
||||
"cmd": "hf mf cwipe <card type> f",
|
||||
"card type": {
|
||||
"mini": "0",
|
||||
"1k": "1",
|
||||
"2k": "2",
|
||||
"4k": "4"
|
||||
}
|
||||
},
|
||||
"emulator read block": {
|
||||
"cmd": "hf mf eget <block>",
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"Magic Card read block": {
|
||||
"cmd": "hf mf cgetblk <block>",
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"normal read block": {
|
||||
"cmd": "hf mf rdbl <block> <key type> <key>",
|
||||
"key type": {
|
||||
"A": "A",
|
||||
"B": "B"
|
||||
},
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"darkside": {
|
||||
"cmd": "hf mf mifare"
|
||||
},
|
||||
"save sniff": {
|
||||
"cmd": "hf list mf -s <filename>"
|
||||
},
|
||||
"load sniff": {
|
||||
"cmd": "hf list mf -l <filename>"
|
||||
},
|
||||
"hardnested": {
|
||||
"cmd": "hf mf hardnested <known key block> <known key type> <known key> <target key block> <target key type>",
|
||||
"known key type": {
|
||||
"A": "A",
|
||||
"B": "B"
|
||||
},
|
||||
"target key type": {
|
||||
"A": "A",
|
||||
"B": "B"
|
||||
}
|
||||
},
|
||||
"normal read sector": {
|
||||
"cmd": "hf mf rdsc <sector> <key type> <key>",
|
||||
"key type": {
|
||||
"A": "A",
|
||||
"B": "B"
|
||||
},
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"Magic Card read sector": {
|
||||
"cmd": "hf mf cgetsc <sector>",
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"//": "When writing a block, if the result is not empty and doesn't contain the failed flag, the function will return true",
|
||||
"normal write block": {
|
||||
"cmd": "hf mf wrbl <block> <key type> <key> <data>",
|
||||
"key type": {
|
||||
"A": "A",
|
||||
"B": "B"
|
||||
},
|
||||
"failed flag": [
|
||||
"isOk:00"
|
||||
]
|
||||
},
|
||||
"Magic Card write block": {
|
||||
"cmd": "hf mf csetblk <block> <data>",
|
||||
"failed flag": [
|
||||
"No chinese magic"
|
||||
]
|
||||
},
|
||||
"emulator write block": {
|
||||
"cmd": "hf mf eset <block> <data>"
|
||||
},
|
||||
"Magic Card lock": {
|
||||
"cmd": "hf 14a raw ",
|
||||
"sequence": [
|
||||
"-pa -b7 40",
|
||||
"-pa 43",
|
||||
"-pa E0 00 39 F7",
|
||||
"-pa E1 00 E1 EE",
|
||||
"-pa 85 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 18 47",
|
||||
"-a 52"
|
||||
]
|
||||
},
|
||||
"Magic Card set parameter": {
|
||||
"cmd": "hf mf csetuid <uid> <atqa> <sak>"
|
||||
}
|
||||
},
|
||||
"lf": {
|
||||
"read": {
|
||||
"cmd": "lf read",
|
||||
"show cmd": "data plot"
|
||||
},
|
||||
"sniff": {
|
||||
"cmd": "lf snoop",
|
||||
"show cmd": "data plot"
|
||||
},
|
||||
"search": {
|
||||
"cmd": "lf search u"
|
||||
},
|
||||
"tune": {
|
||||
"cmd": "hw tune l"
|
||||
},
|
||||
"get config": {
|
||||
"cmd": "hw status",
|
||||
"field start": "LF Sampling config:",
|
||||
"field end": "USB Speed:",
|
||||
"divisor": {
|
||||
"flag": "divisor:",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"bits per sample": {
|
||||
"flag": "bps:",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"decimation": {
|
||||
"flag": "decimation:",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"averaging": {
|
||||
"flag": "averaging:",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"trigger threshold": {
|
||||
"flag": "trigger threshold:",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"samples to skip": {
|
||||
"flag": "samples to skip:",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"//": "execute 'cmd' then find parameters between 'field stard' and 'field end'",
|
||||
"//": "for each line, if the line doesn't have any flag, skip",
|
||||
"//": "otherwise, delete characters before 'flag' and 'flag' itself, then use 'pattern' to get the parameter",
|
||||
"//": "If 'replace' dict exists, replace all keys with respective values before getting parameters"
|
||||
},
|
||||
"set config": {
|
||||
"cmd": "lf config q <divisor> b <bits per sample> d <decimation> a <averaging> t <trigger threshold> s <samples to skip>",
|
||||
"divisor cmd": "hw setlfdivisor <divisor>"
|
||||
}
|
||||
},
|
||||
"t55xx":{
|
||||
"clone em410x":{
|
||||
"read":"lf search",
|
||||
"successful read flag":"Valid EM410x ID",
|
||||
"pattern":"EM TAG ID\\s*:\\s\\K[0-9a-fA-F]{10}",
|
||||
"clone cmd":"lf em 410xwrite <id> <type>",
|
||||
"t5555 flag":"0",
|
||||
"t55x7 flag":"1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
{
|
||||
"//": "Based on Proxmark3 rrg repo v4.13441, commit 35ddebc",
|
||||
"//": "You can change this file if the command format of client changes",
|
||||
"mifare classic": {
|
||||
"nested": {
|
||||
"cmd": "hf mf nested --<card type> --blk <block> -<key type> -k <key>",
|
||||
"static cmd": "hf mf staticnested --<card type> --blk <block> -<key type> -k <key>",
|
||||
"card type": {
|
||||
"mini": "mini",
|
||||
"1k": "1k",
|
||||
"2k": "2k",
|
||||
"4k": "4k"
|
||||
},
|
||||
"key type": {
|
||||
"A": "a",
|
||||
"B": "b"
|
||||
},
|
||||
"key pattern": "\\|\\s*\\d{3}\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|",
|
||||
"key A index": 2,
|
||||
"key B index": 4
|
||||
},
|
||||
"check": {
|
||||
"cmd": "hf mf chk --<card type>",
|
||||
"card type": {
|
||||
"mini": "mini",
|
||||
"1k": "1k",
|
||||
"2k": "2k",
|
||||
"4k": "4k"
|
||||
},
|
||||
"key pattern": "\\|\\s*\\d{3}\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|\\s*.+?\\s*\\|",
|
||||
"key A index": 2,
|
||||
"key B index": 4
|
||||
},
|
||||
"info": {
|
||||
"cmd": "hf 14a info"
|
||||
},
|
||||
"sniff": {
|
||||
"cmd": "hf sniff"
|
||||
},
|
||||
"sniff 14a": {
|
||||
"cmd": "hf 14a sniff"
|
||||
},
|
||||
"list": {
|
||||
"cmd": "trace list -t mf"
|
||||
},
|
||||
"dump": {
|
||||
"cmd": "hf mf dump"
|
||||
},
|
||||
"restore": {
|
||||
"cmd": "hf mf restore"
|
||||
},
|
||||
"emulator wipe": {
|
||||
"cmd": "hf mf eclr"
|
||||
},
|
||||
"Magic Card wipe": {
|
||||
"cmd": "hf mf cwipe"
|
||||
},
|
||||
"emulator read block": {
|
||||
"cmd": "hf mf egetblk --blk <block>",
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"Magic Card read block": {
|
||||
"cmd": "hf mf cgetblk --blk <block>",
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"normal read block": {
|
||||
"cmd": "hf mf rdbl --blk <block> -<key type> -k <key>",
|
||||
"key type": {
|
||||
"A": "a",
|
||||
"B": "b"
|
||||
},
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"darkside": {
|
||||
"cmd": "hf mf darkside"
|
||||
},
|
||||
"save sniff": {
|
||||
"cmd": "trace save -f <filename>"
|
||||
},
|
||||
"load sniff": {
|
||||
"cmd": "trace load -f <filename>",
|
||||
"show cmd": "trace list --buffer -t mf"
|
||||
},
|
||||
"hardnested": {
|
||||
"cmd": "hf mf hardnested --blk <known key block> -<known key type> -k <known key> --tblk <target key block> --t<target key type>",
|
||||
"known key type": {
|
||||
"A": "a",
|
||||
"B": "b"
|
||||
},
|
||||
"target key type": {
|
||||
"A": "a",
|
||||
"B": "b"
|
||||
}
|
||||
},
|
||||
"normal read sector": {
|
||||
"cmd": "hf mf rdsc --sec <sector> -<key type> -k <key>",
|
||||
"key type": {
|
||||
"A": "a",
|
||||
"B": "b"
|
||||
},
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"Magic Card read sector": {
|
||||
"cmd": "hf mf cgetsc --sec <sector>",
|
||||
"data pattern": "([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}"
|
||||
},
|
||||
"//": "When writing a block, if the result is not empty and doesn't contain the failed flag, the function will return true",
|
||||
"normal write block": {
|
||||
"cmd": "hf mf wrbl --blk <block> -<key type> -k <key> -d <data>",
|
||||
"key type": {
|
||||
"A": "a",
|
||||
"B": "b"
|
||||
},
|
||||
"failed flag": [
|
||||
"fail",
|
||||
"error"
|
||||
]
|
||||
},
|
||||
"Magic Card write block": {
|
||||
"cmd": "hf mf csetblk --blk <block> -d <data>",
|
||||
"failed flag": [
|
||||
"fail",
|
||||
"error"
|
||||
]
|
||||
},
|
||||
"emulator write block": {
|
||||
"cmd": "hf mf esetblk --blk <block> -d <data>"
|
||||
},
|
||||
"Magic Card lock": {
|
||||
"cmd": "hf 14a raw ",
|
||||
"sequence": [
|
||||
"-ak -b 7 40",
|
||||
"-ak 43",
|
||||
"-ak E0 00 39 F7",
|
||||
"-ak E1 00 E1 EE",
|
||||
"-ak 85 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 18 47",
|
||||
"-a 52"
|
||||
]
|
||||
},
|
||||
"Magic Card set parameter": {
|
||||
"cmd": "hf mf csetuid --uid <uid> --atqa <atqa> --sak <sak>"
|
||||
}
|
||||
},
|
||||
"lf": {
|
||||
"read": {
|
||||
"cmd": "lf read -v",
|
||||
"show cmd": "data plot"
|
||||
},
|
||||
"sniff": {
|
||||
"cmd": "lf sniff -v",
|
||||
"show cmd": "data plot"
|
||||
},
|
||||
"search": {
|
||||
"cmd": "lf search -u"
|
||||
},
|
||||
"tune": {
|
||||
"cmd": "lf tune --divisor <divisor>"
|
||||
},
|
||||
"get config": {
|
||||
"cmd": "hw status",
|
||||
"field start": "LF Sampling config",
|
||||
"field end": "LF Sampling Stack",
|
||||
"divisor": {
|
||||
"flag": "divisor",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"bits per sample": {
|
||||
"flag": "bits per sample",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"decimation": {
|
||||
"flag": "decimation",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"averaging": {
|
||||
"flag": "averaging",
|
||||
"pattern": "\\d+",
|
||||
"replace": {
|
||||
"yes": "1",
|
||||
"no": "0",
|
||||
"Yes": "1",
|
||||
"No": "0"
|
||||
}
|
||||
},
|
||||
"trigger threshold": {
|
||||
"flag": "trigger threshold",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"samples to skip": {
|
||||
"flag": "samples to skip",
|
||||
"pattern": "\\d+"
|
||||
},
|
||||
"//": "execute 'cmd' then find parameters between 'field stard' and 'field end'",
|
||||
"//": "for each line, if the line doesn't have any flag, skip",
|
||||
"//": "otherwise, delete characters before 'flag' and 'flag' itself, then use 'pattern' to get the parameter",
|
||||
"//": "If 'replace' dict exists, replace all keys with respective values before getting parameters"
|
||||
},
|
||||
"set config": {
|
||||
"cmd": "lf config --divisor <divisor> --bps <bits per sample> --dec <decimation> --avg <averaging> --trig <trigger threshold> --skip <samples to skip>",
|
||||
"divisor cmd": "hw setlfdivisor -d <divisor>"
|
||||
}
|
||||
},
|
||||
"t55xx":{
|
||||
"clone em410x":{
|
||||
"read":"lf em 410x reader",
|
||||
"successful read flag":"EM 410x ID",
|
||||
"pattern":"EM 410x ID\\s*\\K[0-9a-fA-F]{10}",
|
||||
"clone cmd":"lf em 410x clone --id <id> <type>",
|
||||
"t5555 flag":"--q5",
|
||||
"t55x7 flag":""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
# Proxmark3GUI
|
||||

|
||||
|
||||
一个自制的[Proxmark3](https://github.com/Proxmark/proxmark3) GUI,可在Windows/Linux系统下运行
|
||||
|
||||
[English](../../README.md)
|
||||
|
||||
***
|
||||
|
||||
## 功能
|
||||
|
||||
+ 快速查找可用端口并连接
|
||||
+ 支持直接输入PM3命令(官方版/冰人版)
|
||||
+ 有针对于Mifare卡(IC卡)的图形界面
|
||||
+ 支持不同大小的卡片(MINI, 1K, 2K, 4K)
|
||||
+ 支持编辑Mifare扇区数据
|
||||
+ 支持读取全卡/选中扇区,读卡逻辑更加智能
|
||||
+ 支持写入全卡/选中扇区
|
||||
+ 可以打开二进制/文本格式的扇区数据文件
|
||||
+ 分析访问控制位(Access Bits)
|
||||
+ 支持UID卡操作(UID快速读写,UFUID锁卡)
|
||||
+ 支持部分低频命令
|
||||
+ 自定义UI界面,各选项卡可拆分组合
|
||||
+ ...
|
||||
|
||||
***
|
||||
|
||||
## 预览图
|
||||

|
||||
|
||||
[更多预览](../preview/previews.md)
|
||||
|
||||
***
|
||||
|
||||
## 关于冰人版
|
||||
[冰人版](https://github.com/RfidResearchGroup/proxmark3)(Iceman/RRG)的客户端和固件更新更为激进,相比官方版具有更多的功能
|
||||
此GUI所有功能均兼容冰人版(在v4.13441上测试通过)
|
||||
|
||||
***
|
||||
|
||||
## 关于预编译Windows客户端
|
||||
|
||||
一位国外大佬 [Gator96100](https://github.com/Gator96100) 做了个 [ProxSpace](https://github.com/Gator96100/ProxSpace) 以便在Windows平台上编译PM3固件和客户端,他还把自己编译好的客户端放到了[网站](https://www.proxmarkbuilds.org/)上
|
||||
release页面中有含客户端的GUI。这个GUI也可以搭配你自己的客户端使用
|
||||
(本来打算在CSDN下载里面放几个最新版客户端的,结果不能把下载币改为0)
|
||||
感谢大佬
|
||||
|
||||
***
|
||||
|
||||
## 在Linux系统下编译
|
||||
|
||||
cd ~
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-default libqt5serialport5 libqt5serialport5-dev
|
||||
git clone https://github.com/wh201906/Proxmark3GUI.git --depth=1
|
||||
cd Proxmark3GUI
|
||||
mkdir build && cd build
|
||||
qmake ../src
|
||||
make -j4 && make clean
|
||||
cp -r ../config ./
|
||||
./Proxmark3GUI
|
||||
|
||||
***
|
||||
## 教程
|
||||
[1.快速上手](../tutorial/Quickstart/quickstart_zh_CN.md)
|
||||
[2.编辑Mifare(IC)卡数据](../tutorial/Edit_Mifare_Classic_data/Edit_Mifare_Classic_data_zh_CN.md)(无需PM3硬件)
|
||||
***
|
||||
## 更新日志:
|
||||
|
||||
### V0.2.4
|
||||
+ 复制EM410x卡(一种常见的低频ID卡)
|
||||
|
||||
### V0.2.3
|
||||
+ 修复 [#27](https://github.com/wh201906/Proxmark3GUI/issues/27)
|
||||
+ 尝试支持中文启动路径
|
||||
|
||||
### V0.2.2
|
||||
+ 从外部文件加载客户端命令格式
|
||||
+ 修复 [#20](https://github.com/wh201906/Proxmark3GUI/issues/20), [#21](https://github.com/wh201906/Proxmark3GUI/issues/21), [#22](https://github.com/wh201906/Proxmark3GUI/issues/22)
|
||||
+ 兼容冰人版客户端 v4.13441
|
||||
|
||||
### V0.2.1
|
||||
+ 优化MIFARE Classic读卡逻辑
|
||||
+ 修复 [#16](https://github.com/wh201906/Proxmark3GUI/issues/16) (配合新版RRG固件时无法读取扇区数据)
|
||||
+ 修复 [#15](https://github.com/wh201906/Proxmark3GUI/issues/15) (路径中支持空格)
|
||||
|
||||
### V0.2
|
||||
+ 使用浮动窗口,界面配置更加灵活
|
||||
+ 支持部分低频命令
|
||||
+ 修复原始命令选项卡中的一个Bug
|
||||
|
||||
### V0.1.4
|
||||
+ 优化性能
|
||||
+ 优化用户界面
|
||||
+ 自动搜索可用端口
|
||||
+ 支持高分屏
|
||||
+ 可通过外部脚本配置环境变量
|
||||
(在客户端需要配置环境变量时很有用)
|
||||
+ 全功能兼容冰人版(在v4.9237上测试通过)
|
||||
+ 支持指定客户端工作路径
|
||||
+ 修复部分bug
|
||||
|
||||
### V0.1.3
|
||||
+ 修复访问控制位解码器
|
||||
+ 写多个块时显示写入结果
|
||||
|
||||
### V0.1.2
|
||||
+ 优化读卡逻辑
|
||||
+ UI自定义
|
||||
+ 自动保存客户端路径
|
||||
+ 添加访问控制位解码器(也可用于自己构造访问控制位)(有bug,请使用V0.1.3或更高版本)
|
||||
+ 支持仅读写选中块
|
||||
+ 支持部分冰人功能
|
||||
+ 修复部分bug
|
||||
|
||||
### V0.1.1
|
||||
+ 完成整个Mifare模块(支持模拟卡和嗅探功能)
|
||||
|
||||
### V0.1
|
||||
+ 支持处理Mifare卡片及相关数据文件
|
||||
|
||||
### V0.0.1
|
||||
+ 一个带串口选择框的实验版本
|
||||
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 797 KiB |
|
After Width: | Height: | Size: 438 KiB |
|
After Width: | Height: | Size: 468 KiB |
@@ -0,0 +1,20 @@
|
||||
## Previews
|
||||
|
||||
Raw Command:
|
||||

|
||||
|
||||
Mifare Nested Attack:
|
||||

|
||||
|
||||
Mifare Load File:
|
||||

|
||||
|
||||
Mifare Edit File:
|
||||

|
||||
|
||||
Mifare Trailer Decoder:
|
||||

|
||||
|
||||
Dock Widget:
|
||||

|
||||

|
||||
|
After Width: | Height: | Size: 345 KiB |
@@ -0,0 +1,50 @@
|
||||
# Edit Mifare Classic data
|
||||
|
||||
[中文教程](Edit_Mifare_Classic_data_zh_CN.md)
|
||||
This function is useful even if you don't use Proxmark3.
|
||||
|
||||
## About card type
|
||||
There are four sizes of Mifare Classic card
|
||||
+ 320Byte, also known as MINI, S20
|
||||
+ 1kB, also known as S50
|
||||
+ 2kB
|
||||
+ 4kB, alsow known as S70
|
||||
|
||||
Before any operation, you need to choose the right card type.
|
||||
If you don't know your card type, you can try 1K first. Mifare Classic S50(1K) is the most common type.
|
||||

|
||||
|
||||
## About file format
|
||||
This program supports binary data file and text data file.
|
||||
Binary data files have the same size of chosen card type.(e.g, type 1K->1024KB data file).
|
||||
The file extensions of them are always .dump or .bin.
|
||||
You can edit them by hex editor or this program.
|
||||

|
||||
Text data files can be open by any text editors.
|
||||
The file extensions of them are always .eml or .txt.
|
||||

|
||||
|
||||
## Load
|
||||
Go to "Mifare"->"File"->, choose "data" on the left and click "Load", then choose the file you want to load. The program will detect the file type by context.
|
||||

|
||||

|
||||
Also, you can drag the file into data widget to load the data file.
|
||||

|
||||
|
||||
## Edit
|
||||
Double click any data row to start edit
|
||||

|
||||
You don't need to fill the space between every byte.
|
||||

|
||||
|
||||
## Save
|
||||
Go to "Mifare"->"File"->, choose "data" on the left and click "Save", then choose the path you want to save and the file format.
|
||||

|
||||
|
||||
## File format convert
|
||||
If you got a binary data file and you want to edit with notepad, here are the steps.
|
||||
+ Load the orignal binary file
|
||||
+ Save it as a text file
|
||||
+ Edit the new file with whatever you want then save it
|
||||
+ Load the edited file
|
||||
+ Save it as binary file
|
||||
@@ -0,0 +1,51 @@
|
||||
# 编辑Mifare(IC)卡数据
|
||||
|
||||
[English](Edit_Mifare_Classic_data.md)
|
||||
此功能对没有PM3硬件的用户也很有用。
|
||||
|
||||
## 关于卡类型
|
||||
Mifare Classic卡有四种不同的容量
|
||||
+ 320字节,也被称作MINI卡,S20卡
|
||||
+ 1k字节,也被称为S50卡,最常见的型号
|
||||
+ 2k字节
|
||||
+ 4k字节,也被称为S70卡
|
||||
|
||||
在操作前,请先选择卡类型。
|
||||
如果自己不清楚卡类型,可尝试选择1k卡,这是最常见的型号。
|
||||

|
||||
|
||||
## 关于文件格式
|
||||
此程序支持二进制文件格式和文本文件格式。
|
||||
二进制文件的大小和所选卡类型的大小完全相等,文件中的每一个字节对应卡片数据中的一个字节。
|
||||
二进制文件的后缀名一般是.dump或.bin。
|
||||
此类文件需要使用16进制编辑器或者此程序来编辑。
|
||||

|
||||
文本文件可被任意文本编辑器打开。
|
||||
此类文件的后缀名一般是.eml或.txt。
|
||||

|
||||
|
||||
## 加载文件
|
||||
在“Mifare”选项卡->“文件”框中勾选“数据”,点击“加载”按钮载入文件。
|
||||
此程序会根据文件内容判断待加载的文件格式。
|
||||

|
||||

|
||||
程序还支持拖拽加载。你可以直接把文件拖入左边数据显示器中。
|
||||

|
||||
|
||||
## 编辑数据
|
||||
双击数据行即可开始编辑。
|
||||

|
||||
编辑过程中无需手动补全字节间空格。
|
||||

|
||||
|
||||
## 保存文件
|
||||
在“Mifare”选项卡->“文件”框中勾选“数据”,点击“保存”按钮,选择保存的路径和文件格式即可保存文件。
|
||||

|
||||
|
||||
## 文件格式转换
|
||||
如果你想用其它文本编辑器编辑二进制文件,可以参考以下步骤
|
||||
+ 加载原始二进制文件
|
||||
+ 保存为文本文件
|
||||
+ 用自己喜欢的文本编辑器编辑后保存
|
||||
+ 加载编辑后的文件
|
||||
+ 保存为二进制文件
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,45 @@
|
||||
# Quickstart
|
||||
|
||||
[中文教程](quickstart_zh_CN.md)
|
||||
***
|
||||
**On Windows**
|
||||
***
|
||||
## Use GUI with included client
|
||||
(1) Download the GUI with included client on [release](https://github.com/wh201906/Proxmark3GUI/releases) page
|
||||

|
||||
|
||||
(2) Extract the .7z file to a path. The target path should not contain non-ASCII characters
|
||||

|
||||
|
||||
(3) Open Proxmark3GUI.exe in the GUI folder, then select the language and click "OK". Now you can use it
|
||||

|
||||

|
||||
|
||||
## Use the GUI with your own client
|
||||
(1) Download the standalone GUI on [release](https://github.com/wh201906/Proxmark3GUI/releases) page
|
||||

|
||||
|
||||
(2) Extract the .7z file to a path. The target path should not contain non-ASCII characters. Make sure the client path and the GUI path are different.
|
||||
|
||||
(3) Open the GUI. Input the client path in the "Client Path" editbox on the top of the main window.
|
||||

|
||||
|
||||
(4) Go to "Settings" panel. Input the config file path which matching the client you use.
|
||||

|
||||
|
||||
(5) If setup.bat is required, input the script path in the "Preload script path" editbox.
|
||||

|
||||
|
||||
(6) If using RRG/Iceman repo, input "-p \<port\> -f" in the "Start arguments" editbox.
|
||||

|
||||
|
||||
***
|
||||
**On Linux**
|
||||
***
|
||||
(1) Build the GUI by following the instructions on [README](../../../README.md)
|
||||
(2) Config the GUI with the same steps of "On Windows"->"Use the GUI with your own client"
|
||||
(3) You might need to change "\<port\>" to "/dev/\<port\>" in "Settings"->"Start arguments" editbox
|
||||

|
||||
|
||||
(4) If you are using Raspbian(Raspberry OS), you might need to check "Keep the client active even the PM3 hardware is disconnected." in the "Steeings" panel
|
||||

|
||||
@@ -0,0 +1,49 @@
|
||||
# 快速上手
|
||||
|
||||
[English](quickstart.md)
|
||||
***
|
||||
**Windows用户**
|
||||
***
|
||||
## 使用包含客户端的版本
|
||||
(1) 直接下载[release](https://github.com/wh201906/Proxmark3GUI/releases)当中包含客户端的版本即可
|
||||

|
||||
(例如Vx.x.x-win-Officialclient.7z或Vx.x.x-win-RRGclient.7z,前者为官方客户端,后者为冰人版/RRG客户端)
|
||||
|
||||
(2) 下载完成后将压缩包内所有内容解压到不含中文的路径当中
|
||||

|
||||
|
||||
(3) 双击GUI目录下的Proxmark3GUI.exe,选择语言,点击OK,即可正常运行
|
||||

|
||||

|
||||
***
|
||||
|
||||
## 使用现有客户端
|
||||
(1) 下载[release](https://github.com/wh201906/Proxmark3GUI/releases)当中不包含客户端的版本
|
||||

|
||||
|
||||
(2) 解压到不含中文的路径当中
|
||||
(注意,GUI所在目录和PM3客户端所在目录不能相同)
|
||||
|
||||
(3) 双击打开,选择语言,在顶端“客户端路径”当中填入proxmark3.exe的路径
|
||||

|
||||
|
||||
(4) 进入“设置”面板,根据自己使用的客户端类型(官方版/冰人版)选择正确的配置文件
|
||||
(./config/config_official.json或./config/config_rrgv4.13.json)
|
||||

|
||||
|
||||
(5) 若客户端启动时需要双击setup.bat启动,而setup.bat内会设置客户端运行时的环境变量,则需要在“预加载脚本路径”当中填入setup.bat的路径
|
||||

|
||||
|
||||
(6) 若使用的是冰人固件,则可能需要在“启动参数”当中填入“-p \<port\> -f”
|
||||

|
||||
|
||||
***
|
||||
**Linux用户**
|
||||
***
|
||||
(1) 参考[README](../../README/README_zh_CN.md)当中的编译步骤手动编译Proxmark3GUI
|
||||
(2) 参考“Windows用户”->“使用现有客户端”的(2)~(6)步进行配置
|
||||
(3) “设置”->“启动参数”当中可能需要将“\<port\>”改为“/dev/\<port\>”
|
||||

|
||||
|
||||
(4) 若使用树莓派Raspbian系统且连接成功若干秒后PM3会自动断开,则需要在“设置”面板中勾选“在PM3断开后保持客户端运行”
|
||||

|
||||
@@ -1,608 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>MF_Attack_hardnestedDialog</name>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="14"/>
|
||||
<source>Hardnested Attack</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="20"/>
|
||||
<source>Known Block:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="29"/>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="104"/>
|
||||
<source>Block:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="68"/>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="143"/>
|
||||
<source>A</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="73"/>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="148"/>
|
||||
<source>B</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="95"/>
|
||||
<source>Target Block:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MF_UID_parameterDialog</name>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="14"/>
|
||||
<source>Set Parameter</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="22"/>
|
||||
<source>UID:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="32"/>
|
||||
<source>ATQA:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="42"/>
|
||||
<source>SAK:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="23"/>
|
||||
<source>Proxmark3GUI</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="56"/>
|
||||
<source>Path:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="80"/>
|
||||
<source>Refresh</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="87"/>
|
||||
<source>Connect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="94"/>
|
||||
<source>Disconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="113"/>
|
||||
<source>Mifare</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="206"/>
|
||||
<source>>></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="231"/>
|
||||
<source><<</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="263"/>
|
||||
<source>F</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="320"/>
|
||||
<source>Card Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="335"/>
|
||||
<source>MINI</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="342"/>
|
||||
<source>1K</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="352"/>
|
||||
<source>2K</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="359"/>
|
||||
<source>4K</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="369"/>
|
||||
<source>File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="387"/>
|
||||
<location filename="../ui/mainwindow.ui" line="944"/>
|
||||
<source>Load</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="400"/>
|
||||
<location filename="../ui/mainwindow.ui" line="957"/>
|
||||
<source>Save</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="420"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="534"/>
|
||||
<source>Data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="430"/>
|
||||
<source>Key</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="440"/>
|
||||
<source>Attack</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="465"/>
|
||||
<source>Card Info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="478"/>
|
||||
<source>Check Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="491"/>
|
||||
<source>Nested</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="498"/>
|
||||
<source>Hardnested</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="523"/>
|
||||
<source>Read/Write</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="533"/>
|
||||
<source>Block:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="565"/>
|
||||
<source>Key:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="584"/>
|
||||
<source>Key Type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="604"/>
|
||||
<source>A</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="609"/>
|
||||
<source>B</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="632"/>
|
||||
<source>Normal(Require Password)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="647"/>
|
||||
<location filename="../ui/mainwindow.ui" line="736"/>
|
||||
<source>Read Block</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="654"/>
|
||||
<location filename="../ui/mainwindow.ui" line="743"/>
|
||||
<source>Write Block</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="661"/>
|
||||
<location filename="../ui/mainwindow.ui" line="750"/>
|
||||
<location filename="../ui/mainwindow.ui" line="850"/>
|
||||
<source>Read All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="668"/>
|
||||
<location filename="../ui/mainwindow.ui" line="757"/>
|
||||
<source>Write All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="687"/>
|
||||
<source>Dump</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="700"/>
|
||||
<source>Restore</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="710"/>
|
||||
<source>Chinese Magic Card(Without Password)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="722"/>
|
||||
<source>Lock UFUID Card</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="729"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="461"/>
|
||||
<source>About UID Card</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="770"/>
|
||||
<source>Set Parameter</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="789"/>
|
||||
<source>Wipe</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="815"/>
|
||||
<location filename="../ui/mainwindow.ui" line="870"/>
|
||||
<source>Simulate</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="843"/>
|
||||
<source>Load from data above</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="413"/>
|
||||
<location filename="../ui/mainwindow.ui" line="863"/>
|
||||
<source>Clear</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="893"/>
|
||||
<location filename="../ui/mainwindow.ui" line="924"/>
|
||||
<source>Sniff</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="931"/>
|
||||
<source>List Sniff Data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="983"/>
|
||||
<source>RawCommand</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1030"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="143"/>
|
||||
<source>History:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1062"/>
|
||||
<source>ClearHistory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1081"/>
|
||||
<source>Send</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1088"/>
|
||||
<source>ClearOutput</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="77"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="179"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="229"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="246"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="259"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="278"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="291"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="314"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="327"/>
|
||||
<source>Info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="77"/>
|
||||
<source>Plz choose a port first</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="91"/>
|
||||
<source>Connected</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="95"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="105"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="524"/>
|
||||
<source>Not Connected</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="272"/>
|
||||
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml);;All Files(*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="278"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="291"/>
|
||||
<source>Failed to open</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="179"/>
|
||||
<source>When Changeing card type, the data and keys in this app will be cleard.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="179"/>
|
||||
<source>Continue?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="208"/>
|
||||
<source>Plz select the font of data widget and key widget</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="229"/>
|
||||
<source>Data must consists of 32 Hex symbols(Whitespace is allowed)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="246"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="259"/>
|
||||
<source>Key must consists of 12 Hex symbols(Whitespace is allowed)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="271"/>
|
||||
<source>Plz select the data file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="284"/>
|
||||
<source>Plz select the key file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="285"/>
|
||||
<source>Binary Key Files(*.bin *.dump);;Binary Data Files(*.bin *.dump);;All Files(*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="307"/>
|
||||
<source>Plz select the location to save data file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="308"/>
|
||||
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="314"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="327"/>
|
||||
<source>Failed to save to</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="320"/>
|
||||
<source>Plz select the location to save key file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="321"/>
|
||||
<source>Binary Key Files(*.bin *.dump)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="446"/>
|
||||
<source> Normally, the Block 0 of a typical Mifare card, which contains the UID, is locked during the manufacture. Users cannot write anything to Block 0 or set a new UID to a normal Mifare card.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="447"/>
|
||||
<source> Chinese Magic Cards(aka UID Cards) are some special cards whose Block 0 are writeable. And you can change UID by writing to it.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="449"/>
|
||||
<source>There are two versions of Chinese Magic Cards, the Gen1 and the Gen2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="450"/>
|
||||
<source> Gen1:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="450"/>
|
||||
<source> also called UID card in China. It responses to some backdoor commands so you can access any blocks without password. The Proxmark3 has a bunch of related commands(csetblk, cgetblk, ...) to deal with this type of card, and my GUI also support these commands.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="451"/>
|
||||
<source> Gen2:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="451"/>
|
||||
<source> doesn't response to the backdoor commands, which means that a reader cannot detect whether it is a Chinese Magic Card or not by sending backdoor commands.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="453"/>
|
||||
<source>There are some types of Chinese Magic Card Gen2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="454"/>
|
||||
<source> CUID Card:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="454"/>
|
||||
<source> the Block 0 is writeable, you can write to this block repeatedly by normal wrbl command.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="455"/>
|
||||
<source> (hf mf wrbl 0 A FFFFFFFFFFFF <the data you want to write>)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="456"/>
|
||||
<source> FUID Card:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="456"/>
|
||||
<source> you can only write to Block 0 once. After that, it seems like a typical Mifare card(Block 0 cannot be written to).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="457"/>
|
||||
<source> (some readers might try changing the Block 0, which could detect the CUID Card. In that case, you should use FUID card.)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="458"/>
|
||||
<source> UFUID Card:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="458"/>
|
||||
<source> It behaves like a CUID card(or UID card? I'm not sure) before you send some special command to lock it. Once it is locked, you cannot change its Block 0(just like a typical Mifare card).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="460"/>
|
||||
<source> Seemingly, these Chinese Magic Cards are more easily to be compromised by Nested Attack(it takes little time to get an unknown key).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="525"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="642"/>
|
||||
<source>Idle</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="532"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="541"/>
|
||||
<source>Sec</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="533"/>
|
||||
<source>Blk</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="542"/>
|
||||
<source>KeyA</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="543"/>
|
||||
<source>KeyB</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="579"/>
|
||||
<source>HW Version:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="581"/>
|
||||
<source>PM3:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="583"/>
|
||||
<source>State:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="638"/>
|
||||
<source>Running</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Mifare</name>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="289"/>
|
||||
<location filename="../module/mifare.cpp" line="386"/>
|
||||
<source>Success!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="289"/>
|
||||
<location filename="../module/mifare.cpp" line="293"/>
|
||||
<location filename="../module/mifare.cpp" line="386"/>
|
||||
<location filename="../module/mifare.cpp" line="390"/>
|
||||
<location filename="../module/mifare.cpp" line="425"/>
|
||||
<source>Info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="293"/>
|
||||
<location filename="../module/mifare.cpp" line="390"/>
|
||||
<source>Failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="425"/>
|
||||
<source>Failed to read card.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -1,649 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="zh_CN">
|
||||
<context>
|
||||
<name>MF_Attack_hardnestedDialog</name>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="14"/>
|
||||
<source>Hardnested Attack</source>
|
||||
<translation>Hardnested攻击</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Known Key:</source>
|
||||
<translation type="obsolete">已知Key:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="20"/>
|
||||
<source>Known Block:</source>
|
||||
<translation>已知块:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="29"/>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="104"/>
|
||||
<source>Block:</source>
|
||||
<translation>块:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="68"/>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="143"/>
|
||||
<source>A</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="73"/>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="148"/>
|
||||
<source>B</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_attack_hardnesteddialog.ui" line="95"/>
|
||||
<source>Target Block:</source>
|
||||
<translation>目标块:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Target Block: </source>
|
||||
<translation type="vanished">目标块:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MF_UID_parameterDialog</name>
|
||||
<message>
|
||||
<source>Dialog</source>
|
||||
<translation type="vanished">对话框</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="14"/>
|
||||
<source>Set Parameter</source>
|
||||
<translation>设置卡参数</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="22"/>
|
||||
<source>UID:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="32"/>
|
||||
<source>ATQA:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mf_uid_parameterdialog.ui" line="42"/>
|
||||
<source>SAK:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The parameter will not change if you leave it empty.</source>
|
||||
<translation type="vanished">如果留空,则对应参数将保持不变</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="23"/>
|
||||
<source>Proxmark3GUI</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="56"/>
|
||||
<source>Path:</source>
|
||||
<translation>路径:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="80"/>
|
||||
<source>Refresh</source>
|
||||
<translation>刷新端口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="87"/>
|
||||
<source>Connect</source>
|
||||
<translation>连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="94"/>
|
||||
<source>Disconnect</source>
|
||||
<translation>断开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="113"/>
|
||||
<source>Mifare</source>
|
||||
<translation>Mifare(IC)卡</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="206"/>
|
||||
<source>>></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="231"/>
|
||||
<source><<</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="263"/>
|
||||
<source>F</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="320"/>
|
||||
<source>Card Type</source>
|
||||
<translation>卡类型</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="335"/>
|
||||
<source>MINI</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="342"/>
|
||||
<source>1K</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="352"/>
|
||||
<source>2K</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="359"/>
|
||||
<source>4K</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="369"/>
|
||||
<source>File</source>
|
||||
<translation>文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="387"/>
|
||||
<location filename="../ui/mainwindow.ui" line="944"/>
|
||||
<source>Load</source>
|
||||
<translation>加载</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="400"/>
|
||||
<location filename="../ui/mainwindow.ui" line="957"/>
|
||||
<source>Save</source>
|
||||
<translation>保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="420"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="534"/>
|
||||
<source>Data</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="430"/>
|
||||
<source>Key</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="440"/>
|
||||
<source>Attack</source>
|
||||
<translation>破解</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="465"/>
|
||||
<source>Card Info</source>
|
||||
<translation>读卡片信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="478"/>
|
||||
<source>Check Default</source>
|
||||
<translation>验证默认密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="491"/>
|
||||
<source>Nested</source>
|
||||
<translation>Nested攻击</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="498"/>
|
||||
<source>Hardnested</source>
|
||||
<translation>Hardested攻击</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="523"/>
|
||||
<source>Read/Write</source>
|
||||
<translation>读/写</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="533"/>
|
||||
<source>Block:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="565"/>
|
||||
<source>Key:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="584"/>
|
||||
<source>Key Type:</source>
|
||||
<translation>Key类型:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="604"/>
|
||||
<source>A</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="609"/>
|
||||
<source>B</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="632"/>
|
||||
<source>Normal(Require Password)</source>
|
||||
<translation>普通卡(需要密码)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="647"/>
|
||||
<location filename="../ui/mainwindow.ui" line="736"/>
|
||||
<source>Read Block</source>
|
||||
<translation>读单个块</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="654"/>
|
||||
<location filename="../ui/mainwindow.ui" line="743"/>
|
||||
<source>Write Block</source>
|
||||
<translation>写单个块</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="661"/>
|
||||
<location filename="../ui/mainwindow.ui" line="750"/>
|
||||
<location filename="../ui/mainwindow.ui" line="850"/>
|
||||
<source>Read All</source>
|
||||
<translation>读所有块</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="668"/>
|
||||
<location filename="../ui/mainwindow.ui" line="757"/>
|
||||
<source>Write All</source>
|
||||
<translation>写所有块</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="687"/>
|
||||
<source>Dump</source>
|
||||
<translation>Dump命令</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="700"/>
|
||||
<source>Restore</source>
|
||||
<translation>Restore命令</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="710"/>
|
||||
<source>Chinese Magic Card(Without Password)</source>
|
||||
<translation>UID卡(不需要密码)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="722"/>
|
||||
<source>Lock UFUID Card</source>
|
||||
<translation>锁定UFUID卡</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="729"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="461"/>
|
||||
<source>About UID Card</source>
|
||||
<translation>关于UID卡</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="770"/>
|
||||
<source>Set Parameter</source>
|
||||
<translation>设置卡参数</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="789"/>
|
||||
<source>Wipe</source>
|
||||
<translation>擦除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="815"/>
|
||||
<location filename="../ui/mainwindow.ui" line="870"/>
|
||||
<source>Simulate</source>
|
||||
<translation>模拟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="843"/>
|
||||
<source>Load from data above</source>
|
||||
<translation>从上方数据导入</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="413"/>
|
||||
<location filename="../ui/mainwindow.ui" line="863"/>
|
||||
<source>Clear</source>
|
||||
<translation>清空</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="893"/>
|
||||
<location filename="../ui/mainwindow.ui" line="924"/>
|
||||
<source>Sniff</source>
|
||||
<translation>嗅探</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="931"/>
|
||||
<source>List Sniff Data</source>
|
||||
<translation>列出嗅探数据</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="983"/>
|
||||
<source>RawCommand</source>
|
||||
<translation>原始命令</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1030"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="143"/>
|
||||
<source>History:</source>
|
||||
<translation>命令历史:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1062"/>
|
||||
<source>ClearHistory</source>
|
||||
<translation>清空历史</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1081"/>
|
||||
<source>Send</source>
|
||||
<translation>发送</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1088"/>
|
||||
<source>ClearOutput</source>
|
||||
<translation>清空输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="77"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="179"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="229"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="246"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="259"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="278"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="291"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="314"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="327"/>
|
||||
<source>Info</source>
|
||||
<translation>信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="77"/>
|
||||
<source>Plz choose a port first</source>
|
||||
<translation>请先选择端口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="91"/>
|
||||
<source>Connected</source>
|
||||
<translation>已连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="95"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="105"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="524"/>
|
||||
<source>Not Connected</source>
|
||||
<translation>未连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When Changeing card type, the data and keys in this app will be cleard.
|
||||
Continue?</source>
|
||||
<translation type="vanished">更改卡容量后,窗口中的data和key会被清空\n要继续吗?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Plz choose the data file:</source>
|
||||
<translation type="vanished">请选择data文件:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="272"/>
|
||||
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml);;All Files(*.*)</source>
|
||||
<translation>二进制Data文件(*.bin *.dump);;文本Data文件(*.txt *.eml);;所有文件(*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="278"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="291"/>
|
||||
<source>Failed to open</source>
|
||||
<translation>无法打开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Plz choose the key file:</source>
|
||||
<translation type="vanished">请选择key文件:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Binary Key Files(*.bin *.dump);;All Files(*.*)</source>
|
||||
<translation type="vanished">二进制Key文件(*.bin *.dump);;所有文件(*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save data to</source>
|
||||
<translation type="vanished">保存数据至</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="179"/>
|
||||
<source>When Changeing card type, the data and keys in this app will be cleard.</source>
|
||||
<translation>卡片容量改变后,上方的所有Data和Key会被清空。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="179"/>
|
||||
<source>Continue?</source>
|
||||
<translation>确定?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="208"/>
|
||||
<source>Plz select the font of data widget and key widget</source>
|
||||
<translation>请选择Data窗口和Key窗口的字体</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="229"/>
|
||||
<source>Data must consists of 32 Hex symbols(Whitespace is allowed)</source>
|
||||
<translation>Data必须由32个十六进制字符组成(中间可含有空格)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="246"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="259"/>
|
||||
<source>Key must consists of 12 Hex symbols(Whitespace is allowed)</source>
|
||||
<translation>Key必须由12个十六进制字符组成(中间可含有空格)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="271"/>
|
||||
<source>Plz select the data file:</source>
|
||||
<translation>请选择data文件:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="284"/>
|
||||
<source>Plz select the key file:</source>
|
||||
<translation>请选择key文件:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="285"/>
|
||||
<source>Binary Key Files(*.bin *.dump);;Binary Data Files(*.bin *.dump);;All Files(*.*)</source>
|
||||
<translation>二进制Key文件(*.bin *.dump)二进制Data文件(*.bin *.dump);;所有文件(*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="307"/>
|
||||
<source>Plz select the location to save data file:</source>
|
||||
<translation>请选择文件保存的位置:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="308"/>
|
||||
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml)</source>
|
||||
<translation>二进制Data文件(*.bin *.dump);;文本Data文件(*.txt *.eml)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="314"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="327"/>
|
||||
<source>Failed to save to</source>
|
||||
<translation>无法保存至</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="320"/>
|
||||
<source>Plz select the location to save key file:</source>
|
||||
<translation>请选择key文件保存的位置:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="321"/>
|
||||
<source>Binary Key Files(*.bin *.dump)</source>
|
||||
<translation>二进制Key文件(*.bin *.dump)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="446"/>
|
||||
<source> Normally, the Block 0 of a typical Mifare card, which contains the UID, is locked during the manufacture. Users cannot write anything to Block 0 or set a new UID to a normal Mifare card.</source>
|
||||
<translation> 普通Mifare卡的Block0无法写入,UID也不能更改</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="447"/>
|
||||
<source> Chinese Magic Cards(aka UID Cards) are some special cards whose Block 0 are writeable. And you can change UID by writing to it.</source>
|
||||
<translation> UID卡(在国外叫Chinese Magic Card)的Block0可写,UID可变</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="449"/>
|
||||
<source>There are two versions of Chinese Magic Cards, the Gen1 and the Gen2.</source>
|
||||
<translation>国外把UID卡分为Chinese Magic Card Gen1和Gen2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="450"/>
|
||||
<source> Gen1:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="450"/>
|
||||
<source> also called UID card in China. It responses to some backdoor commands so you can access any blocks without password. The Proxmark3 has a bunch of related commands(csetblk, cgetblk, ...) to deal with this type of card, and my GUI also support these commands.</source>
|
||||
<translation> 指通常所说的UID卡,可以通过后门指令直接读写块而无需密码,在PM3和此GUI中有特殊命令处理这类卡片</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="451"/>
|
||||
<source> Gen2:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="451"/>
|
||||
<source> doesn't response to the backdoor commands, which means that a reader cannot detect whether it is a Chinese Magic Card or not by sending backdoor commands.</source>
|
||||
<translation> 这个叫法在国内比较罕见,在国外指CUID/FUID/UFUID这类对后门指令不响应的卡(防火墙卡)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="453"/>
|
||||
<source>There are some types of Chinese Magic Card Gen2.</source>
|
||||
<translation>以下是Gen2卡的详细介绍</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="454"/>
|
||||
<source> CUID Card:</source>
|
||||
<translation> CUID卡:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="454"/>
|
||||
<source> the Block 0 is writeable, you can write to this block repeatedly by normal wrbl command.</source>
|
||||
<translation> 可通过普通的写块命令来写Block0,可重复擦写</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="455"/>
|
||||
<source> (hf mf wrbl 0 A FFFFFFFFFFFF <the data you want to write>)</source>
|
||||
<translation> (hf mf wrbl 0 A FFFFFFFFFFFF <待写入数据>)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="456"/>
|
||||
<source> FUID Card:</source>
|
||||
<translation> FUID卡:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="456"/>
|
||||
<source> you can only write to Block 0 once. After that, it seems like a typical Mifare card(Block 0 cannot be written to).</source>
|
||||
<translation> Block0只能写入一次</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="457"/>
|
||||
<source> (some readers might try changing the Block 0, which could detect the CUID Card. In that case, you should use FUID card.)</source>
|
||||
<translation> (更高级的穿防火墙卡,可以过一些能识别出CUID卡的读卡器)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="458"/>
|
||||
<source> UFUID Card:</source>
|
||||
<translation> UFUID卡:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="458"/>
|
||||
<source> It behaves like a CUID card(or UID card? I'm not sure) before you send some special command to lock it. Once it is locked, you cannot change its Block 0(just like a typical Mifare card).</source>
|
||||
<translation> 锁卡前和普通UID/CUID卡一样可以反复读写Block0,用特殊命令锁卡后就和FUID卡一样了</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="460"/>
|
||||
<source> Seemingly, these Chinese Magic Cards are more easily to be compromised by Nested Attack(it takes little time to get an unknown key).</source>
|
||||
<translation> 所有UID卡都似乎更容易被Nested攻击破解</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="525"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="642"/>
|
||||
<source>Idle</source>
|
||||
<translation>空闲</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="532"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="541"/>
|
||||
<source>Sec</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="533"/>
|
||||
<source>Blk</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="542"/>
|
||||
<source>KeyA</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="543"/>
|
||||
<source>KeyB</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="579"/>
|
||||
<source>HW Version:</source>
|
||||
<translation>固件版本:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="581"/>
|
||||
<source>PM3:</source>
|
||||
<translation>连接状态:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="583"/>
|
||||
<source>State:</source>
|
||||
<translation>运行状态:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="638"/>
|
||||
<source>Running</source>
|
||||
<translation>运行中</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Mifare</name>
|
||||
<message>
|
||||
<source>info</source>
|
||||
<translation type="vanished">信息:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="289"/>
|
||||
<location filename="../module/mifare.cpp" line="386"/>
|
||||
<source>Success!</source>
|
||||
<translation>成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="289"/>
|
||||
<location filename="../module/mifare.cpp" line="293"/>
|
||||
<location filename="../module/mifare.cpp" line="386"/>
|
||||
<location filename="../module/mifare.cpp" line="390"/>
|
||||
<location filename="../module/mifare.cpp" line="425"/>
|
||||
<source>Info</source>
|
||||
<translation>信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="293"/>
|
||||
<location filename="../module/mifare.cpp" line="390"/>
|
||||
<source>Failed!</source>
|
||||
<translation>失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../module/mifare.cpp" line="425"/>
|
||||
<source>Failed to read card.</source>
|
||||
<translation>读卡失败。</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -1,57 +0,0 @@
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSettings>
|
||||
#include <QTranslator>
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
QSettings* settings = new QSettings("GUIsettings.ini", QSettings::IniFormat);
|
||||
QVariant lang = settings->value("lang", "null");
|
||||
if(lang == "null")
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
lang = "lang/en_US.qm";
|
||||
#else
|
||||
lang = "lang/en_US.ts";
|
||||
#endif
|
||||
QStringList langList;
|
||||
langList.append("English");
|
||||
langList.append("简体中文");
|
||||
QString seletedText = QInputDialog::getItem(&w, "", "Choose a language:", langList, 0, false);
|
||||
if(seletedText == "English")
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
lang = "lang/en_US.qm";
|
||||
#else
|
||||
lang = "lang/en_US.ts";
|
||||
#endif
|
||||
}
|
||||
else if(seletedText == "简体中文")
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
lang = "lang/zh_CN.qm";
|
||||
#else
|
||||
lang = "lang/zh_CN.ts";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
QTranslator* translator = new QTranslator(&w);
|
||||
if(translator->load(lang.toString()))
|
||||
{
|
||||
a.installTranslator(translator);
|
||||
settings->setValue("lang", lang);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(&w, "Error", "Can't load " + lang.toString() + " as translation file.");
|
||||
}
|
||||
delete settings;
|
||||
w.initUI();
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,855 +0,0 @@
|
||||
#include "mifare.h"
|
||||
|
||||
Mifare::Mifare(Ui::MainWindow *ui, Util *addr, QWidget *parent) : QObject(parent)
|
||||
{
|
||||
this->parent = parent;
|
||||
util = addr;
|
||||
this->ui = ui;
|
||||
cardType = card_1k;
|
||||
keyAList = new QStringList();
|
||||
keyBList = new QStringList();
|
||||
dataList = new QStringList();
|
||||
data_clearKey(); // fill with blank Qstring
|
||||
data_clearData(); // fill with blank Qstring
|
||||
dataPattern = new QRegExp("([0-9a-fA-F]{2} ){15}[0-9a-fA-F]{2}");
|
||||
chkKeyPattern = new QRegExp("\\|\\d{3}\\|.+\\|.+\\|");
|
||||
nestedKeyPattern = new QRegExp("\\|\\d{3}\\|.+\\|.+\\|.+\\|.+\\|");
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString Mifare::info(bool isRequiringOutput)
|
||||
{
|
||||
if(isRequiringOutput)
|
||||
{
|
||||
QString result = util->execCMDWithOutput("hf 14a info", 500);
|
||||
qDebug() << result << result.indexOf(QRegExp(ui->MF_RW_dataEdit->text()), 0);
|
||||
result.replace("UID :", "|");
|
||||
result.replace("ATQA :", "|");
|
||||
result.replace("SAK :", "|");
|
||||
result.replace("TYPE :", "|");
|
||||
QStringList lis = result.split("|");
|
||||
if(lis.length() > 4)
|
||||
{
|
||||
qDebug() << lis[1] + lis[2] + lis[3];
|
||||
return lis[1] + lis[2] + lis[3];
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
util->execCMD("hf 14a info");
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::chk()
|
||||
{
|
||||
QString result = util->execCMDWithOutput("hf mf chk *" + QString::number(cardType.type) + " ?", 1000 + cardType.type * 1000);
|
||||
qDebug() << result;
|
||||
|
||||
int offset = 0;
|
||||
QString tmp, tmp2;
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
offset = result.indexOf(*chkKeyPattern, offset);
|
||||
tmp = result.mid(offset, 39).toUpper();
|
||||
offset += 39;
|
||||
qDebug() << tmp << offset;
|
||||
tmp2 = tmp.mid(7, 12).trimmed();
|
||||
if(tmp2 != "?")
|
||||
keyAList->replace(i, tmp2);
|
||||
tmp2 = tmp.mid(24, 12).trimmed();
|
||||
if(tmp2 != "?")
|
||||
keyBList->replace(i, tmp2);
|
||||
}
|
||||
data_syncWithKeyWidget();
|
||||
}
|
||||
|
||||
void Mifare::nested()
|
||||
{
|
||||
QString result = util->execCMDWithOutput("hf mf nested " + QString::number(cardType.type) + " *");
|
||||
|
||||
int offset = 0;
|
||||
QString tmp;
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
offset = result.indexOf(*nestedKeyPattern, offset);
|
||||
tmp = result.mid(offset, 47).toUpper();
|
||||
offset += 47;
|
||||
if(tmp.at(23) == '1')
|
||||
keyAList->replace(i, tmp.mid(7, 12).trimmed());
|
||||
if(tmp.at(44) == '1')
|
||||
keyBList->replace(i, tmp.mid(28, 12).trimmed());
|
||||
}
|
||||
data_syncWithKeyWidget();
|
||||
}
|
||||
|
||||
void Mifare::hardnested()
|
||||
{
|
||||
MF_Attack_hardnestedDialog dialog(cardType.blocks);
|
||||
connect(&dialog, &MF_Attack_hardnestedDialog::sendCMD, util, &Util::execCMD);
|
||||
if(dialog.exec() == QDialog::Accepted)
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void Mifare::sniff()
|
||||
{
|
||||
util->execCMD("hf mf sniff");
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void Mifare::list()
|
||||
{
|
||||
util->execCMD("hf list mf");
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void Mifare::read()
|
||||
{
|
||||
int waitTime = 300;
|
||||
int currblk = ui->MF_RW_blockBox->currentText().toInt();
|
||||
QString result = util->execCMDWithOutput("hf mf rdbl "
|
||||
+ QString::number(currblk)
|
||||
+ " "
|
||||
+ ui->MF_RW_keyTypeBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyEdit->text(), waitTime);
|
||||
if(result.indexOf("isOk:01") != -1)
|
||||
{
|
||||
result = result.mid(result.indexOf(*dataPattern, 0), 47).toUpper();
|
||||
if((currblk < 128 && ((currblk + 1) % 4 == 0)) || ((currblk + 1) % 8 == 0)) // process key block
|
||||
{
|
||||
if(ui->MF_RW_keyTypeBox->currentText() == "A")
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
result = result.replace(i * 3, 2, ui->MF_RW_keyEdit->text().mid(i * 2, 2));
|
||||
}
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
QString tmpKey = result.right(18).replace(" ", "");
|
||||
result = util->execCMDWithOutput("hf mf rdbl "
|
||||
+ ui->MF_RW_keyTypeBox->currentText()
|
||||
+ " B "
|
||||
+ tmpKey, waitTime);
|
||||
if(result.indexOf("isOk:01") == -1)
|
||||
{
|
||||
result = ui->MF_RW_dataEdit->text();
|
||||
result = result.replace(30, 17, "?? ?? ?? ?? ?? ??");
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
result = result.replace(30 + i * 3, 2, ui->MF_RW_keyEdit->text().mid(i * 2, 2));
|
||||
}
|
||||
result = result.replace(0, 18, "?? ?? ?? ?? ?? ?? ");
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::readAll()
|
||||
{
|
||||
QString result;
|
||||
bool isKeyAValid;
|
||||
bool isKeyBValid;
|
||||
const int waitTime = 150;
|
||||
|
||||
QString tmp;
|
||||
int offset = 0;
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
result = "";
|
||||
isKeyAValid = false;
|
||||
isKeyBValid = false;
|
||||
|
||||
// check keys and read the first block of each sector
|
||||
if(data_isKeyValid(keyAList->at(i)))
|
||||
{
|
||||
result = util->execCMDWithOutput("hf mf rdsc "
|
||||
+ QString::number(i)
|
||||
+ " A "
|
||||
+ keyAList->at(i), waitTime);
|
||||
qDebug() << result;
|
||||
offset = result.indexOf("isOk:01");
|
||||
if(offset != -1)
|
||||
{
|
||||
isKeyAValid = true;
|
||||
for(int j = 0; j < cardType.blk[i]; j++)
|
||||
{
|
||||
offset = result.indexOf(*dataPattern, offset);
|
||||
tmp = result.mid(offset, 47).toUpper();
|
||||
offset += 47;
|
||||
qDebug() << tmp;
|
||||
tmp.replace(" ", "");
|
||||
dataList->replace(cardType.blks[i] + j, tmp);
|
||||
data_syncWithDataWidget(false, cardType.blks[i] + j);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(data_isKeyValid(keyBList->at(i)))
|
||||
{
|
||||
result = util->execCMDWithOutput("hf mf rdsc "
|
||||
+ QString::number(i)
|
||||
+ " B "
|
||||
+ keyBList->at(i), waitTime);
|
||||
qDebug() << result;
|
||||
offset = result.indexOf("isOk:01");
|
||||
if(offset != -1)
|
||||
{
|
||||
isKeyBValid = true;
|
||||
for(int j = 0; j < cardType.blk[i]; j++)
|
||||
{
|
||||
offset = result.indexOf(*dataPattern, offset);
|
||||
tmp = result.mid(offset, 47).toUpper();
|
||||
offset += 47;
|
||||
qDebug() << tmp;
|
||||
tmp.replace(" ", "");
|
||||
dataList->replace(cardType.blks[i] + j, tmp);
|
||||
data_syncWithDataWidget(false, cardType.blks[i] + j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isKeyAValid || isKeyBValid)
|
||||
{
|
||||
|
||||
// fill the MF_dataWidget with the known valid key
|
||||
//
|
||||
// check whether the MF_dataWidget contains the valid key,
|
||||
// and fill MF_keyWidget(when you only have KeyA but the ReadBlock output contains the KeyB)
|
||||
//
|
||||
// the structure is not symmetric, since you cannot get KeyA from output
|
||||
// this program will only process the provided KeyA(in MF_keyWidget)
|
||||
result = dataList->at(cardType.blks[i] + cardType.blk[i] - 1);
|
||||
if(isKeyAValid)
|
||||
{
|
||||
result.replace(0, 12, keyAList->at(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = result.replace(0, 12, "????????????");
|
||||
}
|
||||
dataList->replace(cardType.blks[i] + cardType.blk[i] - 1, result);
|
||||
|
||||
if(isKeyBValid)
|
||||
{
|
||||
result.replace(20, 12, keyBList->at(i));
|
||||
dataList->replace(cardType.blks[i] + cardType.blk[i] - 1, result);
|
||||
data_syncWithDataWidget(false, cardType.blks[i] + cardType.blk[i] - 1);
|
||||
}
|
||||
else // now isKeyAValid == true, the output might contains the KeyB
|
||||
{
|
||||
QString tmpKey = dataList->at(cardType.blks[i] + cardType.blk[i] - 1).right(12);
|
||||
result = util->execCMDWithOutput("hf mf rdbl "
|
||||
+ QString::number(cardType.blks[i] + cardType.blk[i] - 1)
|
||||
+ " B "
|
||||
+ tmpKey, waitTime);
|
||||
if(result.indexOf("isOk:01") != -1)
|
||||
{
|
||||
keyBList->replace(i, tmpKey);
|
||||
data_syncWithKeyWidget(false, i, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dataList->at(cardType.blks[i] + cardType.blk[i] - 1);
|
||||
result = result.replace(20, 12, "????????????");
|
||||
dataList->replace(cardType.blks[i] + cardType.blk[i] - 1, result);
|
||||
|
||||
}
|
||||
}
|
||||
data_syncWithDataWidget(false, cardType.blks[i] + cardType.blk[i] - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::write()
|
||||
{
|
||||
int waitTime = 300;
|
||||
QString result = util->execCMDWithOutput("hf mf wrbl "
|
||||
+ ui->MF_RW_blockBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyTypeBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyEdit->text()
|
||||
+ " "
|
||||
+ ui->MF_RW_dataEdit->text().replace(" ", ""), waitTime);
|
||||
if(result.indexOf("isOk:01") != -1)
|
||||
{
|
||||
QMessageBox::information(parent, tr("Info"), tr("Success!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(parent, tr("Info"), tr("Failed!"));
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::writeAll()
|
||||
{
|
||||
const int waitTime = 300;
|
||||
QString result;
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
for(int j = 0; j < cardType.blk[i]; j++)
|
||||
{
|
||||
result = ""; // if the KeyA is invalid and the result is not empty, the KeyB will not be tested.
|
||||
if(data_isDataValid(dataList->at(cardType.blks[i] + j)) != DATA_NOSPACE || dataList->at(cardType.blks[i] + j).contains('?'))
|
||||
continue;
|
||||
if(data_isKeyValid(keyAList->at(i)))
|
||||
{
|
||||
result = util->execCMDWithOutput("hf mf wrbl "
|
||||
+ QString::number(cardType.blks[i] + j)
|
||||
+ " A "
|
||||
+ keyAList->at(i)
|
||||
+ " "
|
||||
+ dataList->at(cardType.blks[i] + j), waitTime);
|
||||
}
|
||||
qDebug() << i << j << result.indexOf("isOk:01") << data_isKeyValid(keyBList->at(i));
|
||||
if(result.indexOf("isOk:01") == -1 && data_isKeyValid(keyBList->at(i)))
|
||||
{
|
||||
result = util->execCMDWithOutput("hf mf wrbl "
|
||||
+ QString::number(cardType.blks[i] + j)
|
||||
+ " B "
|
||||
+ keyBList->at(i)
|
||||
+ " "
|
||||
+ dataList->at(cardType.blks[i] + j), waitTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::readC()
|
||||
{
|
||||
int waitTime = 300;
|
||||
int currblk = ui->MF_RW_blockBox->currentText().toInt();
|
||||
QString result = util->execCMDWithOutput("hf mf cgetblk "
|
||||
+ QString::number(currblk), waitTime);
|
||||
if(result.indexOf("No chinese") == -1)
|
||||
{
|
||||
result = result.mid(result.indexOf(*dataPattern, 0), 47).toUpper();
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::readAllC()
|
||||
{
|
||||
QString result;
|
||||
const int waitTime = 150;
|
||||
|
||||
QString tmp;
|
||||
int offset = 0;
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
result = util->execCMDWithOutput("hf mf cgetsc "
|
||||
+ QString::number(i), waitTime);
|
||||
qDebug() << result;
|
||||
if(result.indexOf("No chinese") == -1)
|
||||
{
|
||||
offset = 0;
|
||||
for(int j = 0; j < cardType.blk[i]; j++)
|
||||
{
|
||||
offset = result.indexOf(*dataPattern, offset);
|
||||
tmp = result.mid(offset, 47).toUpper();
|
||||
offset += 47;
|
||||
qDebug() << tmp;
|
||||
tmp.replace(" ", "");
|
||||
dataList->replace(cardType.blks[i] + j, tmp);
|
||||
data_syncWithDataWidget(false, cardType.blks[i] + j);
|
||||
}
|
||||
keyAList->replace(i, dataList->at(cardType.blks[i] + cardType.blk[i] - 1).left(12));
|
||||
keyBList->replace(i, dataList->at(cardType.blks[i] + cardType.blk[i] - 1).right(12));
|
||||
data_syncWithKeyWidget(false, i, true);
|
||||
data_syncWithKeyWidget(false, i, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::writeC()
|
||||
{
|
||||
int waitTime = 150;
|
||||
QString result = util->execCMDWithOutput("hf mf csetblk "
|
||||
+ ui->MF_RW_blockBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_dataEdit->text().replace(" ", ""), waitTime);
|
||||
if(result.indexOf("No chinese") == -1)
|
||||
{
|
||||
QMessageBox::information(parent, tr("Info"), tr("Success!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(parent, tr("Info"), tr("Failed!"));
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::writeAllC()
|
||||
{
|
||||
const int waitTime = 150;
|
||||
QString result;
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
for(int j = 0; j < cardType.blk[i]; j++)
|
||||
{
|
||||
result = ""; // if the KeyA is invalid and the result is not empty, the KeyB will not be tested.
|
||||
if(data_isDataValid(dataList->at(cardType.blks[i] + j)) != DATA_NOSPACE || dataList->at(cardType.blks[i] + j).contains('?'))
|
||||
continue;
|
||||
result = util->execCMDWithOutput("hf mf csetblk "
|
||||
+ QString::number(cardType.blks[i] + j)
|
||||
+ " "
|
||||
+ dataList->at(cardType.blks[i] + j), waitTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::wipeC()
|
||||
{
|
||||
util->execCMD("hf mf cwipe "
|
||||
+ QString::number(cardType.type)
|
||||
+ " f");
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void Mifare::setParameterC()
|
||||
{
|
||||
QString result = info(true);
|
||||
if(result == "")
|
||||
QMessageBox::information(parent, tr("Info"), tr("Failed to read card."));
|
||||
else
|
||||
{
|
||||
QStringList lis = result.split("\r\n");
|
||||
lis[0].replace(" ", "");
|
||||
lis[1].replace(" ", "");
|
||||
lis[2].replace(" ", "");
|
||||
MF_UID_parameterDialog dialog(lis[0].toUpper(), lis[1].toUpper(), lis[2].mid(0, 2).toUpper());
|
||||
connect(&dialog, &MF_UID_parameterDialog::sendCMD, util, &Util::execCMD);
|
||||
if(dialog.exec() == QDialog::Accepted)
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::lockC()
|
||||
{
|
||||
util->execCMD("hf 14a raw -pa -b7 40");
|
||||
util->execCMD("hf 14a raw -pa 43");
|
||||
util->execCMD("hf 14a raw -pa E0 00 39 F7");
|
||||
util->execCMD("hf 14a raw -pa E1 00 E1 EE");
|
||||
util->execCMD("hf 14a raw -pa 85 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 18 47");
|
||||
util->execCMD("hf 14a raw 52");
|
||||
}
|
||||
|
||||
void Mifare::dump()
|
||||
{
|
||||
util->execCMD("hf mf dump");
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void Mifare::restore()
|
||||
{
|
||||
util->execCMD("hf mf restore");
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void Mifare::data_syncWithDataWidget(bool syncAll, int block)
|
||||
{
|
||||
QString tmp;
|
||||
if(syncAll)
|
||||
{
|
||||
for(int i = 0; i < cardType.blocks; i++)
|
||||
{
|
||||
tmp = "";
|
||||
if(dataList->at(i) != "")
|
||||
{
|
||||
tmp += dataList->at(i).mid(0, 2);
|
||||
for(int j = 1; j < 16; j++)
|
||||
{
|
||||
tmp += " ";
|
||||
tmp += dataList->at(i).mid(j * 2, 2);
|
||||
}
|
||||
}
|
||||
ui->MF_dataWidget->item(i, 2)->setText(tmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = "";
|
||||
if(dataList->at(block) != "")
|
||||
{
|
||||
tmp += dataList->at(block).mid(0, 2);
|
||||
for(int j = 1; j < 16; j++)
|
||||
{
|
||||
tmp += " ";
|
||||
tmp += dataList->at(block).mid(j * 2, 2);
|
||||
}
|
||||
}
|
||||
ui->MF_dataWidget->item(block, 2)->setText(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::data_syncWithKeyWidget(bool syncAll, int sector, bool isKeyA)
|
||||
{
|
||||
if(syncAll)
|
||||
{
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
ui->MF_keyWidget->item(i, 1)->setText(keyAList->at(i));
|
||||
ui->MF_keyWidget->item(i, 2)->setText(keyBList->at(i));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isKeyA)
|
||||
ui->MF_keyWidget->item(sector, 1)->setText(keyAList->at(sector));
|
||||
else
|
||||
ui->MF_keyWidget->item(sector, 2)->setText(keyBList->at(sector));
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::data_clearData()
|
||||
{
|
||||
dataList->clear();
|
||||
for(int i = 0; i < cardType.blocks; i++)
|
||||
dataList->append("");
|
||||
}
|
||||
|
||||
void Mifare::data_clearKey()
|
||||
{
|
||||
keyAList->clear();
|
||||
keyBList->clear();
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
keyAList->append("");
|
||||
keyBList->append("");
|
||||
}
|
||||
}
|
||||
|
||||
bool Mifare::data_isKeyValid(const QString& key)
|
||||
{
|
||||
if(key.length() != 12)
|
||||
return false;
|
||||
for(int i = 0; i < 12; i++)
|
||||
{
|
||||
if(!((key[i] >= '0' && key[i] <= '9') || (key[i] >= 'A' && key[i] <= 'F')))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Mifare::DataType Mifare::data_isDataValid(QString data) // "?" will not been processd there
|
||||
{
|
||||
if(data.length() == 47)
|
||||
{
|
||||
for(int i = 0; i < 47; i++)
|
||||
{
|
||||
if(i % 3 != 0)
|
||||
{
|
||||
if(!((data[i] >= '0' && data[i] <= '9') || (data[i] >= 'A' && data[i] <= 'F') || data[i] == '?'))
|
||||
return DATA_INVALID;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(data[i] != ' ')
|
||||
return DATA_INVALID;
|
||||
}
|
||||
}
|
||||
return DATA_WITHSPACE;
|
||||
}
|
||||
else if(data.length() == 32)
|
||||
{
|
||||
for(int i = 0; i < 32; i++)
|
||||
{
|
||||
if(!((data[i] >= '0' && data[i] <= '9') || (data[i] >= 'A' && data[i] <= 'F') || data[i] == '?'))
|
||||
return DATA_INVALID;
|
||||
}
|
||||
return DATA_NOSPACE;
|
||||
}
|
||||
else
|
||||
return DATA_INVALID;
|
||||
}
|
||||
|
||||
Mifare::CardType Mifare::getCardType()
|
||||
{
|
||||
return cardType;
|
||||
}
|
||||
|
||||
void Mifare::setCardType(int type)
|
||||
{
|
||||
if(type == 0 || type == 1 || type == 2 || type == 4)
|
||||
{
|
||||
if(type == 0)
|
||||
cardType = card_mini;
|
||||
else if(type == 1)
|
||||
cardType = card_1k;
|
||||
else if(type == 2)
|
||||
cardType = card_2k;
|
||||
else if(type == 4)
|
||||
cardType = card_4k;
|
||||
data_clearKey();
|
||||
data_clearData();
|
||||
}
|
||||
}
|
||||
|
||||
bool Mifare::data_loadDataFile(const QString& filename)
|
||||
{
|
||||
QFile file(filename, this);
|
||||
if(file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QByteArray buff;
|
||||
buff = file.read(10000);
|
||||
bool isBin = false;
|
||||
for(int i = 0; i < cardType.blocks * 16; i++) // Detect the file type
|
||||
{
|
||||
// qDebug() << (unsigned char)buff[i];
|
||||
if(!((buff[i] >= 'A' && buff[i] <= 'F') ||
|
||||
(buff[i] >= 'a' && buff[i] <= 'f') ||
|
||||
(buff[i] >= '0' && buff[i] <= '9') ||
|
||||
buff[i] == '\n' ||
|
||||
buff[i] == '\r'))
|
||||
{
|
||||
isBin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isBin)
|
||||
{
|
||||
if(file.size() < cardType.blocks * 16)
|
||||
return false;
|
||||
for(int i = 0; i < cardType.blocks; i++)
|
||||
{
|
||||
QString tmp = bin2text(buff, i, 16);
|
||||
dataList->replace(i, tmp.toUpper());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString tmp = buff.left(cardType.blocks * 34);
|
||||
QStringList tmpList = tmp.split("\r\n");
|
||||
for(int i = 0; i < cardType.blocks; i++)
|
||||
{
|
||||
dataList->replace(i, tmpList[i].toUpper());
|
||||
qDebug() << tmpList[i];
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
data_syncWithDataWidget();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Mifare::data_loadKeyFile(const QString& filename)
|
||||
{
|
||||
QFile file(filename, this);
|
||||
if(file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QByteArray buff;
|
||||
buff = file.read(10000);
|
||||
bool isKey = file.size() <= cardType.sectors * 14;
|
||||
if(isKey)
|
||||
{
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
QString tmp = bin2text(buff, i, 12);
|
||||
keyAList->replace(i, tmp.left(12).toUpper());
|
||||
keyBList->replace(i, tmp.right(12).toUpper());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
int blk = cardType.blks[i] + cardType.blk[i] - 1;
|
||||
QString tmp = bin2text(buff, blk, 16);
|
||||
keyAList->replace(i, tmp.left(12).toUpper());
|
||||
keyBList->replace(i, tmp.right(12).toUpper());
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
data_syncWithKeyWidget();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
QString Mifare::bin2text(const QByteArray& buff, int i, int length)
|
||||
{
|
||||
QString ret = "";
|
||||
char LByte, RByte;
|
||||
char map[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
||||
for(int j = 0; j < length; j++)
|
||||
{
|
||||
LByte = map[(unsigned char)buff[i * length + j] >> 4];
|
||||
RByte = map[(unsigned char)buff[i * length + j] & 0xF];
|
||||
ret += LByte;
|
||||
ret += RByte;
|
||||
}
|
||||
qDebug() << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Mifare::data_saveDataFile(const QString& filename, bool isBin)
|
||||
{
|
||||
QFile file(filename, this);
|
||||
if(file.open(QIODevice::WriteOnly))
|
||||
{
|
||||
QByteArray buff;
|
||||
QChar tmp;
|
||||
if(isBin)
|
||||
{
|
||||
for(int i = 0; i < cardType.blocks; i++)
|
||||
{
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
unsigned char Byt[2];
|
||||
for(int k = 0; k < 2; k++)
|
||||
{
|
||||
tmp = dataList->at(i).at(j * 2 + k).toUpper();
|
||||
if(tmp >= '0' && tmp <= '9')
|
||||
Byt[k] = tmp.toLatin1() - '0';
|
||||
else if(tmp >= 'A' && tmp <= 'F')
|
||||
Byt[k] = tmp.toLatin1() - 'A' + 10;
|
||||
}
|
||||
buff += (Byt[0] << 4) | Byt[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < cardType.blocks; i++)
|
||||
{
|
||||
buff += dataList->at(i);
|
||||
buff += "\r\n";
|
||||
}
|
||||
}
|
||||
bool ret = file.write(buff) != -1;
|
||||
file.close();
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Mifare::data_saveKeyFile(const QString& filename, bool isBin)
|
||||
{
|
||||
QFile file(filename, this);
|
||||
if(file.open(QIODevice::WriteOnly))
|
||||
{
|
||||
QByteArray buff;
|
||||
QChar tmp;
|
||||
if(isBin)
|
||||
{
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
for(int j = 0; j < 6; j++)
|
||||
{
|
||||
unsigned char Byt[2];
|
||||
for(int k = 0; k < 2; k++)
|
||||
{
|
||||
tmp = keyAList->at(i).at(j * 2 + k).toUpper();
|
||||
if(tmp >= '0' && tmp <= '9')
|
||||
Byt[k] = tmp.toLatin1() - '0';
|
||||
else if(tmp >= 'A' && tmp <= 'F')
|
||||
Byt[k] = tmp.toLatin1() - 'A' + 10;
|
||||
}
|
||||
buff += (Byt[0] << 4) | Byt[1];
|
||||
}
|
||||
for(int j = 0; j < 6; j++)
|
||||
{
|
||||
unsigned char Byt[2];
|
||||
for(int k = 0; k < 2; k++)
|
||||
{
|
||||
tmp = keyBList->at(i).at(j * 2 + k).toUpper();
|
||||
if(tmp >= '0' && tmp <= '9')
|
||||
Byt[k] = tmp.toLatin1() - '0';
|
||||
else if(tmp >= 'A' && tmp <= 'F')
|
||||
Byt[k] = tmp.toLatin1() - 'A' + 10;
|
||||
}
|
||||
buff += (Byt[0] << 4) | Byt[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
bool ret = file.write(buff) != -1;
|
||||
file.close();
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::data_key2Data()
|
||||
{
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
QString tmp = "";
|
||||
if(data_isKeyValid(keyAList->at(i)))
|
||||
tmp += keyAList->at(i);
|
||||
else
|
||||
tmp += "????????????";
|
||||
|
||||
if(dataList->at(cardType.blks[i] + cardType.blk[i] - 1) == "")
|
||||
tmp += "FF078069"; // default control bytes
|
||||
else
|
||||
tmp += dataList->at(cardType.blks[i] + cardType.blk[i] - 1).mid(12, 8);
|
||||
|
||||
if(data_isKeyValid(keyBList->at(i)))
|
||||
tmp += keyBList->at(i);
|
||||
else
|
||||
tmp += "????????????";
|
||||
|
||||
dataList->replace(cardType.blks[i] + cardType.blk[i] - 1, tmp);
|
||||
data_syncWithDataWidget();
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::data_data2Key()
|
||||
{
|
||||
for(int i = 0; i < cardType.sectors; i++)
|
||||
{
|
||||
if(dataList->at(cardType.blks[i] + cardType.blk[i] - 1) == "")
|
||||
{
|
||||
keyAList->replace(i, "????????????");
|
||||
keyBList->replace(i, "????????????");
|
||||
}
|
||||
else
|
||||
{
|
||||
keyAList->replace(i, dataList->at(cardType.blks[i] + cardType.blk[i] - 1).left(12));
|
||||
keyBList->replace(i, dataList->at(cardType.blks[i] + cardType.blk[i] - 1).right(12));
|
||||
}
|
||||
data_syncWithKeyWidget();
|
||||
}
|
||||
}
|
||||
|
||||
void Mifare::data_setData(int block, const QString& data)
|
||||
{
|
||||
dataList->replace(block, data);
|
||||
}
|
||||
|
||||
void Mifare::data_setKey(int sector, bool isKeyA, const QString& key)
|
||||
{
|
||||
if(isKeyA)
|
||||
keyAList->replace(sector, key);
|
||||
else
|
||||
keyBList->replace(sector, key);
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
#ifndef MIFARE_H
|
||||
#define MIFARE_H
|
||||
|
||||
#include "common/util.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "ui/mf_attack_hardnesteddialog.h"
|
||||
#include "ui/mf_uid_parameterdialog.h"
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QRegExp>
|
||||
#include <QMessageBox>
|
||||
class Mifare : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Mifare(Ui::MainWindow *ui, Util *addr, QWidget *parent = nullptr);
|
||||
|
||||
QString info(bool isRequiringOutput = false);
|
||||
void chk();
|
||||
void nested();
|
||||
void hardnested();
|
||||
void sniff();
|
||||
void list();
|
||||
void read();
|
||||
void readAll();
|
||||
void write();
|
||||
void writeAll();
|
||||
void dump();
|
||||
void restore();
|
||||
|
||||
enum DataType
|
||||
{
|
||||
DATA_INVALID,
|
||||
DATA_WITHSPACE,
|
||||
DATA_NOSPACE,
|
||||
};
|
||||
|
||||
struct CardType
|
||||
{
|
||||
int type;
|
||||
int sectors;
|
||||
int blocks;
|
||||
int blk[40];
|
||||
int blks[40];
|
||||
};
|
||||
|
||||
const CardType card_mini =
|
||||
{
|
||||
0,
|
||||
5,
|
||||
20,
|
||||
{4, 4, 4, 4, 4},
|
||||
{0, 4, 8, 12, 16}
|
||||
};
|
||||
const CardType card_1k =
|
||||
{
|
||||
1,
|
||||
16,
|
||||
64,
|
||||
{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
|
||||
{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60}
|
||||
};
|
||||
const CardType card_2k =
|
||||
{
|
||||
2,
|
||||
32,
|
||||
128,
|
||||
{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
|
||||
{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124}
|
||||
};
|
||||
const CardType card_4k =
|
||||
{
|
||||
4,
|
||||
40,
|
||||
256,
|
||||
{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16},
|
||||
{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 144, 160, 176, 192, 208, 224, 240}
|
||||
};
|
||||
|
||||
void data_clearData();
|
||||
void data_clearKey();
|
||||
bool data_isKeyValid(const QString &key);
|
||||
Mifare::DataType data_isDataValid(QString data);
|
||||
void data_syncWithDataWidget(bool syncAll = true, int block = 0);
|
||||
void data_syncWithKeyWidget(bool syncAll = true, int sector = 0, bool isKeyA = true);
|
||||
|
||||
CardType cardType;
|
||||
Mifare::CardType getCardType();
|
||||
void setCardType(int type);
|
||||
void writeAllC();
|
||||
void writeC();
|
||||
void readAllC();
|
||||
void readC();
|
||||
void wipeC();
|
||||
void setParameterC();
|
||||
|
||||
bool data_loadDataFile(const QString &filename);
|
||||
bool data_loadKeyFile(const QString &filename);
|
||||
bool data_saveDataFile(const QString& filename, bool isBin);
|
||||
bool data_saveKeyFile(const QString &filename, bool isBin);
|
||||
void data_key2Data();
|
||||
void data_data2Key();
|
||||
|
||||
void data_setData(int block, const QString &data);
|
||||
void data_setKey(int sector, bool isKeyA, const QString &key);
|
||||
void lockC();
|
||||
public slots:
|
||||
signals:
|
||||
|
||||
private:
|
||||
QWidget* parent;
|
||||
Ui::MainWindow *ui;
|
||||
Util* util;
|
||||
|
||||
QStringList* keyAList;
|
||||
QStringList* keyBList;
|
||||
QStringList* dataList;
|
||||
QRegExp* dataPattern;
|
||||
QRegExp* chkKeyPattern;
|
||||
QRegExp* nestedKeyPattern;
|
||||
QRegExp* UIDPattern;
|
||||
QString bin2text(const QByteArray &buff, int start, int length);
|
||||
};
|
||||
|
||||
#endif // MIFARE_H
|
||||
@@ -0,0 +1,72 @@
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
*.a
|
||||
*.core
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
*.so
|
||||
*.so.*
|
||||
*_pch.h.cpp
|
||||
*_resource.rc
|
||||
.#*
|
||||
*.*#
|
||||
core
|
||||
!core/
|
||||
tags
|
||||
.DS_Store
|
||||
.directory
|
||||
*.debug
|
||||
Makefile*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
ui_*.h
|
||||
qrc_*.cpp
|
||||
Thumbs.db
|
||||
*.res
|
||||
*.rc
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# xemacs temporary files
|
||||
*.flc
|
||||
|
||||
# Vim temporary files
|
||||
.*.swp
|
||||
|
||||
# Visual Studio generated files
|
||||
*.ib_pdb_index
|
||||
*.idb
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.sln
|
||||
*.suo
|
||||
*.vcproj
|
||||
*vcproj.*.*.user
|
||||
*.ncb
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.vcxproj
|
||||
*vcxproj.*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
# Python byte code
|
||||
*.pyc
|
||||
|
||||
# Binaries
|
||||
# --------
|
||||
*.dll
|
||||
*.exe
|
||||
|
||||
@@ -16,37 +16,53 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
common/myeventfilter.cpp \
|
||||
main.cpp \
|
||||
common/pm3process.cpp \
|
||||
common/util.cpp \
|
||||
module/lf.cpp \
|
||||
module/mifare.cpp \
|
||||
module/t55xxtab.cpp \
|
||||
ui/mf_trailerdecoderdialog.cpp \
|
||||
ui/mf_sim_simdialog.cpp \
|
||||
ui/mf_uid_parameterdialog.cpp \
|
||||
ui/mainwindow.cpp \
|
||||
ui/mf_attack_hardnesteddialog.cpp \
|
||||
|
||||
HEADERS += \
|
||||
common/myeventfilter.h \
|
||||
common/pm3process.h \
|
||||
common/util.h \
|
||||
module/lf.h \
|
||||
module/mifare.h \
|
||||
module/t55xxtab.h \
|
||||
ui/mf_trailerdecoderdialog.h \
|
||||
ui/mf_sim_simdialog.h \
|
||||
ui/mf_uid_parameterdialog.h \
|
||||
ui/mainwindow.h \
|
||||
ui/mf_attack_hardnesteddialog.h \
|
||||
|
||||
FORMS += \
|
||||
ui/t55xxtab.ui \
|
||||
ui/mf_trailerdecoderdialog.ui \
|
||||
ui/mf_sim_simdialog.ui \
|
||||
ui/mf_uid_parameterdialog.ui \
|
||||
ui/mainwindow.ui \
|
||||
ui/mf_attack_hardnesteddialog.ui
|
||||
|
||||
TRANSLATIONS += \
|
||||
lang/zh_CN.ts \
|
||||
lang/en_US.ts
|
||||
i18n/zh_CN.ts \
|
||||
i18n/en_US.ts
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
VERSION = 0.1
|
||||
VERSION = 0.2.4
|
||||
QMAKE_TARGET_PRODUCT = "Proxmark3GUI"
|
||||
QMAKE_TARGET_DESCRIPTION = "Proxmark3GUI"
|
||||
QMAKE_TARGET_COMPANY = "wh201906"
|
||||
|
||||
RESOURCES += \
|
||||
i18n/language.qrc
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "myeventfilter.h"
|
||||
|
||||
MyEventFilter::MyEventFilter(QEvent::Type filter)
|
||||
{
|
||||
targetEventType = filter;
|
||||
}
|
||||
|
||||
bool MyEventFilter::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if(event->type() == targetEventType)
|
||||
emit eventHappened(obj, *event);
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef MYEVENTFILTER_H
|
||||
#define MYEVENTFILTER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QKeyEvent>
|
||||
|
||||
class MyEventFilter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MyEventFilter(QEvent::Type filter);
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
signals:
|
||||
void eventHappened(QObject* obj_addr, QEvent& event);
|
||||
private:
|
||||
QEvent::Type targetEventType;
|
||||
};
|
||||
|
||||
#endif // MYEVENTFILTER_H
|
||||
@@ -12,33 +12,62 @@ PM3Process::PM3Process(QThread* thread, QObject* parent): QProcess(parent)
|
||||
serialListener->setTimerType(Qt::VeryCoarseTimer);
|
||||
connect(serialListener, &QTimer::timeout, this, &PM3Process::onTimeout);
|
||||
connect(this, &PM3Process::readyRead, this, &PM3Process::onReadyRead);
|
||||
portInfo = nullptr;
|
||||
}
|
||||
|
||||
void PM3Process::connectPM3(const QString path, const QString port)
|
||||
void PM3Process::connectPM3(const QString& path, const QStringList args)
|
||||
{
|
||||
QString result;
|
||||
Util::ClientType clientType;
|
||||
setRequiringOutput(true);
|
||||
|
||||
// stash for reconnect
|
||||
currPath = path;
|
||||
currArgs = args;
|
||||
|
||||
// using "-f" option to make the client output flushed after every print.
|
||||
start(path, QStringList() << port << "-f", QProcess::Unbuffered | QProcess::ReadWrite);
|
||||
start(path, args, QProcess::Unbuffered | QProcess::ReadWrite | QProcess::Text);
|
||||
if(waitForStarted(10000))
|
||||
{
|
||||
while(waitForReadyRead(1000))
|
||||
;
|
||||
waitForReadyRead(10000);
|
||||
setRequiringOutput(false);
|
||||
QString result = *requiredOutput;
|
||||
result = *requiredOutput;
|
||||
if(result.indexOf("[=]") != -1)
|
||||
{
|
||||
clientType = Util::CLIENTTYPE_ICEMAN;
|
||||
setRequiringOutput(true);
|
||||
write("hw version\n");
|
||||
for(int i = 0; i < 50; i++)
|
||||
{
|
||||
waitForReadyRead(200);
|
||||
result += *requiredOutput;
|
||||
if(result.indexOf("os: ") != -1)
|
||||
break;
|
||||
}
|
||||
setRequiringOutput(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientType = Util::CLIENTTYPE_OFFICIAL;
|
||||
}
|
||||
if(result.indexOf("os: ") != -1) // make sure the PM3 is connected
|
||||
{
|
||||
emit changeClientType(clientType);
|
||||
result = result.mid(result.indexOf("os: "));
|
||||
result = result.left(result.indexOf("\r\n"));
|
||||
result = result.mid(3, result.lastIndexOf(" ") - 3);
|
||||
result = result.left(result.indexOf("\n"));
|
||||
result = result.mid(4, result.indexOf(" ", 4) - 4);
|
||||
emit PM3StatedChanged(true, result);
|
||||
setSerialListener(port, true);
|
||||
}
|
||||
else
|
||||
kill();
|
||||
}
|
||||
}
|
||||
|
||||
void PM3Process::reconnectPM3()
|
||||
{
|
||||
connectPM3(currPath, currArgs);
|
||||
}
|
||||
|
||||
void PM3Process::setRequiringOutput(bool st)
|
||||
{
|
||||
isRequiringOutput = st;
|
||||
@@ -55,6 +84,7 @@ void PM3Process::setSerialListener(const QString& name, bool state)
|
||||
{
|
||||
if(state)
|
||||
{
|
||||
currPort = name;
|
||||
portInfo = new QSerialPortInfo(name);
|
||||
serialListener->start();
|
||||
qDebug() << serialListener->thread();
|
||||
@@ -62,18 +92,29 @@ void PM3Process::setSerialListener(const QString& name, bool state)
|
||||
else
|
||||
{
|
||||
serialListener->stop();
|
||||
if(portInfo != nullptr)
|
||||
{
|
||||
delete portInfo;
|
||||
portInfo = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PM3Process::setSerialListener(bool state)
|
||||
{
|
||||
setSerialListener(currPort, state);
|
||||
}
|
||||
|
||||
void PM3Process::onTimeout() //when the proxmark3 client is unexpectedly terminated or the PM3 hardware is removed, the isBusy() will return false(only tested on Windows);
|
||||
{
|
||||
// isBusy() is a deprecated function because it will block the serial port when the port is not in use.
|
||||
// However, the PM3 client is supposed to use the target serial port exclusively, so it should be fine
|
||||
// isBusy() will always return false on Raspbian, in this case, check "Keep the client active" in the Settings panel.
|
||||
//
|
||||
// qDebug()<<portInfo->isBusy();
|
||||
if(!portInfo->isBusy())
|
||||
{
|
||||
kill();
|
||||
emit PM3StatedChanged(false);
|
||||
setSerialListener("", false);
|
||||
killPM3();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +123,6 @@ void PM3Process::testThread()
|
||||
qDebug() << "PM3:" << QThread::currentThread();
|
||||
}
|
||||
|
||||
|
||||
qint64 PM3Process::write(QString data)
|
||||
{
|
||||
return QProcess::write(data.toLatin1());
|
||||
@@ -100,3 +140,23 @@ void PM3Process::onReadyRead()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void PM3Process::setProcEnv(const QStringList* env)
|
||||
{
|
||||
// qDebug() << "passed Env List" << *env;
|
||||
this->setEnvironment(*env);
|
||||
// qDebug() << "final Env List" << processEnvironment().toStringList();
|
||||
}
|
||||
|
||||
void PM3Process::setWorkingDir(const QString& dir)
|
||||
{
|
||||
// the working directory cannot be the default, or the client will failed to load the dll
|
||||
this->setWorkingDirectory(dir);
|
||||
}
|
||||
|
||||
void PM3Process::killPM3()
|
||||
{
|
||||
kill();
|
||||
emit PM3StatedChanged(false);
|
||||
setSerialListener(false);
|
||||
}
|
||||
@@ -8,6 +8,10 @@
|
||||
#include <QTimer>
|
||||
#include <QtSerialPort/QSerialPortInfo>
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QDir>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
class PM3Process : public QProcess
|
||||
{
|
||||
@@ -19,9 +23,14 @@ public:
|
||||
void testThread();
|
||||
|
||||
public slots:
|
||||
void connectPM3(const QString path, const QString port);
|
||||
void connectPM3(const QString& path, const QStringList args);
|
||||
void setSerialListener(const QString& name, bool state);
|
||||
void setSerialListener(bool state);
|
||||
qint64 write(QString data);
|
||||
void reconnectPM3();
|
||||
void setProcEnv(const QStringList* env);
|
||||
void setWorkingDir(const QString& dir);
|
||||
void killPM3();
|
||||
private slots:
|
||||
void onTimeout();
|
||||
void onReadyRead();
|
||||
@@ -31,9 +40,14 @@ private:
|
||||
void setRequiringOutput(bool st);// It only works in this class now
|
||||
QTimer* serialListener;
|
||||
QSerialPortInfo* portInfo;
|
||||
QString currPath;
|
||||
QString currPort = "";
|
||||
QStringList currArgs;
|
||||
|
||||
signals:
|
||||
void PM3StatedChanged(bool st, QString info = "");
|
||||
void newOutput(QString output);
|
||||
void PM3StatedChanged(bool st, const QString& info = "");
|
||||
void newOutput(const QString& output);
|
||||
void changeClientType(Util::ClientType);
|
||||
};
|
||||
|
||||
#endif // PM3PROCESS_H
|
||||
@@ -0,0 +1,153 @@
|
||||
#include "util.h"
|
||||
|
||||
Util::ClientType Util::clientType = CLIENTTYPE_OFFICIAL;
|
||||
|
||||
int Util::rawTabIndex = 0;
|
||||
QDockWidget* Util::rawDockPtr = nullptr;
|
||||
Ui::MainWindow* Util::ui = nullptr;
|
||||
|
||||
|
||||
Util::Util(QObject *parent) : QObject(parent)
|
||||
{
|
||||
isRequiringOutput = false;
|
||||
requiredOutput = new QString();
|
||||
timeStamp = QTime::currentTime();
|
||||
qRegisterMetaType<Util::ClientType>("Util::ClientType");
|
||||
}
|
||||
|
||||
|
||||
void Util::processOutput(const QString& output)
|
||||
{
|
||||
// qDebug() << "Util::processOutput:" << output;
|
||||
if(isRequiringOutput)
|
||||
{
|
||||
requiredOutput->append(output);
|
||||
timeStamp = QTime::currentTime();
|
||||
}
|
||||
emit refreshOutput(output);
|
||||
}
|
||||
|
||||
void Util::execCMD(const QString& cmd)
|
||||
{
|
||||
qDebug() << "executing: " << cmd;
|
||||
if(isRunning)
|
||||
emit write(cmd + "\n");
|
||||
}
|
||||
|
||||
QString Util::execCMDWithOutput(const QString& cmd, ReturnTrigger trigger, bool rawOutput)
|
||||
{
|
||||
// if the trigger is empty, this function will wait trigger.waitTime then return all outputs during the wait time.
|
||||
// otherwise, this function will return empty string if no trigger is detected, or return outputs if any trigger is detected.
|
||||
// the waitTime will be refreshed if the client have new outputs
|
||||
bool isResultFound = false;
|
||||
QRegularExpression re;
|
||||
re.setPatternOptions(QRegularExpression::DotMatchesEverythingOption);
|
||||
|
||||
if(!isRunning)
|
||||
return "";
|
||||
QTime currTime = QTime::currentTime();
|
||||
QTime targetTime = QTime::currentTime().addMSecs(trigger.waitTime);
|
||||
isRequiringOutput = true;
|
||||
requiredOutput->clear();
|
||||
execCMD(cmd);
|
||||
while(QTime::currentTime() < targetTime)
|
||||
{
|
||||
if(!isRunning)
|
||||
break;
|
||||
QApplication::processEvents();
|
||||
// qDebug() << "currOutput:" << *requiredOutput;
|
||||
for(QString otpt : trigger.expectedOutputs)
|
||||
{
|
||||
re.setPattern(otpt);
|
||||
isResultFound = re.match(*requiredOutput).hasMatch();
|
||||
if(isResultFound)
|
||||
{
|
||||
qDebug() << "output Matched: " << *requiredOutput;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isResultFound)
|
||||
{
|
||||
delay(200);
|
||||
break;
|
||||
}
|
||||
if(timeStamp > currTime) //has new output
|
||||
{
|
||||
currTime = timeStamp;
|
||||
targetTime = timeStamp.addMSecs(trigger.waitTime);
|
||||
}
|
||||
}
|
||||
isRequiringOutput = false;
|
||||
|
||||
// For functions without expected outputs in the return trigger, the result is the raw output.
|
||||
// For functions with expected outputs in the return trigger,
|
||||
// if rawOutput=true, the result is the raw output,
|
||||
// otherwise, if the raw output contains one of the expected outputs, the result is the raw output,
|
||||
// otherwise, the result is empty(as a failed flag).
|
||||
return (trigger.expectedOutputs.isEmpty() || isResultFound || rawOutput ? *requiredOutput : "");
|
||||
}
|
||||
|
||||
void Util::delay(unsigned int msec)
|
||||
{
|
||||
QTime timer = QTime::currentTime().addMSecs(msec);
|
||||
while(QTime::currentTime() < timer)
|
||||
QApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
}
|
||||
|
||||
Util::ClientType Util::getClientType()
|
||||
{
|
||||
return Util::clientType;
|
||||
}
|
||||
|
||||
void Util::setClientType(Util::ClientType clientType)
|
||||
{
|
||||
Util::clientType = clientType;
|
||||
}
|
||||
|
||||
void Util::setRunningState(bool st)
|
||||
{
|
||||
this->isRunning = st;
|
||||
}
|
||||
|
||||
bool Util::chooseLanguage(QSettings* guiSettings, QMainWindow* window)
|
||||
{
|
||||
// make sure the GUISettings is not in any group
|
||||
QSettings* langSettings = new QSettings(":/i18n/languages.ini", QSettings::IniFormat);
|
||||
QMap<QString, QString> langMap;
|
||||
langSettings->setIniCodec("UTF-8");
|
||||
langSettings->beginGroup("Languages");
|
||||
QStringList langList = langSettings->allKeys();
|
||||
for(int i = 0; i < langList.size(); i++)
|
||||
langMap.insert(langSettings->value(langList[i]).toString(), langList[i]);
|
||||
langSettings->endGroup();
|
||||
delete langSettings;
|
||||
bool isOk = false;
|
||||
QString selectedText = QInputDialog::getItem(window, "", "Choose a language:", langMap.keys(), 0, false, &isOk);
|
||||
if(isOk)
|
||||
{
|
||||
guiSettings->beginGroup("lang");
|
||||
guiSettings->setValue("language", langMap[selectedText]);
|
||||
guiSettings->endGroup();
|
||||
guiSettings->sync();
|
||||
}
|
||||
return isOk;
|
||||
}
|
||||
|
||||
void Util::gotoRawTab()
|
||||
{
|
||||
Util::ui->funcTab->setCurrentIndex(Util::rawTabIndex);
|
||||
Util::rawDockPtr->setVisible(true);
|
||||
Util::rawDockPtr->raise();
|
||||
}
|
||||
|
||||
void Util::setUI(Ui::MainWindow *ui)
|
||||
{
|
||||
Util::ui = ui;
|
||||
}
|
||||
|
||||
|
||||
void Util::setRawTab(QDockWidget *dockPtr, int tabIndex)
|
||||
{
|
||||
Util::rawDockPtr = dockPtr;
|
||||
Util::rawTabIndex = tabIndex;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
#include <QThread>
|
||||
#include <QApplication>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
#include <QMetaType>
|
||||
#include <QRegularExpression>
|
||||
#include <QSettings>
|
||||
#include <QMainWindow>
|
||||
#include <QInputDialog>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
class Util : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum ClientType
|
||||
{
|
||||
CLIENTTYPE_OFFICIAL,
|
||||
CLIENTTYPE_ICEMAN,
|
||||
};
|
||||
|
||||
struct ReturnTrigger
|
||||
{
|
||||
unsigned long waitTime;
|
||||
QStringList expectedOutputs;
|
||||
ReturnTrigger(unsigned long time)
|
||||
{
|
||||
waitTime = time;
|
||||
expectedOutputs = QStringList();
|
||||
}
|
||||
ReturnTrigger(const QStringList& outputs)
|
||||
{
|
||||
waitTime = 10000;
|
||||
expectedOutputs = outputs;
|
||||
}
|
||||
ReturnTrigger(unsigned long time, const QStringList& outputs)
|
||||
{
|
||||
waitTime = time;
|
||||
expectedOutputs = outputs;
|
||||
}
|
||||
};
|
||||
|
||||
Q_ENUM(Util::ClientType)
|
||||
|
||||
explicit Util(QObject *parent = nullptr);
|
||||
|
||||
void execCMD(const QString& cmd);
|
||||
QString execCMDWithOutput(const QString& cmd, ReturnTrigger trigger = 10000, bool rawOutput = false);
|
||||
void delay(unsigned int msec);
|
||||
static ClientType getClientType();
|
||||
static int rawTabIndex;
|
||||
static QDockWidget* rawDockPtr;
|
||||
static bool chooseLanguage(QSettings *guiSettings, QMainWindow *window);
|
||||
public slots:
|
||||
void processOutput(const QString& output);
|
||||
static void setClientType(Util::ClientType clientType);
|
||||
void setRunningState(bool st);
|
||||
static void gotoRawTab();
|
||||
static void setUI(Ui::MainWindow *ui);
|
||||
static void setRawTab(QDockWidget* dockPtr, int tabIndex);
|
||||
private:
|
||||
bool isRequiringOutput;
|
||||
bool isRunning;
|
||||
QString* requiredOutput;
|
||||
QTime timeStamp;
|
||||
static ClientType clientType;
|
||||
static Ui::MainWindow *ui;
|
||||
signals:
|
||||
void refreshOutput(const QString& output);
|
||||
void write(QString data); // connected to PM3Process::write(QString data);
|
||||
};
|
||||
|
||||
#endif // UTIL_H
|
||||
@@ -0,0 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="/i18n">
|
||||
<file>en_US.qm</file>
|
||||
<file>languages.ini</file>
|
||||
<file>zh_CN.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,4 @@
|
||||
[Languages]
|
||||
en_US=English
|
||||
zh_CN=简体中文
|
||||
ext=Load from external file
|
||||
@@ -0,0 +1,63 @@
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSettings>
|
||||
#include <QTranslator>
|
||||
#include <QMessageBox>
|
||||
#include <QTextCodec>
|
||||
#include <QDir>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// A trick to handle non-ascii path
|
||||
// The application cannot find the plugins when the path contains non ascii characters.
|
||||
// However, the plugins will be load after creating MainWindow(or QApplication?).
|
||||
// QDir will handle the path correctly.
|
||||
QDir* pluginDir = new QDir;
|
||||
if(pluginDir->cd("plugins")) // has plugins folder
|
||||
{
|
||||
qputenv("QT_PLUGIN_PATH", pluginDir->absolutePath().toLocal8Bit());
|
||||
}
|
||||
delete pluginDir;
|
||||
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
|
||||
QSettings* settings = new QSettings("GUIsettings.ini", QSettings::IniFormat);
|
||||
settings->setIniCodec("UTF-8");
|
||||
settings->beginGroup("lang");
|
||||
QString currLang = settings->value("language", "").toString();
|
||||
settings->endGroup();
|
||||
if(currLang == "")
|
||||
{
|
||||
if(Util::chooseLanguage(settings, &w))
|
||||
{
|
||||
settings->beginGroup("lang");
|
||||
currLang = settings->value("language", "").toString();
|
||||
settings->endGroup();
|
||||
}
|
||||
else
|
||||
currLang = "en_US";
|
||||
}
|
||||
if(currLang == "ext")
|
||||
currLang = QFileDialog::getOpenFileName(nullptr, "Select the translation file:");
|
||||
else
|
||||
currLang = ":/i18n/" + currLang + ".qm";
|
||||
QTranslator* translator = new QTranslator(&w);
|
||||
if(translator->load(currLang))
|
||||
{
|
||||
a.installTranslator(translator);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(&w, "Error", "Can't load " + currLang + " as translation file.");
|
||||
}
|
||||
delete settings;
|
||||
w.initUI();
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
#include "lf.h"
|
||||
#include <QJsonArray>
|
||||
|
||||
const LF::LFConfig LF::defaultLFConfig;
|
||||
|
||||
LF::LF(Ui::MainWindow *ui, Util *addr, QWidget *parent): QObject(parent)
|
||||
{
|
||||
this->parent = parent;
|
||||
util = addr;
|
||||
this->ui = ui;
|
||||
|
||||
LFconfigPattern = new QRegularExpression("(\\d+)|Yes|No");
|
||||
currLFConfig = defaultLFConfig;
|
||||
}
|
||||
|
||||
void LF::read()
|
||||
{
|
||||
QVariantMap config = configMap["read"].toMap();
|
||||
util->execCMD(config["cmd"].toString());
|
||||
Util::gotoRawTab();
|
||||
util->execCMD(config["show cmd"].toString());
|
||||
}
|
||||
|
||||
void LF::sniff()
|
||||
{
|
||||
QVariantMap config = configMap["sniff"].toMap();
|
||||
util->execCMD(config["cmd"].toString());
|
||||
Util::gotoRawTab();
|
||||
util->execCMD(config["show cmd"].toString());
|
||||
}
|
||||
|
||||
void LF::search()
|
||||
{
|
||||
QVariantMap config = configMap["search"].toMap();
|
||||
util->execCMD(config["cmd"].toString());
|
||||
Util::gotoRawTab();
|
||||
}
|
||||
|
||||
void LF::tune()
|
||||
{
|
||||
QVariantMap config = configMap["tune"].toMap();
|
||||
QString cmd = config["cmd"].toString();
|
||||
cmd.replace("<divisor>", QString::number(currLFConfig.divisor));
|
||||
util->execCMD(cmd);
|
||||
Util::gotoRawTab();
|
||||
}
|
||||
|
||||
bool LF::getLFConfig_helper(const QVariantMap& map, QString& str, int* result)
|
||||
{
|
||||
int len;
|
||||
QString flag = map["flag"].toString();
|
||||
QRegularExpressionMatch reMatch;
|
||||
if(!str.contains(flag))
|
||||
return false;
|
||||
len = str.length() - (str.indexOf(flag) + flag.length());
|
||||
str = str.right(len);
|
||||
if(map.contains("replace"))
|
||||
{
|
||||
QVariantMap table = map["replace"].toMap();
|
||||
for(auto it = table.begin(); it != table.end(); it++)
|
||||
{
|
||||
str.replace(it.key(), it.value().toString());
|
||||
}
|
||||
}
|
||||
reMatch = QRegularExpression(map["pattern"].toString()).match(str);
|
||||
if(!reMatch.hasMatch())
|
||||
return false;
|
||||
*result = reMatch.captured().toInt();
|
||||
qDebug() << *result;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
void LF::getLFConfig()
|
||||
{
|
||||
|
||||
QRegularExpressionMatch reMatch;
|
||||
QString result;
|
||||
QStringList resultList;
|
||||
int start, end, temp;
|
||||
QVariantMap config = configMap["get config"].toMap();
|
||||
QString cmd = config["cmd"].toString();
|
||||
result = util->execCMDWithOutput(cmd, 400);
|
||||
start = result.indexOf(config["field start"].toString());
|
||||
end = result.indexOf(config["field end"].toString());
|
||||
result = result.mid(start, end - start);
|
||||
#if (QT_VERSION <= QT_VERSION_CHECK(5,14,0))
|
||||
resultList = result.split("\n", QString::SkipEmptyParts);
|
||||
#else
|
||||
resultList = result.split("\n", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
qDebug() << "LF CONFIG GET\n" << resultList;
|
||||
for(auto it = resultList.begin(); it != resultList.end(); it++)
|
||||
{
|
||||
if(getLFConfig_helper(config["divisor"].toMap(), *it, &temp))
|
||||
currLFConfig.divisor = temp;
|
||||
else if(getLFConfig_helper(config["bits per sample"].toMap(), *it, &temp))
|
||||
currLFConfig.bitsPerSample = temp;
|
||||
else if(getLFConfig_helper(config["decimation"].toMap(), *it, &temp))
|
||||
currLFConfig.decimation = temp;
|
||||
else if(getLFConfig_helper(config["averaging"].toMap(), *it, &temp))
|
||||
currLFConfig.averaging = (bool)temp;
|
||||
else if(getLFConfig_helper(config["trigger threshold"].toMap(), *it, &temp))
|
||||
currLFConfig.triggerThreshold = temp;
|
||||
else if(getLFConfig_helper(config["samples to skip"].toMap(), *it, &temp))
|
||||
currLFConfig.samplesToSkip = temp;
|
||||
}
|
||||
syncWithUI();
|
||||
}
|
||||
|
||||
void LF::setLFConfig(LF::LFConfig lfconfig)
|
||||
{
|
||||
currLFConfig = lfconfig;
|
||||
QVariantMap config = configMap["set config"].toMap();
|
||||
QString cmd = config["cmd"].toString();
|
||||
cmd.replace("<divisor>", QString::number(currLFConfig.divisor));
|
||||
cmd.replace("<bits per sample>", QString::number(currLFConfig.bitsPerSample));
|
||||
cmd.replace("<decimation>", QString::number(currLFConfig.decimation));
|
||||
cmd.replace("<averaging>", currLFConfig.averaging ? "1" : "0");
|
||||
cmd.replace("<trigger threshold>", QString::number(currLFConfig.triggerThreshold));
|
||||
cmd.replace("<samples to skip>", QString::number(currLFConfig.samplesToSkip));
|
||||
util->execCMDWithOutput(cmd, 500);
|
||||
cmd = config["divisor cmd"].toString();
|
||||
cmd.replace("<divisor>", QString::number(currLFConfig.divisor));
|
||||
util->execCMDWithOutput(cmd, 500);
|
||||
}
|
||||
|
||||
void LF::resetLFConfig()
|
||||
{
|
||||
setLFConfig(defaultLFConfig);
|
||||
getLFConfig();
|
||||
}
|
||||
|
||||
float LF::divisor2Freq(uint8_t divisor)
|
||||
{
|
||||
return (12000.0 / (divisor + 1.0));
|
||||
}
|
||||
|
||||
uint8_t LF::freq2Divisor(float freq)
|
||||
{
|
||||
return ((uint16_t)(12000.0 / freq + 0.5) - 1); // uint16_t for (divisor + 1) = 256
|
||||
}
|
||||
|
||||
void LF::syncWithUI()
|
||||
{
|
||||
ui->LF_LFConf_freqDivisorBox->setValue(currLFConfig.divisor); // will trigger valueChanged()
|
||||
ui->LF_LFConf_bitsPerSampleBox->setValue(currLFConfig.bitsPerSample);
|
||||
ui->LF_LFConf_decimationBox->setValue(currLFConfig.decimation);
|
||||
ui->LF_LFConf_averagingBox->setChecked(currLFConfig.averaging);
|
||||
ui->LF_LFConf_thresholdBox->setValue(currLFConfig.triggerThreshold);
|
||||
ui->LF_LFConf_skipsBox->setValue(currLFConfig.samplesToSkip);
|
||||
}
|
||||
|
||||
void LF::setConfigMap(const QVariantMap& configMap)
|
||||
{
|
||||
this->configMap = configMap;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
#ifndef LF_H
|
||||
#define LF_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "common/util.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
class LF : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LF(Ui::MainWindow *ui, Util *addr, QWidget *parent = nullptr);
|
||||
|
||||
struct LFConfig
|
||||
{
|
||||
uint8_t divisor;
|
||||
uint8_t bitsPerSample;
|
||||
uint8_t decimation;
|
||||
bool averaging;
|
||||
uint8_t triggerThreshold;
|
||||
uint16_t samplesToSkip;
|
||||
};
|
||||
|
||||
static constexpr LFConfig defaultLFConfig =
|
||||
{
|
||||
95,
|
||||
8,
|
||||
1,
|
||||
true,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
void read();
|
||||
void sniff();
|
||||
void search();
|
||||
void tune();
|
||||
void getLFConfig();
|
||||
void setLFConfig(LF::LFConfig lfconfig);
|
||||
void resetLFConfig();
|
||||
static float divisor2Freq(uint8_t divisor);
|
||||
static uint8_t freq2Divisor(float freq);
|
||||
|
||||
void setConfigMap(const QVariantMap &configMap);
|
||||
private:
|
||||
QWidget* parent;
|
||||
Ui::MainWindow *ui;
|
||||
Util* util;
|
||||
LFConfig currLFConfig;
|
||||
QRegularExpression* LFconfigPattern;
|
||||
QVariantMap configMap;
|
||||
void syncWithUI();
|
||||
bool getLFConfig_helper(const QVariantMap& map, QString& str, int* result);
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // LF_H
|
||||
@@ -0,0 +1,141 @@
|
||||
#ifndef MIFARE_H
|
||||
#define MIFARE_H
|
||||
|
||||
#include "common/util.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "ui/mf_attack_hardnesteddialog.h"
|
||||
#include "ui/mf_uid_parameterdialog.h"
|
||||
#include "ui/mf_sim_simdialog.h"
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QRegularExpression>
|
||||
#include <QMessageBox>
|
||||
#include <QJsonObject>
|
||||
class Mifare : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Mifare(Ui::MainWindow *ui, Util *addr, QWidget *parent = nullptr);
|
||||
|
||||
enum KeyType
|
||||
{
|
||||
KEY_A = 'A',
|
||||
KEY_B = 'B',
|
||||
};
|
||||
|
||||
enum DataType
|
||||
{
|
||||
DATA_INVALID,
|
||||
DATA_WITHSPACE,
|
||||
DATA_NOSPACE,
|
||||
};
|
||||
|
||||
struct CardType
|
||||
{
|
||||
quint8 type;
|
||||
quint8 sector_size;
|
||||
quint16 block_size;
|
||||
quint8 blk[40];
|
||||
quint8 blks[40];
|
||||
QString typeText;
|
||||
};
|
||||
|
||||
enum AccessType
|
||||
{
|
||||
ACC_NEVER = 0,
|
||||
ACC_KEY_A = 1,
|
||||
ACC_KEY_B = 2,
|
||||
ACC_KEY_AB = 3,
|
||||
};
|
||||
|
||||
enum TargetType
|
||||
{
|
||||
TARGET_MIFARE,
|
||||
TARGET_UID,
|
||||
TARGET_EMULATOR,
|
||||
};
|
||||
|
||||
static const CardType card_mini;
|
||||
static const CardType card_1k;
|
||||
static const CardType card_2k;
|
||||
static const CardType card_4k;
|
||||
|
||||
static const AccessType dataCondition[8][4];
|
||||
static const AccessType trailerReadCondition[8][3];
|
||||
static const AccessType trailerWriteCondition[8][3];
|
||||
|
||||
QMap<QString, QString> info(bool isRequiringOutput = false);
|
||||
void chk();
|
||||
void nested(bool isStaticNested = false);
|
||||
void darkside();
|
||||
void hardnested();
|
||||
void sniff();
|
||||
void sniff14a();
|
||||
void list();
|
||||
void readOne(TargetType targetType = TARGET_MIFARE);
|
||||
void readSelected(TargetType targetType = TARGET_MIFARE);
|
||||
void writeOne(TargetType targetType = TARGET_MIFARE);
|
||||
void writeSelected(TargetType targetType = TARGET_MIFARE);
|
||||
void dump();
|
||||
void restore();
|
||||
|
||||
void data_clearData(bool clearAll = true);
|
||||
void data_clearKey(bool clearAll = true);
|
||||
static bool data_isKeyValid(const QString& key);
|
||||
static Mifare::DataType data_isDataValid(const QString& data);
|
||||
void data_syncWithDataWidget(bool syncAll = true, int block = 0);
|
||||
void data_syncWithKeyWidget(bool syncAll = true, int sector = 0, KeyType keyType = KEY_A);
|
||||
|
||||
CardType cardType;
|
||||
Mifare::CardType getCardType();
|
||||
void setCardType(int type);
|
||||
void wipeC();
|
||||
void setParameterC();
|
||||
|
||||
bool data_loadDataFile(const QString& filename);
|
||||
bool data_loadKeyFile(const QString& filename);
|
||||
bool data_saveDataFile(const QString& filename, bool isBin);
|
||||
bool data_saveKeyFile(const QString& filename, bool isBin);
|
||||
void data_key2Data();
|
||||
void data_data2Key();
|
||||
|
||||
void data_setData(int block, const QString& data);
|
||||
void data_setKey(int sector, KeyType keyType, const QString& key);
|
||||
void lockC();
|
||||
void wipeE();
|
||||
void simulate();
|
||||
void loadSniff(const QString& file);
|
||||
void saveSniff(const QString& file);
|
||||
void data_fillKeys();
|
||||
|
||||
static QList<quint8> data_getACBits(const QString& text);
|
||||
static int data_b2s(int block);
|
||||
static bool data_isACBitsValid(const QString& text, QList<quint8> *returnHalfBytes = nullptr);
|
||||
QString data_getUID();
|
||||
quint16 getTrailerBlockId(quint8 sectorId, qint8 cardTypeId = -1); // -1: use current cardtype
|
||||
void setConfigMap(const QVariantMap& configMap);
|
||||
public slots:
|
||||
signals:
|
||||
|
||||
private:
|
||||
QWidget* parent;
|
||||
Ui::MainWindow *ui;
|
||||
Util* util;
|
||||
|
||||
QVariantMap configMap;
|
||||
|
||||
QStringList* keyAList;
|
||||
QStringList* keyBList;
|
||||
QStringList* dataList;
|
||||
QRegularExpression* dataPattern;
|
||||
QRegularExpression* keyPattern_res;
|
||||
QRegularExpression* keyPattern;
|
||||
QString bin2text(const QByteArray& buff, int start, int length);
|
||||
|
||||
QString _readblk(int blockId, KeyType keyType, const QString& key, TargetType targetType = TARGET_MIFARE, int waitTime = 300);
|
||||
QStringList _readsec(int sectorId, KeyType keyType, const QString& key, TargetType targetType = TARGET_MIFARE, int waitTime = 300);
|
||||
bool _writeblk(int blockId, KeyType keyType, const QString& key, const QString& data, TargetType targetType = TARGET_MIFARE, int waitTime = 300);
|
||||
};
|
||||
|
||||
#endif // MIFARE_H
|
||||
@@ -0,0 +1,68 @@
|
||||
#include "t55xxtab.h"
|
||||
#include "ui_t55xxtab.h"
|
||||
|
||||
T55xxTab::T55xxTab(Util *addr, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::T55xxTab)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
util = addr;
|
||||
}
|
||||
|
||||
T55xxTab::~T55xxTab()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void T55xxTab::setConfigMap(const QVariantMap &configMap)
|
||||
{
|
||||
this->configMap = configMap;
|
||||
}
|
||||
|
||||
void T55xxTab::setGUIState(bool st)
|
||||
{
|
||||
ui->cloneGroupBox->setEnabled(st);
|
||||
emit setParentGUIState(st);
|
||||
}
|
||||
|
||||
void T55xxTab::on_Clone_EM410xReadButton_clicked()
|
||||
{
|
||||
setGUIState(false);
|
||||
|
||||
QVariantMap config = configMap["clone em410x"].toMap();
|
||||
QString result;
|
||||
QRegularExpressionMatch reMatch;
|
||||
|
||||
result = util->execCMDWithOutput(
|
||||
config["read"].toString(),
|
||||
Util::ReturnTrigger(6000, {config["successful read flag"].toString()}));
|
||||
if(result.isEmpty())
|
||||
{
|
||||
setGUIState(true);
|
||||
return;
|
||||
}
|
||||
reMatch = QRegularExpression(config["pattern"].toString()).match(result);
|
||||
ui->Clone_EM410xIDEdit->setText(reMatch.captured());
|
||||
|
||||
setGUIState(true);
|
||||
}
|
||||
|
||||
void T55xxTab::on_Clone_EM410xCloneButton_clicked()
|
||||
{
|
||||
if(ui->Clone_EM410xIDEdit->text().isEmpty())
|
||||
return;
|
||||
setGUIState(false);
|
||||
|
||||
QVariantMap config = configMap["clone em410x"].toMap();
|
||||
QString cmd = config["clone cmd"].toString();
|
||||
cmd.replace("<id>", ui->Clone_EM410xIDEdit->text());
|
||||
if(ui->Clone_T5555Button->isChecked())
|
||||
cmd.replace("<type>", config["t5555 flag"].toString());
|
||||
else
|
||||
cmd.replace("<type>", config["t55x7 flag"].toString());
|
||||
util->execCMD(cmd);
|
||||
Util::gotoRawTab();
|
||||
|
||||
setGUIState(true);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef T55XXTAB_H
|
||||
#define T55XXTAB_H
|
||||
|
||||
#include "common/util.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class T55xxTab;
|
||||
}
|
||||
|
||||
class T55xxTab : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit T55xxTab(Util *addr, QWidget *parent = nullptr);
|
||||
~T55xxTab();
|
||||
|
||||
void setConfigMap(const QVariantMap& configMap);
|
||||
private slots:
|
||||
void on_Clone_EM410xReadButton_clicked();
|
||||
|
||||
void on_Clone_EM410xCloneButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::T55xxTab *ui;
|
||||
Util* util;
|
||||
QVariantMap configMap;
|
||||
|
||||
void setGUIState(bool st);
|
||||
signals:
|
||||
void setParentGUIState(bool st);
|
||||
};
|
||||
|
||||
#endif // T55XXTAB_H
|
||||
@@ -0,0 +1,268 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QThread>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QListWidgetItem>
|
||||
#include <QButtonGroup>
|
||||
#include <QRadioButton>
|
||||
#include <QFileDialog>
|
||||
#include <QFontDialog>
|
||||
#include <QtSerialPort/QSerialPortInfo>
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
#include <QMimeData>
|
||||
#include <QAction>
|
||||
#include <QDesktopServices>
|
||||
#include <QGroupBox>
|
||||
#include <QSizePolicy>
|
||||
#include <QSettings>
|
||||
#include <QPushButton>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QScrollBar>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QDockWidget>
|
||||
#include <QMenu>
|
||||
|
||||
#include "common/myeventfilter.h"
|
||||
#include "common/pm3process.h"
|
||||
#include "module/mifare.h"
|
||||
#include "module/lf.h"
|
||||
#include "module/t55xxtab.h"
|
||||
#include "common/util.h"
|
||||
#include "ui/mf_trailerdecoderdialog.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
void initUI();
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
public slots:
|
||||
void refreshOutput(const QString& output);
|
||||
void refreshCMD(const QString& cmd);
|
||||
void setStatusBar(QLabel* target, const QString& text);
|
||||
void onPM3StateChanged(bool st, const QString& info);
|
||||
void MF_onMFCardTypeChanged(int id, bool st);
|
||||
void on_Raw_keyPressed(QObject *obj_addr, QEvent &event);
|
||||
void on_MF_keyWidget_resized(QObject *obj_addr, QEvent &event);
|
||||
private slots:
|
||||
|
||||
void on_PM3_connectButton_clicked();
|
||||
|
||||
void on_Raw_sendCMDButton_clicked();
|
||||
|
||||
void on_PM3_disconnectButton_clicked();
|
||||
|
||||
void on_Raw_clearOutputButton_clicked();
|
||||
|
||||
void sendMSG();
|
||||
|
||||
void on_portSearchTimer_timeout();
|
||||
|
||||
void on_Raw_CMDHistoryBox_stateChanged(int arg1);
|
||||
|
||||
void on_Raw_clearHistoryButton_clicked();
|
||||
|
||||
void on_Raw_CMDHistoryWidget_itemDoubleClicked(QListWidgetItem *item);
|
||||
|
||||
void on_MF_Attack_chkButton_clicked();
|
||||
|
||||
void on_MF_Attack_nestedButton_clicked();
|
||||
|
||||
void on_MF_Attack_hardnestedButton_clicked();
|
||||
|
||||
void on_MF_Sniff_sniffButton_clicked();
|
||||
|
||||
void on_MF_Sniff_listButton_clicked();
|
||||
|
||||
void on_MF_RW_readSelectedButton_clicked();
|
||||
|
||||
void on_MF_RW_readBlockButton_clicked();
|
||||
|
||||
void on_MF_RW_writeBlockButton_clicked();
|
||||
|
||||
void on_MF_Attack_infoButton_clicked();
|
||||
|
||||
void on_MF_RW_writeSelectedButton_clicked();
|
||||
|
||||
void on_MF_RW_dumpButton_clicked();
|
||||
|
||||
void on_MF_RW_restoreButton_clicked();
|
||||
|
||||
void on_MF_UID_readSelectedButton_clicked();
|
||||
|
||||
void on_MF_UID_readBlockButton_clicked();
|
||||
|
||||
void on_MF_UID_writeSelectedButton_clicked();
|
||||
|
||||
void on_MF_UID_writeBlockButton_clicked();
|
||||
|
||||
void on_MF_File_loadButton_clicked();
|
||||
|
||||
void on_MF_File_saveButton_clicked();
|
||||
|
||||
void on_MF_data2KeyButton_clicked();
|
||||
|
||||
void on_MF_key2DataButton_clicked();
|
||||
|
||||
void on_MF_dataWidget_itemChanged(QTableWidgetItem *item);
|
||||
|
||||
void on_MF_File_clearButton_clicked();
|
||||
|
||||
void on_MF_keyWidget_itemChanged(QTableWidgetItem *item);
|
||||
|
||||
void on_MF_fontButton_clicked();
|
||||
|
||||
void on_MF_UID_wipeButton_clicked();
|
||||
|
||||
void on_MF_UID_aboutUIDButton_clicked();
|
||||
|
||||
void on_MF_UID_setParaButton_clicked();
|
||||
|
||||
void on_MF_UID_lockButton_clicked();
|
||||
|
||||
void on_MF_Sim_readSelectedButton_clicked();
|
||||
|
||||
void on_MF_Sim_writeSelectedButton_clicked();
|
||||
|
||||
void on_MF_Sim_clearButton_clicked();
|
||||
|
||||
void on_MF_Sim_simButton_clicked();
|
||||
|
||||
void on_MF_Sniff_loadButton_clicked();
|
||||
|
||||
void on_MF_Sniff_saveButton_clicked();
|
||||
|
||||
void on_GroupBox_clicked(bool checked);
|
||||
|
||||
void on_MF_selectAllBox_stateChanged(int arg1);
|
||||
|
||||
void on_MF_fillKeysButton_clicked();
|
||||
|
||||
void on_MF_14aSniff_snoopButton_clicked();
|
||||
|
||||
void on_MF_trailerDecoderButton_clicked();
|
||||
|
||||
void on_MF_selectTrailerBox_stateChanged(int arg1);
|
||||
|
||||
void on_stopButton_clicked();
|
||||
|
||||
void on_Raw_CMDEdit_textChanged(const QString &arg1);
|
||||
|
||||
void on_MF_Attack_darksideButton_clicked();
|
||||
|
||||
void on_Set_Client_startArgsEdit_editingFinished();
|
||||
|
||||
void on_Set_Client_forceEnabledBox_stateChanged(int arg1);
|
||||
|
||||
void on_Set_GUI_setLanguageButton_clicked();
|
||||
|
||||
void setButtonsEnabled(bool st);
|
||||
|
||||
void on_PM3_refreshPortButton_clicked();
|
||||
|
||||
void on_Set_Client_envScriptEdit_editingFinished();
|
||||
|
||||
void on_Set_Client_keepClientActiveBox_stateChanged(int arg1);
|
||||
|
||||
void on_LF_LFConf_freqSlider_valueChanged(int value);
|
||||
|
||||
void on_LF_LFConf_freqDivisorBox_valueChanged(int arg1);
|
||||
|
||||
void on_LF_LFConf_freq125kButton_clicked();
|
||||
|
||||
void on_LF_LFConf_freq134kButton_clicked();
|
||||
|
||||
void on_LF_Op_searchButton_clicked();
|
||||
|
||||
void on_LF_Op_readButton_clicked();
|
||||
|
||||
void on_LF_Op_tuneButton_clicked();
|
||||
|
||||
void on_LF_Op_sniffButton_clicked();
|
||||
|
||||
void on_LF_LFConf_getButton_clicked();
|
||||
|
||||
void on_LF_LFConf_setButton_clicked();
|
||||
|
||||
void on_LF_LFConf_resetButton_clicked();
|
||||
|
||||
void on_Set_Client_workingDirEdit_editingFinished();
|
||||
|
||||
void on_Set_Client_configPathEdit_editingFinished();
|
||||
|
||||
void setState(bool st);
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
QButtonGroup* MFCardTypeBtnGroup;
|
||||
QLabel* connectStatusBar;
|
||||
QLabel* programStatusBar;
|
||||
QLabel* PM3VersionBar;
|
||||
QPushButton* stopButton;
|
||||
QAction* dockAllWindows;
|
||||
QAction* myInfo;
|
||||
QAction* currVersion;
|
||||
QAction* checkUpdate;
|
||||
QSettings* settings;
|
||||
MyEventFilter* keyEventFilter;
|
||||
MyEventFilter* resizeEventFilter;
|
||||
|
||||
QString stashedCMDEditText;
|
||||
int stashedIndex = -1;
|
||||
|
||||
void uiInit();
|
||||
|
||||
PM3Process* pm3;
|
||||
bool pm3state;
|
||||
bool keepButtonsEnabled;
|
||||
bool keepClientActive;
|
||||
QThread* pm3Thread;
|
||||
QTimer* portSearchTimer;
|
||||
QStringList portList;
|
||||
QStringList clientEnv;
|
||||
QDir* clientWorkingDir;
|
||||
|
||||
T55xxTab* t55xxTab;
|
||||
Mifare* mifare;
|
||||
LF* lf;
|
||||
Util* util;
|
||||
|
||||
QList<QDockWidget*> dockList;
|
||||
QMenu* contextMenu;
|
||||
|
||||
MF_trailerDecoderDialog* decDialog;
|
||||
|
||||
void signalInit();
|
||||
void MF_widgetReset();
|
||||
void setTableItem(QTableWidget *widget, int row, int column, const QString& text);
|
||||
void saveClientPath(const QString& path);
|
||||
void onLFfreqConfChanged(int value, bool isCustomized);
|
||||
void dockInit();
|
||||
void loadConfig();
|
||||
protected:
|
||||
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||
signals:
|
||||
void connectPM3(const QString& path, const QStringList args);
|
||||
void reconnectPM3();
|
||||
void killPM3();
|
||||
void setSerialListener(bool state);
|
||||
void setSerialListener(const QString& name, bool state);
|
||||
void setProcEnv(const QStringList *env);
|
||||
void setWorkingDir(const QString& dir);
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "mf_attack_hardnesteddialog.h"
|
||||
#include "ui_mf_attack_hardnesteddialog.h"
|
||||
|
||||
MF_Attack_hardnestedDialog::MF_Attack_hardnestedDialog(int blocks, const QVariantMap& config, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::MF_Attack_hardnestedDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
for(int i = 0; i < blocks; i++)
|
||||
{
|
||||
ui->knownKeyBlockBox->addItem(QString::number(i));
|
||||
ui->targetKeyBlockBox->addItem(QString::number(i));
|
||||
}
|
||||
this->config = config;
|
||||
|
||||
}
|
||||
|
||||
MF_Attack_hardnestedDialog::~MF_Attack_hardnestedDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MF_Attack_hardnestedDialog::on_buttonBox_accepted()
|
||||
{
|
||||
QString cmd = config["cmd"].toString();
|
||||
cmd.replace("<known key block>", ui->knownKeyBlockBox->currentText());
|
||||
cmd.replace("<known key type>", config["known key type"].toMap()[ui->knownKeyTypeBox->currentText()].toString());
|
||||
cmd.replace("<known key>", ui->knownKeyBox->text());
|
||||
cmd.replace("<target key block>", ui->targetKeyBlockBox->currentText());
|
||||
cmd.replace("<target key type>", config["target key type"].toMap()[ui->targetKeyTypeBox->currentText()].toString());
|
||||
emit sendCMD(cmd);
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
#define MF_ATTACK_HARDNESTEDDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "common/util.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class MF_Attack_hardnestedDialog;
|
||||
}
|
||||
|
||||
@@ -12,14 +14,15 @@ class MF_Attack_hardnestedDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MF_Attack_hardnestedDialog(int blocks, QWidget *parent = nullptr);
|
||||
explicit MF_Attack_hardnestedDialog(int blocks, const QVariantMap& config, QWidget *parent = nullptr);
|
||||
~MF_Attack_hardnestedDialog();
|
||||
|
||||
|
||||
private:
|
||||
Ui::MF_Attack_hardnestedDialog *ui;
|
||||
QVariantMap config;
|
||||
signals:
|
||||
void sendCMD(QString cmd);
|
||||
void sendCMD(const QString& cmd);
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
};
|
||||
@@ -31,7 +31,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="knownKeySectorBox">
|
||||
<widget class="QComboBox" name="knownKeyBlockBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
@@ -106,7 +106,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="targetKeySectorBox">
|
||||
<widget class="QComboBox" name="targetKeyBlockBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
@@ -0,0 +1,103 @@
|
||||
#include "mf_sim_simdialog.h"
|
||||
#include "ui_mf_sim_simdialog.h"
|
||||
|
||||
MF_Sim_simDialog::MF_Sim_simDialog(int cardType, QString cardTypeText, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::MF_Sim_simDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
if(Util::getClientType() == Util::CLIENTTYPE_OFFICIAL)
|
||||
{
|
||||
ui->atqaGroupBox->setVisible(false);
|
||||
ui->atqaLine->setVisible(false);
|
||||
ui->sakGroupBox->setVisible(false);
|
||||
ui->sakLine->setVisible(false);
|
||||
ui->vGroupBox->setVisible(false);
|
||||
ui->vLine->setVisible(false);
|
||||
}
|
||||
else if(Util::getClientType() == Util::CLIENTTYPE_ICEMAN)
|
||||
{
|
||||
ui->fGroupBox->setVisible(false);
|
||||
ui->fLine->setVisible(false);
|
||||
ui->rGroupBox->setVisible(false);
|
||||
ui->rLine->setVisible(false);
|
||||
ui->uBox->setText("-u");
|
||||
ui->nBox->setText("-n");
|
||||
ui->iBox->setText("-i");
|
||||
ui->xBox->setText("--crack");
|
||||
ui->eBox->setText("-e");
|
||||
}
|
||||
this->cardType = cardType;
|
||||
this->cardTypeText = cardTypeText;
|
||||
}
|
||||
|
||||
MF_Sim_simDialog::~MF_Sim_simDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MF_Sim_simDialog::on_eBox_clicked(bool checked)
|
||||
{
|
||||
if(checked)
|
||||
{
|
||||
ui->iBox->setChecked(true);
|
||||
ui->xBox->setChecked(true);
|
||||
}
|
||||
if(!ui->eBox->isChecked() && !ui->fBox->isChecked())
|
||||
{
|
||||
ui->iBox->setEnabled(true);
|
||||
ui->xBox->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->iBox->setEnabled(false);
|
||||
ui->xBox->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MF_Sim_simDialog::on_fBox_clicked(bool checked)
|
||||
{
|
||||
if(checked)
|
||||
{
|
||||
ui->iBox->setChecked(true);
|
||||
ui->xBox->setChecked(true);
|
||||
}
|
||||
if(!ui->eBox->isChecked() && !ui->fBox->isChecked())
|
||||
{
|
||||
ui->iBox->setEnabled(true);
|
||||
ui->xBox->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->iBox->setEnabled(false);
|
||||
ui->xBox->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MF_Sim_simDialog::on_buttonBox_accepted()
|
||||
{
|
||||
QString paras;
|
||||
if(Util::getClientType() == Util::CLIENTTYPE_OFFICIAL)
|
||||
{
|
||||
paras += (ui->uBox->isChecked() ? "u " + ui->uEdit->text() + " " : "");
|
||||
paras += (ui->nBox->isChecked() ? "n " + ui->nEdit->text() + " " : "");
|
||||
paras += (ui->iBox->isChecked() ? "i " : "");
|
||||
paras += (ui->xBox->isChecked() ? "x " : "");
|
||||
paras += (ui->eBox->isChecked() ? "e " : "");
|
||||
paras += (ui->fBox->isChecked() ? "f " + ui->fEdit->text() + " " : "");
|
||||
paras += (ui->rBox->isChecked() ? "r " : "");
|
||||
emit sendCMD(QString("hf mf sim ") + "*" + QString::number(cardType) + " " + paras.trimmed());
|
||||
}
|
||||
else if(Util::getClientType() == Util::CLIENTTYPE_ICEMAN)
|
||||
{
|
||||
paras += (ui->uBox->isChecked() ? "-u " + ui->uEdit->text() + " " : "");
|
||||
paras += (ui->atqaBox->isChecked() ? "--atqa " + ui->atqaEdit->text() + " " : "");
|
||||
paras += (ui->sakBox->isChecked() ? "--sak " + ui->sakEdit->text() + " " : "");
|
||||
paras += (ui->nBox->isChecked() ? "-n " + ui->nEdit->text() + " " : "");
|
||||
paras += (ui->iBox->isChecked() ? "-i " : "");
|
||||
paras += (ui->xBox->isChecked() ? "--crack " : "");
|
||||
paras += (ui->eBox->isChecked() ? "-e " : "");
|
||||
paras += (ui->vBox->isChecked() ? "-v " : "");
|
||||
emit sendCMD(QString("hf mf sim --") + cardTypeText + " " + paras.trimmed());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef MF_SIM_SIMDIALOG_H
|
||||
#define MF_SIM_SIMDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDebug>
|
||||
#include "common/util.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MF_Sim_simDialog;
|
||||
}
|
||||
|
||||
class MF_Sim_simDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MF_Sim_simDialog(int cardType, QString cardTypeText, QWidget *parent = nullptr);
|
||||
~MF_Sim_simDialog();
|
||||
|
||||
private slots:
|
||||
void on_eBox_clicked(bool checked);
|
||||
|
||||
void on_fBox_clicked(bool checked);
|
||||
|
||||
private:
|
||||
Ui::MF_Sim_simDialog *ui;
|
||||
int cardType;
|
||||
QString cardTypeText;
|
||||
signals:
|
||||
void sendCMD(const QString& cmd);
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
};
|
||||
|
||||
#endif // MF_SIM_SIMDIALOG_H
|
||||
@@ -0,0 +1,667 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MF_Sim_simDialog</class>
|
||||
<widget class="QDialog" name="MF_Sim_simDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>461</width>
|
||||
<height>524</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Simulate</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="uGroupBox">
|
||||
<layout class="QHBoxLayout" name="uLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="uBox">
|
||||
<property name="text">
|
||||
<string>u</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="uEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>UID 4 or 7 bytes. If not specified, the UID 4B from emulator memory will be used</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="uLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="atqaGroupBox">
|
||||
<layout class="QHBoxLayout" name="atqaLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="atqaBox">
|
||||
<property name="text">
|
||||
<string>--atqa</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="atqaEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Provide explicit ATQA (2 bytes)</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="atqaLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="sakGroupBox">
|
||||
<layout class="QHBoxLayout" name="sakLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="sakBox">
|
||||
<property name="text">
|
||||
<string>--sak</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="sakEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Provide explicit SAK (1 byte)</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="sakLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="nGroupBox">
|
||||
<layout class="QHBoxLayout" name="nLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="nBox">
|
||||
<property name="text">
|
||||
<string>n</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="nEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Automatically exit simulation after <numreads> blocks have been read by reader. 0 = infinite</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="nLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="iGroupBox">
|
||||
<layout class="QHBoxLayout" name="iLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="iBox">
|
||||
<property name="text">
|
||||
<string>i</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Interactive, means that console will not be returned until simulation finishes or is aborted</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="iLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="xGroupBox">
|
||||
<layout class="QHBoxLayout" name="xLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="xBox">
|
||||
<property name="text">
|
||||
<string>x</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Crack, performs the 'reader attack', nr/ar attack against a legitimate reader, fishes out the key(s)</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="xLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="eGroupBox">
|
||||
<layout class="QHBoxLayout" name="eLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="eBox">
|
||||
<property name="text">
|
||||
<string>e</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>set keys found from 'reader attack' to emulator memory (implies x(--crack) and i)</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="eLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="fGroupBox">
|
||||
<layout class="QHBoxLayout" name="fLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="fBox">
|
||||
<property name="text">
|
||||
<string>f</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="fEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>get UIDs to use for 'reader attack' from file 'f <filename.txt>' (implies x and i)</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="fLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="rGroupBox">
|
||||
<layout class="QHBoxLayout" name="rLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="rBox">
|
||||
<property name="text">
|
||||
<string>r</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Generate random nonces instead of sequential nonces. Standard reader attack won't work with this option, only moebius attack works</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="rLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="vGroupBox">
|
||||
<layout class="QHBoxLayout" name="vLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="vBox">
|
||||
<property name="text">
|
||||
<string>-v</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>verbose output</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="vLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>MF_Sim_simDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>MF_Sim_simDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,154 @@
|
||||
#include "mf_trailerdecoderdialog.h"
|
||||
#include "ui_mf_trailerdecoderdialog.h"
|
||||
|
||||
MF_trailerDecoderDialog::MF_trailerDecoderDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::MF_trailerDecoderDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QRegularExpression re("(([0-9a-fA-F]{2} ){0,4})|([0-9a-fA-F]{0,8})");
|
||||
validator = new QRegularExpressionValidator(this);
|
||||
validator->setRegularExpression(re);
|
||||
ui->accessBitsEdit->setValidator(validator);
|
||||
|
||||
sizeGroup = new QButtonGroup(this);
|
||||
sizeGroup->addButton(ui->size4Button, 4);
|
||||
sizeGroup->addButton(ui->size16Button, 16);
|
||||
connect(sizeGroup, QOverload<int, bool>::of(&QButtonGroup::buttonToggled), this, &MF_trailerDecoderDialog::on_blockSizeChanged);
|
||||
connect(ui->C0Box, QOverload<int>::of(&QSpinBox::valueChanged), this, &MF_trailerDecoderDialog::on_boxChanged);
|
||||
connect(ui->C1Box, QOverload<int>::of(&QSpinBox::valueChanged), this, &MF_trailerDecoderDialog::on_boxChanged);
|
||||
connect(ui->C2Box, QOverload<int>::of(&QSpinBox::valueChanged), this, &MF_trailerDecoderDialog::on_boxChanged);
|
||||
connect(ui->C3Box, QOverload<int>::of(&QSpinBox::valueChanged), this, &MF_trailerDecoderDialog::on_boxChanged);
|
||||
|
||||
ui->dataBlockWidget->setRowCount(3);
|
||||
ui->dataBlockWidget->setColumnCount(4);
|
||||
ui->trailerBlockWidget->setRowCount(2);
|
||||
ui->trailerBlockWidget->setColumnCount(3);
|
||||
}
|
||||
|
||||
MF_trailerDecoderDialog::~MF_trailerDecoderDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
void MF_trailerDecoderDialog::on_accessBitsEdit_textChanged(const QString &arg1)
|
||||
{
|
||||
ui->C0Box->blockSignals(true);
|
||||
ui->C1Box->blockSignals(true);
|
||||
ui->C2Box->blockSignals(true);
|
||||
ui->C3Box->blockSignals(true);
|
||||
QList<quint8> ACBits = Mifare::data_getACBits(arg1);
|
||||
if(ACBits.size() == 0)
|
||||
{
|
||||
ui->isAccessBitsValidLabel->setStyleSheet("color:rgb(200, 0, 0)");
|
||||
ui->isAccessBitsValidLabel->setText(tr("Invalid!\nIt could make the whole sector blocked irreversibly!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->C0Box->setValue(ACBits[0]);
|
||||
ui->C1Box->setValue(ACBits[1]);
|
||||
ui->C2Box->setValue(ACBits[2]);
|
||||
ui->C3Box->setValue(ACBits[3]);
|
||||
ui->isAccessBitsValidLabel->setStyleSheet("color:rgb(0, 200, 0)");
|
||||
ui->isAccessBitsValidLabel->setText(tr("Valid"));
|
||||
bool isKeyBReadable = ACBits[3] == 0 || ACBits[3] == 1 || ACBits[3] == 4;
|
||||
for(int j = 0; j < 3; j++)
|
||||
{
|
||||
setTableItem(ui->trailerBlockWidget, 0, j, Mifare::trailerReadCondition[ACBits[3]][j]);
|
||||
setTableItem(ui->trailerBlockWidget, 1, j, Mifare::trailerWriteCondition[ACBits[3]][j]);
|
||||
}
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 4; j++)
|
||||
{
|
||||
Mifare::AccessType type = Mifare::dataCondition[ACBits[i]][j];
|
||||
if(type == Mifare::ACC_KEY_B && isKeyBReadable)
|
||||
{
|
||||
type = Mifare::ACC_NEVER;
|
||||
}
|
||||
else if(type == Mifare::ACC_KEY_AB && isKeyBReadable)
|
||||
{
|
||||
type = Mifare::ACC_KEY_A;
|
||||
}
|
||||
setTableItem(ui->dataBlockWidget, i, j, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
ui->C0Box->blockSignals(false);
|
||||
ui->C1Box->blockSignals(false);
|
||||
ui->C2Box->blockSignals(false);
|
||||
ui->C3Box->blockSignals(false);
|
||||
}
|
||||
|
||||
void MF_trailerDecoderDialog::on_blockSizeChanged(int id, bool st)
|
||||
{
|
||||
if(st)
|
||||
{
|
||||
if(id == 4)
|
||||
{
|
||||
ui->dataBlockWidget->verticalHeaderItem(0)->setText(tr("Block") + "0");
|
||||
ui->dataBlockWidget->verticalHeaderItem(1)->setText(tr("Block") + "1");
|
||||
ui->dataBlockWidget->verticalHeaderItem(2)->setText(tr("Block") + "2");
|
||||
}
|
||||
else if(id == 16)
|
||||
{
|
||||
ui->dataBlockWidget->verticalHeaderItem(0)->setText(tr("Block") + "0~4");
|
||||
ui->dataBlockWidget->verticalHeaderItem(1)->setText(tr("Block") + "5~9");
|
||||
ui->dataBlockWidget->verticalHeaderItem(2)->setText(tr("Block") + "10~14");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void MF_trailerDecoderDialog::setTableItem(QTableWidget* widget, int row, int column, Mifare::AccessType accessType)
|
||||
{
|
||||
if(widget->item(row, column) == nullptr)
|
||||
widget->setItem(row, column, new QTableWidgetItem());
|
||||
QString text;
|
||||
if(accessType == Mifare::ACC_NEVER)
|
||||
{
|
||||
text = "X";
|
||||
}
|
||||
else if(accessType == Mifare::ACC_KEY_A)
|
||||
{
|
||||
text = tr("KeyA");
|
||||
}
|
||||
else if(accessType == Mifare::ACC_KEY_B)
|
||||
{
|
||||
text = tr("KeyB");
|
||||
}
|
||||
else if(accessType == Mifare::ACC_KEY_AB)
|
||||
{
|
||||
text = tr("KeyA+B");
|
||||
}
|
||||
widget->item(row, column)->setText(text);
|
||||
}
|
||||
|
||||
void MF_trailerDecoderDialog::on_boxChanged()
|
||||
{
|
||||
quint8 ACBits[4];
|
||||
ACBits[0] = ui->C0Box->value();
|
||||
ACBits[1] = ui->C1Box->value();
|
||||
ACBits[2] = ui->C2Box->value();
|
||||
ACBits[3] = ui->C3Box->value();
|
||||
quint8 halfBytes[6] = {0, 0, 0, 0, 0, 0};
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
halfBytes[2] |= (((ACBits[i] >> 0) & 1) << i);
|
||||
halfBytes[5] |= (((ACBits[i] >> 1) & 1) << i);
|
||||
halfBytes[4] |= (((ACBits[i] >> 2) & 1) << i);
|
||||
}
|
||||
halfBytes[0] = (~halfBytes[5]) & 0xf;
|
||||
halfBytes[1] = (~halfBytes[2]) & 0xf;
|
||||
halfBytes[3] = (~halfBytes[4]) & 0xf;
|
||||
|
||||
QString result;
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
result += QString::number(halfBytes[i * 2], 16);
|
||||
result += QString::number(halfBytes[i * 2 + 1], 16);
|
||||
result += " ";
|
||||
}
|
||||
result = result.toUpper();
|
||||
ui->accessBitsEdit->setText(result);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef MF_TRAILERDECODERDIALOG_H
|
||||
#define MF_TRAILERDECODERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QValidator>
|
||||
#include <QDebug>
|
||||
#include <QButtonGroup>
|
||||
#include <QTableWidget>
|
||||
#include "../module/mifare.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MF_trailerDecoderDialog;
|
||||
}
|
||||
|
||||
class MF_trailerDecoderDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MF_trailerDecoderDialog(QWidget *parent = nullptr);
|
||||
~MF_trailerDecoderDialog();
|
||||
|
||||
private slots:
|
||||
|
||||
void on_accessBitsEdit_textChanged(const QString& arg1);
|
||||
|
||||
void on_blockSizeChanged(int id, bool st);
|
||||
|
||||
void on_boxChanged();
|
||||
private:
|
||||
Ui::MF_trailerDecoderDialog *ui;
|
||||
QRegularExpressionValidator* validator;
|
||||
QButtonGroup* sizeGroup;
|
||||
void setTableItem(QTableWidget *widget, int row, int column, Mifare::AccessType accessType);
|
||||
|
||||
};
|
||||
|
||||
#endif // MF_TRAILERDECODERDIALOG_H
|
||||
@@ -0,0 +1,402 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MF_trailerDecoderDialog</class>
|
||||
<widget class="QDialog" name="MF_trailerDecoderDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>534</width>
|
||||
<height>507</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Trailer Decoder</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="sizeGroupBox">
|
||||
<property name="title">
|
||||
<string>Blocks</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="size4Button">
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="size16Button">
|
||||
<property name="text">
|
||||
<string>16</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Trailer Data:
|
||||
(like "FF0780" or "FF 07 80")</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="accessBitsEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="isAccessBitsValidLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Or set bits manually</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Cx0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="C0Box">
|
||||
<property name="maximum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Cx1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="C1Box">
|
||||
<property name="maximum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Cx2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="C2Box">
|
||||
<property name="maximum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Cx3</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="C3Box">
|
||||
<property name="maximum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Data Block Permission:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="dataBlockWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>4</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Block0</string>
|
||||
</property>
|
||||
</row>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Block1</string>
|
||||
</property>
|
||||
</row>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Block2</string>
|
||||
</property>
|
||||
</row>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Read</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Write</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Increase</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Decrease/Transfer/Restore</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Trailer Block Permission:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="trailerBlockWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>3</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Read</string>
|
||||
</property>
|
||||
</row>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Write</string>
|
||||
</property>
|
||||
</row>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>KeyA</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Access Bits</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>KeyB</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Reference:
|
||||
MF1S70YYX_V1 Product data sheet
|
||||
Rev. 3.2 — 23 November 2017</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Note:the Access Bits usually contains 4 bytes(8 hex symbols), but only the first 3 bytes matters. You can set the 4th byte randomly.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>MF_trailerDecoderDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>MF_trailerDecoderDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "mf_uid_parameterdialog.h"
|
||||
#include "ui_mf_uid_parameterdialog.h"
|
||||
|
||||
MF_UID_parameterDialog::MF_UID_parameterDialog(const QString& uid, const QString& atqa, const QString& sak, QWidget *parent) :
|
||||
MF_UID_parameterDialog::MF_UID_parameterDialog(const QString& uid, const QString& atqa, const QString& sak, const QVariantMap& config, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::MF_UID_parameterDialog)
|
||||
{
|
||||
@@ -9,6 +9,7 @@ MF_UID_parameterDialog::MF_UID_parameterDialog(const QString& uid, const QString
|
||||
ui->UIDLineEdit->setText(uid);
|
||||
ui->ATQALineEdit->setText(atqa);
|
||||
ui->SAKLineEdit->setText(sak);
|
||||
this->config = config;
|
||||
}
|
||||
|
||||
MF_UID_parameterDialog::~MF_UID_parameterDialog()
|
||||
@@ -18,10 +19,9 @@ MF_UID_parameterDialog::~MF_UID_parameterDialog()
|
||||
|
||||
void MF_UID_parameterDialog::on_buttonBox_accepted()
|
||||
{
|
||||
emit sendCMD("hf mf csetuid "
|
||||
+ ui->UIDLineEdit->text()
|
||||
+ " "
|
||||
+ ui->ATQALineEdit->text()
|
||||
+ " "
|
||||
+ ui->SAKLineEdit->text());
|
||||
QString cmd = config["cmd"].toString();
|
||||
cmd.replace("<uid>", ui->UIDLineEdit->text());
|
||||
cmd.replace("<atqa>", ui->ATQALineEdit->text());
|
||||
cmd.replace("<sak>", ui->SAKLineEdit->text());
|
||||
emit sendCMD(cmd);
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
#define MF_UID_PARAMETERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "common/util.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class MF_UID_parameterDialog;
|
||||
}
|
||||
|
||||
@@ -12,13 +14,14 @@ class MF_UID_parameterDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MF_UID_parameterDialog(const QString& uid, const QString& atqa, const QString& sak, QWidget *parent = nullptr);
|
||||
explicit MF_UID_parameterDialog(const QString& uid, const QString& atqa, const QString& sak, const QVariantMap& config, QWidget *parent = nullptr);
|
||||
~MF_UID_parameterDialog();
|
||||
|
||||
private:
|
||||
Ui::MF_UID_parameterDialog *ui;
|
||||
QVariantMap config;
|
||||
signals:
|
||||
void sendCMD(QString cmd);
|
||||
void sendCMD(const QString& cmd);
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
};
|
||||