forked from resilar/HotFinger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.inc
60 lines (54 loc) · 1.93 KB
/
cli.inc
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;-------------------------------------------------------------------------;
; Command-line interface (very rudimentary)
;-------------------------------------------------------------------------;
proc CommandLineInterface
local argc:DWORD
local argv:DWORD
; Debugging ...
;call @f
;du '"C:\Users\Hitler\Desktop\HotFinger\hotfinger.exe" install USB\VID_1488&PID_1488\222222222222',0
;du '"C:\Users\Hitler\Desktop\HotFinger\hotfinger.exe" uninstall',0
;@@: pop eax
;jmp @f
; Read command-line and skip argv[0]
call [GetCommandLineW]
@@: lea ecx, [argc]
push ecx
push eax
call [CommandLineToArgvW]
test eax, eax
jnz @f
ret
@@: movzx ecx, byte [argc]
mov [argv], eax
cmp cl, 2
jnz .three_args
push dword [eax + 4]
push clidata.wszUninstall
call [lstrcmpW]
test eax, eax
jnz .exit
push guidDatabase
call UninstallDatabase
jmp .exit_process
.three_args: cmp cl, 3
jnz .exit
push dword [eax + 8]
push dword [eax + 4]
push clidata.wszInstall
call [lstrcmpW]
test eax, eax
pop eax
jnz .exit
.install_for: push eax
push guidDatabase
call InstallDatabaseForSensor
jmp .exit_process
.exit: push [argv]
call [LocalFree]
ret
.exit_process: push eax
push [argv]
call [LocalFree]
call [ExitProcess]
endp