Avatar billede brian0905 Nybegynder
09. juli 2008 - 21:15 Der er 3 kommentarer

Decifrering af messages

Hej,
Jeg sidder og leger med en simpel bot til at give statistiske oplysninger til mig i et blackjack spil. Jeg har lavet en global hook (CBT) og fat i det rigtige vindue. Jeg ved nu bare ikke hvad jeg skal have fat i for at få at vide hvilke kort jeg selv sidder med. Kigger jeg i Spy++ kan jeg se følgende bliver sendt systematisk til vinduet, når jeg får kort, klikker og dealer får kort:

<02124> 00050710 S WM_NCHITTEST xPos:658 yPos:538
<02125> 00050710 R WM_NCHITTEST nHittest:HTCLIENT
<02126> 00050710 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<02127> 00050710 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<02128> 00050710 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<02129> 00050710 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<02130> 00050710 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<02131> 00050710 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<02132> 00050710 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<02133> 00050710 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<02134> 00050710 S WM_NCHITTEST xPos:658 yPos:538
<02135> 00050710 R WM_NCHITTEST nHittest:HTCLIENT
<02136> 00050710 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<02137> 00050710 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<02138> 00050710 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<02139> 00050710 R message:0x046F [User-defined:WM_USER+111] lResult:00000001

Er der nogen chance for at decifrere hvad der er i disse beskeder således jeg kan få noget konstruktivt ud af dem? Alternative løsninger? Jeg ville hade at skulle omkring screen scraping, så meget gider jeg ikke smide efter det...
Avatar billede bertelbrander Novice
10. juli 2008 - 00:33 #1
Jeg tror ikke at de beskeder du har der kan give dig nogen brugbar information.

WM_NCHITTEST er ikke rigtigt brugbare, og "message:0x046F" er en applikations defineret besked, hvilken kan vi ikke vide, parametrene fortæller heller ikke noget.

Du må få mange flere beskeder, heriblandt nogen der fortæller noget brugbart.
Avatar billede brian0905 Nybegynder
10. juli 2008 - 09:43 #2
De eneste jeg får ellers er hittests og mousemoves. Kan det passe at jeg for at få mere ud af WM_USER beskeden skal subclasse mit window for at kunne se hvad de WM_USER beskeder indeholder? En fuld Spy++ log indeholder dette:

<01874> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01875> 000805F8 S WM_NCHITTEST xPos:448 yPos:511
<01876> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01877> 000805F8 S WM_NCHITTEST xPos:448 yPos:511
<01878> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01879> 000805F8 S WM_SETCURSOR hwnd:000805F8 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01880> 000805F8 R WM_SETCURSOR fHaltProcessing:False
<01881> 000805F8 P WM_MOUSEMOVE fwKeys:0000 xPos:201 yPos:348
<01882> 000805F8 S WM_NCHITTEST xPos:448 yPos:511
<01883> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01884> 000805F8 S WM_NCHITTEST xPos:428 yPos:503
<01885> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01886> 000805F8 S WM_NCHITTEST xPos:428 yPos:503
<01887> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01888> 000805F8 S WM_SETCURSOR hwnd:000805F8 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01889> 000805F8 R WM_SETCURSOR fHaltProcessing:False
<01890> 000805F8 P WM_MOUSEMOVE fwKeys:0000 xPos:181 yPos:340
<01891> 000805F8 S WM_NCHITTEST xPos:428 yPos:503
<01892> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01893> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01894> 000805F8 S WM_PAINT hdc:00000000
<01895> 000805F8 R WM_PAINT
<01896> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01897> 000805F8 S WM_NCHITTEST xPos:327 yPos:480
<01898> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01899> 000805F8 S WM_NCHITTEST xPos:327 yPos:480
<01900> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01901> 000805F8 S WM_SETCURSOR hwnd:000805F8 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01902> 000805F8 R WM_SETCURSOR fHaltProcessing:False
<01903> 000805F8 P WM_MOUSEMOVE fwKeys:0000 xPos:80 yPos:317
<01904> 000805F8 S WM_NCHITTEST xPos:327 yPos:480
<01905> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01906> 000805F8 S WM_NCHITTEST xPos:298 yPos:476
<01907> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01908> 000805F8 S WM_NCHITTEST xPos:298 yPos:476
<01909> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01910> 000805F8 S WM_SETCURSOR hwnd:000805F8 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01911> 000805F8 R WM_SETCURSOR fHaltProcessing:False
<01912> 000805F8 P WM_MOUSEMOVE fwKeys:0000 xPos:51 yPos:313
<01913> 000805F8 S WM_NCHITTEST xPos:298 yPos:476
<01914> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01915> 000805F8 S WM_NCHITTEST xPos:277 yPos:471
<01916> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01917> 000805F8 S WM_NCHITTEST xPos:277 yPos:471
<01918> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01919> 000805F8 S WM_SETCURSOR hwnd:000805F8 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01920> 000805F8 R WM_SETCURSOR fHaltProcessing:False
<01921> 000805F8 P WM_MOUSEMOVE fwKeys:0000 xPos:30 yPos:308
<01922> 000805F8 S WM_NCHITTEST xPos:277 yPos:471
<01923> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01924> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01925> 000805F8 S WM_PAINT hdc:00000000
<01926> 000805F8 R WM_PAINT
<01927> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01928> 000805F8 S WM_NCHITTEST xPos:247 yPos:465
<01929> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01930> 000805F8 S WM_NCHITTEST xPos:247 yPos:465
<01931> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01932> 000805F8 S WM_SETCURSOR hwnd:000805F8 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<01933> 000805F8 R WM_SETCURSOR fHaltProcessing:False
<01934> 000805F8 P WM_MOUSEMOVE fwKeys:0000 xPos:0 yPos:302
<01935> 000805F8 S WM_NCHITTEST xPos:247 yPos:465
<01936> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01937> 000805F8 S WM_NCHITTEST xPos:247 yPos:465
<01938> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01939> 000805F8 S WM_NCHITTEST xPos:247 yPos:465
<01940> 000805F8 R WM_NCHITTEST nHittest:HTCLIENT
<01941> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01942> 000805F8 S WM_PAINT hdc:00000000
<01943> 000805F8 R WM_PAINT
<01944> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01945> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01946> 000805F8 S WM_PAINT hdc:00000000
<01947> 000805F8 R WM_PAINT
<01948> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01949> 000805F8 P WM_TIMER wTimerID:54218 tmprc:00000000
<01950> 000805F8 P WM_PAINT hdc:00000000
<01951> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01952> 000805F8 S WM_PAINT hdc:00000000
<01953> 000805F8 R WM_PAINT
<01954> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01955> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01956> 000805F8 S WM_ERASEBKGND hdc:25010E56
<01957> 000805F8 R WM_ERASEBKGND fErased:True
<01958> 000805F8 S WM_ERASEBKGND hdc:25010E56
<01959> 000805F8 R WM_ERASEBKGND fErased:True
<01960> 000805F8 S WM_ERASEBKGND hdc:25010E56
<01961> 000805F8 R WM_ERASEBKGND fErased:True
<01962> 000805F8 S WM_ERASEBKGND hdc:25010E56
<01963> 000805F8 R WM_ERASEBKGND fErased:True
<01964> 000805F8 S WM_ERASEBKGND hdc:25010E56
<01965> 000805F8 R WM_ERASEBKGND fErased:True
<01966> 000805F8 S WM_PAINT hdc:00000000
<01967> 000805F8 R WM_PAINT
<01968> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000001
<01969> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01970> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000000
<01971> 000805F8 S message:0x046F [User-defined:WM_USER+111] wParam:00000000 lParam:00000000
<01972> 000805F8 R message:0x046F [User-defined:WM_USER+111] lResult:00000000

Så vidt jeg kan se er det kun user beskederne der er noget køb på ???
Avatar billede brian0905 Nybegynder
10. juli 2008 - 09:43 #3
Køb = Kød
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester