Log in

View Full Version : HELP!! Cant find the correct ID button in GetDlgItem


Gento
April 13th, 2004, 08:47
Hi i've trying this:
.386
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

.data
MsgCaption db "Iczelion's tutorial no.2",0
MsgBoxText db "Win32 Assembly is Great!",0
dfx db "DFX Close",0

handlewindow dd 00000000h

.code
start:
xor eax,eax
invoke FindWindowA, 0, addr dfx
cmp eax,0
je start

mov handlewindow, eax

invoke GetDlgItem, eax, 02bfh
mov handlewindow, eax

invoke SendMessageA, eax,WM_LBUTTONDOWN,0,0
mov eax, handlewindow

invoke SendMessageA, eax,WM_LBUTTONUP,0,0

invoke MessageBox, NULL,addr MsgBoxText, addr MsgCaption, MB_OK
invoke ExitProcess,NULL
end start

but 02bfh is no correct. Can anybody helo me??? I have seeing the api reference but i can see the correct value.

Fake51
April 13th, 2004, 08:59
Before I venture any stupid guesses: have you debugged your app, to make sure it finds the right window? And why do you keep storing eax in a variable that you keep overwriting without using it?

Fake

Gento
April 13th, 2004, 09:43
Yes I used OLLYDBG, the target is a dll so I cant find the correct ID. It finds the window. I uses w32dsm89 to disassemble and to find the ID but in a document (making one loader using ollydbg by ricardo navaja) I've got the correct value is 2.

Fake51
April 14th, 2004, 01:41
Quote:
[Originally Posted by Gento]Yes I used OLLYDBG, the target is a dll so I cant find the correct ID. It finds the window. I uses w32dsm89 to disassemble and to find the ID but in a document (making one loader using ollydbg by ricardo navaja) I've got the correct value is 2.


How about using some app to glean some system info? Should be quite a few that will tell you everything about all the open windows - to let you see what the id is, and if it's changing from time to time. Have you checked the calls in the dll, to see if the id is hardcoded?

Fake

Gento
April 19th, 2004, 08:39
hardcoded !!!! uppssss

cRk
April 21st, 2004, 07:56
you can use PELG to get The Window Titles or Windows Classes of a Program

PELG = Predator's eXtreme Loader Generator

btw what exactly mean that you code you just wrote?? you want to kill a Nag by finding the window name and simule that you pressed the button?