Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3756964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:56:00+00:00 2026-05-19T09:56:00+00:00

I need to convert a DLL file to HEX representation to use it as

  • 0

I need to convert a DLL file to HEX representation to use it as a part of string to create a sql server assembly like this


CREATE ASSEMBLY [AssemblyNameHere]
FROM 0x4D5A90000300000004000000FFFF000......continue binary data
WITH PERMISSION_SET = EXTERNAL_ACCESS

I need this to be in a batch file for many reasons, but it seems that FOR statement only suitable for text files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:56:01+00:00Added an answer on May 19, 2026 at 9:56 am

    It is not a very good idea to create a hex output with pure batch.

    But you could use vbscript or for simple tasks FC.exe could work.

    @echo off
    SETLOCAL EnableDelayedExpansion
    set filesize=%~z1
    set "hexVal=41"
    set "x10=AAAAAAAAAA"
    
    set /a chunks=1+filesize / 10
    
    del dummy.txt 2>nul > nul
    for /L %%n in (0,1,%chunks%) DO (
      <nul >> dummy.txt set /p ".=%x10%"
    )
    
    set /a expectedNum=0
    for /F "eol=F usebackq tokens=1,2 skip=1 delims=:[] " %%A in (`fc /b "%~dpf1" dummy.txt`) DO (
        set /a num=0x%%A && (
                set /a numDec=num-1
            set "hex=%%B"
    
            for /L %%n in (!expectedNum!=,=1 !numDec!) DO (
                echo %hexVal%
            )
            set /a expectedNum=num+1
            echo !hex!
        )
    )
    

    First I create a file with (nearly) the same length, and then I compare them with FC in binary mode (/B), the output is scanned and if a line missings are detected, they are filled with the hexVal of the x10 string (in this case 0x41=’A’).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert a String to enum. I followed the idea in String
I need to convert a string vector in a simple string. I do not
I need to convert a Joda-Time DateTime into a String, in the following format:
I need to convert keys from type string to hash. The name of all
We have a requirement where we need to convert from .wav file to .mp3
I Need to convert doc/docx to pdf with iTextSharp.dll. May i know how can
I need to create an ActiveX DLL (not a control). I know that VB6
1.I need to convert a PDF File into a txt.file. My Command seems to
I need call a DLL file in my delphi code, here is the code
I like to create a file full of custom functions which I have made,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.