15 "WM_KILLFOCUS=0x0008",
17 "WM_SETREDRAW=0x000B",
20 "WM_GETTEXTLENGTH=0x000E",
23 "WM_QUERYENDSESSION=0x0011",
25 "WM_QUERYOPEN=0x0013",
26 "WM_ERASEBKGND=0x0014",
27 "WM_SYSCOLORCHANGE=0x0015",
28 "WM_ENDSESSION=0x0016",
29 "WM_SHOWWINDOW=0x0018",
30 "WM_WININICHANGE=0x001A",
31 "WM_DEVMODECHANGE=0x001B",
32 "WM_ACTIVATEAPP=0x001C",
33 "WM_FONTCHANGE=0x001D",
34 "WM_TIMECHANGE=0x001E",
35 "WM_CANCELMODE=0x001F",
36 "WM_SETCURSOR=0x0020",
37 "WM_MOUSEACTIVATE=0x0021",
38 "WM_CHILDACTIVATE=0x0022",
39 "WM_QUEUESYNC=0x0023",
40 "WM_GETMINMAXINFO=0x0024",
41 "WM_PAINTICON=0x0026",
42 "WM_ICONERASEBKGND=0x0027",
43 "WM_NEXTDLGCTL=0x0028",
44 "WM_SPOOLERSTATUS=0x002A",
46 "WM_MEASUREITEM=0x002C",
47 "WM_DELETEITEM=0x002D",
48 "WM_VKEYTOITEM=0x002E",
49 "WM_CHARTOITEM=0x002F",
52 "WM_SETHOTKEY=0x0032",
53 "WM_GETHOTKEY=0x0033",
54 "WM_QUERYDRAGICON=0x0037",
55 "WM_COMPAREITEM=0x0039",
56 "WM_GETOBJECT=0x003D",
57 "WM_COMPACTING=0x0041",
58 "WM_COMMNOTIFY=0x0044",
59 "WM_WINDOWPOSCHANGING=0x0046",
60 "WM_WINDOWPOSCHANGED=0x0047",
63 "WM_CANCELJOURNAL=0x004B",
65 "WM_INPUTLANGCHANGEREQUEST=0x0050",
66 "WM_INPUTLANGCHANGE=0x0051",
69 "WM_USERCHANGED=0x0054",
70 "WM_NOTIFYFORMAT=0x0055",
71 "WM_CONTEXTMENU=0x007B",
72 "WM_STYLECHANGING=0x007C",
73 "WM_STYLECHANGED=0x007D",
74 "WM_DISPLAYCHANGE=0x007E",
78 "WM_NCDESTROY=0x0082",
79 "WM_NCCALCSIZE=0x0083",
80 "WM_NCHITTEST=0x0084",
82 "WM_NCACTIVATE=0x0086",
83 "WM_GETDLGCODE=0x0087",
84 "WM_SYNCPAINT=0x0088",
85 "WM_NCMOUSEMOVE=0x00A0",
86 "WM_NCLBUTTONDOWN=0x00A1",
87 "WM_NCLBUTTONUP=0x00A2",
88 "WM_NCLBUTTONDBLCLK=0x00A3",
89 "WM_NCRBUTTONDOWN=0x00A4",
90 "WM_NCRBUTTONUP=0x00A5",
91 "WM_NCRBUTTONDBLCLK=0x00A6",
92 "WM_NCMBUTTONDOWN=0x00A7",
93 "WM_NCMBUTTONUP=0x00A8",
94 "WM_NCMBUTTONDBLCLK=0x00A9",
95 "WM_NCXBUTTONDOWN=0x00AB",
96 "WM_NCXBUTTONUP=0x00AC",
97 "WM_NCXBUTTONDBLCLK=0x00AD",
103 "WM_DEADCHAR=0x0103",
104 "WM_SYSKEYDOWN=0x0104",
105 "WM_SYSKEYUP=0x0105",
107 "WM_SYSDEADCHAR=0x0107",
111 "WM_INITDIALOG=0x0110",
113 "WM_SYSCOMMAND=0x0112",
117 "WM_INITMENU=0x0116",
118 "WM_INITMENUPOPUP=0x0117",
120 "WM_GESTURENOTIFY=0x011A",
121 "WM_MENUSELECT=0x011F",
122 "WM_MENUCHAR=0x0120",
123 "WM_ENTERIDLE=0x0121",
124 "WM_MENURBUTTONUP=0x0122",
125 "WM_MENUDRAG=0x0123",
126 "WM_MENUGETOBJECT=0x0124",
127 "WM_UNINITMENUPOPUP=0x0125",
128 "WM_MENUCOMMAND=0x0126",
129 "WM_CHANGEUISTATE=0x0127",
130 "WM_UPDATEUISTATE=0x0128",
131 "WM_QUERYUISTATE=0x0129",
132 "WM_CTLCOLORMSGBOX=0x0132",
133 "WM_CTLCOLOREDIT=0x0133",
134 "WM_CTLCOLORLISTBOX=0x0134",
135 "WM_CTLCOLORBTN=0x0135",
136 "WM_CTLCOLORDLG=0x0136",
137 "WM_CTLCOLORSCROLLBAR=0x0137",
138 "WM_CTLCOLORSTATIC=0x0138",
139 "WM_MOUSEFIRST=0x0200",
140 "WM_MOUSEMOVE=0x0200",
141 "WM_LBUTTONDOWN=0x0201",
142 "WM_LBUTTONUP=0x0202",
143 "WM_LBUTTONDBLCLK=0x0203",
144 "WM_RBUTTONDOWN=0x0204",
145 "WM_RBUTTONUP=0x0205",
146 "WM_RBUTTONDBLCLK=0x0206",
147 "WM_MBUTTONDOWN=0x0207",
148 "WM_MBUTTONUP=0x0208",
149 "WM_MBUTTONDBLCLK=0x0209",
150 "WM_MOUSEWHEEL=0x020A",
151 "WM_XBUTTONDOWN=0x020B",
152 "WM_XBUTTONUP=0x020C",
153 "WM_XBUTTONDBLCLK=0x020D",
154 "WM_MOUSEHWHEEL=0x020E",
155 "WM_MOUSELAST=0x020E",
156 "WM_MOUSELAST=0x020D",
157 "WM_MOUSELAST=0x020A",
158 "WM_MOUSELAST=0x0209",
159 "WM_PARENTNOTIFY=0x0210",
160 "WM_ENTERMENULOOP=0x0211",
161 "WM_EXITMENULOOP=0x0212",
162 "WM_NEXTMENU=0x0213",
164 "WM_CAPTURECHANGED=0x0215",
166 "WM_POWERBROADCAST=0x0218",
167 "WM_DEVICECHANGE=0x0219",
168 "WM_MDICREATE=0x0220",
169 "WM_MDIDESTROY=0x0221",
170 "WM_MDIACTIVATE=0x0222",
171 "WM_MDIRESTORE=0x0223",
173 "WM_MDIMAXIMIZE=0x0225",
175 "WM_MDICASCADE=0x0227",
176 "WM_MDIICONARRANGE=0x0228",
177 "WM_MDIGETACTIVE=0x0229",
178 "WM_MDISETMENU=0x0230",
179 "WM_ENTERSIZEMOVE=0x0231",
180 "WM_EXITSIZEMOVE=0x0232",
181 "WM_DROPFILES=0x0233",
182 "WM_MDIREFRESHMENU=0x0234",
183 "WM_POINTERDEVICECHANGE=0x238",
184 "WM_POINTERDEVICEINRANGE=0x239",
185 "WM_POINTERDEVICEOUTOFRANGE=0x23A",
187 "WM_NCPOINTERUPDATE=0x0241",
188 "WM_NCPOINTERDOWN=0x0242",
189 "WM_NCPOINTERUP=0x0243",
190 "WM_POINTERUPDATE=0x0245",
191 "WM_POINTERDOWN=0x0246",
192 "WM_POINTERUP=0x0247",
193 "WM_POINTERENTER=0x0249",
194 "WM_POINTERLEAVE=0x024A",
195 "WM_POINTERACTIVATE=0x024B",
196 "WM_POINTERCAPTURECHANGED=0x024C",
197 "WM_TOUCHHITTESTING=0x024D",
198 "WM_POINTERWHEEL=0x024E",
199 "WM_POINTERHWHEEL=0x024F",
200 "WM_POINTERROUTEDTO=0x0251",
201 "WM_POINTERROUTEDAWAY=0x0252",
202 "WM_POINTERROUTEDRELEASED=0x0253",
203 "WM_MOUSEHOVER=0x02A1",
204 "WM_MOUSELEAVE=0x02A3",
205 "WM_NCMOUSEHOVER=0x02A0",
206 "WM_NCMOUSELEAVE=0x02A2",
207 "WM_DPICHANGED=0x02E0",
208 "WM_GETDPISCALEDSIZE=0x02E4",
214 "WM_RENDERFORMAT=0x0305",
215 "WM_RENDERALLFORMATS=0x0306",
216 "WM_DESTROYCLIPBOARD=0x0307",
217 "WM_DRAWCLIPBOARD=0x0308",
218 "WM_PAINTCLIPBOARD=0x0309",
219 "WM_VSCROLLCLIPBOARD=0x030A",
220 "WM_SIZECLIPBOARD=0x030B",
221 "WM_ASKCBFORMATNAME=0x030C",
222 "WM_CHANGECBCHAIN=0x030D",
223 "WM_HSCROLLCLIPBOARD=0x030E",
224 "WM_QUERYNEWPALETTE=0x030F",
225 "WM_PALETTEISCHANGING=0x0310",
226 "WM_PALETTECHANGED=0x0311",
229 "WM_PRINTCLIENT=0x0318",
230 "WM_APPCOMMAND=0x0319",
231 "WM_THEMECHANGED=0x031A",
232 "WM_CLIPBOARDUPDATE=0x031D",
233 "WM_DWMCOMPOSITIONCHANGED=0x031E",
234 "WM_DWMNCRENDERINGCHANGED=0x031F",
235 "WM_DWMCOLORIZATIONCOLORCHANGED=0x0320",
236 "WM_DWMWINDOWMAXIMIZEDCHANGE=0x0321",
237 "WM_DWMSENDICONICTHUMBNAIL=0x0323",
238 "WM_DWMSENDICONICLIVEPREVIEWBITMAP=0x0326",
239 "WM_GETTITLEBARINFOEX=0x033F",
240 "WM_HANDHELDFIRST=0x0358",
241 "WM_HANDHELDLAST=0x035F",
242 "WM_AFXFIRST=0x0360",
244 "WM_PENWINFIRST=0x0380",
245 "WM_PENWINLAST=0x038F",
272 win->tid = GetWindowThreadProcessId(hwnd, &win->pid);
273 win->proc = GetClassLongPtrW(hwnd, GCLP_WNDPROC);
274 const size_t sz = MAX_CLASS_NAME *
sizeof(WCHAR);
280 GetClassNameW(hwnd,
tmp, MAX_CLASS_NAME);
281 win->name = rz_utf16_to_utf8(
tmp);
313 while (!
rz_cons_yesno(
'y',
"Move cursor to the window to be identified. Ready? (Y/n)"))
316 if (!GetCursorPos(&
p)) {
319 HWND hwnd = WindowFromPoint(
p);
323 HWND child = ChildWindowFromPoint(hwnd,
p);
324 hwnd = child ? child : hwnd;
341 rz_cons_print(tbl_str);
348 _In_ LPARAM lParam) {
363 DWORD dwProcessID = 0;
364 GetWindowThreadProcessId(hCurWnd, &dwProcessID);
365 if (
dbg->
pid == dwProcessID) {
366 EnumChildWindows(hCurWnd,
enum_childs, (LPARAM)windows);
374 }
while (hCurWnd !=
NULL);
383 rz_list_foreach (modlist, it,
mod) {
384 if (!strnicmp(
mod->name,
"user32.dll",
sizeof(
"user32.dll"))) {
397 char *
line = strtok(res,
"\n");
400 char *sym = strrchr(
line,
' ');
406 }
while ((
line = strtok(
NULL,
"\n")));
441 rz_list_foreach (windows, it, win) {
475 if (windows && !windows->
length) {
481 rz_list_foreach (windows, it, win) {
482 if ((
ut64)win->h == win_h || !strnicmp(win->name, window_id, strlen(window_id))) {
507 if (!strcmp(
dbg->
arch,
"arm")) {
519 if (!strcmp(
dbg->
arch,
"arm")) {
static mcore_handle handle
RZ_API RzList * rz_debug_modules_list(RzDebug *dbg)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
RZ_API RZ_BORROW RzBreakpointItem * rz_debug_bp_add(RZ_NONNULL RzDebug *dbg, ut64 addr, int hw, bool watch, int rw, RZ_NULLABLE const char *module, st64 m_delta)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API int sdb_query(Sdb *s, const char *cmd)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc pid
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
void(* RzListFree)(void *ptr)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API void rz_str_trim(RZ_NONNULL RZ_INOUT char *str)
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
RZ_API bool rz_str_startswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string starts with a specifc sequence of characters (case sensitive)
RZ_API void rz_table_add_column(RzTable *t, RzTableColumnType *type, const char *name, int maxWidth)
RZ_API void rz_table_free(RzTable *t)
RZ_API void rz_table_add_row(RZ_NONNULL RzTable *t, const char *name,...)
RZ_API char * rz_table_tostring(RzTable *t)
RZ_API RzTable * rz_table_new(void)
RZ_API RZ_OWN char * rz_table_tofancystring(RZ_NONNULL RzTable *t)
Convert the content of RzTable to string.
RZ_API RzTableColumnType * rz_table_type(const char *name)
RZ_API Sdb * sdb_new0(void)
RZ_API const char * sdb_const_get(Sdb *s, const char *key, ut32 *cas)
#define cond(bop, top, mask, flags)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static BOOL CALLBACK enum_childs(_In_ HWND hwnd, _In_ LPARAM lParam)
RZ_API void rz_w32_identify_window(void)
static DWORD get_msg_type(char *name)
static void init_msg_types(Sdb **msg_types)
static RzList * get_windows(RzDebug *dbg)
RZ_API bool rz_w32_add_winmsg_breakpoint(RzDebug *dbg, const char *msg_name, const char *window_id)
RZ_API void rz_w32_print_windows(RzDebug *dbg)
static void print_windows(RzDebug *dbg, RzList *windows)
static window * window_from_handle(HANDLE hwnd)
static char * msg_types_arr[]
static void add_window_to_table(RzTable *tbl, window *win)
static ut64 get_dispatchmessage_offset(RzDebug *dbg)
void free_window(void *ptr)
static RzTable * create_window_table(void)