What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » creating an asm opcode

creating an asm opcode
Author: Message:
Verte
Full Member
***

Avatar

Posts: 272
Reputation: 7
Joined: Apr 2007
RE: RE: creating an asm opcode
quote:
Originally posted by effection
i said x86 as in Intel x86 used by 90% of the worlds PCs...I have my code already written and i am able to inject it by dynamically allocating memory and get the pointer (which will always change), therefore i must be able to create a "jmp" instruction for this address pointing to the function


call is not always a simple jmp, depending on the original language it may be the caller or the callee that sets up the new stack, saves the register state, etc.

Pick a compiler and compile C code only to ASM, and have it call your function. In the resulting ASM, it should have something like "call <function@whatever>", with the @ meaning it's linked somewhere to be determined at runtime. I'm not entirely sure how it works.

I know what you mean by x86 and MIPS, but it's not a processor specific feature that finds the pointer to your function- it's one of calling convention, which is language specific. You could make up any crazy call functionality you like, for example, passing input or output values in registers, just as easily on either architecture [well, not quite true, MIPS having more registers IIRC], but what you want is the ASM calling convention of the function you've written, which should be obvious from the ASM you're reading now. or if not, ASM you can easily generate by compiling an example.

Having never used Ollydbg myself, I can only agree with TheSteve's comment, as you're less likely to get yourself into trouble using a program that's designed specifically for what you're trying to do. But I think it might be good for you, effection, to work out the calling convention used by your function.
was put impeccably into words at DebianDay for me last Saturday, by Knut Yrvin of Trolltech - adults try something once, fail, and then are like "ffs this doesn't work". Children try, fail, and then try again, and succeed - maybe on the second, or even fifth retry. But the thing is that they keep at it and overcome the problems in the end.

-andrewdodd13
06-26-2007 09:17 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
creating an asm opcode - by effection on 06-25-2007 at 12:25 PM
RE: creating an asm opcode - by Verte on 06-25-2007 at 03:26 PM
RE: creating an asm opcode - by effection on 06-25-2007 at 08:03 PM
RE: RE: creating an asm opcode - by Verte on 06-26-2007 at 09:17 AM
RE: creating an asm opcode - by TheSteve on 06-26-2007 at 12:21 AM
RE: creating an asm opcode - by effection on 06-26-2007 at 10:04 AM
RE: RE: creating an asm opcode - by Verte on 06-26-2007 at 10:24 AM
RE: creating an asm opcode - by effection on 06-27-2007 at 03:45 PM
RE: creating an asm opcode - by CookieRevised on 06-27-2007 at 11:48 PM
RE: creating an asm opcode - by Verte on 06-28-2007 at 01:39 AM
RE: creating an asm opcode - by effection on 06-28-2007 at 11:28 AM
RE: creating an asm opcode - by Verte on 06-28-2007 at 01:57 PM
RE: creating an asm opcode - by effection on 06-28-2007 at 03:18 PM
RE: creating an asm opcode - by CookieRevised on 06-29-2007 at 02:40 AM
RE: creating an asm opcode - by Verte on 06-29-2007 at 10:07 AM
RE: creating an asm opcode - by effection on 06-29-2007 at 05:49 PM
RE: creating an asm opcode - by Verte on 06-29-2007 at 11:42 PM
RE: creating an asm opcode - by effection on 06-30-2007 at 12:15 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On