作者: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

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

  1. 第 1 章 一 JVM 和 Java 体系架构 (虚拟机介绍、字节码、Java跨平台性)

    第 1 章 JVM 和 Java 体系架构 1.JVM 前言 作为Java工程师, 你是否也遇到过这些问题? 运行着的线上系统突然卡死,系统无法访问,甚至直接OOM! 想解决线上JVM GC问题,但却 ...

  2. java编译后生成字节码_请问java源文件编译后怎么生成字节码文件?

    比如,有的java源程序生成一个字节码文件,带有内部类的生成两个.可是有一种情况怎么回事呢?importjava.awt.*;importjavax.swing.*;importjava.awt.ev ...

  3. 大多数程序员都懂的java虚拟机:C1编译器从字节码到HIR

    从字节码到HIR 正如之前看到的,C1的HIR是一个基于静态单赋值的图IR,由基本块构成控制流图,由静态单赋值指令构成基本块,如图8-1所示. 所有的指令都派生自Instruction类,其中,Blo ...

  4. Java指令全集_Java的JVM字节码指令集详解

    本文详细介绍了如何使用javap查看java方法中的字节码.以及各种字节码的含义,并且配以完善的案例,一步步,从头到尾带领大家翻译javap的输出.在文末还附有JVM字节码指令集表. 本文不适合没有J ...

  5. Java 基础巩固:内部类的字节码学习和实战使用场景

    文章出自:安卓进阶学习指南 主要贡献者: Cloud9527 Alex_赵 Struggle shixinzhang 读完本文你将了解: 背景介绍 四种内部类介绍 成员内部类 静态内部类 局部内部类 ...

  6. java如何手撕加载字节码的代码?编写一个加载class文件的方法

    1 自定义ClassLoader类:MemoryClassLoader public class MemoryClassLoader extends URLClassLoader {// class ...

  7. Java字节码浅析(—)

    英文原文链接,译文链接,原文作者:James Bloom,译者:有孚 明白Java代码是如何编译成字节码并在JVM上运行的非常重要,这有助于理解程序运行的时候究竟发生了些什么.理解这点不仅能搞清语言特 ...

  8. 《深入理解Java虚拟机》笔记5——类加载机制与字节码执行引擎

    第七章 虚拟机类加载机制 7.1 概述 虚拟机把描述类的数据从Class文件加载到内存,并对数据进行校验.转换解析和初始化,最终形成可以被虚拟机直接使用的Java类型,这就是虚拟机的类加载机制. 在J ...

  9. java探针之修改类字节码文件

    java探针利用了javaAgent + ASM字节码注入工具实现了动态修改类文件的功能.像skywalking和arthas都使用到了这个技术. 具体原理为: jdk1.5以后引入了javaAgen ...

  10. Java字节码(.class文件)格式详解(一)

    原文链接:http://www.blogjava.net/DLevin/archive/2011/09/05/358033.html 小介:去年在读<深入解析JVM>的时候写的,记得当时还 ...

最新文章

  1. [二分][前缀和]洛谷 P1083 借教室
  2. 马斯克:我是Rust粉丝,但我选择C
  3. MongoDB 基本命令
  4. python获取小程序手机号并绑定
  5. 模式对话框与非模式对话框的创建方法
  6. DEDECMS v5.7 实现导航条下拉二级菜单
  7. DotNetBar SuperGridControl控件
  8. spark入门demo
  9. FPS综述:植物次生代谢物与微生物组互作研究进展
  10. 历经30年,仍未解决通讯难题,水下机器人是虚假繁荣吗?
  11. OpenCV 文字检测与识别模块
  12. Unity3D 实现本地排行榜功能
  13. MySQL入门教程系列-1.5 如何学习MySQL
  14. C++代码中R“(xxxxxxxxxxx)“
  15. 服务器右下角的tomcat图标不显示了——解决方法
  16. nc测试UDP是否正常
  17. MM快讯:移动MM折桂中国移动2009年度业务服务创新奖
  18. Vector NTI 11.5.3| Win版 | 生物专业软件 | 安装教程
  19. “小会话,大学问”:如何让聊天机器人读懂对话历史?
  20. picgo-plugin-imageX火山引擎ImageX插件for picGo

热门文章

  1. python3安装MySQLdb
  2. java高级面试题及答案
  3. WinRAR 5.70 简体中文官方试用版(无广告)
  4. 易语言js加密解密教程
  5. 人脸识别的人像处理流程是怎样的?
  6. 办公技巧分享:如何编辑PDF文件内容
  7. EtherCAT主站SOEM函数详解---- ecx_statecheck
  8. 2022最新版sci和ssci双检索期刊,详细期刊目录值得了解!
  9. java acr122 读取数据_acr122读写器软件下载
  10. 联想微型计算机 y720,助你全场超神 评联想拯救者Y720 Cube