commit f9e8058931e2e9ab39f4ccf129aecb24423d89e9 Author: huxuejian Date: Mon Oct 19 18:08:35 2026 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a24650 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/build/ +/dist/ +/logs/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0d60163 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.12) +project(readcard_c LANGUAGES C CXX) + +# Build with: cmake -A Win32 -T v141 .. +# This project targets 32-bit Windows 7 SP1 and later, subject to the vendor +# device drivers and their installed dependencies. +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_executable(readcard-c WIN32 src/main.cpp src/qrcodegen.c) +target_compile_definitions(readcard-c PRIVATE UNICODE _UNICODE WIN32_LEAN_AND_MEAN) +target_link_libraries(readcard-c PRIVATE ws2_32 comctl32) + +if(MSVC) + target_compile_options(readcard-c PRIVATE /W4 /permissive- /utf-8 /MT) + # target_link_options was added after the CMake bundled with VS2017. + set_property(TARGET readcard-c APPEND_STRING PROPERTY LINK_FLAGS " /SUBSYSTEM:WINDOWS,6.01") +endif() diff --git a/README.md b/README.md new file mode 100644 index 0000000..1d57d95 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# readcard-c + +é�¢å�‘旧版 Windows 的原生 C++/Win32 本地读å�¡ä¸ŽåŒ»ä¿�电å­�凭è¯�程åº�。程åº�必须构建为 **Win32/x86**,因为 `CardReaderDLL.dll` 与 `NationECCode.dll` å�‡ä¸º 32 ä½� DLL。 + +## Windows 兼容性 + +项目使用 Win32 API å’Œé�™æ€�链接 MSVC è¿�行时。建议用 Visual Studio 2017 çš„ `v141_xp` 工具集构建,目标为 Windows XP SP3 å�Šä»¥ä¸Šï¼›å®žé™…下é™�还å�–决于读å�¡å™¨ã€�扫ç �墩驱动å�ŠåŒ»ä¿�厂商 DLL 的支æŒ�范围。 + +```powershell +cmake -S . -B build -A Win32 -T v141_xp +cmake --build build --config Release +``` + +也å�¯å�Œå‡» `一键打包.bat`。若直接è¿�行 `build.ps1`,请在 PowerShell 中执行 `./build.ps1`,而ä¸�是在资æº�管ç�†å™¨ä¸­å�Œå‡» `.ps1` 文件。 + +将以下内容一起å�‘布: + +```text +readcard-c.exe +config.json +package/DWCardReaderDLL/ +package/EMICDLL/ +``` + +## GUI 与å�Žç»­æŽ¥å�£ + +当å‰�首版已实现 Win32 GUIã€�两套 DLL 的加载ã€�医ä¿�扫ç �墩输入到 `NationEcTrans` 的调用ã€�电å­�凭è¯�è§£æž�展示,以å�Šé€�步骤日志。医ä¿�电å­�凭è¯�按钮会把焦点交给éš�è—�的扫ç �输入框;扫ç �墩输入完æˆ�å¹¶å�‘é€�回车å�Žï¼Œç¨‹åº�通过 `NationEcTrans` 调用医ä¿� DLL,并显示姓å��ã€�è¯�ä»¶å�·ã€�`ecToken`。 + +旧项目的本地 HTTP 接å�£ï¼ˆ`/health`ã€�`/api/card/read-nopin`ã€�`/api/card/read`ã€�`/api/hmac-sm3`ã€�`/api/emic/scan`)应作为下一阶段è¿�移到本项目;在未完æˆ�å‰�,PC å‰�端ä»�应继续调用旧的 `readcard-go` æœ�务。 + +## é€�步骤日志 + +`operation_trace_enabled` 控制æµ�程日志,开å�‘期默认为 `true`。`operation_trace_include_sensitive` 控制是å�¦è®°å½•å§“å��ã€�身份è¯�å�·ã€�å�¡å�·ã€�医ä¿�ç �å’Œ `ecToken`,开å�‘期默认为 `true`,正å¼�环境应设为 `false`。日志写入 `logs/operation-YYYYMMDD.log`。 diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..0fae235 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,75 @@ +param([string]$Configuration = "Release") + +$ErrorActionPreference = "Stop" +$Root = $PSScriptRoot +$Build = Join-Path -Path $Root -ChildPath "build" +$Dist = Join-Path -Path $Root -ChildPath "dist" +$MSBuild = "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" +$VCVars = "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" + +$CMakeCommand = Get-Command cmake -ErrorAction SilentlyContinue +if ($CMakeCommand) { + $CMake = $CMakeCommand.Source +} else { + $VsCMake = "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" + if (-not (Test-Path -LiteralPath $VsCMake)) { + throw "CMake was not found. Install Visual Studio C++ Desktop Development and CMake." + } + $CMake = $VsCMake +} +if (-not (Test-Path -LiteralPath $MSBuild)) { + throw "Visual Studio 2017 MSBuild was not found. Install the Visual C++ Build Tools workload." +} +$env:Path = (Split-Path -Parent $MSBuild) + ";" + $env:Path +if (-not (Test-Path -LiteralPath $VCVars)) { + throw "Visual Studio 2017 C++ environment setup was not found. Install the Visual C++ Build Tools workload." +} +# Import the x86 compiler, SDK, include, and library paths into this PowerShell process. +$VCVarsCommand = 'call "' + $VCVars + '" x86 >nul && set' +cmd.exe /c $VCVarsCommand | ForEach-Object { + if ($_ -match '^([^=]+)=(.*)$') { + Set-Item -Path ("env:" + $matches[1]) -Value $matches[2] + } +} +$UcrtLib = "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\ucrt\x86" +if (Test-Path -LiteralPath $UcrtLib) { + $env:LIB = $env:LIB + ";" + $UcrtLib +} + +# VS2017's bundled CMake predates the -S/-B flags, so configure from build/. +# Build a 32-bit v141 application. v141 is the appropriate target for +# Windows 7; the optional v141_xp toolset requires an obsolete XP SDK and +# prevents CMake's compiler probe from locating the modern UCRT libraries. +New-Item -ItemType Directory -Force -Path $Build | Out-Null +$Cache = Join-Path -Path $Build -ChildPath "CMakeCache.txt" +if ((Test-Path -LiteralPath $Cache) -and ((Select-String -LiteralPath $Cache -Pattern 'CMAKE_CXX_COMPILER:FILEPATH=CMAKE_CXX_COMPILER-NOTFOUND' -Quiet) -or (Test-Path -LiteralPath (Join-Path -Path $Build -ChildPath "CMakeFiles\CMakeError.log")))) { + Remove-Item -LiteralPath $Cache -Force + $CMakeFiles = Join-Path -Path $Build -ChildPath "CMakeFiles" + if (Test-Path -LiteralPath $CMakeFiles) { Remove-Item -LiteralPath $CMakeFiles -Recurse -Force } +} +Push-Location $Build +try { + # Force static CRT even for CMake's Debug compiler probe. + & $CMake -G "Visual Studio 15 2017" -A Win32 -T v141 ("-DCMAKE_MAKE_PROGRAM=" + $MSBuild) "-DCMAKE_C_FLAGS_DEBUG=/MTd" "-DCMAKE_CXX_FLAGS_DEBUG=/MTd" $Root + if ($LASTEXITCODE -ne 0) { throw "CMake configuration failed." } + & $CMake --build . --config $Configuration + if ($LASTEXITCODE -ne 0) { throw "CMake build failed." } +} finally { + Pop-Location +} + +New-Item -ItemType Directory -Force -Path $Dist | Out-Null +$ConfigurationDir = Join-Path -Path $Build -ChildPath $Configuration +$Binary = Join-Path -Path $ConfigurationDir -ChildPath "readcard-c.exe" +if (-not (Test-Path -LiteralPath $Binary)) { + throw "Build output was not found: $Binary" +} +$ExeDestination = Join-Path -Path $Dist -ChildPath "readcard-c.exe" +$ConfigSource = Join-Path -Path $Root -ChildPath "config.json" +$ConfigDestination = Join-Path -Path $Dist -ChildPath "config.json" +$PackageSource = Join-Path -Path $Root -ChildPath "package" +$PackageDestination = Join-Path -Path $Dist -ChildPath "package" +Copy-Item -LiteralPath $Binary -Destination $ExeDestination -Force +Copy-Item -LiteralPath $ConfigSource -Destination $ConfigDestination -Force +Copy-Item -LiteralPath $PackageSource -Destination $PackageDestination -Recurse -Force +Write-Host "Build completed: $Dist" diff --git a/config.json b/config.json new file mode 100644 index 0000000..d594c2f --- /dev/null +++ b/config.json @@ -0,0 +1,17 @@ +{ + "host": "127.0.0.1", + "port": 17880, + "card_dll_dir": "package/DWCardReaderDLL", + "gui_reader_type": "ZJ_HZ_310000", + "emic_dll": "package/EMICDLL/NationECCode.dll", + "emic_url": "http://10.249.81.107/localcfc/api/hsecfc/localQrCodeQuery", + "emic_org_id": "H33048100004", + "emic_business_type": "01101", + "emic_operator_id": "admin", + "emic_operator_name": "administrator", + "emic_office_id": "D99", + "emic_office_name": "其他科室", + "operation_trace_enabled": true, + "operation_trace_include_sensitive": true, + "log_dir": "logs" +} diff --git a/package/DWCardReaderDLL/CardReaderDLL.dll b/package/DWCardReaderDLL/CardReaderDLL.dll new file mode 100644 index 0000000..f10ed45 Binary files /dev/null and b/package/DWCardReaderDLL/CardReaderDLL.dll differ diff --git a/package/DWCardReaderDLL/CardReaderDLLTest.exe b/package/DWCardReaderDLL/CardReaderDLLTest.exe new file mode 100644 index 0000000..1e5fc0e Binary files /dev/null and b/package/DWCardReaderDLL/CardReaderDLLTest.exe differ diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 32.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 32.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 32.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 41.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 41.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 41.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 46.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 46.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 46.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 47.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 47.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 47.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 51.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 51.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 51.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 53.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 53.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 53.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 54.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 54.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 54.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 57.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 57.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 57.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 53 58.txt b/package/DWCardReaderDLL/RYTCARDLog_14 53 58.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 53 58.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 54 02.txt b/package/DWCardReaderDLL/RYTCARDLog_14 54 02.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 54 02.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 54 03.txt b/package/DWCardReaderDLL/RYTCARDLog_14 54 03.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 54 03.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 54 16.txt b/package/DWCardReaderDLL/RYTCARDLog_14 54 16.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 54 16.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 54 20.txt b/package/DWCardReaderDLL/RYTCARDLog_14 54 20.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 54 20.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/RYTCARDLog_14 54 26.txt b/package/DWCardReaderDLL/RYTCARDLog_14 54 26.txt new file mode 100644 index 0000000..0c7fe26 --- /dev/null +++ b/package/DWCardReaderDLL/RYTCARDLog_14 54 26.txt @@ -0,0 +1,2 @@ + + --------------------------begin iReadCardBas_YT shanghai test diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_MH_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_MH_ZJ.dll new file mode 100644 index 0000000..54438b8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_MH_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_WX_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_WX_ZJ.dll new file mode 100644 index 0000000..7be1409 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_310000/SSCardDriver_WX_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/ZJ_HZ_ReadCard.dll b/package/DWCardReaderDLL/ZJ_HZ_310000/ZJ_HZ_ReadCard.dll new file mode 100644 index 0000000..ce1a216 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_310000/ZJ_HZ_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/egapp.ini b/package/DWCardReaderDLL/ZJ_HZ_310000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_310000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_HZ_310000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_HZ_310000/hsmconfig.ini new file mode 100644 index 0000000..9de19bc --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_310000/hsmconfig.ini @@ -0,0 +1,17 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +//æ�­å·žå¸‚加密机æœ�务地å�€é»˜è®¤ä¸ºçœ�人社å�¡ç®¡ç³»ç»ŸåŠ å¯†æœºåœ°å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œæ�­å·žé»˜è®¤ä¸ºå�¯ç”¨ +HSM=1 +;加密机æœ�务IP +HostName=172.16.69.3 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 明å�Žï¼›2 å¾·å�¡ï¼›3 网新;4 顺嘉;5 明泰 +search=0 + diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/C++_hidpos_dll.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/C++_hidpos_dll.dll new file mode 100644 index 0000000..baba660 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/C++_hidpos_dll.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/CH9326DLL.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/CH9326DLL.dll new file mode 100644 index 0000000..9a82a39 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/CH9326DLL.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/DS_32.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/DS_32.dll new file mode 100644 index 0000000..c4ef20d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/DS_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/GetInfo.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/GetInfo.dll new file mode 100644 index 0000000..daebde6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/GetInfo.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/HSM.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/HSM.dll new file mode 100644 index 0000000..182e768 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/HSM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/Hnic32_2.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/Hnic32_2.dll new file mode 100644 index 0000000..a4b56ed Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/Hnic32_2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/Hnic32_3.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/Hnic32_3.dll new file mode 100644 index 0000000..51bc8de Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/Hnic32_3.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/KeyPad.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/KeyPad.dll new file mode 100644 index 0000000..1ab33d9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/KeyPad.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/LANDI_SSCardDriver.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/LANDI_SSCardDriver.ini new file mode 100644 index 0000000..d30afb5 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/LANDI_SSCardDriver.ini @@ -0,0 +1,3 @@ +LANDI_SSCardDriver +#´®¿ÚÉ趨 ´®¿ÚΪ1-9 +COM=4 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/LD_Reader.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/LD_Reader.dll new file mode 100644 index 0000000..d0fe4d8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/LD_Reader.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/PCOMM.DLL b/package/DWCardReaderDLL/ZJ_HZ_313000/PCOMM.DLL new file mode 100644 index 0000000..a6ebd82 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/PCOMM.DLL differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCARD.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCARD.dll new file mode 100644 index 0000000..387bb3a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCARD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_HD_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_HD_ZJ.dll new file mode 100644 index 0000000..ce4ee23 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_HD_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_JYX_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_JYX_ZJ.dll new file mode 100644 index 0000000..04fdda6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_JYX_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_LD_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_LD_ZJ.dll new file mode 100644 index 0000000..5989234 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_LD_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_MH_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_MH_ZJ.dll new file mode 100644 index 0000000..54438b8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_MH_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_TSW_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_TSW_ZJ.dll new file mode 100644 index 0000000..a9870de Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_TSW_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_WX_ZJ.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_WX_ZJ.dll new file mode 100644 index 0000000..7be1409 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSCardDriver_WX_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32.dll new file mode 100644 index 0000000..1bfeabc Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_F4.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_F4.dll new file mode 100644 index 0000000..3c51c9b Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_F4.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_F41.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_F41.dll new file mode 100644 index 0000000..c89484d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_F41.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_MDS.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_MDS.dll new file mode 100644 index 0000000..ba8eca6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_MDS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_TSD.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_TSD.dll new file mode 100644 index 0000000..ba8eca6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_TSD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_TSU.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_TSU.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_TSU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_U.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_U.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_U.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_U30.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_U30.dll new file mode 100644 index 0000000..2d1a6a1 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SSSE32_U30.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/SW100.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/SW100.dll new file mode 100644 index 0000000..5d06b52 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/SW100.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/ScanerModule.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/ScanerModule.dll new file mode 100644 index 0000000..f25a526 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/ScanerModule.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TECSUN.DAT b/package/DWCardReaderDLL/ZJ_HZ_313000/TECSUN.DAT new file mode 100644 index 0000000..012ed02 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TECSUN.DAT differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TECSUN.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TECSUN.dll new file mode 100644 index 0000000..f2110b5 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TECSUN.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TERMINF.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/TERMINF.ini new file mode 100644 index 0000000..53a82f5 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/TERMINF.ini @@ -0,0 +1,11 @@ +[TERMINF] + +#SAM¿¨²Û +SAM=1 + +#¶Ë¿Ú +USBPORT=1 + +#¼ÓÃÜ»ú·þÎñÆ÷µØÖ· + +URL=http://10.87.0.72:9006/WebServiceTz/services/callBusiness \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSCISCONFIG.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSCISCONFIG.dll new file mode 100644 index 0000000..5159383 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSCISCONFIG.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSConfig.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSConfig.dll new file mode 100644 index 0000000..5cc07b3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSConfig.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSConfig.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/TSConfig.ini new file mode 100644 index 0000000..99b84ef --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/TSConfig.ini @@ -0,0 +1,21 @@ +[SET] +Flag = 1 +SamNad_V1 = 17|18|19|20 +SamNad_V2 = 17|18|19|20 +SamNad_V3 = 17|18|19|20 +LogFile = 4 +LogDir = "" +LogLife = 1 +RetPIN = 0 +DevLmtType=0 +[READER] +ReaderType =4 +Try = "1|4" +[KEYPAD] +KeyPadType =108 +Try = "110|101|105" +[FILEAUTH] +Label=32 +SSSE32_TSD=F4_MDS +SSSE32_TSU=SSSE32.dll +TSW_KS=panny_dl.dll diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSCrypt.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSCrypt.dll new file mode 100644 index 0000000..4eee9d8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSCrypt.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSDrvCfg.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/TSDrvCfg.ini new file mode 100644 index 0000000..977b54b --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/TSDrvCfg.ini @@ -0,0 +1,9 @@ + +[SET] +Flag = 1 +LogFile = 4 +LogDir = "" +LogLife = 1 + + + diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-903KU-2.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-903KU-2.dll new file mode 100644 index 0000000..ffb1a6d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-903KU-2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-905HU.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-905HU.dll new file mode 100644 index 0000000..a0b09b2 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-905HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-906HU.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-906HU.dll new file mode 100644 index 0000000..efbf4ef Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW-906HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSW_KS.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW_KS.dll new file mode 100644 index 0000000..e602eae Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSW_KS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/TSWriteKey.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/TSWriteKey.dll new file mode 100644 index 0000000..20d1b72 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/TSWriteKey.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/USBDll.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/USBDll.dll new file mode 100644 index 0000000..6e03d05 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/USBDll.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/UnPack.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/UnPack.dll new file mode 100644 index 0000000..2dc0943 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/UnPack.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/WinSocket.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/WinSocket.dll new file mode 100644 index 0000000..d6dd9f6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/WinSocket.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/WinSocketSM.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/WinSocketSM.dll new file mode 100644 index 0000000..fb1afdb Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/WinSocketSM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/WltRS.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/WltRS.dll new file mode 100644 index 0000000..daebde6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/WltRS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/ZJHSM.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/ZJHSM.ini new file mode 100644 index 0000000..daeb4c3 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/ZJHSM.ini @@ -0,0 +1,6 @@ +[SET] +URL = "http://10.87.0.72:9006/WebServiceTz/services/callBusiness" +PKeyNo = 1 +PKey = "F88041389C13DD075FAC5F2DDCE86AF8" +KLevel = 2 +Location = 1 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/ZJ_HuZhou_ReadCard.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/ZJ_HuZhou_ReadCard.dll new file mode 100644 index 0000000..f16da16 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/ZJ_HuZhou_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/config.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/config.ini new file mode 100644 index 0000000..1828a95 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/config.ini @@ -0,0 +1,19 @@ +[SET] +SamNad_V1 = 17 +SamNad_V2 = 17 +SamNad_V3 = 17 + +LogFile = 3 +LogDir = "" +LogLife = 1 +VPINBEFCPIN = 1 + +FilePath_SSSE = 1 + +[READER] +ReaderType = 6 +Try = "1|6" + +[KEYPAD] +KeyPadType =105 +Try = "" diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/dcrf32.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/dcrf32.dll new file mode 100644 index 0000000..2426c53 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/dcrf32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/egapp.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/fct_des.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/fct_des.dll new file mode 100644 index 0000000..e3d3e91 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/fct_des.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_HZ_313000/hsmconfig.ini new file mode 100644 index 0000000..4d2c163 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_HZ_313000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œæ¹–州默认为å�¯ç”¨ +HSM=1 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 è�”迪;2 明å�Žï¼›3 网新;4 明泰;5 德生;6 å�Žå¤§ï¼›7 顺嘉;8 å¾·å�¡ï¼›9 æ�·å®‡æ˜Ÿ +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/libcurl.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/libcurl.dll new file mode 100644 index 0000000..fce12b9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/libcurl.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/libghttp.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/libghttp.dll new file mode 100644 index 0000000..e80295e Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/libghttp.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/mt_32.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/mt_32.dll new file mode 100644 index 0000000..5ba13b0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/mt_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_HZ_313000/ssse32_LANDI.dll b/package/DWCardReaderDLL/ZJ_HZ_313000/ssse32_LANDI.dll new file mode 100644 index 0000000..02cea0c Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_HZ_313000/ssse32_LANDI.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/CH9326DLL.dll b/package/DWCardReaderDLL/ZJ_JH_321000/CH9326DLL.dll new file mode 100644 index 0000000..9a82a39 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/CH9326DLL.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/DS_32.dll b/package/DWCardReaderDLL/ZJ_JH_321000/DS_32.dll new file mode 100644 index 0000000..c4ef20d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/DS_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/HSM.dll b/package/DWCardReaderDLL/ZJ_JH_321000/HSM.dll new file mode 100644 index 0000000..182e768 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/HSM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/Hnic32_2.dll b/package/DWCardReaderDLL/ZJ_JH_321000/Hnic32_2.dll new file mode 100644 index 0000000..a4b56ed Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/Hnic32_2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/Hnic32_3.dll b/package/DWCardReaderDLL/ZJ_JH_321000/Hnic32_3.dll new file mode 100644 index 0000000..51bc8de Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/Hnic32_3.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/LANDI_SSCardDriver.ini b/package/DWCardReaderDLL/ZJ_JH_321000/LANDI_SSCardDriver.ini new file mode 100644 index 0000000..d30afb5 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/LANDI_SSCardDriver.ini @@ -0,0 +1,3 @@ +LANDI_SSCardDriver +#´®¿ÚÉ趨 ´®¿ÚΪ1-9 +COM=4 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/LD_Reader.dll b/package/DWCardReaderDLL/ZJ_JH_321000/LD_Reader.dll new file mode 100644 index 0000000..d0fe4d8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/LD_Reader.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/PCOMM.DLL b/package/DWCardReaderDLL/ZJ_JH_321000/PCOMM.DLL new file mode 100644 index 0000000..a6ebd82 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/PCOMM.DLL differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCARD.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCARD.dll new file mode 100644 index 0000000..387bb3a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCARD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_DXHP_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_DXHP_ZJ.dll new file mode 100644 index 0000000..df36f0c Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_DXHP_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_HD_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_HD_ZJ.dll new file mode 100644 index 0000000..fad8b70 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_HD_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_LD_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_LD_ZJ.dll new file mode 100644 index 0000000..5989234 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_LD_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_MH_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_MH_ZJ.dll new file mode 100644 index 0000000..54438b8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_MH_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_TSW_ZJ.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_TSW_ZJ.dll new file mode 100644 index 0000000..a9870de Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSCardDriver_TSW_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32.dll new file mode 100644 index 0000000..6055872 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_F4.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_F4.dll new file mode 100644 index 0000000..3c51c9b Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_F4.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_F41.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_F41.dll new file mode 100644 index 0000000..c89484d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_F41.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_MDS.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_MDS.dll new file mode 100644 index 0000000..ba8eca6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_MDS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_TSD.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_TSD.dll new file mode 100644 index 0000000..ba8eca6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_TSD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_TSU.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_TSU.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_TSU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_U.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_U.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_U.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_U30.dll b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_U30.dll new file mode 100644 index 0000000..2d1a6a1 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/SSSE32_U30.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TECSUN.DAT b/package/DWCardReaderDLL/ZJ_JH_321000/TECSUN.DAT new file mode 100644 index 0000000..012ed02 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TECSUN.DAT differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TECSUN.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TECSUN.dll new file mode 100644 index 0000000..f2110b5 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TECSUN.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSCISCONFIG.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSCISCONFIG.dll new file mode 100644 index 0000000..5159383 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSCISCONFIG.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSConfig.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSConfig.dll new file mode 100644 index 0000000..5cc07b3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSConfig.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSConfig.ini b/package/DWCardReaderDLL/ZJ_JH_321000/TSConfig.ini new file mode 100644 index 0000000..99b84ef --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/TSConfig.ini @@ -0,0 +1,21 @@ +[SET] +Flag = 1 +SamNad_V1 = 17|18|19|20 +SamNad_V2 = 17|18|19|20 +SamNad_V3 = 17|18|19|20 +LogFile = 4 +LogDir = "" +LogLife = 1 +RetPIN = 0 +DevLmtType=0 +[READER] +ReaderType =4 +Try = "1|4" +[KEYPAD] +KeyPadType =108 +Try = "110|101|105" +[FILEAUTH] +Label=32 +SSSE32_TSD=F4_MDS +SSSE32_TSU=SSSE32.dll +TSW_KS=panny_dl.dll diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSCrypt.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSCrypt.dll new file mode 100644 index 0000000..4eee9d8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSCrypt.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSDrvCfg.ini b/package/DWCardReaderDLL/ZJ_JH_321000/TSDrvCfg.ini new file mode 100644 index 0000000..977b54b --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/TSDrvCfg.ini @@ -0,0 +1,9 @@ + +[SET] +Flag = 1 +LogFile = 4 +LogDir = "" +LogLife = 1 + + + diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSW-903KU-2.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSW-903KU-2.dll new file mode 100644 index 0000000..ffb1a6d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSW-903KU-2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSW-905HU.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSW-905HU.dll new file mode 100644 index 0000000..a0b09b2 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSW-905HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSW-906HU.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSW-906HU.dll new file mode 100644 index 0000000..efbf4ef Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSW-906HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSW_KS.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSW_KS.dll new file mode 100644 index 0000000..e602eae Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSW_KS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/TSWriteKey.dll b/package/DWCardReaderDLL/ZJ_JH_321000/TSWriteKey.dll new file mode 100644 index 0000000..20d1b72 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/TSWriteKey.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/WinSocket.dll b/package/DWCardReaderDLL/ZJ_JH_321000/WinSocket.dll new file mode 100644 index 0000000..d6dd9f6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/WinSocket.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/WinSocketSM.dll b/package/DWCardReaderDLL/ZJ_JH_321000/WinSocketSM.dll new file mode 100644 index 0000000..fb1afdb Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/WinSocketSM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/ZJHSM.ini b/package/DWCardReaderDLL/ZJ_JH_321000/ZJHSM.ini new file mode 100644 index 0000000..daeb4c3 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/ZJHSM.ini @@ -0,0 +1,6 @@ +[SET] +URL = "http://10.87.0.72:9006/WebServiceTz/services/callBusiness" +PKeyNo = 1 +PKey = "F88041389C13DD075FAC5F2DDCE86AF8" +KLevel = 2 +Location = 1 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/ZJ_JH_ReadCard.dll b/package/DWCardReaderDLL/ZJ_JH_321000/ZJ_JH_ReadCard.dll new file mode 100644 index 0000000..9c317a2 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/ZJ_JH_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/config.ini b/package/DWCardReaderDLL/ZJ_JH_321000/config.ini new file mode 100644 index 0000000..1828a95 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/config.ini @@ -0,0 +1,19 @@ +[SET] +SamNad_V1 = 17 +SamNad_V2 = 17 +SamNad_V3 = 17 + +LogFile = 3 +LogDir = "" +LogLife = 1 +VPINBEFCPIN = 1 + +FilePath_SSSE = 1 + +[READER] +ReaderType = 6 +Try = "1|6" + +[KEYPAD] +KeyPadType =105 +Try = "" diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/egapp.ini b/package/DWCardReaderDLL/ZJ_JH_321000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_JH_321000/hsmconfig.ini new file mode 100644 index 0000000..4d3019b --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JH_321000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œé‡‘å�Žé»˜è®¤ä¸ºä¸�å�¯ç”¨ +HSM=0 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 è�”迪;2 明å�Žï¼›3 å¾·å�¡ï¼›4 德生;5 å�Žå¤§ï¼›6 东信;7 顺嘉;8 明泰 +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/libcurl.dll b/package/DWCardReaderDLL/ZJ_JH_321000/libcurl.dll new file mode 100644 index 0000000..fce12b9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/libcurl.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/mt_32.dll b/package/DWCardReaderDLL/ZJ_JH_321000/mt_32.dll new file mode 100644 index 0000000..7de9bef Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/mt_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JH_321000/ssse32_LANDI.dll b/package/DWCardReaderDLL/ZJ_JH_321000/ssse32_LANDI.dll new file mode 100644 index 0000000..02cea0c Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JH_321000/ssse32_LANDI.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/CH9326DLL.dll b/package/DWCardReaderDLL/ZJ_JX/CH9326DLL.dll new file mode 100644 index 0000000..9a82a39 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/CH9326DLL.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/CardReader_JX_ZZ.dll b/package/DWCardReaderDLL/ZJ_JX/CardReader_JX_ZZ.dll new file mode 100644 index 0000000..deaa9e4 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/CardReader_JX_ZZ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/ICCInter_JX_SB.dll b/package/DWCardReaderDLL/ZJ_JX/ICCInter_JX_SB.dll new file mode 100644 index 0000000..ceb8f04 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/ICCInter_JX_SB.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSCardDriver_ds.dll b/package/DWCardReaderDLL/ZJ_JX/SSCardDriver_ds.dll new file mode 100644 index 0000000..c0a660d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSCardDriver_ds.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSCardDriver_mt.dll b/package/DWCardReaderDLL/ZJ_JX/SSCardDriver_mt.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSCardDriver_mt.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSSE32_F41.dll b/package/DWCardReaderDLL/ZJ_JX/SSSE32_F41.dll new file mode 100644 index 0000000..c89484d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSSE32_F41.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSSE32_MDS.dll b/package/DWCardReaderDLL/ZJ_JX/SSSE32_MDS.dll new file mode 100644 index 0000000..19d8833 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSSE32_MDS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSSE32_TSD.dll b/package/DWCardReaderDLL/ZJ_JX/SSSE32_TSD.dll new file mode 100644 index 0000000..1693bee Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSSE32_TSD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSSE32_TSU.dll b/package/DWCardReaderDLL/ZJ_JX/SSSE32_TSU.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSSE32_TSU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/SSSE32_U.dll b/package/DWCardReaderDLL/ZJ_JX/SSSE32_U.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/SSSE32_U.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/TECSUN.dll b/package/DWCardReaderDLL/ZJ_JX/TECSUN.dll new file mode 100644 index 0000000..d58a28a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/TECSUN.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/TSConfig.ini b/package/DWCardReaderDLL/ZJ_JX/TSConfig.ini new file mode 100644 index 0000000..3518d35 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JX/TSConfig.ini @@ -0,0 +1,15 @@ +[SET] +Flag = 1 +SamNad_V1 = 17|18 +SamNad_V2 = 17|18 +SamNad_V3 = 17|18 +LogFile = 4 +LogDir = "" +LogLife = 1 +RetPIN = 0 +[READER] +ReaderType =1 +Try = "1|4" +[KEYPAD] +KeyPadType =101 +Try = "110|101" diff --git a/package/DWCardReaderDLL/ZJ_JX/TSW-905HU.dll b/package/DWCardReaderDLL/ZJ_JX/TSW-905HU.dll new file mode 100644 index 0000000..a0b09b2 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/TSW-905HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/TSW_KS.dll b/package/DWCardReaderDLL/ZJ_JX/TSW_KS.dll new file mode 100644 index 0000000..6bbe023 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/TSW_KS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/fct_des.dll b/package/DWCardReaderDLL/ZJ_JX/fct_des.dll new file mode 100644 index 0000000..e3d3e91 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/fct_des.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/iconv.dll b/package/DWCardReaderDLL/ZJ_JX/iconv.dll new file mode 100644 index 0000000..ef1baef Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/iconv.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/mt_32.dll b/package/DWCardReaderDLL/ZJ_JX/mt_32.dll new file mode 100644 index 0000000..ed6ee5a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/mt_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/mtjx_32.dll b/package/DWCardReaderDLL/ZJ_JX/mtjx_32.dll new file mode 100644 index 0000000..5fd11a4 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_JX/mtjx_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_JX/serverconfig.ini b/package/DWCardReaderDLL/ZJ_JX/serverconfig.ini new file mode 100644 index 0000000..ec78cde --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_JX/serverconfig.ini @@ -0,0 +1,5 @@ +[server_info] +;·þÎñÆ÷µØÖ· +addr=10.82.21.190 +;·þÎñÆ÷¶Ë¿Ú +port=8080 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/C++_hidpos_dll.dll b/package/DWCardReaderDLL/ZJ_LS_323000/C++_hidpos_dll.dll new file mode 100644 index 0000000..baba660 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/C++_hidpos_dll.dll differ diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/KeyPad.dll b/package/DWCardReaderDLL/ZJ_LS_323000/KeyPad.dll new file mode 100644 index 0000000..1ab33d9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/KeyPad.dll differ diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_LS_323000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/SSCardDriver_JYX_ZJ.dll b/package/DWCardReaderDLL/ZJ_LS_323000/SSCardDriver_JYX_ZJ.dll new file mode 100644 index 0000000..04fdda6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/SSCardDriver_JYX_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/WltRS.dll b/package/DWCardReaderDLL/ZJ_LS_323000/WltRS.dll new file mode 100644 index 0000000..daebde6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/WltRS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/ZJ_LS_ReadCard.dll b/package/DWCardReaderDLL/ZJ_LS_323000/ZJ_LS_ReadCard.dll new file mode 100644 index 0000000..8ede558 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/ZJ_LS_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/egapp.ini b/package/DWCardReaderDLL/ZJ_LS_323000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_LS_323000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_LS_323000/hsmconfig.ini new file mode 100644 index 0000000..e3b69ec --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_LS_323000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œä¸½æ°´é»˜è®¤ä¸ºä¸�å�¯ç”¨ +HSM=0 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 æ�·å®‡æ˜Ÿï¼›2 å¾·å�¡ +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_LS_323000/ssse32.dll b/package/DWCardReaderDLL/ZJ_LS_323000/ssse32.dll new file mode 100644 index 0000000..1bfeabc Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_LS_323000/ssse32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_MH_ZJ.dll b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_MH_ZJ.dll new file mode 100644 index 0000000..54438b8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_MH_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_NB_315000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/ZJ_NB_ReadCard.dll b/package/DWCardReaderDLL/ZJ_NB_315000/ZJ_NB_ReadCard.dll new file mode 100644 index 0000000..fb4fe97 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_NB_315000/ZJ_NB_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/egapp.ini b/package/DWCardReaderDLL/ZJ_NB_315000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_NB_315000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_NB_315000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_NB_315000/hsmconfig.ini new file mode 100644 index 0000000..2affa08 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_NB_315000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œå®�波默认为ä¸�å�¯ç”¨ +HSM=0 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 明å�Žï¼›2 å¾·å�¡ï¼›3 顺嘉;4 明泰 +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_QZ/C++_hidpos_dll.dll b/package/DWCardReaderDLL/ZJ_QZ/C++_hidpos_dll.dll new file mode 100644 index 0000000..baba660 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/C++_hidpos_dll.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/KeyPad.dll b/package/DWCardReaderDLL/ZJ_QZ/KeyPad.dll new file mode 100644 index 0000000..1ab33d9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/KeyPad.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_DP_R123USB2.dll b/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_DP_R123USB2.dll new file mode 100644 index 0000000..54438b8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_DP_R123USB2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_JYX_ZJ.dll b/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_JYX_ZJ.dll new file mode 100644 index 0000000..04fdda6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_JYX_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/ZJ_QZ_ReadCard.dll b/package/DWCardReaderDLL/ZJ_QZ/ZJ_QZ_ReadCard.dll new file mode 100644 index 0000000..f9e7964 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/ZJ_QZ_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_QZ/hsmconfig.ini new file mode 100644 index 0000000..528164e --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_QZ/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œè¡¢å·žé»˜è®¤ä¸ºå�¯ç”¨ +HSM=1 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 明å�Žï¼›2 明泰;3 æ�·å®‡æ˜Ÿ +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_QZ/log4net.dll b/package/DWCardReaderDLL/ZJ_QZ/log4net.dll new file mode 100644 index 0000000..7735ef2 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/log4net.dll differ diff --git a/package/DWCardReaderDLL/ZJ_QZ/ssse32.dll b/package/DWCardReaderDLL/ZJ_QZ/ssse32.dll new file mode 100644 index 0000000..1bfeabc Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_QZ/ssse32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_DC.ini b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_DC.ini new file mode 100644 index 0000000..b7da54f --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_DC.ini @@ -0,0 +1,52 @@ +; +; +; Ö¸¶¨¶ÁдÆ÷Á¬½Ó + + +; +; Version: V1.1 + + +;; ˵Ã÷:µÚһλ;´ú±íÕâÒ»ÐÐÊÇ×¢ÊÍ¡£ÈôÐèÒªÆôÓÃÉèÖÃɾµôµÚһλ;¼´¿É + +[DEV] +; ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ + + PORT=100 +; ¶ÁдÆ÷Á¬½ÓµÄ¶Ë¿ÚºÅ¡£ +; ȡֵº¬Òå: 100´ú±íUSB¡¢1´ú±íCOM1¡¢2´ú±íCOM2¡¢3´ú±íCOM3¡¢...... +; ĬÈÏȡֵ100 + +; ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ + + BAUD=115200 +; ¶ÁдÆ÷Á¬½ÓµÄ²¨ÌØÂÊ¡£ +; ³£ÓÃȡֵ: 9600¡¢115200 +; ĬÈÏȡֵ115200 + +; ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ + +; SNR= +; ±¸ÓÃÉèÖᣠ+ +; ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ + +; PRE_PROTOCOL= +; Ö¸¶¨Á¬½ÓµÄÉ豸ЭÒé¡£µ±¶ą̀É豸ͬʱÁ¬½ÓʱʹÓà +; ȡֵº¬Òå: 1´ú±íDCICЭÒé(°üº¬T6/Z9)¡¢2´ú±íDCRFЭÒé(°üº¬D8/T10/Z90½ðÈÚ°æ) +; ĬÈÏȡֵ¿Õ + +; ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ + +; PRE_VER= +; Ö¸¶¨Á¬½ÓµÄÉ豸¹Ì¼þ°æ±¾ºÅ¡£µ±¶ą̀É豸ͬʱÁ¬½ÓʱʹÓà +; ȡֵº¬Òå: ±ØÐëÓëÉ豸ÄÚ°æ±¾ºÅÍêȫһÖ +; ĬÈÏȡֵ¿Õ + +; ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ + +; PRE_SNR= +; Ö¸¶¨Á¬½ÓµÄÉ豸³¤°æ±¾ºÅ¡£µ±¶ą̀É豸ͬʱÁ¬½ÓʱʹÓà +; ȡֵº¬Òå: ±ØÐëÓëÉ豸ÄÚдµÄ32λÍêȫһÖ +; ĬÈÏȡֵ¿Õ + diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9110cd7 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_MH_ZJ.dll b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_MH_ZJ.dll new file mode 100644 index 0000000..54438b8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_MH_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_SX_312000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/Trf32.dll b/package/DWCardReaderDLL/ZJ_SX_312000/Trf32.dll new file mode 100644 index 0000000..90eade9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_SX_312000/Trf32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/ZJ_SX_ReadCard.dll b/package/DWCardReaderDLL/ZJ_SX_312000/ZJ_SX_ReadCard.dll new file mode 100644 index 0000000..4780ed8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_SX_312000/ZJ_SX_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/egapp.ini b/package/DWCardReaderDLL/ZJ_SX_312000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_SX_312000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_SX_312000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_SX_312000/hsmconfig.ini new file mode 100644 index 0000000..56380f9 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_SX_312000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œç»�兴默认为å�¯ç”¨ï¼ˆV1.6.7版本修改) +HSM=1 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 明å�Žï¼›2 明泰;3 å¾·å�¡ï¼›4 顺嘉 +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/CH9326DLL.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/CH9326DLL.dll new file mode 100644 index 0000000..9a82a39 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/CH9326DLL.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/DS_32.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/DS_32.dll new file mode 100644 index 0000000..c4ef20d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/DS_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/HSM.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/HSM.dll new file mode 100644 index 0000000..182e768 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/HSM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/Hnic32_2.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/Hnic32_2.dll new file mode 100644 index 0000000..a4b56ed Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/Hnic32_2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/Hnic32_3.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/Hnic32_3.dll new file mode 100644 index 0000000..51bc8de Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/Hnic32_3.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/PCOMM.DLL b/package/DWCardReaderDLL/ZJ_TZ_318000/PCOMM.DLL new file mode 100644 index 0000000..a6ebd82 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/PCOMM.DLL differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSCARD.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCARD.dll new file mode 100644 index 0000000..387bb3a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCARD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_MT3_ZJ.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_MT3_ZJ.dll new file mode 100644 index 0000000..190a8a3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_MT3_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_TSW_ZJ.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_TSW_ZJ.dll new file mode 100644 index 0000000..a9870de Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSCardDriver_TSW_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32.dll new file mode 100644 index 0000000..6055872 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_F4.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_F4.dll new file mode 100644 index 0000000..3c51c9b Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_F4.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_F41.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_F41.dll new file mode 100644 index 0000000..c89484d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_F41.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_MDS.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_MDS.dll new file mode 100644 index 0000000..ba8eca6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_MDS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_TSD.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_TSD.dll new file mode 100644 index 0000000..ba8eca6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_TSD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_TSU.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_TSU.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_TSU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_U.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_U.dll new file mode 100644 index 0000000..14b4387 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_U.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_U30.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_U30.dll new file mode 100644 index 0000000..2d1a6a1 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/SSSE32_U30.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TECSUN.DAT b/package/DWCardReaderDLL/ZJ_TZ_318000/TECSUN.DAT new file mode 100644 index 0000000..012ed02 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TECSUN.DAT differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TECSUN.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TECSUN.dll new file mode 100644 index 0000000..f2110b5 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TECSUN.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSCISCONFIG.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSCISCONFIG.dll new file mode 100644 index 0000000..5159383 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSCISCONFIG.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSConfig.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSConfig.dll new file mode 100644 index 0000000..5cc07b3 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSConfig.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSConfig.ini b/package/DWCardReaderDLL/ZJ_TZ_318000/TSConfig.ini new file mode 100644 index 0000000..99b84ef --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_TZ_318000/TSConfig.ini @@ -0,0 +1,21 @@ +[SET] +Flag = 1 +SamNad_V1 = 17|18|19|20 +SamNad_V2 = 17|18|19|20 +SamNad_V3 = 17|18|19|20 +LogFile = 4 +LogDir = "" +LogLife = 1 +RetPIN = 0 +DevLmtType=0 +[READER] +ReaderType =4 +Try = "1|4" +[KEYPAD] +KeyPadType =108 +Try = "110|101|105" +[FILEAUTH] +Label=32 +SSSE32_TSD=F4_MDS +SSSE32_TSU=SSSE32.dll +TSW_KS=panny_dl.dll diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSCrypt.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSCrypt.dll new file mode 100644 index 0000000..4eee9d8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSCrypt.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSDrvCfg.ini b/package/DWCardReaderDLL/ZJ_TZ_318000/TSDrvCfg.ini new file mode 100644 index 0000000..977b54b --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_TZ_318000/TSDrvCfg.ini @@ -0,0 +1,9 @@ + +[SET] +Flag = 1 +LogFile = 4 +LogDir = "" +LogLife = 1 + + + diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-903KU-2.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-903KU-2.dll new file mode 100644 index 0000000..ffb1a6d Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-903KU-2.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-905HU.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-905HU.dll new file mode 100644 index 0000000..a0b09b2 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-905HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-906HU.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-906HU.dll new file mode 100644 index 0000000..efbf4ef Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW-906HU.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSW_KS.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW_KS.dll new file mode 100644 index 0000000..e602eae Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSW_KS.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/TSWriteKey.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/TSWriteKey.dll new file mode 100644 index 0000000..20d1b72 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/TSWriteKey.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/WinSocket.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/WinSocket.dll new file mode 100644 index 0000000..d6dd9f6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/WinSocket.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/WinSocketSM.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/WinSocketSM.dll new file mode 100644 index 0000000..fb1afdb Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/WinSocketSM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/ZJHSM.ini b/package/DWCardReaderDLL/ZJ_TZ_318000/ZJHSM.ini new file mode 100644 index 0000000..daeb4c3 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_TZ_318000/ZJHSM.ini @@ -0,0 +1,6 @@ +[SET] +URL = "http://10.87.0.72:9006/WebServiceTz/services/callBusiness" +PKeyNo = 1 +PKey = "F88041389C13DD075FAC5F2DDCE86AF8" +KLevel = 2 +Location = 1 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/ZJ_TZ_ReadCard.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/ZJ_TZ_ReadCard.dll new file mode 100644 index 0000000..bef5fbe Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/ZJ_TZ_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/config.ini b/package/DWCardReaderDLL/ZJ_TZ_318000/config.ini new file mode 100644 index 0000000..1828a95 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_TZ_318000/config.ini @@ -0,0 +1,19 @@ +[SET] +SamNad_V1 = 17 +SamNad_V2 = 17 +SamNad_V3 = 17 + +LogFile = 3 +LogDir = "" +LogLife = 1 +VPINBEFCPIN = 1 + +FilePath_SSSE = 1 + +[READER] +ReaderType = 6 +Try = "1|6" + +[KEYPAD] +KeyPadType =105 +Try = "" diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/egapp.ini b/package/DWCardReaderDLL/ZJ_TZ_318000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_TZ_318000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_TZ_318000/hsmconfig.ini new file mode 100644 index 0000000..2c9da4f --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_TZ_318000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œå�°å·žé»˜è®¤ä¸ºä¸�å�¯ç”¨ +HSM=0 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 明泰;2 å¾·å�¡ï¼›3 德生;4 顺嘉 +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/libcurl.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/libcurl.dll new file mode 100644 index 0000000..fce12b9 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/libcurl.dll differ diff --git a/package/DWCardReaderDLL/ZJ_TZ_318000/mt_32.dll b/package/DWCardReaderDLL/ZJ_TZ_318000/mt_32.dll new file mode 100644 index 0000000..7de9bef Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_TZ_318000/mt_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_WZ_325000/SSCardDriver_DC_ZJ.dll b/package/DWCardReaderDLL/ZJ_WZ_325000/SSCardDriver_DC_ZJ.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_WZ_325000/SSCardDriver_DC_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_WZ_325000/SSCardDriver_SJ_ZJ.dll b/package/DWCardReaderDLL/ZJ_WZ_325000/SSCardDriver_SJ_ZJ.dll new file mode 100644 index 0000000..bc7e0c0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_WZ_325000/SSCardDriver_SJ_ZJ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_WZ_325000/ZJ_WZ_ReadCard.dll b/package/DWCardReaderDLL/ZJ_WZ_325000/ZJ_WZ_ReadCard.dll new file mode 100644 index 0000000..c8c3890 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_WZ_325000/ZJ_WZ_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_WZ_325000/egapp.ini b/package/DWCardReaderDLL/ZJ_WZ_325000/egapp.ini new file mode 100644 index 0000000..bc6f60d --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_WZ_325000/egapp.ini @@ -0,0 +1,29 @@ +;------------------------------------------------------------------------------------- +; +; Version: V1.0 +; +;------------------------------------------------------------------------------------- + +[KEYBOARD] +;#------------------------------------------------------------------------------------- +;ÊÇ·ñÆôÓÃÍⲿÃÜÂë¼üÅ̿⣨¹«¹²¿â£© +;TRUE±íʾÆôÓ㬴ËʱÃÜÂë¼üÅÌÊäÈëÊÜÍⲿ¼üÅÌ¿â¿ØÖÆ,EnableUSBKBÖµÎÞЧ¡¢EnablePS2KBÖµÎÞЧ +;FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableExtKBLib=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃPS2±ê×¼ÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓÃ,´ËʱEnableExtKBLibÖµÎÞЧ£¨ÓÅÏÈУÑéEnableExtKBLib£©¡¢EnableUSBKBÖµÎÞЧ +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnablePS2KB=FALSE + + +;#------------------------------------------------------------------------------------- +;#ÊÇ·ñÆôÓÃUSBͨѶµÄÃÜÂë¼üÅÌ +;#TRUE±íʾÆôÓà +;#FALSE±íʾ²»ÆôÓà +;-------------------------------------------------------------------------------------# +EnableUSBKB=TRUE \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_WZ_325000/hsmconfig.ini b/package/DWCardReaderDLL/ZJ_WZ_325000/hsmconfig.ini new file mode 100644 index 0000000..aa76b0b --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_WZ_325000/hsmconfig.ini @@ -0,0 +1,15 @@ +//加密机æœ�务地å�€é…�置,å�ªæ”¯æŒ�通过跳转IP和端å�£è·³è½¬è‡³çœ�厅加密机æœ�务,默认为çœ�厅加密机æœ�务的地å�€ +[Server] +;是å�¦å�¯ç”¨åŠ å¯†æœºè¯»å�¡æ¨¡å¼�,1为å�¯ç”¨ï¼Œ0为ä¸�å�¯ç”¨ï¼Œæ¸©å·žé»˜è®¤ä¸ºå�¯ç”¨ +HSM=1 +;加密机æœ�务IP +HostName=10.87.0.72 +;加密机æœ�务端å�£ +Port=9006 + + +//读å�¡å™¨è½®è¯¢é…�ç½® +[device] +;是å�¦è½®è¯¢æŸ¥æ‰¾è¯»å�¡å™¨ï¼Œ0为轮询查找,其他值为固定æŸ�类读å�¡å™¨ï¼Œé»˜è®¤ä¸ºè½®è¯¢æ¨¡å¼� +;0 轮询;1 顺嘉;2 å¾·å�¡ +search=0 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_ZS/GetInfo.dll b/package/DWCardReaderDLL/ZJ_ZS/GetInfo.dll new file mode 100644 index 0000000..daebde6 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/GetInfo.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/HttpInter_ZJZS_JZ.dll b/package/DWCardReaderDLL/ZJ_ZS/HttpInter_ZJZS_JZ.dll new file mode 100644 index 0000000..0d57f48 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/HttpInter_ZJZS_JZ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/HttpInter_ZJZS_SB.dll b/package/DWCardReaderDLL/ZJ_ZS/HttpInter_ZJZS_SB.dll new file mode 100644 index 0000000..923bd5b Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/HttpInter_ZJZS_SB.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_CM.ini b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_CM.ini new file mode 100644 index 0000000..10ff5da --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_CM.ini @@ -0,0 +1,39 @@ +//¶Á¿¨Æ÷ÅäÖà +[m1_config] +;¶Ë¿ÚÉèÖÃÈç¹û²ÉÓÃUSBµÄ¶Á¿¨Æ÷ÉèÖóÉ101£¬Èç¹û²ÉÓô®¿ÚµÄÉ豸£¬¸ù¾Ý´®¿ÚºÅÉèÖóÉ1(±íʾ¶Á¿¨Æ÷´®¿ÚΪ´®¿Ú1) +port = 101 +;ͨѶ²¨ÌØÂÊ +baud = 115200 +;Ѱ¿¨Ä£Ê½0±íʾһ´ÎÖ»¶ÔÒ»ÕÅ¿¨Æ¬²Ù×÷£¬1±íʾһ´Î¿ÉÒÔ¶Ô¶àÕÅ¿¨Æ¬²Ù×÷ +SearchMode = 0 +;·Ç½Ó´¥Ê½psam¿¨²Ù×÷0±íʾ²»²ÉÓÃpsam¿¨£¬1±íʾ²ÉÓÃpsam¿¨ +psam=0 +;ÀÍÉ粿psam¿¨²Ù×÷0±íʾ²»²ÉÓÃpsam¿¨£¬1±íʾ²ÉÓÃpsam¿¨ +sipsam=1 +;ÀÍÉ粿psam¿¨×ùÅäÖÃ1±íʾ½Ó´¥Ê½Ö÷¿¨×ù£¬2±íʾSAM1¿¨×ù£¬3±íʾSAM2¿¨×ù£¬4±íʾSAM3¿¨×ù +sipsamid=2 + +//µ×²ã¶¯Ì¬¿âÅäÖà +[dllname_config] +;µ×²ã¶¯Ì¬¿âÃû³Æ +dllname= ICCDevInter_ZS_CM.dll +httpdllname = HttpInter_ZJZS_JZ.dll + +/ÀÍÉ粿¼ÓÃÜ»úÉèÖà +[SBMachine_Config] +;ǰÖõØÖ·172.16.161.248:9986 +url=http://172.16.161.248:9986/WorkService/do +;²Ù×÷¹ñÔ± +sysoperid=1 +;µ÷ÓÃÇþµÀ +channel=08 +;¹ñÔ± +operid=adminj +;µÇ½session +session=c4ca4238a0b923820dcc509a6f75849b + + + + + + diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_SB.ini b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_SB.ini new file mode 100644 index 0000000..83404a7 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_SB.ini @@ -0,0 +1,50 @@ +//¶Á¿¨Æ÷ÅäÖà +[m1_config] +;¶Ë¿ÚÉèÖÃÈç¹û²ÉÓÃUSBµÄ¶Á¿¨Æ÷ÉèÖóÉ101£¬Èç¹û²ÉÓô®¿ÚµÄÉ豸£¬¸ù¾Ý´®¿ÚºÅÉèÖóÉ1(±íʾ¶Á¿¨Æ÷´®¿ÚΪ´®¿Ú1) +;µÂ¿¨¡¢Ã÷Ì©£º101 ÁªµÏ£º¸ù¾Ý´®¿ÚºÅÉèÖà +port=101 +;ͨѶ²¨ÌØÂÊ +baud = 115200 +;Ѱ¿¨Ä£Ê½0±íʾһ´ÎÖ»¶ÔÒ»ÕÅ¿¨Æ¬²Ù×÷£¬1±íʾһ´Î¿ÉÒÔ¶Ô¶àÕÅ¿¨Æ¬²Ù×÷ +SearchMode = 1 +;·Ç½Ó´¥Ê½psam¿¨²Ù×÷0±íʾ²»²ÉÓÃpsam¿¨£¬1±íʾ²ÉÓÃpsam¿¨ +psam=0 +;ÀÍÉ粿psam¿¨²Ù×÷0±íʾ²»²ÉÓÃpsam¿¨£¬1±íʾ²ÉÓÃpsam¿¨ +sipsam=1 +;·Ç½Ó´¥Ê½psam¿¨×ùÅäÖÃ1±íʾ½Ó´¥Ê½Ö÷¿¨×ù£¬2±íʾSAM1¿¨×ù£¬3±íʾSAM2¿¨×ù£¬4±íʾSAM3¿¨×ù +psamid=2 +;ÀÍÉ粿psam¿¨×ùÅäÖÃ1±íʾ½Ó´¥Ê½Ö÷¿¨×ù£¬2±íʾSAM1¿¨×ù£¬3±íʾSAM2¿¨×ù£¬4±íʾSAM3¿¨×ù +sipsamid=2 + +//ÃÜÂë¼üÅÌÅäÖà +[kb_config] +;¶Ë¿ÚÉèÖñíʾÃÜÂë¼üÅ̽ӵĴ®¿ÚºÅ£¬¸ù¾Ý¸ù¾Ý´®¿ÚºÅÉèÖóÉCOM1(±íʾÃÜÂë¼üÅÌ´®¿ÚΪ´®¿Ú1) +port = COM0 + +//µ×²ã¶¯Ì¬¿âÅäÖà +[dllname_config] +;µ×²ã¶¯Ì¬¿âÃû³Æ +dllname= ICCDevInter_ZS_SB.dll + +;¶Á¿¨Æ÷¶¯Ì¬¿âÑ¡Ôñ£¬ÁªµÏÉ豸:SSCardDriver_ld.dll µÂ¿¨É豸:SSCardDriver_dc.dll Ã÷Ì©É豸²»ÐèÒªÐ޸Ĵ˴¦ +sbdllname= SSCardDriver_ld.dll + +httpdllname = HttpInter_ZJZS_SB.dll + +/ÀÍÉ粿¼ÓÃÜ»úÉèÖà +[SBMachine_Config] +;ǰÖõØÖ·172.16.161.248:9986 +url=http://172.16.161.248:9986/WorkService/do +;²Ù×÷¹ñÔ± +sysoperid=1 +;µ÷ÓÃÇþµÀ +channel=08 +;¹ñÔ± +operid=adminj +;µÇ½session +session=c4ca4238a0b923820dcc509a6f75849b + + + + + diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_CM.dll b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_CM.dll new file mode 100644 index 0000000..229a88a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_CM.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_LD.dll b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_LD.dll new file mode 100644 index 0000000..e4bfa89 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_LD.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_SB.dll b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_SB.dll new file mode 100644 index 0000000..8f1c875 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ICCDevInter_ZS_SB.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCInter_ZS_JZ.dll b/package/DWCardReaderDLL/ZJ_ZS/ICCInter_ZS_JZ.dll new file mode 100644 index 0000000..3cfc33a Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ICCInter_ZS_JZ.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ICCInter_ZS_SB.dll b/package/DWCardReaderDLL/ZJ_ZS/ICCInter_ZS_SB.dll new file mode 100644 index 0000000..2b7bbc0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ICCInter_ZS_SB.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/LANDI_SSCardDriver.ini b/package/DWCardReaderDLL/ZJ_ZS/LANDI_SSCardDriver.ini new file mode 100644 index 0000000..d30afb5 --- /dev/null +++ b/package/DWCardReaderDLL/ZJ_ZS/LANDI_SSCardDriver.ini @@ -0,0 +1,3 @@ +LANDI_SSCardDriver +#´®¿ÚÉ趨 ´®¿ÚΪ1-9 +COM=4 \ No newline at end of file diff --git a/package/DWCardReaderDLL/ZJ_ZS/LD_Reader.dll b/package/DWCardReaderDLL/ZJ_ZS/LD_Reader.dll new file mode 100644 index 0000000..d0fe4d8 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/LD_Reader.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/SSCardDriver_dc.dll b/package/DWCardReaderDLL/ZJ_ZS/SSCardDriver_dc.dll new file mode 100644 index 0000000..9bd8e46 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/SSCardDriver_dc.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/SSCardDriver_ld.dll b/package/DWCardReaderDLL/ZJ_ZS/SSCardDriver_ld.dll new file mode 100644 index 0000000..db568dc Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/SSCardDriver_ld.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ScanerModule.dll b/package/DWCardReaderDLL/ZJ_ZS/ScanerModule.dll new file mode 100644 index 0000000..f25a526 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ScanerModule.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/USBDll.dll b/package/DWCardReaderDLL/ZJ_ZS/USBDll.dll new file mode 100644 index 0000000..6e03d05 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/USBDll.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ZJ_ZS_ReadCard.dll b/package/DWCardReaderDLL/ZJ_ZS/ZJ_ZS_ReadCard.dll new file mode 100644 index 0000000..a157192 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ZJ_ZS_ReadCard.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/dcrf32.dll b/package/DWCardReaderDLL/ZJ_ZS/dcrf32.dll new file mode 100644 index 0000000..2426c53 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/dcrf32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/fct_des.dll b/package/DWCardReaderDLL/ZJ_ZS/fct_des.dll new file mode 100644 index 0000000..e3d3e91 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/fct_des.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/libghttp.dll b/package/DWCardReaderDLL/ZJ_ZS/libghttp.dll new file mode 100644 index 0000000..e80295e Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/libghttp.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/mt_32.dll b/package/DWCardReaderDLL/ZJ_ZS/mt_32.dll new file mode 100644 index 0000000..5ba13b0 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/mt_32.dll differ diff --git a/package/DWCardReaderDLL/ZJ_ZS/ssse32.dll b/package/DWCardReaderDLL/ZJ_ZS/ssse32.dll new file mode 100644 index 0000000..269d437 Binary files /dev/null and b/package/DWCardReaderDLL/ZJ_ZS/ssse32.dll differ diff --git a/package/EMICDLL/NationECCode.dll b/package/EMICDLL/NationECCode.dll new file mode 100644 index 0000000..f768550 Binary files /dev/null and b/package/EMICDLL/NationECCode.dll differ diff --git a/package/EMICDLL/NationECCodeTest.exe b/package/EMICDLL/NationECCodeTest.exe new file mode 100644 index 0000000..75ab79e Binary files /dev/null and b/package/EMICDLL/NationECCodeTest.exe differ diff --git a/package/EMICDLL/NationEcCodeUpdater.exe b/package/EMICDLL/NationEcCodeUpdater.exe new file mode 100644 index 0000000..994643f Binary files /dev/null and b/package/EMICDLL/NationEcCodeUpdater.exe differ diff --git a/package/EMICDLL/NationEcCodeUpdater_Daemon.exe b/package/EMICDLL/NationEcCodeUpdater_Daemon.exe new file mode 100644 index 0000000..18b70e3 Binary files /dev/null and b/package/EMICDLL/NationEcCodeUpdater_Daemon.exe differ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..b9f163e --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "qrcodegen.h" + +// The implementation intentionally uses only Win32 APIs so it can be built +// with the v141_xp toolset. Both vendor DLLs are x86 stdcall libraries. +struct Config { + std::string host="127.0.0.1", cardDir="package/DWCardReaderDLL", readerType="ZJ_HZ_310000"; + std::string emicDll="package/EMICDLL/NationECCode.dll", emicUrl, orgId, businessType="01101", operatorId, operatorName, officeId, officeName, logDir="logs"; + int port=17880; bool trace=true, traceSensitive=true; +}; +static std::wstring root; static Config cfg; static std::mutex vendorLock; static std::atomic sequence(0); + +static std::wstring W(const std::string& s, UINT cp=CP_UTF8) { if(s.empty()) return L""; int n=MultiByteToWideChar(cp,0,s.data(),(int)s.size(),0,0); std::wstring r(n,L'\0'); MultiByteToWideChar(cp,0,s.data(),(int)s.size(),&r[0],n); return r; } +static std::string A(const std::wstring& s, UINT cp=CP_UTF8) { if(s.empty()) return ""; int n=WideCharToMultiByte(cp,0,s.data(),(int)s.size(),0,0,0,0); std::string r(n,'\0'); WideCharToMultiByte(cp,0,s.data(),(int)s.size(),&r[0],n,0,0); return r; } +static std::wstring Join(const std::wstring& a,const std::string& b) { return a+L"\\"+W(b); } +static std::string ReadFileUtf8(const std::wstring& p) { std::ifstream f(p.c_str(),std::ios::binary); return std::string((std::istreambuf_iterator(f)),{}); } +static std::string J(const std::string& s) { std::string o; for(char c:s){ if(c=='\\'||c=='"')o+='\\'; if(c=='\n')o+="\\n";else if(c=='\r')o+="\\r";else o+=c;} return o; } +static std::string Get(const std::string& j,const char* key,const std::string& d="") { std::smatch m; std::regex x(std::string("\\\"")+key+"\\\"\\s*:\\s*\\\"([^\\\"]*)\\\""); return std::regex_search(j,m,x)?m[1].str():d; } +static bool GetBool(const std::string& j,const char* key,bool d) { std::smatch m; std::regex x(std::string("\\\"")+key+"\\\"\\s*:\\s*(true|false)"); return std::regex_search(j,m,x)?m[1]=="true":d; } +static int GetInt(const std::string& j,const char* key,int d) { std::smatch m; std::regex x(std::string("\\\"")+key+"\\\"\\s*:\\s*(\\d+)"); return std::regex_search(j,m,x)?atoi(m[1].str().c_str()):d; } +static void Trace(const char* step,const std::string& result="") { if(!cfg.trace)return; std::wstring dir=Join(root,cfg.logDir); CreateDirectoryW(dir.c_str(),0); SYSTEMTIME t;GetLocalTime(&t); wchar_t n[64];wsprintfW(n,L"\\operation-%04d%02d%02d.log",t.wYear,t.wMonth,t.wDay); std::ofstream f((dir+n).c_str(),std::ios::app|std::ios::binary); if(!f)return; f<l(vendorLock); char out[4096]={}; LONG r=(noPin?readNoPin:readPin)((char*)type.c_str(),out); std::string raw=A(W(std::string(out),936)); Trace("card.read.dll.return",std::string("returnCode=")+std::to_string((long long)r)+", output="+raw); if(r!=0){e="读社ä¿�å�¡å¤±è´¥ï¼ˆè¯»å�¡ DLL 返回ç � " + std::to_string((long long)r) + ")";if(!raw.empty()&&raw!=std::to_string((long long)r))e+=":"+raw;Trace("card.read.failure",e);return "";}Trace("card.read.success",raw);return raw; } +static std::string Emic(const std::string& scanned,std::string& e) { Trace("emic.start",scanned); if(cfg.emicUrl.empty()||cfg.orgId.empty()||cfg.operatorId.empty()||cfg.officeId.empty()){e="EMIC configuration incomplete";Trace("emic.config.failure",e);return "";} std::string trans=scanned.empty()?"cn.nhsa.qrcode.get":"ec.query"; char serial[32]; SYSTEMTIME t;GetLocalTime(&t); wsprintfA(serial,"%04d%02d%02d%02d%02d%02d%04lu",t.wYear,t.wMonth,t.wDay,t.wHour,t.wMinute,t.wSecond,sequence.fetch_add(1)%10000); std::ostringstream q;q<<"{\"orgId\":\""< > completed(new std::atomic(false));std::thread([completed](){Sleep(10000);if(!completed->load())Trace("emic.dll.call.waiting","NationEcTrans has not returned after 10 seconds; check intranet connectivity or vendor DLL dialog");}).detach();char* r=emic((char*)cfg.emicUrl.c_str(),ib.data(),out);completed->store(true);if(!r||std::string(r)!="0000"){e=r?r:"NationEcTrans failed";Trace("emic.dll.failure",e);return "";} std::string raw=A(W(std::string(out),54936)); if(GetInt(raw,"code",-1)!=0){e=Get(raw,"message","EMIC failed");Trace("emic.platform.failure",e);return "";}Trace("emic.success",raw);return raw; } + +static HWND outBox,inputBox,scanButton,cardButton,qrView,titleLabel,subtitleLabel; +static HFONT titleFont=0,bodyFont=0,buttonFont=0; +static HBRUSH headerBrush=0,backgroundBrush=0; +static WNDPROC inputProc=0; static bool scannerArmed=false; static std::wstring scannerBuffer; static std::vector qr; +static std::string Trim(std::string s){while(!s.empty()&&isspace((unsigned char)s.front()))s.erase(s.begin());while(!s.empty()&&isspace((unsigned char)s.back()))s.pop_back();return s;} +static std::string EncodeURIComponent(const std::string& s){const char* hex="0123456789ABCDEF";std::string r;for(unsigned char c:s){if(isalnum(c)||strchr("-_.!~*'()",c))r+=c;else{r+='%';r+=hex[c>>4];r+=hex[c&15];}}return r;} +static bool ShowQr(const std::string& raw,std::string& e){std::string content=EncodeURIComponent(Get(raw,"Name"))+"|"+Get(raw,"IDNum")+"|"+Get(raw,"CardNum")+"|"+Get(raw,"CardIDCode");if(content=="|||"){e="读å�¡æˆ�功,但未获å�–到å�¯ç”Ÿæˆ�二维ç �çš„å�¡ç‰‡ä¿¡æ�¯";Trace("card.qrcode.failure",e);return false;}uint8_t temp[qrcodegen_BUFFER_LEN_MAX],data[qrcodegen_BUFFER_LEN_MAX];if(!qrcodegen_encodeText(content.c_str(),temp,data,qrcodegen_Ecc_MEDIUM,qrcodegen_VERSION_MIN,qrcodegen_VERSION_MAX,qrcodegen_Mask_AUTO,true)){e="å�¡ç‰‡ä¿¡æ�¯è¿‡é•¿ï¼Œæ— æ³•生æˆ�二维ç �";Trace("card.qrcode.failure",e);return false;}qr.assign(data,data+sizeof(data));InvalidateRect(qrView,0,TRUE);Trace("card.qrcode.success",content);return true;} +static LRESULT CALLBACK QrProc(HWND h,UINT m,WPARAM w,LPARAM l){if(m==WM_PAINT){PAINTSTRUCT ps;HDC dc=BeginPaint(h,&ps);RECT r;GetClientRect(h,&r);FillRect(dc,&r,(HBRUSH)(COLOR_WINDOW+1));if(qr.empty()){DrawTextW(dc,L"请放置社ä¿�å�¡ï¼Œç„¶å�Žç‚¹å‡»è¯»ç¤¾ä¿�å�¡",-1,&r,DT_CENTER|DT_VCENTER|DT_SINGLELINE);}else{int s=qrcodegen_getSize(qr.data()),scale=(std::min)(r.right/(s+8),r.bottom/(s+8));int x=(r.right-s*scale)/2,y=(r.bottom-s*scale)/2;HBRUSH b=CreateSolidBrush(RGB(0,0,0));for(int yy=0;yy=32)scannerBuffer.push_back((wchar_t)w);return 0;}if(m==WM_KEYDOWN&&w==VK_RETURN&&scannerArmed)return 0;return CallWindowProcW(inputProc,h,m,w,l);} +static void PaintButton(const DRAWITEMSTRUCT* d){HDC dc=d->hDC;RECT r=d->rcItem;bool disabled=(d->itemState&ODS_DISABLED)!=0,pressed=(d->itemState&ODS_SELECTED)!=0;COLORREF color=disabled?RGB(163,181,203):(d->CtlID==12?RGB(30,104,190):RGB(21,137,196));if(pressed)color=RGB(18,79,153);HBRUSH b=CreateSolidBrush(color);HPEN p=CreatePen(PS_SOLID,1,color);HGDIOBJ oldB=SelectObject(dc,b),oldP=SelectObject(dc,p);RoundRect(dc,r.left,r.top,r.right,r.bottom,10,10);SelectObject(dc,oldB);SelectObject(dc,oldP);DeleteObject(b);DeleteObject(p);wchar_t text[128];GetWindowTextW(d->hwndItem,text,128);SetBkMode(dc,TRANSPARENT);SetTextColor(dc,RGB(255,255,255));HFONT old=(HFONT)SelectObject(dc,buttonFont);DrawTextW(dc,text,-1,&r,DT_CENTER|DT_VCENTER|DT_SINGLELINE);SelectObject(dc,old);} +static LRESULT CALLBACK Proc(HWND h,UINT m,WPARAM w,LPARAM l){if(m==WM_PAINT){PAINTSTRUCT ps;HDC dc=BeginPaint(h,&ps);RECT r;GetClientRect(h,&r);FillRect(dc,&r,backgroundBrush);RECT header={0,0,r.right,118};FillRect(dc,&header,headerBrush);EndPaint(h,&ps);return 0;}if(m==WM_CTLCOLORSTATIC){HDC dc=(HDC)w;HWND control=(HWND)l;if(control==titleLabel||control==subtitleLabel){SetBkMode(dc,TRANSPARENT);SetTextColor(dc,RGB(255,255,255));return (LRESULT)headerBrush;}SetBkColor(dc,RGB(255,255,255));SetTextColor(dc,RGB(36,54,75));return (LRESULT)GetStockObject(WHITE_BRUSH);}if(m==WM_DRAWITEM){PaintButton((const DRAWITEMSTRUCT*)l);return TRUE;}if(m==WM_COMMAND){if(LOWORD(w)==10){SetWindowTextW(inputBox,L"");scannerBuffer.clear();scannerArmed=true;SetFocus(inputBox);SetWindowTextW(scanButton,L"请使用扫ç �墩扫ç �...");SetWindowTextW(outBox,L"扫ç �墩已就绪,请扫æ��医ä¿�电å­�凭è¯�。");Trace("scanner.armed","input focused");return 0;}if(LOWORD(w)==12){EnableWindow(cardButton,FALSE);SetWindowTextW(outBox,L"正在读å�–社ä¿�å�¡ï¼Œè¯·ä¿�æŒ�å�¡ç‰‡ä½�ç½®ä¸�动...");Trace("card.gui.clicked");std::thread([](){std::string e,raw=Card(cfg.readerType,true,e);PostMessageW(GetParent(outBox),WM_APP+2,(WPARAM)new std::string(raw.empty()?"ERROR:"+e:raw),0);}).detach();return 0;}}if(m==WM_APP+1||m==WM_APP+2){std::string* r=(std::string*)w;if(m==WM_APP+1){EnableWindow(scanButton,TRUE);SetWindowTextW(scanButton,L"扫医ä¿�电å­�凭è¯�");}else EnableWindow(cardButton,TRUE);if(r->compare(0,6,"ERROR:")==0){SetWindowTextW(outBox,W(r->substr(6)).c_str());Trace(m==WM_APP+1?"emic.gui.error":"card.gui.error",r->substr(6));}else if(m==WM_APP+1)ShowEmic(*r);else{std::string e;if(ShowQr(*r,e))SetWindowTextW(outBox,L"读å�¡æˆ�功,请扫æ��上方二维ç �");else SetWindowTextW(outBox,W(e).c_str());}delete r;return 0;}if(m==WM_DESTROY){DeleteObject(titleFont);DeleteObject(bodyFont);DeleteObject(buttonFont);DeleteObject(headerBrush);DeleteObject(backgroundBrush);PostQuitMessage(0);return 0;}return DefWindowProcW(h,m,w,l);} +static void RunGui(HINSTANCE i){headerBrush=CreateSolidBrush(RGB(25,72,132));backgroundBrush=CreateSolidBrush(RGB(242,246,251));titleFont=CreateFontW(-26,0,0,0,FW_BOLD,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITY,DEFAULT_PITCH,L"Microsoft YaHei UI");bodyFont=CreateFontW(-15,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITY,DEFAULT_PITCH,L"Microsoft YaHei UI");buttonFont=CreateFontW(-16,0,0,0,FW_BOLD,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITY,DEFAULT_PITCH,L"Microsoft YaHei UI");WNDCLASSW c={};c.lpfnWndProc=Proc;c.hInstance=i;c.lpszClassName=L"readcardc";c.hCursor=LoadCursor(0,IDC_ARROW);RegisterClassW(&c);WNDCLASSW q={};q.lpfnWndProc=QrProc;q.hInstance=i;q.lpszClassName=L"readcardc_qr";q.hCursor=LoadCursor(0,IDC_ARROW);RegisterClassW(&q);HWND h=CreateWindowExW(0,c.lpszClassName,L"社ä¿�å�¡ / 医ä¿�电å­�凭è¯�",WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_VISIBLE,200,100,620,740,0,0,i,0);titleLabel=CreateWindowW(L"STATIC",L"社ä¿�å�¡è¯»å�¡ / 医ä¿�电å­�凭è¯�",WS_CHILD|WS_VISIBLE,28,18,500,36,h,0,i,0);subtitleLabel=CreateWindowW(L"STATIC",L"读å�¡ç”Ÿæˆ�二维ç � · 扫ç �自动解æž�凭è¯�ä¿¡æ�¯",WS_CHILD|WS_VISIBLE,30,58,520,24,h,0,i,0);SendMessageW(titleLabel,WM_SETFONT,(WPARAM)titleFont,TRUE);SendMessageW(subtitleLabel,WM_SETFONT,(WPARAM)bodyFont,TRUE);qrView=CreateWindowExW(WS_EX_CLIENTEDGE,q.lpszClassName,L"",WS_CHILD|WS_VISIBLE,140,138,340,330,h,0,i,0);outBox=CreateWindowExW(WS_EX_CLIENTEDGE,L"EDIT",L"请放置社ä¿�å�¡ï¼Œç„¶å�Žç‚¹å‡»ä¸‹æ–¹â€œè¯»ç¤¾ä¿�å�¡â€�。",WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOVSCROLL|WS_VSCROLL|ES_READONLY,32,492,536,112,h,0,i,0);SendMessageW(outBox,WM_SETFONT,(WPARAM)bodyFont,TRUE);inputBox=CreateWindowW(L"EDIT",L"",WS_CHILD|WS_VISIBLE,-10,-10,1,1,h,(HMENU)11,i,0);inputProc=(WNDPROC)SetWindowLongPtrW(inputBox,GWLP_WNDPROC,(LONG_PTR)InputProc);cardButton=CreateWindowW(L"BUTTON",L"读社ä¿�å�¡",WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,105,635,170,46,h,(HMENU)12,i,0);scanButton=CreateWindowW(L"BUTTON",L"扫医ä¿�电å­�凭è¯�",WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,305,635,210,46,h,(HMENU)10,i,0);Trace("gui.ready","log file is next to executable in logs");MSG msg;while(GetMessageW(&msg,0,0,0)){TranslateMessage(&msg);DispatchMessageW(&msg);}} +int WINAPI wWinMain(HINSTANCE i,HINSTANCE,LPWSTR,int){wchar_t p[MAX_PATH];GetModuleFileNameW(0,p,MAX_PATH);root=std::wstring(p);root=root.substr(0,root.find_last_of(L"\\/"));LoadConfig();Trace("application.start","trace enabled");std::string e;if(!LoadDlls(e)){MessageBoxW(0,W(e).c_str(),L"readcard-c",MB_ICONERROR);return 1;}RunGui(i);return 0;} diff --git a/src/qrcodegen.c b/src/qrcodegen.c new file mode 100644 index 0000000..34f1002 --- /dev/null +++ b/src/qrcodegen.c @@ -0,0 +1,1027 @@ +/* + * QR Code generator library (C) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * 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: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - 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. + */ + +#include +#include +#include +#include +#include "qrcodegen.h" + +#ifndef QRCODEGEN_TEST + #define testable static // Keep functions private +#else + #define testable // Expose private functions +#endif + + +/*---- Forward declarations for private functions ----*/ + +// Regarding all public and private functions defined in this source file: +// - They require all pointer/array arguments to be not null unless the array length is zero. +// - They only read input scalar/array arguments, write to output pointer/array +// arguments, and return scalar values; they are "pure" functions. +// - They don't read mutable global variables or write to any global variables. +// - They don't perform I/O, read the clock, print to console, etc. +// - They allocate a small and constant amount of stack memory. +// - They don't allocate or free any memory on the heap. +// - They don't recurse or mutually recurse. All the code +// could be inlined into the top-level public functions. +// - They run in at most quadratic time with respect to input arguments. +// Most functions run in linear time, and some in constant time. +// There are no unbounded loops or non-obvious termination conditions. +// - They are completely thread-safe if the caller does not give the +// same writable buffer to concurrent calls to these functions. + +testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen); + +testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]); +testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl); +testable int getNumRawDataModules(int ver); + +testable void reedSolomonComputeDivisor(int degree, uint8_t result[]); +testable void reedSolomonComputeRemainder(const uint8_t data[], int dataLen, + const uint8_t generator[], int degree, uint8_t result[]); +testable uint8_t reedSolomonMultiply(uint8_t x, uint8_t y); + +testable void initializeFunctionModules(int version, uint8_t qrcode[]); +static void drawLightFunctionModules(uint8_t qrcode[], int version); +static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]); +testable int getAlignmentPatternPositions(int version, uint8_t result[7]); +static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]); + +static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]); +static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask); +static long getPenaltyScore(const uint8_t qrcode[]); +static int finderPenaltyCountPatterns(const int runHistory[7], int qrsize); +static int finderPenaltyTerminateAndCount(bool currentRunColor, int currentRunLength, int runHistory[7], int qrsize); +static void finderPenaltyAddHistory(int currentRunLength, int runHistory[7], int qrsize); + +testable bool getModuleBounded(const uint8_t qrcode[], int x, int y); +testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isDark); +testable void setModuleUnbounded(uint8_t qrcode[], int x, int y, bool isDark); +static bool getBit(int x, int i); + +testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars); +testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version); +static int numCharCountBits(enum qrcodegen_Mode mode, int version); + + + +/*---- Private tables of constants ----*/ + +// The set of all legal characters in alphanumeric mode, where each character +// value maps to the index in the string. For checking text and encoding segments. +static const char *ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"; + +// Sentinel value for use in only some functions. +#define LENGTH_OVERFLOW -1 + +// For generating error correction codes. +testable const int8_t ECC_CODEWORDS_PER_BLOCK[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Low + {-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, // Medium + {-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Quartile + {-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // High +}; + +#define qrcodegen_REED_SOLOMON_DEGREE_MAX 30 // Based on the table above + +// For generating error correction codes. +testable const int8_t NUM_ERROR_CORRECTION_BLOCKS[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, // Low + {-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, // Medium + {-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, // Quartile + {-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, // High +}; + +// For automatic mask pattern selection. +static const int PENALTY_N1 = 3; +static const int PENALTY_N2 = 3; +static const int PENALTY_N3 = 40; +static const int PENALTY_N4 = 10; + + + +/*---- High-level QR Code encoding functions ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeText(const char *text, uint8_t tempBuffer[], uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) { + + size_t textLen = strlen(text); + if (textLen == 0) + return qrcodegen_encodeSegmentsAdvanced(NULL, 0, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); + size_t bufLen = (size_t)qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion); + + struct qrcodegen_Segment seg; + if (qrcodegen_isNumeric(text)) { + if (qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_NUMERIC, textLen) > bufLen) + goto fail; + seg = qrcodegen_makeNumeric(text, tempBuffer); + } else if (qrcodegen_isAlphanumeric(text)) { + if (qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_ALPHANUMERIC, textLen) > bufLen) + goto fail; + seg = qrcodegen_makeAlphanumeric(text, tempBuffer); + } else { + if (textLen > bufLen) + goto fail; + for (size_t i = 0; i < textLen; i++) + tempBuffer[i] = (uint8_t)text[i]; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, textLen); + if (seg.bitLength == LENGTH_OVERFLOW) + goto fail; + seg.numChars = (int)textLen; + seg.data = tempBuffer; + } + return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); + +fail: + qrcode[0] = 0; // Set size to invalid value for safety + return false; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) { + + struct qrcodegen_Segment seg; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, dataLen); + if (seg.bitLength == LENGTH_OVERFLOW) { + qrcode[0] = 0; // Set size to invalid value for safety + return false; + } + seg.numChars = (int)dataLen; + seg.data = dataAndTemp; + return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, dataAndTemp, qrcode); +} + + +// Appends the given number of low-order bits of the given value to the given byte-based +// bit buffer, increasing the bit length. Requires 0 <= numBits <= 16 and val < 2^numBits. +testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen) { + assert(0 <= numBits && numBits <= 16 && (unsigned long)val >> numBits == 0); + for (int i = numBits - 1; i >= 0; i--, (*bitLen)++) + buffer[*bitLen >> 3] |= ((val >> i) & 1) << (7 - (*bitLen & 7)); +} + + + +/*---- Low-level QR Code encoding functions ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, + enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]) { + return qrcodegen_encodeSegmentsAdvanced(segs, len, ecl, + qrcodegen_VERSION_MIN, qrcodegen_VERSION_MAX, qrcodegen_Mask_AUTO, true, tempBuffer, qrcode); +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, + int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]) { + assert(segs != NULL || len == 0); + assert(qrcodegen_VERSION_MIN <= minVersion && minVersion <= maxVersion && maxVersion <= qrcodegen_VERSION_MAX); + assert(0 <= (int)ecl && (int)ecl <= 3 && -1 <= (int)mask && (int)mask <= 7); + + // Find the minimal version number to use + int version, dataUsedBits; + for (version = minVersion; ; version++) { + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available + dataUsedBits = getTotalBits(segs, len, version); + if (dataUsedBits != LENGTH_OVERFLOW && dataUsedBits <= dataCapacityBits) + break; // This version number is found to be suitable + if (version >= maxVersion) { // All versions in the range could not fit the given data + qrcode[0] = 0; // Set size to invalid value for safety + return false; + } + } + assert(dataUsedBits != LENGTH_OVERFLOW); + + // Increase the error correction level while the data still fits in the current version number + for (int i = (int)qrcodegen_Ecc_MEDIUM; i <= (int)qrcodegen_Ecc_HIGH; i++) { // From low to high + if (boostEcl && dataUsedBits <= getNumDataCodewords(version, (enum qrcodegen_Ecc)i) * 8) + ecl = (enum qrcodegen_Ecc)i; + } + + // Concatenate all segments to create the data bit string + memset(qrcode, 0, (size_t)qrcodegen_BUFFER_LEN_FOR_VERSION(version) * sizeof(qrcode[0])); + int bitLen = 0; + for (size_t i = 0; i < len; i++) { + const struct qrcodegen_Segment *seg = &segs[i]; + appendBitsToBuffer((unsigned int)seg->mode, 4, qrcode, &bitLen); + appendBitsToBuffer((unsigned int)seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bitLen); + for (int j = 0; j < seg->bitLength; j++) { + int bit = (seg->data[j >> 3] >> (7 - (j & 7))) & 1; + appendBitsToBuffer((unsigned int)bit, 1, qrcode, &bitLen); + } + } + assert(bitLen == dataUsedBits); + + // Add terminator and pad up to a byte if applicable + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; + assert(bitLen <= dataCapacityBits); + int terminatorBits = dataCapacityBits - bitLen; + if (terminatorBits > 4) + terminatorBits = 4; + appendBitsToBuffer(0, terminatorBits, qrcode, &bitLen); + appendBitsToBuffer(0, (8 - bitLen % 8) % 8, qrcode, &bitLen); + assert(bitLen % 8 == 0); + + // Pad with alternating bytes until data capacity is reached + for (uint8_t padByte = 0xEC; bitLen < dataCapacityBits; padByte ^= 0xEC ^ 0x11) + appendBitsToBuffer(padByte, 8, qrcode, &bitLen); + + // Compute ECC, draw modules + addEccAndInterleave(qrcode, version, ecl, tempBuffer); + initializeFunctionModules(version, qrcode); + drawCodewords(tempBuffer, getNumRawDataModules(version) / 8, qrcode); + drawLightFunctionModules(qrcode, version); + initializeFunctionModules(version, tempBuffer); + + // Do masking + if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask + long minPenalty = LONG_MAX; + for (int i = 0; i < 8; i++) { + enum qrcodegen_Mask msk = (enum qrcodegen_Mask)i; + applyMask(tempBuffer, qrcode, msk); + drawFormatBits(ecl, msk, qrcode); + long penalty = getPenaltyScore(qrcode); + if (penalty < minPenalty) { + mask = msk; + minPenalty = penalty; + } + applyMask(tempBuffer, qrcode, msk); // Undoes the mask due to XOR + } + } + assert(0 <= (int)mask && (int)mask <= 7); + applyMask(tempBuffer, qrcode, mask); // Apply the final choice of mask + drawFormatBits(ecl, mask, qrcode); // Overwrite old format bits + return true; +} + + + +/*---- Error correction code generation functions ----*/ + +// Appends error correction bytes to each block of the given data array, then interleaves +// bytes from the blocks and stores them in the result array. data[0 : dataLen] contains +// the input data. data[dataLen : rawCodewords] is used as a temporary work area and will +// be clobbered by this function. The final answer is stored in result[0 : rawCodewords]. +testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]) { + // Calculate parameter numbers + assert(0 <= (int)ecl && (int)ecl < 4 && qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); + int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[(int)ecl][version]; + int blockEccLen = ECC_CODEWORDS_PER_BLOCK [(int)ecl][version]; + int rawCodewords = getNumRawDataModules(version) / 8; + int dataLen = getNumDataCodewords(version, ecl); + int numShortBlocks = numBlocks - rawCodewords % numBlocks; + int shortBlockDataLen = rawCodewords / numBlocks - blockEccLen; + + // Split data into blocks, calculate ECC, and interleave + // (not concatenate) the bytes into a single sequence + uint8_t rsdiv[qrcodegen_REED_SOLOMON_DEGREE_MAX]; + reedSolomonComputeDivisor(blockEccLen, rsdiv); + const uint8_t *dat = data; + for (int i = 0; i < numBlocks; i++) { + int datLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); + uint8_t *ecc = &data[dataLen]; // Temporary storage + reedSolomonComputeRemainder(dat, datLen, rsdiv, blockEccLen, ecc); + for (int j = 0, k = i; j < datLen; j++, k += numBlocks) { // Copy data + if (j == shortBlockDataLen) + k -= numShortBlocks; + result[k] = dat[j]; + } + for (int j = 0, k = dataLen + i; j < blockEccLen; j++, k += numBlocks) // Copy ECC + result[k] = ecc[j]; + dat += datLen; + } +} + + +// Returns the number of 8-bit codewords that can be used for storing data (not ECC), +// for the given version number and error correction level. The result is in the range [9, 2956]. +testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) { + int v = version, e = (int)ecl; + assert(0 <= e && e < 4); + return getNumRawDataModules(v) / 8 + - ECC_CODEWORDS_PER_BLOCK [e][v] + * NUM_ERROR_CORRECTION_BLOCKS[e][v]; +} + + +// Returns the number of data bits that can be stored in a QR Code of the given version number, after +// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. +// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. +testable int getNumRawDataModules(int ver) { + assert(qrcodegen_VERSION_MIN <= ver && ver <= qrcodegen_VERSION_MAX); + int result = (16 * ver + 128) * ver + 64; + if (ver >= 2) { + int numAlign = ver / 7 + 2; + result -= (25 * numAlign - 10) * numAlign - 55; + if (ver >= 7) + result -= 36; + } + assert(208 <= result && result <= 29648); + return result; +} + + + +/*---- Reed-Solomon ECC generator functions ----*/ + +// Computes a Reed-Solomon ECC generator polynomial for the given degree, storing in result[0 : degree]. +// This could be implemented as a lookup table over all possible parameter values, instead of as an algorithm. +testable void reedSolomonComputeDivisor(int degree, uint8_t result[]) { + assert(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); + // Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1. + // For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the uint8 array {255, 8, 93}. + memset(result, 0, (size_t)degree * sizeof(result[0])); + result[degree - 1] = 1; // Start off with the monomial x^0 + + // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}), + // drop the highest monomial term which is always 1x^degree. + // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). + uint8_t root = 1; + for (int i = 0; i < degree; i++) { + // Multiply the current product by (x - r^i) + for (int j = 0; j < degree; j++) { + result[j] = reedSolomonMultiply(result[j], root); + if (j + 1 < degree) + result[j] ^= result[j + 1]; + } + root = reedSolomonMultiply(root, 0x02); + } +} + + +// Computes the Reed-Solomon error correction codeword for the given data and divisor polynomials. +// The remainder when data[0 : dataLen] is divided by divisor[0 : degree] is stored in result[0 : degree]. +// All polynomials are in big endian, and the generator has an implicit leading 1 term. +testable void reedSolomonComputeRemainder(const uint8_t data[], int dataLen, + const uint8_t generator[], int degree, uint8_t result[]) { + assert(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); + memset(result, 0, (size_t)degree * sizeof(result[0])); + for (int i = 0; i < dataLen; i++) { // Polynomial division + uint8_t factor = data[i] ^ result[0]; + memmove(&result[0], &result[1], (size_t)(degree - 1) * sizeof(result[0])); + result[degree - 1] = 0; + for (int j = 0; j < degree; j++) + result[j] ^= reedSolomonMultiply(generator[j], factor); + } +} + +#undef qrcodegen_REED_SOLOMON_DEGREE_MAX + + +// Returns the product of the two given field elements modulo GF(2^8/0x11D). +// All inputs are valid. This could be implemented as a 256*256 lookup table. +testable uint8_t reedSolomonMultiply(uint8_t x, uint8_t y) { + // Russian peasant multiplication + uint8_t z = 0; + for (int i = 7; i >= 0; i--) { + z = (uint8_t)((z << 1) ^ ((z >> 7) * 0x11D)); + z ^= ((y >> i) & 1) * x; + } + return z; +} + + + +/*---- Drawing function modules ----*/ + +// Clears the given QR Code grid with light modules for the given +// version's size, then marks every function module as dark. +testable void initializeFunctionModules(int version, uint8_t qrcode[]) { + // Initialize QR Code + int qrsize = version * 4 + 17; + memset(qrcode, 0, (size_t)((qrsize * qrsize + 7) / 8 + 1) * sizeof(qrcode[0])); + qrcode[0] = (uint8_t)qrsize; + + // Fill horizontal and vertical timing patterns + fillRectangle(6, 0, 1, qrsize, qrcode); + fillRectangle(0, 6, qrsize, 1, qrcode); + + // Fill 3 finder patterns (all corners except bottom right) and format bits + fillRectangle(0, 0, 9, 9, qrcode); + fillRectangle(qrsize - 8, 0, 8, 9, qrcode); + fillRectangle(0, qrsize - 8, 9, 8, qrcode); + + // Fill numerous alignment patterns + uint8_t alignPatPos[7]; + int numAlign = getAlignmentPatternPositions(version, alignPatPos); + for (int i = 0; i < numAlign; i++) { + for (int j = 0; j < numAlign; j++) { + // Don't draw on the three finder corners + if (!((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0))) + fillRectangle(alignPatPos[i] - 2, alignPatPos[j] - 2, 5, 5, qrcode); + } + } + + // Fill version blocks + if (version >= 7) { + fillRectangle(qrsize - 11, 0, 3, 6, qrcode); + fillRectangle(0, qrsize - 11, 6, 3, qrcode); + } +} + + +// Draws light function modules and possibly some dark modules onto the given QR Code, without changing +// non-function modules. This does not draw the format bits. This requires all function modules to be previously +// marked dark (namely by initializeFunctionModules()), because this may skip redrawing dark function modules. +static void drawLightFunctionModules(uint8_t qrcode[], int version) { + // Draw horizontal and vertical timing patterns + int qrsize = qrcodegen_getSize(qrcode); + for (int i = 7; i < qrsize - 7; i += 2) { + setModuleBounded(qrcode, 6, i, false); + setModuleBounded(qrcode, i, 6, false); + } + + // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules) + for (int dy = -4; dy <= 4; dy++) { + for (int dx = -4; dx <= 4; dx++) { + int dist = abs(dx); + if (abs(dy) > dist) + dist = abs(dy); + if (dist == 2 || dist == 4) { + setModuleUnbounded(qrcode, 3 + dx, 3 + dy, false); + setModuleUnbounded(qrcode, qrsize - 4 + dx, 3 + dy, false); + setModuleUnbounded(qrcode, 3 + dx, qrsize - 4 + dy, false); + } + } + } + + // Draw numerous alignment patterns + uint8_t alignPatPos[7]; + int numAlign = getAlignmentPatternPositions(version, alignPatPos); + for (int i = 0; i < numAlign; i++) { + for (int j = 0; j < numAlign; j++) { + if ((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0)) + continue; // Don't draw on the three finder corners + for (int dy = -1; dy <= 1; dy++) { + for (int dx = -1; dx <= 1; dx++) + setModuleBounded(qrcode, alignPatPos[i] + dx, alignPatPos[j] + dy, dx == 0 && dy == 0); + } + } + } + + // Draw version blocks + if (version >= 7) { + // Calculate error correction code and pack bits + int rem = version; // version is uint6, in the range [7, 40] + for (int i = 0; i < 12; i++) + rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); + long bits = (long)version << 12 | rem; // uint18 + assert(bits >> 18 == 0); + + // Draw two copies + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 3; j++) { + int k = qrsize - 11 + j; + setModuleBounded(qrcode, k, i, (bits & 1) != 0); + setModuleBounded(qrcode, i, k, (bits & 1) != 0); + bits >>= 1; + } + } + } +} + + +// Draws two copies of the format bits (with its own error correction code) based +// on the given mask and error correction level. This always draws all modules of +// the format bits, unlike drawLightFunctionModules() which might skip dark modules. +static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]) { + // Calculate error correction code and pack bits + assert(0 <= (int)mask && (int)mask <= 7); + static const int table[] = {1, 0, 3, 2}; + int data = table[(int)ecl] << 3 | (int)mask; // errCorrLvl is uint2, mask is uint3 + int rem = data; + for (int i = 0; i < 10; i++) + rem = (rem << 1) ^ ((rem >> 9) * 0x537); + int bits = (data << 10 | rem) ^ 0x5412; // uint15 + assert(bits >> 15 == 0); + + // Draw first copy + for (int i = 0; i <= 5; i++) + setModuleBounded(qrcode, 8, i, getBit(bits, i)); + setModuleBounded(qrcode, 8, 7, getBit(bits, 6)); + setModuleBounded(qrcode, 8, 8, getBit(bits, 7)); + setModuleBounded(qrcode, 7, 8, getBit(bits, 8)); + for (int i = 9; i < 15; i++) + setModuleBounded(qrcode, 14 - i, 8, getBit(bits, i)); + + // Draw second copy + int qrsize = qrcodegen_getSize(qrcode); + for (int i = 0; i < 8; i++) + setModuleBounded(qrcode, qrsize - 1 - i, 8, getBit(bits, i)); + for (int i = 8; i < 15; i++) + setModuleBounded(qrcode, 8, qrsize - 15 + i, getBit(bits, i)); + setModuleBounded(qrcode, 8, qrsize - 8, true); // Always dark +} + + +// Calculates and stores an ascending list of positions of alignment patterns +// for this version number, returning the length of the list (in the range [0,7]). +// Each position is in the range [0,177), and are used on both the x and y axes. +// This could be implemented as lookup table of 40 variable-length lists of unsigned bytes. +testable int getAlignmentPatternPositions(int version, uint8_t result[7]) { + if (version == 1) + return 0; + int numAlign = version / 7 + 2; + int step = (version * 8 + numAlign * 3 + 5) / (numAlign * 4 - 4) * 2; + for (int i = numAlign - 1, pos = version * 4 + 10; i >= 1; i--, pos -= step) + result[i] = (uint8_t)pos; + result[0] = 6; + return numAlign; +} + + +// Sets every module in the range [left : left + width] * [top : top + height] to dark. +static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) { + for (int dy = 0; dy < height; dy++) { + for (int dx = 0; dx < width; dx++) + setModuleBounded(qrcode, left + dx, top + dy, true); + } +} + + + +/*---- Drawing data modules and masking ----*/ + +// Draws the raw codewords (including data and ECC) onto the given QR Code. This requires the initial state of +// the QR Code to be dark at function modules and light at codeword modules (including unused remainder bits). +static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]) { + int qrsize = qrcodegen_getSize(qrcode); + int i = 0; // Bit index into the data + // Do the funny zigzag scan + for (int right = qrsize - 1; right >= 1; right -= 2) { // Index of right column in each column pair + if (right == 6) + right = 5; + for (int vert = 0; vert < qrsize; vert++) { // Vertical counter + for (int j = 0; j < 2; j++) { + int x = right - j; // Actual x coordinate + bool upward = ((right + 1) & 2) == 0; + int y = upward ? qrsize - 1 - vert : vert; // Actual y coordinate + if (!getModuleBounded(qrcode, x, y) && i < dataLen * 8) { + bool dark = getBit(data[i >> 3], 7 - (i & 7)); + setModuleBounded(qrcode, x, y, dark); + i++; + } + // If this QR Code has any remainder bits (0 to 7), they were assigned as + // 0/false/light by the constructor and are left unchanged by this method + } + } + } + assert(i == dataLen * 8); +} + + +// XORs the codeword modules in this QR Code with the given mask pattern +// and given pattern of function modules. The codeword bits must be drawn +// before masking. Due to the arithmetic of XOR, calling applyMask() with +// the same mask value a second time will undo the mask. A final well-formed +// QR Code needs exactly one (not zero, two, etc.) mask applied. +static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask) { + assert(0 <= (int)mask && (int)mask <= 7); // Disallows qrcodegen_Mask_AUTO + int qrsize = qrcodegen_getSize(qrcode); + for (int y = 0; y < qrsize; y++) { + for (int x = 0; x < qrsize; x++) { + if (getModuleBounded(functionModules, x, y)) + continue; + bool invert; + switch ((int)mask) { + case 0: invert = (x + y) % 2 == 0; break; + case 1: invert = y % 2 == 0; break; + case 2: invert = x % 3 == 0; break; + case 3: invert = (x + y) % 3 == 0; break; + case 4: invert = (x / 3 + y / 2) % 2 == 0; break; + case 5: invert = x * y % 2 + x * y % 3 == 0; break; + case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break; + case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break; + default: assert(false); return; + } + bool val = getModuleBounded(qrcode, x, y); + setModuleBounded(qrcode, x, y, val ^ invert); + } + } +} + + +// Calculates and returns the penalty score based on state of the given QR Code's current modules. +// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. +static long getPenaltyScore(const uint8_t qrcode[]) { + int qrsize = qrcodegen_getSize(qrcode); + long result = 0; + + // Adjacent modules in row having same color, and finder-like patterns + for (int y = 0; y < qrsize; y++) { + bool runColor = false; + int runX = 0; + int runHistory[7] = {0}; + for (int x = 0; x < qrsize; x++) { + if (getModuleBounded(qrcode, x, y) == runColor) { + runX++; + if (runX == 5) + result += PENALTY_N1; + else if (runX > 5) + result++; + } else { + finderPenaltyAddHistory(runX, runHistory, qrsize); + if (!runColor) + result += finderPenaltyCountPatterns(runHistory, qrsize) * PENALTY_N3; + runColor = getModuleBounded(qrcode, x, y); + runX = 1; + } + } + result += finderPenaltyTerminateAndCount(runColor, runX, runHistory, qrsize) * PENALTY_N3; + } + // Adjacent modules in column having same color, and finder-like patterns + for (int x = 0; x < qrsize; x++) { + bool runColor = false; + int runY = 0; + int runHistory[7] = {0}; + for (int y = 0; y < qrsize; y++) { + if (getModuleBounded(qrcode, x, y) == runColor) { + runY++; + if (runY == 5) + result += PENALTY_N1; + else if (runY > 5) + result++; + } else { + finderPenaltyAddHistory(runY, runHistory, qrsize); + if (!runColor) + result += finderPenaltyCountPatterns(runHistory, qrsize) * PENALTY_N3; + runColor = getModuleBounded(qrcode, x, y); + runY = 1; + } + } + result += finderPenaltyTerminateAndCount(runColor, runY, runHistory, qrsize) * PENALTY_N3; + } + + // 2*2 blocks of modules having same color + for (int y = 0; y < qrsize - 1; y++) { + for (int x = 0; x < qrsize - 1; x++) { + bool color = getModuleBounded(qrcode, x, y); + if ( color == getModuleBounded(qrcode, x + 1, y) && + color == getModuleBounded(qrcode, x, y + 1) && + color == getModuleBounded(qrcode, x + 1, y + 1)) + result += PENALTY_N2; + } + } + + // Balance of dark and light modules + int dark = 0; + for (int y = 0; y < qrsize; y++) { + for (int x = 0; x < qrsize; x++) { + if (getModuleBounded(qrcode, x, y)) + dark++; + } + } + int total = qrsize * qrsize; // Note that size is odd, so dark/total != 1/2 + // Compute the smallest integer k >= 0 such that (45-5k)% <= dark/total <= (55+5k)% + int k = (int)((labs(dark * 20L - total * 10L) + total - 1) / total) - 1; + assert(0 <= k && k <= 9); + result += k * PENALTY_N4; + assert(0 <= result && result <= 2568888L); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4 + return result; +} + + +// Can only be called immediately after a light run is added, and +// returns either 0, 1, or 2. A helper function for getPenaltyScore(). +static int finderPenaltyCountPatterns(const int runHistory[7], int qrsize) { + int n = runHistory[1]; + assert(n <= qrsize * 3); (void)qrsize; + bool core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n; + // The maximum QR Code size is 177, hence the dark run length n <= 177. + // Arithmetic is promoted to int, so n*4 will not overflow. + return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0); +} + + +// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore(). +static int finderPenaltyTerminateAndCount(bool currentRunColor, int currentRunLength, int runHistory[7], int qrsize) { + if (currentRunColor) { // Terminate dark run + finderPenaltyAddHistory(currentRunLength, runHistory, qrsize); + currentRunLength = 0; + } + currentRunLength += qrsize; // Add light border to final run + finderPenaltyAddHistory(currentRunLength, runHistory, qrsize); + return finderPenaltyCountPatterns(runHistory, qrsize); +} + + +// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore(). +static void finderPenaltyAddHistory(int currentRunLength, int runHistory[7], int qrsize) { + if (runHistory[0] == 0) + currentRunLength += qrsize; // Add light border to initial run + memmove(&runHistory[1], &runHistory[0], 6 * sizeof(runHistory[0])); + runHistory[0] = currentRunLength; +} + + + +/*---- Basic QR Code information ----*/ + +// Public function - see documentation comment in header file. +int qrcodegen_getSize(const uint8_t qrcode[]) { + assert(qrcode != NULL); + int result = qrcode[0]; + assert((qrcodegen_VERSION_MIN * 4 + 17) <= result + && result <= (qrcodegen_VERSION_MAX * 4 + 17)); + return result; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_getModule(const uint8_t qrcode[], int x, int y) { + assert(qrcode != NULL); + int qrsize = qrcode[0]; + return (0 <= x && x < qrsize && 0 <= y && y < qrsize) && getModuleBounded(qrcode, x, y); +} + + +// Returns the color of the module at the given coordinates, which must be in bounds. +testable bool getModuleBounded(const uint8_t qrcode[], int x, int y) { + int qrsize = qrcode[0]; + assert(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); + int index = y * qrsize + x; + return getBit(qrcode[(index >> 3) + 1], index & 7); +} + + +// Sets the color of the module at the given coordinates, which must be in bounds. +testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isDark) { + int qrsize = qrcode[0]; + assert(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); + int index = y * qrsize + x; + int bitIndex = index & 7; + int byteIndex = (index >> 3) + 1; + if (isDark) + qrcode[byteIndex] |= 1 << bitIndex; + else + qrcode[byteIndex] &= (1 << bitIndex) ^ 0xFF; +} + + +// Sets the color of the module at the given coordinates, doing nothing if out of bounds. +testable void setModuleUnbounded(uint8_t qrcode[], int x, int y, bool isDark) { + int qrsize = qrcode[0]; + if (0 <= x && x < qrsize && 0 <= y && y < qrsize) + setModuleBounded(qrcode, x, y, isDark); +} + + +// Returns true iff the i'th bit of x is set to 1. Requires x >= 0 and 0 <= i <= 14. +static bool getBit(int x, int i) { + return ((x >> i) & 1) != 0; +} + + + +/*---- Segment handling ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_isNumeric(const char *text) { + assert(text != NULL); + for (; *text != '\0'; text++) { + if (*text < '0' || *text > '9') + return false; + } + return true; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_isAlphanumeric(const char *text) { + assert(text != NULL); + for (; *text != '\0'; text++) { + if (strchr(ALPHANUMERIC_CHARSET, *text) == NULL) + return false; + } + return true; +} + + +// Public function - see documentation comment in header file. +size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars) { + int temp = calcSegmentBitLength(mode, numChars); + if (temp == LENGTH_OVERFLOW) + return SIZE_MAX; + assert(0 <= temp && temp <= INT16_MAX); + return ((size_t)temp + 7) / 8; +} + + +// Returns the number of data bits needed to represent a segment +// containing the given number of characters using the given mode. Notes: +// - Returns LENGTH_OVERFLOW on failure, i.e. numChars > INT16_MAX +// or the number of needed bits exceeds INT16_MAX (i.e. 32767). +// - Otherwise, all valid results are in the range [0, INT16_MAX]. +// - For byte mode, numChars measures the number of bytes, not Unicode code points. +// - For ECI mode, numChars must be 0, and the worst-case number of bits is returned. +// An actual ECI segment can have shorter data. For non-ECI modes, the result is exact. +testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars) { + // All calculations are designed to avoid overflow on all platforms + if (numChars > (unsigned int)INT16_MAX) + return LENGTH_OVERFLOW; + long result = (long)numChars; + if (mode == qrcodegen_Mode_NUMERIC) + result = (result * 10 + 2) / 3; // ceil(10/3 * n) + else if (mode == qrcodegen_Mode_ALPHANUMERIC) + result = (result * 11 + 1) / 2; // ceil(11/2 * n) + else if (mode == qrcodegen_Mode_BYTE) + result *= 8; + else if (mode == qrcodegen_Mode_KANJI) + result *= 13; + else if (mode == qrcodegen_Mode_ECI && numChars == 0) + result = 3 * 8; + else { // Invalid argument + assert(false); + return LENGTH_OVERFLOW; + } + assert(result >= 0); + if (result > INT16_MAX) + return LENGTH_OVERFLOW; + return (int)result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]) { + assert(data != NULL || len == 0); + struct qrcodegen_Segment result; + result.mode = qrcodegen_Mode_BYTE; + result.bitLength = calcSegmentBitLength(result.mode, len); + assert(result.bitLength != LENGTH_OVERFLOW); + result.numChars = (int)len; + if (len > 0) + memcpy(buf, data, len * sizeof(buf[0])); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeNumeric(const char *digits, uint8_t buf[]) { + assert(digits != NULL); + struct qrcodegen_Segment result; + size_t len = strlen(digits); + result.mode = qrcodegen_Mode_NUMERIC; + int bitLen = calcSegmentBitLength(result.mode, len); + assert(bitLen != LENGTH_OVERFLOW); + result.numChars = (int)len; + if (bitLen > 0) + memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); + result.bitLength = 0; + + unsigned int accumData = 0; + int accumCount = 0; + for (; *digits != '\0'; digits++) { + char c = *digits; + assert('0' <= c && c <= '9'); + accumData = accumData * 10 + (unsigned int)(c - '0'); + accumCount++; + if (accumCount == 3) { + appendBitsToBuffer(accumData, 10, buf, &result.bitLength); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 or 2 digits remaining + appendBitsToBuffer(accumData, accumCount * 3 + 1, buf, &result.bitLength); + assert(result.bitLength == bitLen); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char *text, uint8_t buf[]) { + assert(text != NULL); + struct qrcodegen_Segment result; + size_t len = strlen(text); + result.mode = qrcodegen_Mode_ALPHANUMERIC; + int bitLen = calcSegmentBitLength(result.mode, len); + assert(bitLen != LENGTH_OVERFLOW); + result.numChars = (int)len; + if (bitLen > 0) + memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); + result.bitLength = 0; + + unsigned int accumData = 0; + int accumCount = 0; + for (; *text != '\0'; text++) { + const char *temp = strchr(ALPHANUMERIC_CHARSET, *text); + assert(temp != NULL); + accumData = accumData * 45 + (unsigned int)(temp - ALPHANUMERIC_CHARSET); + accumCount++; + if (accumCount == 2) { + appendBitsToBuffer(accumData, 11, buf, &result.bitLength); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 character remaining + appendBitsToBuffer(accumData, 6, buf, &result.bitLength); + assert(result.bitLength == bitLen); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) { + struct qrcodegen_Segment result; + result.mode = qrcodegen_Mode_ECI; + result.numChars = 0; + result.bitLength = 0; + if (assignVal < 0) + assert(false); + else if (assignVal < (1 << 7)) { + memset(buf, 0, 1 * sizeof(buf[0])); + appendBitsToBuffer((unsigned int)assignVal, 8, buf, &result.bitLength); + } else if (assignVal < (1 << 14)) { + memset(buf, 0, 2 * sizeof(buf[0])); + appendBitsToBuffer(2, 2, buf, &result.bitLength); + appendBitsToBuffer((unsigned int)assignVal, 14, buf, &result.bitLength); + } else if (assignVal < 1000000L) { + memset(buf, 0, 3 * sizeof(buf[0])); + appendBitsToBuffer(6, 3, buf, &result.bitLength); + appendBitsToBuffer((unsigned int)(assignVal >> 10), 11, buf, &result.bitLength); + appendBitsToBuffer((unsigned int)(assignVal & 0x3FF), 10, buf, &result.bitLength); + } else + assert(false); + result.data = buf; + return result; +} + + +// Calculates the number of bits needed to encode the given segments at the given version. +// Returns a non-negative number if successful. Otherwise returns LENGTH_OVERFLOW if a segment +// has too many characters to fit its length field, or the total bits exceeds INT16_MAX. +testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version) { + assert(segs != NULL || len == 0); + long result = 0; + for (size_t i = 0; i < len; i++) { + int numChars = segs[i].numChars; + int bitLength = segs[i].bitLength; + assert(0 <= numChars && numChars <= INT16_MAX); + assert(0 <= bitLength && bitLength <= INT16_MAX); + int ccbits = numCharCountBits(segs[i].mode, version); + assert(0 <= ccbits && ccbits <= 16); + if (numChars >= (1L << ccbits)) + return LENGTH_OVERFLOW; // The segment's length doesn't fit the field's bit width + result += 4L + ccbits + bitLength; + if (result > INT16_MAX) + return LENGTH_OVERFLOW; // The sum might overflow an int type + } + assert(0 <= result && result <= INT16_MAX); + return (int)result; +} + + +// Returns the bit width of the character count field for a segment in the given mode +// in a QR Code at the given version number. The result is in the range [0, 16]. +static int numCharCountBits(enum qrcodegen_Mode mode, int version) { + assert(qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); + int i = (version + 7) / 17; + switch (mode) { + case qrcodegen_Mode_NUMERIC : { static const int temp[] = {10, 12, 14}; return temp[i]; } + case qrcodegen_Mode_ALPHANUMERIC: { static const int temp[] = { 9, 11, 13}; return temp[i]; } + case qrcodegen_Mode_BYTE : { static const int temp[] = { 8, 16, 16}; return temp[i]; } + case qrcodegen_Mode_KANJI : { static const int temp[] = { 8, 10, 12}; return temp[i]; } + case qrcodegen_Mode_ECI : return 0; + default: assert(false); return -1; // Dummy value + } +} + + +#undef LENGTH_OVERFLOW diff --git a/src/qrcodegen.h b/src/qrcodegen.h new file mode 100644 index 0000000..6bbc157 --- /dev/null +++ b/src/qrcodegen.h @@ -0,0 +1,385 @@ +/* + * QR Code generator library (C) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * 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: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - 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. + */ + +#pragma once + +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * This library creates QR Code symbols, which is a type of two-dimension barcode. + * Invented by Denso Wave and described in the ISO/IEC 18004 standard. + * A QR Code structure is an immutable square grid of dark and light cells. + * The library provides functions to create a QR Code from text or binary data. + * The library covers the QR Code Model 2 specification, supporting all versions (sizes) + * from 1 to 40, all 4 error correction levels, and 4 character encoding modes. + * + * Ways to create a QR Code object: + * - High level: Take the payload data and call qrcodegen_encodeText() or qrcodegen_encodeBinary(). + * - Low level: Custom-make the list of segments and call + * qrcodegen_encodeSegments() or qrcodegen_encodeSegmentsAdvanced(). + * (Note that all ways require supplying the desired error correction level and various byte buffers.) + */ + + +/*---- Enum and struct types----*/ + +/* + * The error correction level in a QR Code symbol. + */ +enum qrcodegen_Ecc { + // Must be declared in ascending order of error protection + // so that an internal qrcodegen function works properly + qrcodegen_Ecc_LOW = 0 , // The QR Code can tolerate about 7% erroneous codewords + qrcodegen_Ecc_MEDIUM , // The QR Code can tolerate about 15% erroneous codewords + qrcodegen_Ecc_QUARTILE, // The QR Code can tolerate about 25% erroneous codewords + qrcodegen_Ecc_HIGH , // The QR Code can tolerate about 30% erroneous codewords +}; + + +/* + * The mask pattern used in a QR Code symbol. + */ +enum qrcodegen_Mask { + // A special value to tell the QR Code encoder to + // automatically select an appropriate mask pattern + qrcodegen_Mask_AUTO = -1, + // The eight actual mask patterns + qrcodegen_Mask_0 = 0, + qrcodegen_Mask_1, + qrcodegen_Mask_2, + qrcodegen_Mask_3, + qrcodegen_Mask_4, + qrcodegen_Mask_5, + qrcodegen_Mask_6, + qrcodegen_Mask_7, +}; + + +/* + * Describes how a segment's data bits are interpreted. + */ +enum qrcodegen_Mode { + qrcodegen_Mode_NUMERIC = 0x1, + qrcodegen_Mode_ALPHANUMERIC = 0x2, + qrcodegen_Mode_BYTE = 0x4, + qrcodegen_Mode_KANJI = 0x8, + qrcodegen_Mode_ECI = 0x7, +}; + + +/* + * A segment of character/binary/control data in a QR Code symbol. + * The mid-level way to create a segment is to take the payload data + * and call a factory function such as qrcodegen_makeNumeric(). + * The low-level way to create a segment is to custom-make the bit buffer + * and initialize a qrcodegen_Segment struct with appropriate values. + * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data. + * Any segment longer than this is meaningless for the purpose of generating QR Codes. + * Moreover, the maximum allowed bit length is 32767 because + * the largest QR Code (version 40) has 31329 modules. + */ +struct qrcodegen_Segment { + // The mode indicator of this segment. + enum qrcodegen_Mode mode; + + // The length of this segment's unencoded data. Measured in characters for + // numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode. + // Always zero or positive. Not the same as the data's bit length. + int numChars; + + // The data bits of this segment, packed in bitwise big endian. + // Can be null if the bit length is zero. + uint8_t *data; + + // The number of valid data bits used in the buffer. Requires + // 0 <= bitLength <= 32767, and bitLength <= (capacity of data array) * 8. + // The character count (numChars) must agree with the mode and the bit buffer length. + int bitLength; +}; + + + +/*---- Macro constants and functions ----*/ + +#define qrcodegen_VERSION_MIN 1 // The minimum version number supported in the QR Code Model 2 standard +#define qrcodegen_VERSION_MAX 40 // The maximum version number supported in the QR Code Model 2 standard + +// Calculates the number of bytes needed to store any QR Code up to and including the given version number, +// as a compile-time constant. For example, 'uint8_t buffer[qrcodegen_BUFFER_LEN_FOR_VERSION(25)];' +// can store any single QR Code from version 1 to 25 (inclusive). The result fits in an int (or int16). +// Requires qrcodegen_VERSION_MIN <= n <= qrcodegen_VERSION_MAX. +#define qrcodegen_BUFFER_LEN_FOR_VERSION(n) ((((n) * 4 + 17) * ((n) * 4 + 17) + 7) / 8 + 1) + +// The worst-case number of bytes needed to store one QR Code, up to and including +// version 40. This value equals 3918, which is just under 4 kilobytes. +// Use this more convenient value to avoid calculating tighter memory bounds for buffers. +#define qrcodegen_BUFFER_LEN_MAX qrcodegen_BUFFER_LEN_FOR_VERSION(qrcodegen_VERSION_MAX) + + + +/*---- Functions (high level) to generate QR Codes ----*/ + +/* + * Encodes the given text string to a QR Code, returning true if successful. + * If the data is too long to fit in any version in the given range + * at the given ECC level, then false is returned. + * + * The input text must be encoded in UTF-8 and contain no NULs. + * Requires 1 <= minVersion <= maxVersion <= 40. + * + * The smallest possible QR Code version within the given range is automatically + * chosen for the output. Iff boostEcl is true, then the ECC level of the result + * may be higher than the ecl argument if it can be done without increasing the + * version. The mask is either between qrcodegen_Mask_0 to 7 to force that mask, or + * qrcodegen_Mask_AUTO to automatically choose an appropriate mask (which may be slow). + * + * About the arrays, letting len = qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion): + * - Before calling the function: + * - The array ranges tempBuffer[0 : len] and qrcode[0 : len] must allow + * reading and writing; hence each array must have a length of at least len. + * - The two ranges must not overlap (aliasing). + * - The initial state of both ranges can be uninitialized + * because the function always writes before reading. + * - After the function returns: + * - Both ranges have no guarantee on which elements are initialized and what values are stored. + * - tempBuffer contains no useful data and should be treated as entirely uninitialized. + * - If successful, qrcode can be passed into qrcodegen_getSize() and qrcodegen_getModule(). + * + * If successful, the resulting QR Code may use numeric, + * alphanumeric, or byte mode to encode the text. + * + * In the most optimistic case, a QR Code at version 40 with low ECC + * can hold any UTF-8 string up to 2953 bytes, or any alphanumeric string + * up to 4296 characters, or any digit string up to 7089 characters. + * These numbers represent the hard upper limit of the QR Code standard. + * + * Please consult the QR Code specification for information on + * data capacities per version, ECC level, and text encoding mode. + */ +bool qrcodegen_encodeText(const char *text, uint8_t tempBuffer[], uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); + + +/* + * Encodes the given binary data to a QR Code, returning true if successful. + * If the data is too long to fit in any version in the given range + * at the given ECC level, then false is returned. + * + * Requires 1 <= minVersion <= maxVersion <= 40. + * + * The smallest possible QR Code version within the given range is automatically + * chosen for the output. Iff boostEcl is true, then the ECC level of the result + * may be higher than the ecl argument if it can be done without increasing the + * version. The mask is either between qrcodegen_Mask_0 to 7 to force that mask, or + * qrcodegen_Mask_AUTO to automatically choose an appropriate mask (which may be slow). + * + * About the arrays, letting len = qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion): + * - Before calling the function: + * - The array ranges dataAndTemp[0 : len] and qrcode[0 : len] must allow + * reading and writing; hence each array must have a length of at least len. + * - The two ranges must not overlap (aliasing). + * - The input array range dataAndTemp[0 : dataLen] should normally be + * valid UTF-8 text, but is not required by the QR Code standard. + * - The initial state of dataAndTemp[dataLen : len] and qrcode[0 : len] + * can be uninitialized because the function always writes before reading. + * - After the function returns: + * - Both ranges have no guarantee on which elements are initialized and what values are stored. + * - dataAndTemp contains no useful data and should be treated as entirely uninitialized. + * - If successful, qrcode can be passed into qrcodegen_getSize() and qrcodegen_getModule(). + * + * If successful, the resulting QR Code will use byte mode to encode the data. + * + * In the most optimistic case, a QR Code at version 40 with low ECC can hold any byte + * sequence up to length 2953. This is the hard upper limit of the QR Code standard. + * + * Please consult the QR Code specification for information on + * data capacities per version, ECC level, and text encoding mode. + */ +bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); + + +/*---- Functions (low level) to generate QR Codes ----*/ + +/* + * Encodes the given segments to a QR Code, returning true if successful. + * If the data is too long to fit in any version at the given ECC level, + * then false is returned. + * + * The smallest possible QR Code version is automatically chosen for + * the output. The ECC level of the result may be higher than the + * ecl argument if it can be done without increasing the version. + * + * About the byte arrays, letting len = qrcodegen_BUFFER_LEN_FOR_VERSION(qrcodegen_VERSION_MAX): + * - Before calling the function: + * - The array ranges tempBuffer[0 : len] and qrcode[0 : len] must allow + * reading and writing; hence each array must have a length of at least len. + * - The two ranges must not overlap (aliasing). + * - The initial state of both ranges can be uninitialized + * because the function always writes before reading. + * - The input array segs can contain segments whose data buffers overlap with tempBuffer. + * - After the function returns: + * - Both ranges have no guarantee on which elements are initialized and what values are stored. + * - tempBuffer contains no useful data and should be treated as entirely uninitialized. + * - Any segment whose data buffer overlaps with tempBuffer[0 : len] + * must be treated as having invalid values in that array. + * - If successful, qrcode can be passed into qrcodegen_getSize() and qrcodegen_getModule(). + * + * Please consult the QR Code specification for information on + * data capacities per version, ECC level, and text encoding mode. + * + * This function allows the user to create a custom sequence of segments that switches + * between modes (such as alphanumeric and byte) to encode text in less space. + * This is a low-level API; the high-level API is qrcodegen_encodeText() and qrcodegen_encodeBinary(). + */ +bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, + enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]); + + +/* + * Encodes the given segments to a QR Code, returning true if successful. + * If the data is too long to fit in any version in the given range + * at the given ECC level, then false is returned. + * + * Requires 1 <= minVersion <= maxVersion <= 40. + * + * The smallest possible QR Code version within the given range is automatically + * chosen for the output. Iff boostEcl is true, then the ECC level of the result + * may be higher than the ecl argument if it can be done without increasing the + * version. The mask is either between qrcodegen_Mask_0 to 7 to force that mask, or + * qrcodegen_Mask_AUTO to automatically choose an appropriate mask (which may be slow). + * + * About the byte arrays, letting len = qrcodegen_BUFFER_LEN_FOR_VERSION(qrcodegen_VERSION_MAX): + * - Before calling the function: + * - The array ranges tempBuffer[0 : len] and qrcode[0 : len] must allow + * reading and writing; hence each array must have a length of at least len. + * - The two ranges must not overlap (aliasing). + * - The initial state of both ranges can be uninitialized + * because the function always writes before reading. + * - The input array segs can contain segments whose data buffers overlap with tempBuffer. + * - After the function returns: + * - Both ranges have no guarantee on which elements are initialized and what values are stored. + * - tempBuffer contains no useful data and should be treated as entirely uninitialized. + * - Any segment whose data buffer overlaps with tempBuffer[0 : len] + * must be treated as having invalid values in that array. + * - If successful, qrcode can be passed into qrcodegen_getSize() and qrcodegen_getModule(). + * + * Please consult the QR Code specification for information on + * data capacities per version, ECC level, and text encoding mode. + * + * This function allows the user to create a custom sequence of segments that switches + * between modes (such as alphanumeric and byte) to encode text in less space. + * This is a low-level API; the high-level API is qrcodegen_encodeText() and qrcodegen_encodeBinary(). + */ +bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, + int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]); + + +/* + * Tests whether the given string can be encoded as a segment in numeric mode. + * A string is encodable iff each character is in the range 0 to 9. + */ +bool qrcodegen_isNumeric(const char *text); + + +/* + * Tests whether the given string can be encoded as a segment in alphanumeric mode. + * A string is encodable iff each character is in the following set: 0 to 9, A to Z + * (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon. + */ +bool qrcodegen_isAlphanumeric(const char *text); + + +/* + * Returns the number of bytes (uint8_t) needed for the data buffer of a segment + * containing the given number of characters using the given mode. Notes: + * - Returns SIZE_MAX on failure, i.e. numChars > INT16_MAX or the internal + * calculation of the number of needed bits exceeds INT16_MAX (i.e. 32767). + * - Otherwise, all valid results are in the range [0, ceil(INT16_MAX / 8)], i.e. at most 4096. + * - It is okay for the user to allocate more bytes for the buffer than needed. + * - For byte mode, numChars measures the number of bytes, not Unicode code points. + * - For ECI mode, numChars must be 0, and the worst-case number of bytes is returned. + * An actual ECI segment can have shorter data. For non-ECI modes, the result is exact. + */ +size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars); + + +/* + * Returns a segment representing the given binary data encoded in + * byte mode. All input byte arrays are acceptable. Any text string + * can be converted to UTF-8 bytes and encoded as a byte mode segment. + */ +struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]); + + +/* + * Returns a segment representing the given string of decimal digits encoded in numeric mode. + */ +struct qrcodegen_Segment qrcodegen_makeNumeric(const char *digits, uint8_t buf[]); + + +/* + * Returns a segment representing the given text string encoded in alphanumeric mode. + * The characters allowed are: 0 to 9, A to Z (uppercase only), space, + * dollar, percent, asterisk, plus, hyphen, period, slash, colon. + */ +struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char *text, uint8_t buf[]); + + +/* + * Returns a segment representing an Extended Channel Interpretation + * (ECI) designator with the given assignment value. + */ +struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]); + + +/*---- Functions to extract raw data from QR Codes ----*/ + +/* + * Returns the side length of the given QR Code, assuming that encoding succeeded. + * The result is in the range [21, 177]. Note that the length of the array buffer + * is related to the side length - every 'uint8_t qrcode[]' must have length at least + * qrcodegen_BUFFER_LEN_FOR_VERSION(version), which equals ceil(size^2 / 8 + 1). + */ +int qrcodegen_getSize(const uint8_t qrcode[]); + + +/* + * Returns the color of the module (pixel) at the given coordinates, which is false + * for light or true for dark. The top left corner has the coordinates (x=0, y=0). + * If the given coordinates are out of bounds, then false (light) is returned. + */ +bool qrcodegen_getModule(const uint8_t qrcode[], int x, int y); + + +#ifdef __cplusplus +} +#endif diff --git a/一键打包.bat b/一键打包.bat new file mode 100644 index 0000000..0a22374 --- /dev/null +++ b/一键打包.bat @@ -0,0 +1,23 @@ +@echo off +setlocal +cd /d "%~dp0" +title readcard-c package + +where powershell.exe >nul 2>&1 +if errorlevel 1 ( + echo [ERROR] PowerShell was not found. + pause + exit /b 1 +) + +powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0build.ps1" +set "RESULT=%ERRORLEVEL%" +echo. +if not "%RESULT%"=="0" ( + echo Packaging failed. Review the error above. + pause + exit /b %RESULT% +) +echo Packaging completed. Output: %~dp0dist +start "" "%~dp0dist" +pause