Welcome to Dream.In.Code
Getting Help is Easy!

Join 117,610 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,958 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Intel to AT&T

 
Reply to this topicStart new topic

Intel to AT&T, Need help converting a piece of Intel ASM to AT&T ASM

TyVeryMuch
post 10 Jun, 2008 - 04:40 AM
Post #1


New D.I.C Head

*
Joined: 24 Mar, 2007
Posts: 6


My Contributions


Im trying to convert a piece of Intel to AT&T but i know zero about ASM, this is the Intel code:
CODE

void __declspec(naked) __declspec(noreturn) UninjectSelf(HMODULE Module)
{
   __asm
   {
      push -2
      push 0
      push Module
      mov eax, TerminateThread
      push eax
      mov eax, FreeLibrary
      jmp eax
   }
}


This is what i got so far:

CODE

void __declspec(noreturn) UninjectSelf(HMODULE Module)
{
   __asm("pushl $-2");
   __asm("pushl $0");
   __asm("pushl Module");
   __asm("movl TerminateThread, %eax");
   __asm("pushl %eax");
   __asm("movl FreeLibrary, %eax");
   __asm("jmp *%eax");
}


Im getting these errors:

CODE

[Linker error] undefined reference to `Module'
[Linker error] undefined reference to `TerminateThread'
[Linker error] undefined reference to `FreeLibrary'


It would be very kind if someone could fix this, and take a look at the part i already converted, since im not sure its right

EDIT: Help no longer needed, i downloaded a compiler that supported Intel instead

This post has been edited by TyVeryMuch: 10 Jun, 2008 - 07:09 AM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 11:42PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month