What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Hex Help

Hex Help
Author: Message:
TheGuruSupremacy
Full Member
***

Avatar

Posts: 367
Reputation: 19
34 / Male / Flag
Joined: Nov 2006
O.P. RE: RE: RE: Hex Help
OK Thank all boys...I'll try to explain what i want better:
Well...this is the code I used:


code:
function Hex(number) {return number.toString(16).toUpperCase()}//function by CookieRevised

function SetDataPatch(string){
var newstring=0
for (var i=0;i<string.length;i++){
newstring += "\x" + Hex(string.charCodeAt(i)) + "\x00"}
Debug.Trace(newstring)
return newstring}


function Patch(nAddress, sByteString) {
    var sBuffer = Interop.Allocate(++sByteString.length);
    for (var j = 0; j < sByteString.length; j++) sBuffer.WriteWORD(j, sByteString.charCodeAt(j));
    var hProc = Interop.Call("Kernel32", "GetCurrentProcess");
    Interop.Call("Kernel32", "WriteProcessMemory", hProc, nAddress, sBuffer.DataPtr, sByteString.length, 0);
}//Function By CookieRevised


i need to make a function that return in hex the bytes that i have to write in memory but i don't know i have to do it...example

if i used this code

This code:

code:
Patch(0x5F6D5C,"\x00\xFF\xFC")

it works perfectly

but i need to make the sByteString because it is not the constant and the data i have to write memory is an unicode string so i add to my function + "\x00"....for example if i pass to SetPatchData funtion this string "Example" i need to return

"\x45\x00\x78\x00\x61\x00\x6D\x00\x70\x00\x6C\x00\x65\x00"

that then i pass to Patch function.....if i use "\\x" instead "\x" don't work because the data that return is not in hex...

I hope that you understand me....

Thanks in advice and sorry for my english

This post was edited on 01-17-2007 at 01:52 PM by TheGuruSupremacy.
01-17-2007 01:51 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Hex Help - by TheGuruSupremacy on 01-16-2007 at 04:20 PM
RE: Hex Help - by Matti on 01-16-2007 at 05:04 PM
RE: RE: Hex Help - by TheGuruSupremacy on 01-16-2007 at 05:16 PM
RE: Hex Help - by Plik on 01-16-2007 at 07:28 PM
RE: Hex Help - by phalanxii on 01-17-2007 at 04:15 AM
RE: RE: Hex Help - by CookieRevised on 01-17-2007 at 05:13 AM
RE: RE: RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 01:51 PM
RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 06:06 PM
RE: Hex Help - by CookieRevised on 01-17-2007 at 07:00 PM
RE: RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 07:16 PM
RE: Hex Help - by CookieRevised on 01-17-2007 at 08:29 PM
RE: RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 09:35 PM


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