如何使用python从二进制文件中读取数据

2024-04-28 16:10:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我想从智能卡检索证书数据。通过使用“PyScard”实用程序的SCardTransmit函数,我们可以通过发送apdu来获取数据,但是文件的长度太大了。有谁能帮我获得字符串格式的数据以及如何获取数据。 我用C编写的代码如下:

    dwLenExpected = ( ( dwOffset + 0xFD ) > dwCertFileSize )?
                                        dwLenExpected : 0xFD;


    Execute the command and get the data copy the data from receive buffer using "memcpy" and increase the offset by length 

    dwOffset += 0xFD;

现在我想用python实现它。 感谢任何帮助。 提前谢谢你


Tags: and文件the数据函数字符串实用程序data