Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [stack-variables]

Stack variables are variables declared on the stack. They are usually local to the block they were declared in.

0
votes
1answer
35 views

Changing local variable in caller from callee in C?

I'm implementing a function which is going to perform some time-consuming task, and I'd like to hack the benchmarking part a bit by changing the variable indicating the CPU time my function has ...
3
votes
1answer
117 views

There is any way to see the subroutine local variables values and who actually access them?

I know that it exists gdb, but i'm talking about windows, i would like know if there is any way to see who access to current stackframe of a specified variable on an X subroutine... i've tried using ...
0
votes
1answer
248 views

In IDA 5, is there a way to rename a stack variable mid-function

I am reverse engineering a program using IDA Pro Free 5. In one of the functions, the compiler has reused the stack space of one of the passed in arguments as a local variable of a different type, but ...
0
votes
2answers
375 views

How does this local var get assigned?

I'm using IDA PRO to disassemble a function, which produces a control flow that looks like this: start_IE proc near Buffer= dword ptr -230h var_22C= byte ptr -22Ch hFile= dword ptr -30h hInternet= ...
2
votes
1answer
190 views

Stack variable information removed in IDA pro (free version)?

I'm using the IDApro free version and I was wondering why sometimes there could be a instruction like... mov [esp + 1140h + var_1234], ebx and if you click inside the bracket, and hit the letter K (...
2
votes
1answer
139 views

Unknown variable from asm code

During translating some asm code into pseudocode I've found two variables: $rbp-0xb4 and $rbp-0xb8 function check_password(arg0) { var_18 = *0x28; //stack checksum? if (parse_cereal(var_D0, ...
0
votes
0answers
88 views

Garbage value after Stack frame allocation?

Can anyone explain me why do these garbage values present on stack? Below is the disassembly view of the binary. Let me know in case you need the corresponding C source code. So basically I'm not ...
1
vote
2answers
1k views

Obtaining memory locations of local variables

For ELF binaries on Linux, if the executable is not stripped, it is possible to recover memory locations of location variables in the form of relative addresses to stack/frame pointer? As an example, ...
1
vote
1answer
262 views

Variable liveness analysis on binaries

I want to detect all the variables live at any instruction/address in a binary. By variable, I refer to both global as well as function local variables. In other words, given a Linux ELF and a virtual ...
1
vote
1answer
443 views

Variable's position on stack

I wanna create a script/program that will modify value in memory of another process. With GDB I've discovered that variable I want modify is located on heap. Because this variable is create ...
2
votes
1answer
137 views

Passing arrays to a function call (Buffer Overflow)

I need to execute a call to cat on a target file using a buffer overflow in a challenge app (can't execute on the stack, but can use libc). For reference, in C this is valid code for what I'm trying ...
2
votes
1answer
62 views

Trouble understanding change in number when popped from FPU to CPU Stack

So im working on an crackme and came across a couple of FPU loads and pops that confused me. Address main 0040169E pops 80 bit value of 00000000_FED63690h from the FPU stack (ST0=4275451536....
2
votes
1answer
5k views

64-bit integers on 32-bit machines

Let's say I create a program in C like this and compile it on a regular 64-bit desktop machine: #include <stdint.h> int main(void) { uint64_t a = 0x12345679abcdefULL; uint64_t b = ...
3
votes
1answer
4k views

How to make stack variables into an array in IDA Pro

I've got a procedure in IDA Pro with a few local stack variables, but part of them belong to an array. I would like to define the array, but pressing * (Create Array) fails, and pressing Y (Set Type) ...
1
vote
1answer
303 views

Stack frame boundary

I've disassembled some C/C++ codes and realized the stack boundary is specified at beginning of a procedure, somehow like this : 1. push ebp 2. mov ebp , esp 3. sub esp , <power> ; <power>...
3
votes
1answer
1k views

Check if binary was compiled with security checks (/GS)

I have to check massive amount of binaries whether they were compiled with the /GS option. I assume a good indicator would be to check if they have stack cookie or not. Do you know any tool that can ...
1
vote
2answers
388 views

Who does construct the stack on process creation in Windows?

When I start notepad.exe with ollydbg in Windows XP, the initial register was esp:7FFC4 and ebp:7FFF0. stack ... 0007FFC4 7C817067 kernel32.7C817067 <--- ESP 0007FFC8 7C940208 ntdll.7C940208 ...
1
vote
1answer
1k views

Memory allocation on the stack

Here is a sample function reverse engineered from an easy program: main proc near var_70 = dword ptr -70h var_6C = dword ptr -6Ch var_68 = dword ptr -68h i_2 ...
4
votes
1answer
8k views

IDA PRO repairing stack variables / local variables hex-rays with arrays and proper types / structures any scripts/plugins?

IDA PRO's Hex-Ray gives me these variables. void *v7; // esp@1 const char *v8; // ebx@1 PLAYER *v9; // ebp@1 int v10; // edi@5 PLAYER *v11; // edx@6 int v12; // ecx@9 int v13; // esi@17 ...