View Full Version : Next intruction to execute (IP)
albert_sps
03-22-2008, 11:26 AM
I have a script that load into memory a .exe file. I know the CS:IP address, but how can I execute code using this address and an interrupt of DOS after i have loaded file into memory. I'm using Turbo c++.
I have not to use interrupt 21h, 0x4b subfunction.
brewbuck
03-22-2008, 08:54 PM
I have a script that load into memory a .exe file. I know the CS:IP address, but how can I execute code using this address and an interrupt of DOS after i have loaded file into memory. I'm using Turbo c++.
I have not to use interrupt 21h, 0x4b subfunction.
So basically your task is to rewrite DOS. Okay then...
matsp
03-25-2008, 03:42 AM
You mean that you have loaded an executable into memory, but you don't know how to "jump to it"?
It's pretty simple really, just store the start-address (CS:IP) in memory, and use the indirect jump instruction:
jmp dword ptr [startaddress]
Now, how you get back to where you started is a different matter.
--
Mats
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.