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:
effection
Full Member
***

Destroy The Runner

Posts: 135
Reputation: 4
– / Male / Flag
Joined: Sep 2006
O.P. RE: creating an asm opcode
non of you understand this at all

in my first attempt in javascript...
ive allocated some memory for my function,.
Put each individual instruction into an array (in hex of course)
Used a for(i in Patch_Function) to help store each instruction into the allocated memory like so
code:
var BuffAddr = FunctionBuffer.DataPtr;
for(var i = 0; i < Patch_Function.length; i++){
        Patch(BuffAddr, Patch_Function[i]);
        BuffAddr += Patch_Function[i].length;
    }
this works fine and well but now i have to create a JMP to this FunctionBuffer.DataPtr so it can execute my code and IT CANNOT BE HARD CODED which you have all obviously got wrong even though you have read it is dynamically allocated!

to create the jump ive done this

code:
Hook_JMP = Interop.Allocate(6);
    var tmp = Interop.Allocate(6);
    tmp.WriteDWORD(1, FunctionBuffer.DataPtr-Hook_Address-5);
   
    var tmpbyte = tmp.GetAt(0);
    Hook_JMP.SetAt(5,tmpbyte);
   
    tmpbyte = tmp.GetAt(1);
    Hook_JMP.SetAt(4,tmpbyte);
   
    tmpbyte = tmp.GetAt(2);
    Hook_JMP.SetAt(3,tmpbyte);
   
    tmpbyte = tmp.GetAt(3);
    Hook_JMP.SetAt(2,tmpbyte);
   
    tmpbyte = tmp.GetAt(4);
    Hook_JMP.SetAt(0,tmpbyte);
   
    Hook_JMP.SetAt(0,0xE9);

I think the bytes have to be reversed thats why ive put the in a temp buffer then read it backwards but i am unsure.

OBVIOUSLY since its dynamic memory i can just use "asm (jmp $0xE900000000)"

This post was edited on 06-28-2007 at 11:28 AM by effection.
06-28-2007 11:28 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