-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfocusHelper.asm
37 lines (29 loc) · 1.15 KB
/
focusHelper.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
format PE GUI 4.0
entry start
include 'win32a.inc'
section '.code' code readable executable
start:
; Allow any process to set the foreground window
push -1 ; ASFW_ANY
call [AllowSetForegroundWindow]
; Find the window by class name and window name
push wndName ; Window name 'AI Launcher'
push wndClassName ; Class name 'AIChatbarWnd'
call [FindWindowA]
test eax, eax ; Check if the window handle is valid
jz exit ; Exit if no window found
; Call SwitchToThisWindow
push 1 ; fUnknown parameter (TRUE)
push eax ; hWnd (window handle)
call [SwitchToThisWindow]
exit:
; Exit the program
push 0
call [ExitProcess]
section '.data' data readable writeable
wndClassName db 'AIChatbarWnd', 0
wndName db 'AI Launcher', 0
section '.idata' import data readable writeable
library kernel32, 'kernel32.dll', user32, 'user32.dll'
import kernel32, ExitProcess, 'ExitProcess'
import user32, FindWindowA, 'FindWindowA', AllowSetForegroundWindow, 'AllowSetForegroundWindow', SwitchToThisWindow, 'SwitchToThisWindow'