0

Remind you this is done in ASM, no other language.

I basically have a address of a pointer, this pointer is pointing to another memory address, and this memory address holds values I want to access.

  • pointer.address
    • dynamic.address
      • offsets pertaining to the base dynamic address
      • (00)value1
      • (02)value2
      • (03)value3
      • (04)value4

How would I go about accessing/dereferencing a pointer to give me access to a certain value that pertains to the address the pointer is pointing to?

For instance I want to tamper with values 1-4, but I'm currently stuck at the pointer.address level, I don't know what kind of ASM algorithm will help me.

Thank you

Moorease
  • 21
  • 5
  • Which assembler and which architecture? – David Hoelzer Oct 24 '16 at 01:14
  • I don't know much but I'm using Visual Studios 2015, if that helps. (I'd like to see it expandable to both 32 and 64bit) Thank you – Moorease Oct 24 '16 at 01:23
  • 1
    You mean how to do pointer-chasing in asm? like `mov eax, [eax]`? Maybe see the [x86 tag wiki](http://stackoverflow.com/tags/x86/info), and this [list of all the available addressing modes and how to use them](http://stackoverflow.com/a/34058400/224132). – Peter Cordes Oct 24 '16 at 04:35

2 Answers2

0

Without your code, it's hard to give a specific answer but let's assume ESI already points to pointer.address

    mov      esi, pointer.address
    lodsd                              ; EAX = dynamic.address
    mov      cx, [eax+4]               ; CX = value3

or

    mov      esi, pointer.address
    lodsd
    mov      ebx, eax
    mov       ax, [ebx+3*2]            ; AX = value4

or

    mov      esi, pointer.address
    lodsd
    add      eax, 6                    ; Offset dynamic pointer to value4
    mov      esi, eax
    lodsw                              ; AX = value4 again

It would be wise to study and experiment with all the X86 address modes, as this knowledge is essential to effective assembly programming.

Shift_Left
  • 1,208
  • 8
  • 17
0

I actually figured it out, it's just essentially gotta utilize 'mov' to dereference the value that the pointer is referencing or the dynamic value it's referencing. I thought it was something hard, but it's just something I'm overthinking on.

Moorease
  • 21
  • 5