Inject/Execute code?

Need Help With an Existing Feature in Memory Hacking Software? Ask Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Inject/Execute code?

Postby high6 » Tue Jun 16, 2009 5:09 am

Is there a tool in MHS to do this? All I am seeing are tools to do codecaves.

I want to inject say

push 0
push 1
call 0xXXXXXXXX

and execute it.

Would make playing around with a programs functions very easy.
high6
Sir Hacks-A-Lot
 
Posts: 34
Joined: Sat Aug 05, 2006 7:06 am

Postby spunge » Tue Jun 16, 2009 5:33 am

Allocate some memory.

Write in the allocated memory:
Code: Select all
push  0
push  1
call   XXXXXXXX
push  0
call   ExitThread


Call CreateThread at the allocated memory.

You should be able to do this with LSS.
spunge
NULL
 
Posts: 121
Joined: Sun Jul 27, 2008 4:58 am
Location: VEH callback

Postby high6 » Tue Jun 16, 2009 5:41 am

Sorry been out of the loop, what is LSS? (I am guessing it is the scripting language, and LSS is LSpiro script?)

Also that would kinda make it a pain to constantly change.
high6
Sir Hacks-A-Lot
 
Posts: 34
Joined: Sat Aug 05, 2006 7:06 am

Postby high6 » Tue Jun 16, 2009 7:56 am

Just found out that the Disassembler has an "CallFunction" feature which will work for what I want. But it is still nice to have more control.
high6
Sir Hacks-A-Lot
 
Posts: 34
Joined: Sat Aug 05, 2006 7:06 am

Postby L. Spiro » Tue Jun 16, 2009 8:31 am

Then use CallRemoteFunction() via scripts.

You have all the flexibility in the world with MHS.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby high6 » Tue Jun 16, 2009 8:47 am

Does LSS have access to the Assembly engine?

Like you provide a function a string of some assembly and it returns a byte array of the bytecode?
high6
Sir Hacks-A-Lot
 
Posts: 34
Joined: Sat Aug 05, 2006 7:06 am

Postby L. Spiro » Tue Jun 16, 2009 12:51 pm

Of course.
You would do well to read the function reference in the help file.
Everything is sorted by group, and you would have quickly seen the MHSAssembly section, clicked it, and noticed the first function, AutoAssemble(), which provides the full functionality of the Auto-Assembler in MHS.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby high6 » Tue Jun 16, 2009 1:49 pm

But that doesn't return the bytecode?
high6
Sir Hacks-A-Lot
 
Posts: 34
Joined: Sat Aug 05, 2006 7:06 am

Postby L. Spiro » Tue Jun 16, 2009 5:57 pm

No.
For the same reason why the preview window (Next button in the Auto-Assembler) shows multiple lists. There is no convenient way to show the byte code; it can be any number of arrays and each array can be any length.

Working with this from scripts would mean manually querying the number of arrays needed (which would require MHS to compile the code), then allocating that many arrays, then querying the lengths of each array (which requires another recompile of the code), then allocating each array, then filling the arrays (another recompile of the code), using it however you want, deallocating each array, then deallocating the array of arrays.

Not only would such a feature be slow but also very tedious to use.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests