C/C++ >> Writing Hex to a particular address
Posted by gaffarr on 21:37:00 12-09-2002
I am trying to write a hex value to a particular address by using c. Let's say I want to write 0x1111 to address 0xA0800. BTW, I am using little endian machine with MSVS studio and I know this address cannot be accessed or does not exist. I would assume I will have to build a pointer. How would I do that using C. I would appreciate any help.

Thnx
Posted by PGuard on 03:55:00 12-10-2002
Well for a start... It allways help to use Linux.
Code:
int main(void)
{
short int *p;
p=(short int*)0xA0800;
*p=0x1111;
return 0;
}
I hope this answers ur question.
PGuard
Posted by Neu[Mann] on 04:22:00 12-10-2002
I'm really not sure HOW Linux or Windows would let you write at any address that way. Ever heard of memory protection??

The last OS allowing that was DOS. That trick shouldn't work in Windows, nor in Linux.

Ie:
You CAN'T do that.

But if you could, I believe PGuard told the right way.

[ This Message was edited by: Neu[Mann] on 2002-12-10 04:22 ]
Posted by KaGez on 17:49:00 12-10-2002
if you want to exchange data between 2 or more programs, you should use some kind of daemon which helps the 2 programs sharing the data. In linux Corba would be a great solution. I don't know if such a thing exists in windows tho...
[addsig]
Posted by PGuard on 22:10:00 12-10-2002
Heh Linux just kills U with a 11 (SIGSEGV).
I dont think U need another prog to make 2 progs talk. U can make some kind of maped memory or use recvmsg & sendmsg. (have not worked with interprocess communication so dont quote me )
PGuard
Posted by PGuard on 22:39:00 12-10-2002
Kiddie??
Just because im new ur calling me Kiddie??
If U have 1 prog but it have some childs or U have some threads then U can use a pipe. (very easy...)
Or U can use fifo (see man 3 mkfifo)...Firstin Firstout...
PGuard (remember: Keep It Simple)
Posted by dxprog on 10:48:00 12-11-2002
Your avatar is based on how many posts you have, nobody sets it unless you're an admin. You should become a "Programmer" pretty quick, and if you keep it up you'll become a GOde_Of_COde like me , but no useless posts. That gets you nowhere really fast.

_________________
When I got VB, i could have flown without thrusters and shot down TIE Interceptors just by spitting at them.

[ This Message was edited by: dxprog on 2002-12-11 10:49 ]
Posted by KaGez on 23:18:00 12-12-2002
lol, and if I see your posts I can't think that you're _not_ a kiddie!
sorry
[addsig]
Posted by PGuard on 00:30:00 12-13-2002
U dont mean that
Heh Im not ashamed for being young
Maybe im a little ashamed of my lack of usefull knownledge. Is it some of my post that are kiddie-like or just all of them
PGuard
Posted by KaGez on 21:02:00 12-13-2002
nah, I'm not talking about the content, hehe. More abour _how_ it is written
I don't mind about people having nothing to share. You know, this actually is a community for you to learn things, so if I'd get mad at people bringing no useful knowledge... I'd be outa here for long
[addsig]
Posted by PGuard on 01:36:00 12-14-2002
Oh, its my lack of english...well as long as U get my point I dont need to learn more.
And get that "Hall Of Fame" fixed. Someone voted 10 at one my programs and now im number 1! This is not fair.
PGuard.
Posted by MooKeen on 06:45:00 12-14-2002
PGuard, if you replace `U' with `you' in all of your posts, you will look 30% more intelligent, right off the bat. Good luck...
Posted by PGuard on 07:45:00 12-14-2002
It is not my "look" thats matters... U can be nice outside but intel inside Heh Heh
I just write what I want to write... Some ppl dont like z's and some dont like U's... Well if one can read and understand what ur writing its all OK.
PGuard.
Posted by KaGez on 23:30:00 12-15-2002
I first thought so too, but sometimes it pays out to write everything in the long version
[addsig]