강의

멘토링

커뮤니티

Inflearn Community Q&A

fxclimber0695's profile image
fxclimber0695

asked

[MMORPG Game Development with C++ and Unreal Series] Part 1: Introduction to C++ Programming

Pointer Practice

제거 디스어셈블리에는..포인터구조체의 메모리가 안떠요 ㅠ

Written on

·

128

0

저는 어떻게 해야 ebp라는 메모리주소가 뜰까요? 32비트 디버깅중이고, 변수이름이 약간 다르지만, ... 확실히 선생님모니터와 달라서요. 그냥,이전에 변수설정했을때와 같아보입니다.
returnValue.hp = 100;

002F23AE mov eax,dword ptr [returnValue]

002F23B1 mov dword ptr [eax],64h

returnValue.attack = 10;

002F23B7 mov eax,dword ptr [returnValue]

002F23BA mov dword ptr [eax+4],0Ah

returnValue.defense = 2;

002F23C1 mov eax,dword ptr [returnValue]

002F23C4 mov dword ptr [eax+8],2

return returnValue;

002F23CB mov eax,dword ptr [returnValue]

c++

Answer 1

1

Rookiss님의 프로필 이미지
Rookiss
Instructor

dword ptr [returnValue]
어셈블리 언어 자체에서는 원래 지역 변수가 저렇게 변수 이름으로 뜨지 않습니다.
이 부분이 원래는 ebp+@로 되어 있는 건데,
Visual Studio가 우리 보기 편하라고 해당 부분을 변수 이름으로 치환해준 것입니다.

그리고 VS 버전에 따라 당연히 결과물은 다르기 때문에 강의 내용은 참고만 하시면 됩니다.

fxclimber0695's profile image
fxclimber0695

asked

Ask a question