Function at 0x408170
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x8c
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [esp], str.https_url_http:__static.adguardvpn.com_windows_installer.exe_nhttp_url_https:__static.adguardvpn.com_windows_installer.exe_nsetup_args__AID31220__n
mov ebx, eax
mov dword [0x40d078], eax
call sub.msvcrt.dll_strlen
mov dword [esp + 8], 0x18
mov dword [ebp - 0x60], eax
mov dword [esp + 4], 8
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x68], str.https_url_http:__static.adguardvpn.com_windows_installer.exe_nhttp_url_https:__static.adguardvpn.com_windows_installer.exe_nsetup_args__AID31220__n
mov dword [0x40d084], eax
sub esp, 0xc
test eax, eax
je 0x408a85
cmp dword [ebp - 0x60], 0
je 0x4083b3
mov edi, dword [ebp - 0x68]
mov esi, dword [ebp - 0x68]
add esi, dword [ebp - 0x60]
cmp esi, edi
je 0x408279
mov dword [esp + 8], 1
movsx eax, byte [edi]
mov dword [esp], 0x40e2b1
mov dword [esp + 4], eax
call sub.msvcrt.dll_memchr
test eax, eax
je 0x408213
inc edi
jmp 0x4081e9
mov eax, esi
mov dword [esp + 4], 0xa
sub eax, edi
mov dword [esp], edi
mov dword [esp + 8], eax
call sub.msvcrt.dll_memchr
mov ebx, eax
test eax, eax
je 0x408240
mov edx, dword [ebp - 0x60]
cmp esi, eax
je 0x40826e
mov edx, eax
sub edx, dword [ebp - 0x68]
inc edx
jmp 0x40826e
mov edx, dword [ebp - 0x60]
mov ebx, esi
jmp 0x40826e
mov dword [esp + 8], 1
movsx eax, byte [ebx - 1]
mov dword [esp], 0x40e2b1
mov dword [esp + 4], eax
mov dword [ebp - 0x5c], edx
call sub.msvcrt.dll_memchr
mov edx, dword [ebp - 0x5c]
test eax, eax
je 0x408272
dec ebx
cmp edi, ebx
jne 0x408247
mov dword [ebp - 0x5c], edi
sub ebx, edi
jmp 0x40827e
mov edx, dword [ebp - 0x60]
xor ebx, ebx
add dword [ebp - 0x68], edx
sub dword [ebp - 0x60], edx
test ebx, ebx
je 0x4081d6
mov eax, dword [ebp - 0x5c]
lea edx, [ebx - 1]
cmp byte [eax + ebx - 1], 0xd
mov dword [esp + 4], 0x20
cmovne edx, ebx
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [ebp - 0x64], edx
call sub.msvcrt.dll_memchr
mov edx, dword [ebp - 0x64]
mov dword [ebp - 0x64], 0
mov esi, eax
mov eax, dword [ebp - 0x5c]
add eax, edx
test esi, esi
je 0x4082d9
cmp eax, esi
je 0x408a8f
mov edx, esi
inc esi
sub edx, dword [ebp - 0x5c]
sub eax, esi
mov dword [ebp - 0x64], eax
test edx, edx
mov dword [ebp - 0x6c], edx
je 0x4081d6
mov eax, dword [ebp - 0x5c]
cmp byte [eax], 0x23
je 0x4081d6
mov eax, dword [ebp - 0x64]
mov dword [esp + 4], 0
inc eax
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x408a85
mov ecx, dword [ebp - 0x64]
mov edi, eax
mov eax, dword [ebp - 0x64]
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebp - 0x6c]
mov ecx, str.setup_args
mov byte [ebx + eax], 0
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x64], edx
call fcn.0040a058
mov edx, dword [ebp - 0x64]
test eax, eax
jne 0x40834f
mov eax, dword [0x40d084]
mov dword [eax], ebx
jmp 0x4081d6
mov eax, dword [ebp - 0x5c]
mov ecx, str.http_url
mov dword [ebp - 0x64], edx
call fcn.0040a058
mov edx, dword [ebp - 0x64]
test eax, eax
jne 0x408373
mov eax, dword [0x40d084]
mov dword [eax + 4], ebx
jmp 0x4081d6
mov eax, dword [ebp - 0x5c]
mov ecx, str.https_url
call fcn.0040a058
test eax, eax
jne 0x408391
mov eax, dword [0x40d084]
mov dword [eax + 8], ebx
jmp 0x4081d6
mov eax, dword [0x40d078]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
sub esp, 0xc
jmp 0x4081d6
mov eax, dword [0x40d084]
lea edx, [ebp - 0x50]
mov dword [eax + 0x10], 0x1700000
mov dword [eax + 0x14], 0
mov eax, 7
call fcn.00409998
test eax, eax
jne 0x408444
call fcn.0040929c
mov ebx, eax
test eax, eax
je 0x408a85
lea edx, [ebp - 0x50]
call fcn.00409f6c
test eax, eax
jne 0x408403
call fcn.00409144
xor ebx, ebx
test eax, eax
setne bl
jmp 0x408a00
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [eax - 2]
cmp edx, 1
setbe cl
cmp eax, 0x15
sete dl
or cl, dl
jne 0x408434
cmp eax, 0x7b
je 0x408434
lea edx, [ebp - 0x50]
mov eax, ebx
call fcn.00409f6c
test eax, eax
je 0x4083f2
jmp 0x408a85
mov eax, ebx
call fcn.00409b84
test eax, eax
je 0x408421
jmp 0x408a85
mov eax, dword [0x40d078]
mov dword [esp + 8], 0x184
mov dword [esp + 4], 8
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0x40d4a0], eax
sub esp, 0xc
mov edi, eax
test eax, eax
je 0x4087d4
mov dword [eax + 0x12c], 0
lea ebx, [ebp - 0x48]
lea esi, [ebp - 0x54]
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], esi
mov dword [ebp - 0x48], 1
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
call sub.gdiplus.dll_GdiplusStartup
mov eax, dword [ebp - 0x54]
sub esp, 0xc
mov dword [edi + 0x134], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esp], 0
call dword [sym.imp.USER32.dll_GetDC]
mov edi, eax
push edx
test eax, eax
je 0x408505
mov dword [esp + 4], 0x58
mov dword [esp], eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push ecx
push ecx
mov dword [0x40d07c], eax
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.USER32.dll_ReleaseDC]
push edi
push edi
mov eax, dword [0x40d4a0]
mov edx, dword [sym.imp.USER32.dll_SystemParametersInfoW]
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
add eax, 0x138
mov dword [ebp - 0x5c], edx
mov dword [esp + 8], eax
mov dword [esp], 0x30
call edx
mov edi, dword [0x40d4a0]
sub esp, 0x10
lea eax, [edi + 0x138]
call fcn.0040ad20
mov eax, dword [0x40d07c]
mov edx, dword [ebp - 0x5c]
cmp eax, 0xc0
mov dword [edi + 0x148], eax
sbb eax, eax
add edi, 0x14c
mov dword [esp + 0xc], 0
and eax, 0xffffffa0
mov dword [esp + 8], edi
lea edi, [ebp - 0x44]
add eax, 0xc0
mov dword [esp + 4], 0
mov dword [0x40d07c], eax
mov dword [esp], 0x30
call edx
mov eax, dword [0x40d4a0]
sub esp, 0x10
add eax, 0x14c
call fcn.0040ad20
xor eax, eax
mov ecx, 0xb
rep stosd dword es:[edi], eax
mov dword [ebp - 0x48], 0x30
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp - 0x40], 0x40b6a8
push edx
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x20], str.ADGUARD_WI_WNDCLASS
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.USER32.dll_LoadIconW]
push ecx
push ecx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x1c], eax
mov dword [esp + 4], 0x7f00
mov dword [esp], 0
call dword [sym.imp.USER32.dll_LoadCursorW]
mov dword [ebp - 0x28], 5
push edi
push edi
or edi, 0xffffffff
mov dword [ebp - 0x2c], eax
mov dword [esp], ebx
call dword [sym.imp.USER32.dll_RegisterClassExW]
push edx
test ax, ax
je 0x408907
mov eax, dword [0x40d4a0]
or dword [0x40d080], 1
call fcn.0040b020
test eax, eax
jne 0x4087d4
mov eax, dword [0x40d4a0]
mov ecx, 0x19
mov edx, 0x40e250
or byte [eax + 0x14], 1
mov dword [eax + 0x54], 0x40b55c
call fcn.0040aefc
mov eax, esi
mov dword [ebp - 0x54], 0
call fcn.0040addc
mov edi, dword [0x40d4a0]
mov eax, dword [ebp - 0x54]
mov dword [esp + 8], 0
mov dword [esp + 4], pe_nt_image_headers32
mov esi, dword [sym.imp.USER32.dll_SendMessageW]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x54]
sub esp, 0x10
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], pe_nt_image_headers32
mov eax, dword [edi]
mov dword [esp], eax
call esi
mov eax, dword [0x40d4a0]
sub esp, 0x10
mov dword [esp + 4], 0xffffffec
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.USER32.dll_GetWindowLongW]
mov dword [ebp - 0x60], eax
call eax
push edi
or eax, 0x80000
push edi
mov dword [esp + 8], eax
mov eax, dword [0x40d4a0]
mov dword [esp + 4], 0xffffffec
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.USER32.dll_SetWindowLongW]
xor eax, eax
sub esp, 0xc
cmp dword [0x40d07c], 0xc0
sete al
add eax, 3
call fcn.0040b104
test eax, eax
je 0x4087d4
mov esi, dword [0x40d4a0]
mov edi, ebx
lea edx, [esi + 0x160]
call fcn.0040b220
mov ecx, 4
lea edx, [ebp - 0x48]
mov dword [esi + 0x15c], eax
mov eax, dword [0x40d4a0]
lea esi, [eax + 0x160]
mov dword [ebp - 0x5c], eax
add eax, 0x14c
rep movsd dword es:[edi], dword [esi]
call fcn.0040b5fc
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x48]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
mov eax, dword [ebp - 0x5c]
call fcn.0040ae88
xor eax, eax
cmp dword [0x40d07c], 0xc0
sete al
add eax, 5
call fcn.0040b104
test eax, eax
je 0x4087d4
mov esi, dword [0x40d4a0]
lea edx, [esi + 0x174]
call fcn.0040b220
mov dword [esi + 0x170], eax
mov eax, dword [0x40d4a0]
mov dword [esp + 4], 5
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.USER32.dll_ShowWindow]
push esi
push esi
call fcn.0040b2ac
call fcn.0040929c
mov esi, eax
test eax, eax
jne 0x4087dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
call fcn.004093d8
or edi, 0xffffffff
jmp 0x408907
mov eax, dword [0x40d4a0]
mov dword [eax + 0x130], 1
call fcn.0040b2ac
mov edi, dword [0x40d4a0]
mov dword [esp + 0xc], esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x40b62c
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [edi + 0x12c], eax
mov eax, dword [0x40d4a0]
sub esp, 0x18
cmp dword [eax + 0x12c], 0
je 0x4087c9
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.USER32.dll_GetMessageW]
sub esp, 0x10
mov edi, eax
test eax, eax
je 0x408907
mov esi, dword [ebp - 0x48]
test esi, esi
jne 0x40889d
cmp dword [ebp - 0x44], 0x8001
jne 0x4088ee
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [ebp - 0x40]
jmp 0x40883e
cmp dword [eax + 4], 1
je 0x4088b5
mov dword [esp], esi
call dword [sym.imp.USER32.dll_GetParent]
push edi
test eax, eax
je 0x4088b5
mov esi, eax
mov dword [esp + 4], 0xffffffeb
mov eax, dword [ebp - 0x60]
mov dword [esp], esi
call eax
push ecx
push ecx
test eax, eax
jne 0x408887
jmp 0x40888d
mov dword [esp + 4], 0xffffffeb
mov eax, dword [ebp - 0x60]
mov dword [esp], esi
call eax
push edx
push edx
test eax, eax
je 0x4088ee
mov eax, dword [eax + 0x30]
test eax, eax
je 0x4088ee
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.USER32.dll_TranslateAcceleratorW]
sub esp, 0xc
test eax, eax
jne 0x40883e
mov dword [esp], ebx
call dword [sym.imp.USER32.dll_TranslateMessage]
push ecx
mov dword [esp], ebx
call dword [sym.imp.USER32.dll_DispatchMessageW]
push esi
jmp 0x40883e
mov eax, dword [0x40d4a0]
test eax, eax
je 0x4089fc
mov ebx, dword [eax + 0x12c]
test ebx, ebx
je 0x408960
mov dword [esp + 4], 0x3e8
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edx
push edx
test eax, eax
jne 0x408951
lea eax, [ebp - 0x48]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
push eax
push eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
mov eax, dword [0x40d4a0]
mov dword [eax + 0x12c], 0
mov eax, dword [0x40d4a0]
mov ebx, dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [eax + 0x15c]
mov dword [esp], eax
call ebx
mov eax, dword [0x40d4a0]
push esi
mov eax, dword [eax + 0x170]
mov dword [esp], eax
call ebx
push eax
mov eax, dword [0x40d4a0]
mov eax, dword [eax + 0x134]
mov dword [esp], eax
call sub.gdiplus.dll_GdiplusShutdown
push eax
test byte [0x40d080], 1
je 0x4089c6
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push edx
mov dword [esp + 4], eax
mov dword [esp], str.ADGUARD_WI_WNDCLASS
call dword [sym.imp.USER32.dll_UnregisterClassW]
push ecx
push ecx
mov eax, dword [0x40d4a0]
mov dword [esp + 4], 0
mov dword [0x40d07c], 0
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [0x40d4a0], 0
sub esp, 0xc
neg edi
mov ebx, edi
mov edi, dword [0x40d084]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x408a9d
mov eax, dword [edi]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp], eax
call esi
mov eax, dword [edi + 4]
sub esp, 0xc
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp + 4], 0
mov dword [esp], eax
call esi
mov eax, dword [edi + 8]
sub esp, 0xc
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp + 4], 0
mov dword [esp], eax
call esi
mov eax, dword [edi + 0xc]
sub esp, 0xc
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp + 4], 0
mov dword [esp], eax
call esi
sub esp, 0xc
jmp 0x408a9d
mov ebx, 1
jmp 0x408a00
mov dword [ebp - 0x64], 0
xor esi, esi
jmp 0x4082d9
mov eax, dword [0x40d084]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [0x40d078]
mov dword [esp], eax
call esi
mov eax, ebx
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10