GAS : Does it provides callbacks for conversion from assembly to binary code ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GAS : Does it provides callbacks for conversion from assembly to binary code ?

SandeepKsinha
Hello everyone,
I am working on the dis-assembling and assembling of binaries. Well
after dis-assembling the binaries, i convert it into assembly,
manipulate this code, I want to convert it back to binary.  All the
above conversions are to take place at runtime. Can The GAS provide me
with some callbacks to provide this conversion .

If not then does any other utility ?  Please help.

--
Regards,
Sandeep





A candle loses nothing if it is used to light another one!

Reply | Threaded
Open this post in threaded view
|

RE: GAS : Does it provides callbacks for conversion from assembly to binary code ?

Dave Korn
Sandeep Kumar wrote:
> Hello everyone,
> I am working on the dis-assembling and assembling of binaries. Well
> after dis-assembling the binaries, i convert it into assembly,
> manipulate this code, I want to convert it back to binary.  All the
> above conversions are to take place at runtime. Can The GAS provide me
> with some callbacks to provide this conversion .
>
> If not then does any other utility ?  Please help.

  GAS is not a library, so there's no way it can provide anything with
'callbacks'.  Callbacks can only call back to a program that is linked with
the code making the callback, after all.

  It sounds to me like you probably just want to use system/popen to run the
assembler and read the output from temporary files.

    cheers,
      DaveK
--
Can't think of a witty .sigline today....


Reply | Threaded
Open this post in threaded view
|

Re: GAS : Does it provides callbacks for conversion from assembly to binary code ?

Nick Clifton
In reply to this post by SandeepKsinha
Hi Sandeep,

> I am working on the dis-assembling and assembling of binaries. Well
> after dis-assembling the binaries, i convert it into assembly,
> manipulate this code, I want to convert it back to binary.  All the
> above conversions are to take place at runtime. Can The GAS provide me
> with some callbacks to provide this conversion .

GAS cannot help you, but it is possible that the opcodes library might.
  Depending upon the particular target libopcodes might contain routines
to help with assembly as well as with disassembly.  Have a look at the
sources for more information.

Cheers
   Nick