Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Assembly 

Just a pointer doubt

Lets say a memory address is stored at another memory address
For example
0x12345678 is stored at 0x53246975

So when I see the memory dump at 0x53246975 will it be 12 34 56 78 or 78 56 34 12 because of little endian?
(Aug 1, 2017 12:47 AM)Uiqueblhats Wrote:  Lets say a memory address is stored at another memory address
For example
0x12345678 is stored at 0x53246975

So when I see the memory dump at 0x53246975 will it be 12 34 56 78 or 78 56 34 12 because of little endian?

Yes that's correct.
(Aug 1, 2017 01:56 AM)g4143 Wrote:  Yes that's correct.

So 78 56 34 12 is the answer?
(Aug 1, 2017 02:08 AM)Uiqueblhats Wrote:  So 78 56 34 12 is the answer?

You should read this - https://www.cs.umd.edu/class/sum2003/cms...ndian.html

https://stackoverflow.com/questions/7179...e-a-factor
(Aug 1, 2017 02:53 AM)g4143 Wrote:  You should read this - https://www.cs.umd.edu/class/sum2003/cms...ndian.html

https://stackoverflow.com/questions/7179...e-a-factor
So debuggers like olly or windbg shows in little endian or reverse the order for simplicity of user
(Aug 1, 2017 04:27 AM)Uiqueblhats Wrote:  So debuggers like olly or windbg shows in little endian or reverse the order for simplicity of user

When I worked with dumps I never had problems with endianess. If you are walking through exe's via dumps then you quickly get used to endianess.
Test it:

Code
include \masm32\include\masm32rt.inc

.data
MyDwords    dd 12345678h, 11111111h, 22222222h, 33333333h

.code
start:
  mov edi, offset MyDwords
  mov eax, [edi+0]
  mov ebx, [edi+4]
  mov ecx, [edi+8]
  mov edx, [edi+12]
  int 3                ; give Olly a chance
  exit
end start

If you ready for some confusing things, use this one:

Code
include \masm32\include\masm32rt.inc

.data
MyDword    dd 12345678h
MyWords    dw 1234h, 5678h
MyBytes    db 12h, 34h, 56h, 78h
MyDword2    dd 11223344h

.code
start:
  mov edi, offset MyDword
  mov eax, [edi+0]
  mov ebx, [edi+4]
  mov ecx, [edi+8]
  mov edx, [edi+12]
  int 3                ; give Olly a chance
  exit
end start
(Aug 1, 2017 02:08 AM)Uiqueblhats Wrote:  So 78 56 34 12 is the answer?

To be blunt.

Yes, thats correct.
evening chaps
(Aug 1, 2017 08:31 AM)Flaws. Wrote:  To be blunt.

Yes, thats correct.

Thanks for answering his question LMAO. I was also curious about this yes or no answer.
You're correct, yes. Good thinking!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Help] by LenovoNov 22, 2021 10:52 AM 0 96 Nov 22, 2021 10:52 AM
Last Post: Lenovo
by xxxtentaci0nJan 26, 2017 08:44 PM 3 130 Jan 26, 2017 08:44 PM
Last Post: aeiro
[Help] by mrgoodcatSep 17, 2016 04:17 AM 2 116 Sep 17, 2016 04:17 AM
Last Post: Sakuto