flat assembler
Message board for the users of flat assembler.

Index > Windows > Weird check Button press.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 14 Jul 2022, 13:30
Windows 10
Code:
   invoke SendMessage,[hwndButton1],BM_GETSTATE,0,0 
   cmp eax,520 or 620 ;work for me. But not work BST_PUSHED
   jz  pressed
   ret
pressed:
    
   ret
    

Or i must do test eax,BST_PUSHED ?
And what flag ? Jnz or jz or jl or ja or jb ?
Post 14 Jul 2022, 13:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 14 Jul 2022, 14:38
520 or 620 == 620

520 == 0x208
620 == 0x26c

0x208 or 0x26c == 0x26c
Post 14 Jul 2022, 14:38
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 14 Jul 2022, 14:45
i mean i write 520 value or 620
its not asm command or.
Post 14 Jul 2022, 14:45
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 14 Jul 2022, 14:46
i try this, work
Code:
invoke SendMessage,[hwndButton1],BM_GETSTATE,0,0
     
     and    ax,BST_PUSHED  ;BTN_Click  ;BST_HOT ;+BST_PUSHED
     jz    .notpushed
do some
.notpushed:
    
Post 14 Jul 2022, 14:46
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 14 Jul 2022, 15:41
but weird this. buttons "user dll and user action" work always. Button uppp not.
https://www.youtube.com/watch?v=Hx9gA2rzuhY&ab_channel=Roman8139

all 3 buttons check like this.
Code:
invoke SendMessage,[hwndButton1],BM_GETSTATE,0,0
     
     and    ax,BST_PUSHED  ;BTN_Click  ;BST_HOT ;+BST_PUSHED
     jz    .notpushed1
do some
.notpushed1:
invoke SendMessage,[hwndButton2],BM_GETSTATE,0,0
     
     and    ax,BST_PUSHED  ;BTN_Click  ;BST_HOT ;+BST_PUSHED
     jz    .notpushed2
do some
.notpushed2:
invoke SendMessage,[hwndButton3],BM_GETSTATE,0,0
     
     and    ax,BST_PUSHED  ;BTN_Click  ;BST_HOT ;+BST_PUSHED
     jz    .notpushed3
do some
.notpushed3:
    
Post 14 Jul 2022, 15:41
View user's profile Send private message Reply with quote
I



Joined: 19 May 2022
Posts: 58
I 15 Jul 2022, 02:24
You could try test or bt which change flags only.
Code:
      test   eax,BST_PUSHED  
      jz     .notpushed1
      do some
 .notpushed1:
    

or
Code:
        bt      eax,2    ; (BST_PUSHED = 4)
        jnc     .notpushed1
        do some
 .notpushed1:
    
Post 15 Jul 2022, 02:24
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.