Skip to content
Browse files

Create file2hex.bat

  • Loading branch information
npocmaka committed Nov 30, 2017
1 parent ffa65bf commit 56bda6baf423e398bdd64d3d5c5f62ef50611d8d
Showing with 26 additions and 0 deletions.
  1. +26 −0 fileUtils/file2hex.bat
@@ -0,0 +1,26 @@
@echo off
del tmp.hex >nul 2>nul

if "%~2" equ "" (
echo destination not given
exit /b 10

set "source=%~f1"
set "destination=%~2"
del "%destination%" >nul 2>&1

if not exist "%source%" (
echo source file "%source%" does not exist
exit /b 11

certutil -encodehex "%source%" tmp.hex >nul
setlocal enableDelayedExpansion
set "hex_str="
for /f "usebackq tokens=2 delims= " %%A in ("tmp.hex") do (
set "line=%%A"
set line=!line:~0,48!
del tmp.hex >nul 2>nul

0 comments on commit 56bda6b

Please sign in to comment.
You can’t perform that action at this time.