Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As of commit 73dbd5625fb72bf6a6ae1477d2e15d1727877301, version 01.00.00

Download code here.
Info
Info

Code and tests are in the .zip file below.

View file
nameapduExtractor_2023-06-01.zip

Table of Contents
minLevel1
maxLevel7
outlinetrue

...

Between any two CAPDUs, find a SELECT response RAPDU (6F XX …), infer file syntax used to record all RAPDUs in the log, get all RAPDUs by following syntax.

Locate card presentments and , unpredictable numbers and transaction related data (TRD) in the APDUs.

Create replayable output file(s).

Requirements

Developed using Python 3.10.0 on Windows.

Also tested briefly with 3.7.8.

There are no other dependencies.

Usage

The program provides a simple CLI, and understands four types of commands: version, help, file/folder and test.

...

In this case four problems might have occurred:

  1. Changes in code have broken the program.

  2. Reference files were incorrect and need modification.

  3. Testbenches have been corrupted.

  4. TestMode.FILES list in test_mode.py didn’t match the actual file system hierarchy.

In the first example below, a bogus file named “fileToBeRemoved” is placed in the references folder, but not in testbenches. Thus, the program fails to create a .cardtxt for it, and the test fails.

...

The program makes the assumption that an EMV log will contain at least one SELECT PSE or PPSE (C-APDU) and a SELECT response (R-APDU). If these two aren’t present in a log file, or the lines that contain them are written in a different manner than that of the remaining APDUs, the program will not work correctly.

Single Output for Single Input

There may be multiple transactions in one test log, like AMEX logs from EVAL and EVAL+ which may contain 1 transaction each for 4 different transaction modes (EMV, Magstripe, Mobile EMV, Mobile Magstripe). For such logs, APDU Extractor will generate a single .cardtxt and write 4 at the top.

Single TRD for Multiple Transactions

...