Function at 0x402540
Capabilities:
Contain obfuscated stackstrings

Disassembly:
sub esp, 0x4c
mov eax, dword [0x412040]
xor eax, esp
mov dword [esp + 0x48], eax
cmp word [ecx + 0x220], 0
push esi
mov esi, edx
mov dword [esp + 8], ecx
jbe 0x4030b3
test esi, esi
jne 0x402572
cmp dword [esp + 0x54], edx
mov eax, 0x40000000
je 0x402577
mov eax, 0xc0000000
push 0
push 0
push 3
push 0
push 3
push eax
add ecx, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0xc], eax
je 0x4030b3
mov eax, dword [esp + 8]
push ebx
movzx ebx, word [eax + 0x220]
push ebp
push edi
movzx edi, bx
push edi
mov dword [esp + 0x3c], ebx
call fcn.004043af
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x4030a5
test esi, esi
mov dword [esp + 0x30], 0
je 0x402c11
mov al, 0x53
push edi
mov byte [esp + 0x4e], al
mov byte [esp + 0x50], al
mov cl, 0x63
mov al, 0x2e
push 0
push ebp
mov byte [esp + 0x54], 0x5a
mov byte [esp + 0x55], 0x41
mov byte [esp + 0x57], 0x55
mov byte [esp + 0x59], 0x20
mov byte [esp + 0x5a], 0x54
mov byte [esp + 0x5b], 0x65
mov byte [esp + 0x5c], cl
mov byte [esp + 0x5d], 0x68
mov byte [esp + 0x5e], al
mov byte [esp + 0x5f], 0x49
mov byte [esp + 0x60], 0x6e
mov byte [esp + 0x61], cl
mov byte [esp + 0x62], al
mov byte [esp + 0x63], 0
call fcn.004080f0
mov ecx, dword [esp + 0x24]
add esp, 0xc
push edi
push ebp
push ecx
mov byte [ebp], 0x5a
call sub.HID.DLL_HidD_GetFeature
test al, al
je 0x402b83
cmp bx, 3
mov byte [esp + 0x28], 0x5a
mov byte [esp + 0x29], 0xf4
mov byte [esp + 0x2a], 0x6b
mov byte [esp + 0x1c], 0x5a
mov byte [esp + 0x1d], 0xba
mov byte [esp + 0x1e], 0xc5
mov byte [esp + 0x1f], 0xc4
mov byte [esp + 0x40], 0x5a
mov byte [esp + 0x41], 5
mov byte [esp + 0x42], 0x20
mov byte [esp + 0x43], 0x31
mov byte [esp + 0x44], 0
mov byte [esp + 0x45], 8
mov byte [esp + 0x2c], 0x5a
mov byte [esp + 0x2d], 0xb0
mov byte [esp + 0x2e], 0xd0
mov byte [esp + 0x24], 0x5a
mov byte [esp + 0x25], 0xb1
mov byte [esp + 0x26], 0xd0
mov byte [esp + 0x20], 0x5a
mov byte [esp + 0x21], 0xbb
mov byte [esp + 0x22], 1
mov byte [esp + 0x10], 0x5a
mov byte [esp + 0x11], 0xbb
mov byte [esp + 0x12], 2
mov eax, edi
jb 0x4026cf
mov eax, 3
cmp eax, 4
lea ecx, [esp + 0x28]
mov edx, ebp
jb 0x4026f4
lea ebx, [ebx]
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x4026f8
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x4026e0
test eax, eax
je 0x402755
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402747
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402755
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402747
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402755
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402747
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402755
movzx esi, byte [edx]
movzx edx, byte [ecx]
sub esi, edx
je 0x402755
test esi, esi
mov eax, 1
jg 0x402757
or eax, 0xffffffff
jmp 0x402757
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 0x10
movzx eax, bx
jb 0x40276d
mov eax, 0x10
cmp eax, 4
lea ecx, [esp + 0x48]
mov edx, ebp
jb 0x40278c
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x402790
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x402778
test eax, eax
je 0x4027ed
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x4027df
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x4027ed
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x4027df
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x4027ed
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x4027df
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x4027ed
movzx eax, byte [ecx]
movzx esi, byte [edx]
sub esi, eax
je 0x4027ed
test esi, esi
mov eax, 1
jg 0x4027ef
or eax, 0xffffffff
jmp 0x4027ef
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 4
movzx eax, bx
jb 0x402805
mov eax, 4
cmp eax, 4
lea ecx, [esp + 0x1c]
mov edx, ebp
jb 0x402824
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x402828
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x402810
test eax, eax
je 0x402885
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402877
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402885
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402877
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402885
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402877
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402885
movzx esi, byte [edx]
movzx ecx, byte [ecx]
sub esi, ecx
je 0x402885
test esi, esi
mov eax, 1
jg 0x402887
or eax, 0xffffffff
jmp 0x402887
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 6
movzx eax, bx
jb 0x40289d
mov eax, 6
cmp eax, 4
lea ecx, [esp + 0x40]
mov edx, ebp
jb 0x4028bc
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x4028c0
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x4028a8
test eax, eax
je 0x40291d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x40290f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x40291d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x40290f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x40291d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x40290f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x40291d
movzx eax, byte [ecx]
movzx esi, byte [edx]
sub esi, eax
je 0x40291d
test esi, esi
mov eax, 1
jg 0x40291f
or eax, 0xffffffff
jmp 0x40291f
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 3
movzx eax, bx
jb 0x402935
mov eax, 3
cmp eax, 4
lea ecx, [esp + 0x2c]
mov edx, ebp
jb 0x402954
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x402958
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x402940
test eax, eax
je 0x4029b5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x4029a7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x4029b5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x4029a7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x4029b5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x4029a7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x4029b5
movzx esi, byte [edx]
movzx ecx, byte [ecx]
sub esi, ecx
je 0x4029b5
test esi, esi
mov eax, 1
jg 0x4029b7
or eax, 0xffffffff
jmp 0x4029b7
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 3
movzx eax, bx
jb 0x4029cd
mov eax, 3
cmp eax, 4
lea ecx, [esp + 0x24]
mov edx, ebp
jb 0x4029ec
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x4029f0
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x4029d8
test eax, eax
je 0x402a4d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x402a3f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402a4d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x402a3f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402a4d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x402a3f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402a4d
movzx eax, byte [ecx]
movzx esi, byte [edx]
sub esi, eax
je 0x402a4d
test esi, esi
mov eax, 1
jg 0x402a4f
or eax, 0xffffffff
jmp 0x402a4f
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 3
movzx eax, bx
jb 0x402a65
mov eax, 3
cmp eax, 4
lea ecx, [esp + 0x20]
mov edx, ebp
jb 0x402a84
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x402a88
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x402a70
test eax, eax
je 0x402ae5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402ad7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402ae5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402ad7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402ae5
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402ad7
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402ae5
movzx esi, byte [edx]
movzx ecx, byte [ecx]
sub esi, ecx
je 0x402ae5
test esi, esi
mov eax, 1
jg 0x402ae7
or eax, 0xffffffff
jmp 0x402ae7
xor eax, eax
test eax, eax
je 0x402be4
cmp bx, 3
movzx eax, bx
jb 0x402afd
mov eax, 3
cmp eax, 4
lea ecx, [esp + 0x10]
mov edx, ebp
jb 0x402b1c
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x402b20
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x402b08
test eax, eax
je 0x402b7d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x402b6f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402b7d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x402b6f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402b7d
movzx edi, byte [ecx]
movzx esi, byte [edx]
sub esi, edi
jne 0x402b6f
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402b7d
movzx eax, byte [ecx]
movzx esi, byte [edx]
sub esi, eax
je 0x402b7d
test esi, esi
mov eax, 1
jg 0x402b7f
or eax, 0xffffffff
jmp 0x402b7f
xor eax, eax
test eax, eax
je 0x402be4
movzx esi, bx
push esi
push 0
push ebp
call fcn.004080f0
add esp, 0xc
cmp bx, 0x10
mov eax, esi
jb 0x402b9f
mov eax, 0x10
push eax
lea ecx, [esp + 0x4c]
push ecx
push ebp
call fcn.00407d80
mov edx, dword [esp + 0x24]
add esp, 0xc
push esi
push ebp
push edx
call sub.HID.DLL_HidD_SetFeature
cmp dword [0x413cf8], 0
je 0x402c11
mov edi, dword [esp + 0x14]
mov eax, pe_nt_image_headers32
mov dword [edi + 0x280], 0
mov dword [edi + 0x278], eax
mov dword [edi + 0x288], eax
jmp 0x402c20
cmp dword [esp + 0x68], 0
je 0x402c11
cmp dword [0x413cf8], 0
je 0x402c11
mov ecx, dword [esp + 0x14]
mov eax, pe_nt_image_headers32
mov dword [ecx + 0x278], eax
mov dword [ecx + 0x288], eax
mov dword [esp + 0x30], 1
cmp dword [esp + 0x60], 0
je 0x402e08
mov edi, dword [esp + 0x14]
cmp word [edi + 0x25e], 0x182f
je 0x402e08
cmp dword [edi + 0x280], 0
jne 0x402e08
movzx esi, bx
push esi
push 0
push ebp
mov dword [edi + 0x280], 1
call fcn.004080f0
add esp, 0xc
cmp bx, 6
mov byte [esp + 0x30], 0x5a
mov byte [esp + 0x31], 5
mov byte [esp + 0x32], 0x20
mov byte [esp + 0x33], 0x31
mov byte [esp + 0x34], 0
mov byte [esp + 0x35], 8
mov eax, esi
jb 0x402c80
mov eax, 6
push eax
lea eax, [esp + 0x34]
push eax
push ebp
call fcn.00407d80
mov ecx, dword [esp + 0x24]
add esp, 0xc
push esi
push ebp
push ecx
call sub.HID.DLL_HidD_SetFeature
test al, al
je 0x402e17
push esi
push 0
push ebp
call fcn.004080f0
mov edx, dword [esp + 0x24]
add esp, 0xc
push esi
push ebp
push edx
mov byte [ebp], 0x5a
call sub.HID.DLL_HidD_GetFeature
test al, al
je 0x402e17
cmp bx, 8
jb 0x402dde
cmp bx, 6
mov eax, esi
jb 0x402cde
mov eax, 6
cmp eax, 4
lea ecx, [esp + 0x30]
mov edx, ebp
jb 0x402d04
lea esp, [esp]
mov esi, dword [edx]
cmp esi, dword [ecx]
jne 0x402d08
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x402cf0
test eax, eax
je 0x402d6d
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402d57
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402d69
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402d57
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402d69
movzx esi, byte [edx]
movzx edi, byte [ecx]
sub esi, edi
jne 0x402d57
sub eax, 1
add ecx, 1
add edx, 1
test eax, eax
je 0x402d69
movzx esi, byte [edx]
movzx eax, byte [ecx]
sub esi, eax
je 0x402d69
test esi, esi
mov edi, dword [esp + 0x14]
mov eax, 1
jg 0x402d6f
or eax, 0xffffffff
jmp 0x402d6f
mov edi, dword [esp + 0x14]
xor eax, eax
test eax, eax
jne 0x402dde
movzx ecx, byte [ebp + 6]
and cl, 1
sub cl, 1
neg cl
sbb ecx, ecx
add ecx, 1
mov dword [edi + 0x274], ecx
mov dl, byte [ebp + 6]
and dl, 8
cmp dl, 8
sete al
xor edx, edx
mov dword [edi + 0x27c], eax
movzx ecx, byte [ebp + 6]
and cl, 0x20
cmp cl, 0x20
sete dl
cmp dword [edi + 0x274], 0
mov dword [edi + 0x284], edx
je 0x402dde
cmp dword [0x4130d4], 0
je 0x402dde
cmp bx, 0xa
jb 0x402dde
cmp byte [ebp + 9], 0
je 0x402dde
call fcn.004033e0
mov dword [0x4130d4], 0
cmp dword [edi + 0x27c], 0
je 0x402e17
cmp dword [0x41433c], 0
jne 0x402e17
push str.GlobalASUS_AsHidSrv_Keyboard_Lock_Event
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [0x41433c], eax
jmp 0x402e17
cmp dword [esp + 0x30], 0
je 0x402e92
mov edi, dword [esp + 0x14]
cmp dword [edi + 0x284], 0
je 0x402e92
lea edi, [esp + 0x30]
call fcn.004039d0
test eax, eax
je 0x402e92
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x14]
cmp dword [eax + 0x288], esi
je 0x402e92
movzx edi, bx
push edi
mov ecx, eax
push 0
push ebp
mov dword [ecx + 0x288], esi
call fcn.004080f0
add esp, 0xc
test esi, esi
setne dl
add dl, 1
cmp bx, 3
mov byte [esp + 0x10], 0x5a
mov byte [esp + 0x11], 0xbb
mov byte [esp + 0x12], dl
mov eax, edi
jb 0x402e77
mov eax, 3
push eax
lea eax, [esp + 0x14]
push eax
push ebp
call fcn.00407d80
mov ecx, dword [esp + 0x24]
add esp, 0xc
push edi
push ebp
push ecx
call sub.HID.DLL_HidD_SetFeature
mov eax, dword [esp + 0x64]
cmp eax, 1
jne 0x402ecf
movzx esi, bx
push esi
push 0
push ebp
call fcn.004080f0
add esp, 0xc
cmp bx, 3
mov byte [esp + 0x10], 0x5a
mov byte [esp + 0x11], 0xf4
mov byte [esp + 0x12], 0x6b
mov eax, esi
jb 0x403081
mov eax, 3
jmp 0x403081
cmp eax, 2
jne 0x402f9e
mov eax, dword [esp + 0x14]
cmp word [eax + 0x25e], 0x182f
je 0x40309c
cmp dword [eax + 0x274], 0
je 0x40309c
cmp dword [0x4130d8], 1
je 0x40309c
lea edi, [esp + 0x30]
lea ebx, [esp + 0x1c]
call fcn.00403940
test eax, eax
je 0x40309c
cmp dword [esp + 0x30], 0
je 0x402f31
mov ebx, dword [esp + 0x1c]
cmp ebx, 3
jb 0x402f33
mov ebx, 3
jmp 0x402f33
xor ebx, ebx
mov ecx, dword [esp + 0x14]
cmp dword [ecx + 0x278], ebx
je 0x40309c
mov edi, dword [esp + 0x38]
movzx esi, di
push esi
mov edx, ecx
push 0
push ebp
mov dword [edx + 0x278], ebx
call fcn.004080f0
add esp, 0xc
cmp di, 5
mov byte [esp + 0x38], 0x5a
mov byte [esp + 0x39], 0xba
mov byte [esp + 0x3a], 0xc5
mov byte [esp + 0x3b], 0xc4
mov byte [esp + 0x3c], bl
mov eax, esi
jb 0x402f83
mov eax, 5
push eax
lea eax, [esp + 0x3c]
push eax
push ebp
call fcn.00407d80
mov ecx, dword [esp + 0x24]
add esp, 0xc
push esi
push ebp
push ecx
jmp 0x403097
cmp eax, 3
je 0x403041
cmp eax, 4
je 0x403041
cmp eax, 5
jne 0x40309c
mov edx, dword [esp + 0x14]
cmp dword [edx + 0x284], 0
je 0x40309c
lea edi, [esp + 0x38]
call fcn.004039d0
test eax, eax
je 0x40309c
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x14]
cmp dword [eax + 0x288], esi
je 0x40309c
movzx edi, bx
push edi
mov ecx, eax
push 0
push ebp
mov dword [ecx + 0x288], esi
call fcn.004080f0
add esp, 0xc
test esi, esi
setne dl
add dl, 1
cmp bx, 3
mov byte [esp + 0x10], 0x5a
mov byte [esp + 0x11], 0xbb
mov byte [esp + 0x12], dl
mov eax, edi
jb 0x403029
mov eax, 3
push eax
lea eax, [esp + 0x14]
push eax
push ebp
call fcn.00407d80
mov ecx, dword [esp + 0x24]
add esp, 0xc
push edi
push ebp
push ecx
jmp 0x403097
mov edx, dword [esp + 0x14]
cmp dword [edx + 0x27c], 0
je 0x40309c
movzx esi, bx
push esi
push 0
push ebp
call fcn.004080f0
mov eax, 3
add esp, 0xc
cmp dword [esp + 0x64], eax
mov byte [esp + 0x10], 0x5a
setne cl
add cl, 0xb0
cmp bx, ax
mov byte [esp + 0x11], cl
mov byte [esp + 0x12], 0xd0
jae 0x403081
mov eax, esi
push eax
lea edx, [esp + 0x14]
push edx
push ebp
call fcn.00407d80
mov eax, dword [esp + 0x24]
add esp, 0xc
push esi
push ebp
push eax
call sub.HID.DLL_HidD_SetFeature
push ebp
call fcn.00404419
add esp, 4
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
pop esi
xor ecx, esp
call fcn.0040407a
add esp, 0x4c
ret