Dos Real Mode and memory
-
Hello everyone, i'm trying to solve strange problem which occurs in my small program the basic idea is: [i'm working currently on virtual pc in dos real mode + borland c++ 3.11] 1) user gives me address in memory like 0xf4abc3d4 2) i have to start execuing program from that address in order to not hang pc i should put 'ret' instruction to that address and then start executing my program. Any idea how to do this ? i've already written some code but unfortunately i doesn't work properly (sometimes pc hangs because i don't know how to put ret instruction to the specified address in memory) bellow is my snippet of code: unsigned long long *ptr; unsigned long long *a = (unsigned long long*)malloc(sizeof(unsigned long long)); cout << "Give an address in memory: "; scanf("%x",a); // get pointer to that address ptr = (unsigned long long*)*a; // make a jump to that address asm { mov ax, ptr // how to put 'ret' instruction before making call ? call ptr } Any help will be appreciated Kind regards tommy
-
Hello everyone, i'm trying to solve strange problem which occurs in my small program the basic idea is: [i'm working currently on virtual pc in dos real mode + borland c++ 3.11] 1) user gives me address in memory like 0xf4abc3d4 2) i have to start execuing program from that address in order to not hang pc i should put 'ret' instruction to that address and then start executing my program. Any idea how to do this ? i've already written some code but unfortunately i doesn't work properly (sometimes pc hangs because i don't know how to put ret instruction to the specified address in memory) bellow is my snippet of code: unsigned long long *ptr; unsigned long long *a = (unsigned long long*)malloc(sizeof(unsigned long long)); cout << "Give an address in memory: "; scanf("%x",a); // get pointer to that address ptr = (unsigned long long*)*a; // make a jump to that address asm { mov ax, ptr // how to put 'ret' instruction before making call ? call ptr } Any help will be appreciated Kind regards tommy
Have you figured this out or still working on it?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus