java模拟器gba模拟器,CAPRunner-JavaCard字节码仿真器-Benoît Allard

作者:Benoît Allard

### 作者邮箱:benoit.allard@gmx.de

### 首页:https://bitbucket.org/benallard/caprunner

### 文档:None

### 下载链接 UNKNOWN

#########

CAPRunner

#

%%%%%%%%%%%%%%%%%%%%%%%%%% JavaCard ByteCode Emulator %%%%%%%%%%%%%%%%%%%%%%%%%%

Overview

CAPRunner is a javacard bytecode emulator that is able to execute CAP files. It also comes with an handy runcap.py that bind them together and allow you to send some APDUs to a CAP file (without the need for a smartcard).

Example

The following script can be ran by runcap.py. It loads a CAP file, install and instanciate an applet from the file, send two APDu and check their Status Word::

load: /path/to/helloworld.cap

install: 0a a0 00 00 00 62 03 01 0c 01 01 00 00 00 : 00

Select HelloWorld //aid/A000000062/03010C0101

==> 00 a4 04 00 0a a0 00 00 00 62 03 01 0c 01 01 7F <== 00 A4 04 00 0A A0 00 00 00 62 03 01 0C 01 01 90 00

==> 80 B8 00 00 0C 0A <== 80 B8 00 00 0C 90 00

The example is taken from the JavaCard kit wich can be found under samples/classic_applets/HelloWorld.

Dependencies

In order to compile CAP files, you will need a working Java Development Kit together with a JavaCard Development Kit.

This project also relies on the following other ones:

pythoncard_ which provide the JavaCard OS functionnalities in Python.

and (optionnaly) pythonplatform_ which provides a minimal set of functionnalities from the globalplatform_ World.

.. note:: You will only need pythonplatform if your applet relies on some globalplatform functionnalities like secure messaging.

Installation

Your best chance for the moment is to clone the repository using Mercurial_ to a local directory::

$ hg clone https://bitbucket.org/benallard/caprunner/

This will create a copy of the repository in a caprunner directory.

In order to get the dependencies right, I suggest you also clone their repositories (the second one is optionnal)::

$ hg clone https://bitbucket.org/benallard/pythoncard/

$ hg clone https://bitbucket.org/benallard/pythonplatform/

Finally, the easiest way to get the dependencies resolved is to copy (or link on UNIX) the following directories at the root of the caprunner directory:

python, pythoncard and pythoncardx from the pythoncard directory

and (optionnaly) org from the pythonplatform directory.

Getting started

As a final step, you will need to compile the export files used during compilation of your applet into a JSON file. This step is needed in order to not read every single export file at each startup.

This is done with the following command line::

$ genref.py --dump dump.json /path/to/export_files

This will generate a file called dump.json containing the necessary information from the export files. The path given as second parameter is the directory containing the export files from your JavaCard Development Kit (e.g. the api21_export_files directory for a JavaCard 2.1.2).

CAPRunner will expect the generated json file to be called .json

Finally, you should be able to launch runcap.py. By default, it will emulate a JavaCard Classic 3.0.1, if you need another version, just give it as parameter. For instance::

$ ./runcap.py 2.1.2

Starting from here, runcap will wait for your orders. Please refer to the documentation_ for the format of the order to send to runcap.

Contribution

If an issue is bugging you, the issue tracker_ is your best friend to begin with.

If you want to help me improve this project, write some more docs or add functionnalities, the best for you is to make yourself an account on BitBucket, fork the repository and make a Pull request. Chances are big that I also accept patches per mail.

RTFM !

The documentation_ is autogenerated and gently published by ReadTheDocs_ after every commit.

.. _documentation: http://caprunner.readthedocs.org .. _ReadTheDocs: http://readthedocs.org/ .. _pythoncard: https://bitbucket.org/benallard/pythoncard/ .. _pythonplatform: https://bitbucket.org/benallard/pythonplatform/ .. _Mercurial: http://mercurial.selenic.com/ .. _globalplatform: http://www.globalplatform.org/ .. _issue tracker: https://bitbucket.org/benallard/caprunner/issues .. _BitBucket: https://bitbucket.org/ .. _repository: https://bitbucket.org/benallard/caprunner/

Copy from pypi.org

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值