Sponsored Content
Full Discussion: The stack layout
Top Forums Programming The stack layout Post 86596 by ChenMing on Sunday 16th of October 2005 09:40:16 AM
Old 10-16-2005
Question The stack layout

I try to solve the problem https://www.unix.com/showthread.php?p=86595 use stack hack method, I am puzzled the stack layout.
under vc6.0, the following code work(in release mode).
#include <stdio.h>

void change()
{
int x;
int j;
(&x)[3] = 5; // if in debug mode, change to (&x)[22] = 5;
}

int main()
{
int i = 10;
change();
printf("%d\n", i);
}

But in my FreeBSD box, whatever address I change, the i never change, except core dump when I run program.
Smilie Can any expert explain how the stack layout in system, for example, how does BSD system layout the stack and how does the Windows layout the stack?
Any response is appreciated.
 

7 More Discussions You Might Find Interesting

1. SuSE

Keyboard Layout

ok, I am having a seriouse problem! I can not wite in my landguidge, I live in sweden but I seem to have an american keyboard layout so I cant write some letters and all the key commands are all messed up. Does anyone know where I can find a swedisch keyboard layout? (3 Replies)
Discussion started by: Kimm
3 Replies

2. UNIX for Dummies Questions & Answers

Disk layout

Apologize if I hurt anyone's head with my questions, I'm entirely new to Unix and my office here doesn't offer any training just learn as you go. Anyways they asked me to get a disk layout of one of our servers and gave me this as an example the lables are assumptions Disk ... (2 Replies)
Discussion started by: newdigitalblue
2 Replies

3. Programming

what is stack winding and stack unwinding

helo can u tell me what do you mean by stack winding and stack unwinding Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

4. IP Networking

Questions about network layout

Hello all, thinking and reading of networks always make me think, and I have some questions, let me draw a sketch of the network I have, and then I'll put the questions: --->--->--->-->Hosts This is the big layout, now, the Linux Bridge has 3 NICS, two for making the bridge between the... (0 Replies)
Discussion started by: Zarnick
0 Replies

5. AIX

cannot understand my disk layout

my users has requested more space to a particular volume group, so i do a lsvg honda:/tmp/ab/ecc # lsvg rootvg OP24BCKVG OP24ORAvg OP24SYSVG OP24DATVG the user wants to know what disks are available to be added to any of the vgs listed above, (not including rootvg) so i do a lspv... (2 Replies)
Discussion started by: asyed123
2 Replies

6. UNIX for Dummies Questions & Answers

Kernel Stack vs User Mode Stack

Hi, I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
Discussion started by: saurabhkoar
4 Replies

7. UNIX for Dummies Questions & Answers

Changing table layout

Hi everyone, I'm a beginner in Unix, and would need some help from you guys! My input (pipe delimited): City|ZIP|Ref. Item NYC|212|00004 NYC|212|00032 NYC|212|00006 LA|90049|00068 LA|90049|00009 SF|94131|0027 You can see that the first 3 lines have column 1 and 2 in common, same for... (8 Replies)
Discussion started by: beca123456
8 Replies
GLLOADNAME(3G)															    GLLOADNAME(3G)

NAME
glLoadName - load a name onto the name stack C SPECIFICATION
void glLoadName( GLuint name ) PARAMETERS
name Specifies a name that will replace the top value on the name stack. DESCRIPTION
The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. glLoadName causes name to replace the value on the top of the name stack, which is initially empty. The name stack is always empty while the render mode is not GL_SELECT. Calls to glLoadName while the render mode is not GL_SELECT are ignored. ERRORS
GL_INVALID_OPERATION is generated if glLoadName is called while the name stack is empty. GL_INVALID_OPERATION is generated if glLoadName is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_NAME_STACK_DEPTH glGet with argument GL_MAX_NAME_STACK_DEPTH SEE ALSO
glInitNames(3G), glPushName(3G), glRenderMode(3G), glSelectBuffer(3G) GLLOADNAME(3G)
All times are GMT -4. The time now is 09:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy