在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
利用certutil.exe实现在批处理(bat)中嵌入可执行文件或者各种媒体、图片之类二进制文件的简单方法! 实际上利用certutil.exe 把二进制文件(包括各种文件,exe可执行程序,图片,声音,mp3) 经过base64编码为文本,可以实现把这些文件嵌入到批处理代码中。 ###有什么用?: ###缺点: certutil 是一个证书工具,功能挺丰富的,参数非常多,我这里只截取和base64编码相关的帮助信息: ``` C:\Users\Administrator>certutil.exe /? 动词: -dump -- 转储配置信息或文件 -asn -- 分析 ASN.1 文件 -decodehex -- 解码十六进制编码的文件 -decode -- 解码 Base64 编码的文件 -encode -- 将文件编码为 Base64 。。。 ##用法如下: @echo off certutil -decode "%~f0" hello.mp3 start hello.mp3 exit /b 1 -----BEGIN CERTIFICATE----- /+MgxAAUcQZgA0YYALhaemECCEECZNO7u7vGiIiI/7u7u6InxE57v+j+ifoBiz4g cDgYlHMLv+oH35QEP5TqB8//8HDgnB/g+D5d/8oc8v+UB+GJR3BCJw+XD/8u8EEA QAAUCgUCgUD/4yLECRWRPtJfjUAAoFAoFAe997lwJ35Twn+Wfemd/M3TCjiKAuH6 ThO2rqKA0MQ986vujKj97ehhiRAoIFAAKDH4Y9/0qdb/8utJp/nL/oh7w+go9H63 /8UVYYgEAna26X/FY2gtJAX/4yDEDheD7u4fxygDhs/mGECXznOHxh2850FA0Vv8 7ixf0cit7UuX60Mchn/Re+lUjdVexLlZE60OUz/sv///T/NVpaliArIZXXvXf/83 /dZNGrKRmK6v/RR2vceBkMxSptrrS/1hQf/jIsQLFZrm/j44RN4BJ/RRw02+AaEL 8jCEPgNCEL9hCEMHxCD/PNITPUVBka2KmaiI6dPT9Xrovun///R/dWS0UwMdwZAI DB0FRhpLf5XUxR1TDBqz9aFKyBQAHIG2N388oIIJItv9L//jIMQQGALW5X5SBJoG oR3PUwSaUaLjKf+bIFKv2lBp7vbtyjHO/1chDnf/hGVySE0JfRmIme9Gp79Eyf7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ZpVY// /u7huJmRUYzSqwzSqx///+cqipC050k5TSzarDXKrw3/////axNSTWrWUcoKlitX //4lEuXWCCAKAFCFBY7/4yLECxRq9kQXyBAAGirKKmrsx1Q1///KXK3Q3//lL/// /KX//0No/KXL//MbMbUpXl/5S0MZkMbKUu1DVLlKWhhQwGoKneJYKuEQcLfrO8Gv 8SpMQU1FMy45Ni4xqqqqqqqqqqqqqqr/4yDEFQAAA0gAAAAAqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg== -----END CERTIFICATE----- 2016年8月31日 22:52:03 codegay 扩展阅读 |
请发表评论