flat assembler
Message board for the users of flat assembler.

Index > Windows > Copy Struct member from adress

Author
Thread Post new topic Reply to topic
dv4-fa



Joined: 08 Feb 2013
Posts: 14
dv4-fa 20 Mar 2013, 00:58
How can I access the members of a struct after I passed it to a function.

.hadditem equ ebp - 0x88
.additem.hinstance equ ebp - 0x84
.additem.height equ ebp - 0x80
.additem.style equ ebp - 0x7c
.additem.exstyle equ ebp - 0x78
.additem.title equ ebp - 0x74
.additem.class equ ebp - 0x70

lea eax,[ebp-0x84]
mov dword [.hadditem],eax

push dword [.hadditem]
push dword 0x00000100
push BM_ADDITEM ;WM_USER+1
push dword [.hwnd]
call [user32.SendMessageW]

;function with only access to additem struct address passed via lparam
;this only copies the address
;already tried [.lparam+20] with messageboxw but that doesn't work either
mov eax,[.lparam]
mov [.hadditem],eax
Post 20 Mar 2013, 00:58
View user's profile Send private message Reply with quote
dv4-fa



Joined: 08 Feb 2013
Posts: 14
dv4-fa 20 Mar 2013, 01:36
Found it!

push dword 0x00000018
push dword [.lparam]
push dword [.hadditem]
call [crt.memcpy]
Post 20 Mar 2013, 01:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.