Questions tagged [stack-frame]

Use stackframe for questions related to debugging unterminated function calls.

A stackframe is a list of functions that have been invoked but have not yet returned a value

References

291 questions
1
vote
1 answer

I'm having problems understanding ED stacks in ARM Assembly

My professor assigned a homework assignment and it went like this. This is ARM Assembly, and imagine this is an Empty Descending stack. This means memory addresses move from higher addresses to lower addresses, and empty means the stack pointer…
RogueNin7x
  • 37
  • 4
1
vote
1 answer

(Java) How to return -1 from constantly incrementing stack frames without helper function?

I'm doing this dime-a-dozen recursion problem, whereby we must return the first index, where a substring occurs in a larger string. If it is not found, return -1. Helper functions are not encouraged. indexOf("Hello", "Lo") --> 3, because "lo" first…
1
vote
0 answers

Function Stack frame

From my understanding, the local parameters, return address among other things of a procedure are pushed on to the stack in memory only to be popped later into the respective registers to be accessed by the CPU because there are limited number of…
1
vote
1 answer

Stack frame and returns

So I'm currently reading Practical reverse engineering_ x86, x64, ARM, Windows Kernel, reversing tools, and obfuscation the book includes the following example to explain the stack frame. addme(x, y) 01: 004113A0 55 push ebp 02: 004113A1 8B EC mov…
Nice
  • 91
  • 1
  • 9
1
vote
0 answers

Why is the address on stack 8 bytes farther?

There is this mov instuction: 0040064e 89 7d dc MOV dword ptr [RBP + local_2c],EDI EDI stores argc from main function. I wanted to check its value by looking at rbp - 0x2c: (gdb) x/x $rbp-0x2C 0x7ffffffee1c4: 0x00000000 As…
erzis
  • 29
  • 2
1
vote
0 answers

Retrieve the value of a variable from the stack

I'm trying to understand more about how the stack internally works. I have a decent understanding of what the stack is, what the heap is and how they compare. At this point, I'm not interested in how the stack is used when invoking another function…
1
vote
0 answers

Stack frame preparation

In order to improve my binary exploitation skills, and deepen my understanding in low level environments I tried solving challenges in pwnable.kr, The third challenge- called bof has the following C code: #include #include…
1
vote
1 answer

Reflect up 5 levels for a Property?

I have implemented a CustomTraceListener for use with Enterprise Library 5. From the TraceData method, I need to crawl the stack up 6 levels to my class that had the actual logging call, I need a property from there. I don't think I want a…
Snowy
  • 5,942
  • 19
  • 65
  • 119
1
vote
1 answer

How to check if the return value of a function is assigned to anything in Python

I have a function that has a return value. I'd like the function to behave differently when the return value of the function is assigned to something. So something like this: def func(): if return_value_assigned(): print("yes") …
Astral Cai
  • 63
  • 7
1
vote
2 answers

All the calculations take place in registers. Why is the stack not storing the result of the register computation here

I am debugging a simple code in c++ and, looking at the disassembly. In the disassembly, all the calculations are done in the registers. And later, the result of the operation is returned. I only see the a and b variables being pushed onto the…
Vikram Singh
  • 435
  • 2
  • 10
1
vote
1 answer

Stack Alignment - Buffer Overflow Testing

I've done a lot of research trying to understand this topic but still have some confusion. Currently I'm investigating buffer overflow. Here's an example of the function I'm looking at: int testFunction(char* sourceBuffer) { unsigned char result…
Birdman
  • 1,404
  • 5
  • 22
  • 49
1
vote
1 answer

StackFrame.GetFileLineNumber() behaviour varies based on assembly Platform and Optimisation flags

i'm trying to understand a problem and although I've read a lot, I can't seem to find any resources explaining this odd combination. After a bit of experimentation I've found that combinations of setting compiler optimisations on/off and building…
Xerxes
  • 309
  • 3
  • 12
1
vote
2 answers

Why would an assembly programmer want to subtract from ebp in this location instead of esp?

I am having slight confusion about the usage of ebp and esp in relation to setting up a stack frame in x86 assembly language. In this following code: section '.code' code readable executable ; define the code section of the file main: …
the_endian
  • 2,259
  • 1
  • 24
  • 49
1
vote
0 answers

C - Displaying stack frame in C displays additional lines

I have this function I coded who's purpose is to print the entire stack frame of the function it is called in: #include #define FRAME_TYPE_SIZE sizeof(void *) void view_stack_frame(){ void *start = __builtin_frame_address(1); void…
ENBYSS
  • 819
  • 1
  • 10
  • 22
1
vote
0 answers

call by value/call by reference assembly

I am currently learning about stack, stackframes and call by value/call by reference in assembly. The one thing, I dont understand is, what are the advantages of passing a value by reference, because how i understand it, the adresses of the values…