X
X
xverizex2020-07-09 20:55:56
assembler
xverizex, 2020-07-09 20:55:56

How to implement this code in C?

I can't figure out how it should look like. help me please. it is known that rbp - 0x18 is a byte buffer.

mov rax, qword [rbp - 0x18]
mov eax, dword [rax]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
1
15432, 2020-07-09
@15432

Well, here you obviously have a local variable of type int *, which is stored on the stack and dereferenced
to something like
int * ptr = ...;
int value = *ptr;
and here -18 it already depends on the compiler. where it allocates space for the variable, so be it. if it is very critical for you that it be 1:1, paste this code directly in assembler and that's it.

J
jcmvbkbc, 2020-07-09
@jcmvbkbc

How to implement this code in C?

something like this: https://godbolt.org/z/qMsqvx , lines 10 and 11. 0x18 == 24

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question