|
-
Jul 14th, 2003, 06:26 PM
#1
Thread Starter
Fanatic Member
An odd question
Can you directly write machine code into the code segment of a running application?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jul 28th, 2003, 05:18 AM
#2
Addicted Member
Not under Windows
not under windows, i don't know if it works under linux
-
Jul 31st, 2003, 04:06 PM
#3
Thread Starter
Fanatic Member
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Aug 1st, 2003, 01:15 AM
#4
You can in windows. I think the 2.6 Linux kernel has an option to disallow it, but in windows you can. It's done when hooking API calls - you actually replace a piece of code from the windows DLLs.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 1st, 2003, 03:45 PM
#5
Thread Starter
Fanatic Member
Now the application change its own code...
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Aug 3rd, 2003, 04:34 AM
#6
Addicted Member
nah...
When I last tried it under W2K, he didn't allow it... how do you do it?
-
Aug 3rd, 2003, 03:37 PM
#7
Thread Starter
Fanatic Member
Oops. I just checked my previous post. It really should be:
Now can the application change its own code...
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Aug 4th, 2003, 07:00 AM
#8
If not, you can always allocate some memory with execute rights using VirtualAlloc and write your code there.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 4th, 2003, 02:04 PM
#9
Thread Starter
Fanatic Member
I am using NASM, and I do not have VirtualAlloc. Where can I get that macro (or call or whatever) from?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Aug 5th, 2003, 01:12 AM
#10
It's a WinAPI call in kernel32.dll.
If you're programming for DOS, you'll have to look up the various INT21h functions to find out how to allocate memory. DOS gives no restrictions at all on what code is accessible how.
In UNIX, you'll have to look it up too.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 5th, 2003, 02:26 PM
#11
Thread Starter
Fanatic Member
Excuse my ignorance, but is that the same dll that is included in MSVC++?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Aug 6th, 2003, 01:18 AM
#12
It's one of the core dlls of windows, so it doesn't need to come with MSVC++.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 6th, 2003, 10:55 AM
#13
Thread Starter
Fanatic Member
Where could I find information on kernel32.dll?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Aug 6th, 2003, 01:42 PM
#14
In the SDK docs and with Dependency Viewer (a tool that comes with the SDK and is AFAIK also on the WinXP CD).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|