Function at 0x402998
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, str.https_url_http:__static.adguard.com_windows_setup.exe_nhttp_url_http:__static.adguard.com_windows_setup.exe_nsetup_args__AID26415__n
push esi
push ebx
sub esp, 0x8c
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
or ecx, 0xffffffff
mov dword [0x407058], eax
mov edx, eax
xor eax, eax
repne scasb al, byte es:[edi]
mov dword [esp + 8], 0x18
mov dword [esp + 4], 8
mov dword [esp], edx
not ecx
lea eax, [ecx - 1]
mov dword [ebp - 0x60], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x68], str.https_url_http:__static.adguard.com_windows_setup.exe_nhttp_url_http:__static.adguard.com_windows_setup.exe_nsetup_args__AID26415__n
sub esp, 0xc
mov dword [0x407064], eax
test eax, eax
je 0x40329d
cmp dword [ebp - 0x60], 0
je 0x402bc9
mov eax, dword [ebp - 0x68]
add eax, dword [ebp - 0x60]
mov ecx, 0x4081eb
mov dword [esp], 1
mov dword [ebp - 0x64], eax
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x68]
call fcn.004054d4
mov esi, eax
cmp dword [ebp - 0x64], eax
je 0x402a97
mov eax, dword [ebp - 0x64]
mov dword [esp + 4], 0xa
mov dword [esp], esi
sub eax, esi
mov dword [esp + 8], eax
call sub.msvcrt.dll_memchr
mov ebx, eax
test eax, eax
je 0x402a63
mov edi, dword [ebp - 0x60]
cmp dword [ebp - 0x64], eax
je 0x402a8c
mov edi, eax
sub edi, dword [ebp - 0x68]
inc edi
jmp 0x402a8c
mov ebx, dword [ebp - 0x64]
mov edi, dword [ebp - 0x60]
jmp 0x402a8c
mov dword [esp + 8], 1
movsx eax, byte [ebx - 1]
mov dword [esp], 0x4081eb
mov dword [esp + 4], eax
call sub.msvcrt.dll_memchr
test eax, eax
je 0x402a90
dec ebx
cmp esi, ebx
jne 0x402a6b
sub ebx, esi
mov dword [ebp - 0x5c], esi
jmp 0x402a9c
mov edi, dword [ebp - 0x60]
xor ebx, ebx
add dword [ebp - 0x68], edi
sub dword [ebp - 0x60], edi
test ebx, ebx
je 0x402a03
mov ecx, dword [ebp - 0x5c]
lea eax, [ebx - 1]
cmp byte [ecx + ebx - 1], 0xd
mov dword [esp + 4], 0x20
cmove ebx, eax
mov dword [esp], ecx
mov dword [esp + 8], ebx
call sub.msvcrt.dll_memchr
xor edx, edx
mov esi, eax
mov eax, dword [ebp - 0x5c]
add eax, ebx
test esi, esi
je 0x402aed
cmp eax, esi
je 0x402ae9
mov ebx, esi
inc esi
sub ebx, dword [ebp - 0x5c]
sub eax, esi
mov edx, eax
jmp 0x402aed
xor esi, esi
xor edx, edx
test ebx, ebx
je 0x402a03
mov eax, dword [ebp - 0x5c]
cmp byte [eax], 0x23
je 0x402a03
lea eax, [edx + 1]
mov dword [ebp - 0x6c], edx
mov dword [esp + 8], eax
mov eax, dword [0x407058]
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
sub esp, 0xc
mov dword [ebp - 0x64], eax
test eax, eax
je 0x40329d
mov edx, dword [ebp - 0x6c]
mov edi, eax
mov ecx, edx
rep movsb byte es:[edi], byte [esi]
mov byte [eax + edx], 0
mov eax, dword [ebp - 0x5c]
mov ecx, str.setup_args
mov edx, ebx
call fcn.004048dc
test eax, eax
jne 0x402b5e
mov eax, dword [0x407064]
mov ecx, dword [ebp - 0x64]
mov dword [eax], ecx
jmp 0x402a03
mov eax, dword [ebp - 0x5c]
mov ecx, str.http_url
mov edx, ebx
call fcn.004048dc
test eax, eax
jne 0x402b81
mov eax, dword [0x407064]
mov ecx, dword [ebp - 0x64]
mov dword [eax + 4], ecx
jmp 0x402a03
mov eax, dword [ebp - 0x5c]
mov ecx, str.https_url
mov edx, ebx
call fcn.004048dc
test eax, eax
jne 0x402ba4
mov eax, dword [0x407064]
mov ecx, dword [ebp - 0x64]
mov dword [eax + 8], ecx
jmp 0x402a03
mov eax, dword [ebp - 0x64]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [0x407058]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
sub esp, 0xc
jmp 0x402a03
mov eax, dword [0x407064]
lea edx, [ebp - 0x50]
mov dword [eax + 0x10], 0x1700000
mov dword [eax + 0x14], 0
mov eax, 7
call fcn.004041f8
test eax, eax
jne 0x402c55
call fcn.00403adc
mov ebx, eax
test eax, eax
je 0x40329d
lea edx, [ebp - 0x50]
call fcn.004047f0
test eax, eax
jne 0x402c14
call fcn.00403984
test eax, eax
jmp 0x403216
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 0x402c45
cmp eax, 0x7b
je 0x402c45
lea edx, [ebp - 0x50]
mov eax, ebx
call fcn.004047f0
test eax, eax
je 0x402c08
jmp 0x40329d
mov eax, ebx
call fcn.004043e8
test eax, eax
je 0x402c32
jmp 0x40329d
mov eax, dword [0x407058]
mov dword [esp + 8], 0x184
mov dword [esp + 4], 8
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
sub esp, 0xc
mov edi, eax
mov dword [0x407480], eax
test eax, eax
je 0x402fe8
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]
push edi
mov edi, eax
test eax, eax
je 0x402d16
mov dword [esp + 4], 0x58
mov dword [esp], eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push edx
push edx
mov dword [0x40705c], eax
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.USER32.dll_ReleaseDC]
push ecx
push ecx
mov eax, dword [0x407480]
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 [0x407480]
sub esp, 0x10
lea eax, [edi + 0x138]
call fcn.00405678
mov eax, dword [0x40705c]
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 [0x40705c], eax
mov dword [esp], 0x30
call edx
mov eax, dword [0x407480]
sub esp, 0x10
add eax, 0x14c
call fcn.00405678
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], 0x406040
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x20], str.ADGUARD_WI_WNDCLASS
push edi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.USER32.dll_LoadIconW]
push edx
push edx
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 ecx
push ecx
mov dword [ebp - 0x2c], eax
mov dword [esp], ebx
call dword [sym.imp.USER32.dll_RegisterClassExW]
mov dword [ebp - 0x5c], 0xffffffff
push edi
test ax, ax
je 0x40311d
mov eax, dword [0x407480]
or dword [0x407060], 1
call fcn.004059b4
mov dword [ebp - 0x5c], eax
test eax, eax
jne 0x402fe8
mov eax, dword [0x407480]
mov ecx, 0x15
mov edx, 0x408138
or byte [eax + 0x14], 1
mov dword [eax + 0x54], 0x405ef4
call fcn.00405874
mov eax, esi
mov dword [ebp - 0x54], 0
call fcn.00405734
mov edi, dword [0x407480]
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 [0x407480]
sub esp, 0x10
mov dword [esp + 4], 0xffffffec
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.USER32.dll_GetWindowLongW]
push esi
or eax, 0x80000
push esi
mov dword [esp + 8], eax
mov eax, dword [0x407480]
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 [0x40705c], 0xc0
sete al
add eax, 3
call fcn.00405a98
test eax, eax
je 0x402fe8
mov esi, dword [0x407480]
mov edi, ebx
lea edx, [esi + 0x160]
call fcn.00405bb4
lea edx, [ebp - 0x48]
mov ecx, 4
mov dword [esi + 0x15c], eax
mov eax, dword [0x407480]
mov dword [ebp - 0x60], eax
lea esi, [eax + 0x160]
add eax, 0x14c
rep movsd dword es:[edi], dword [esi]
call fcn.00405f94
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 - 0x60]
call fcn.004057f4
xor eax, eax
cmp dword [0x40705c], 0xc0
sete al
add eax, 5
call fcn.00405a98
test eax, eax
je 0x402fe8
mov esi, dword [0x407480]
lea edx, [esi + 0x174]
call fcn.00405bb4
mov dword [esi + 0x170], eax
mov eax, dword [0x407480]
mov dword [esp + 4], 5
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.USER32.dll_ShowWindow]
push ecx
push ecx
call fcn.00405c40
call fcn.00403adc
mov esi, eax
test eax, eax
jne 0x402ff4
call dword [sym.imp.KERNEL32.dll_GetLastError]
call fcn.00403c18
mov dword [ebp - 0x5c], 0xffffffff
jmp 0x40311d
mov eax, dword [0x407480]
mov dword [eax + 0x130], 1
call fcn.00405c40
mov edi, dword [0x407480]
mov dword [esp + 0xc], esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x405fc4
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [edi + 0x12c], eax
mov eax, dword [0x407480]
sub esp, 0x18
cmp dword [eax + 0x12c], 0
je 0x402fdd
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
test eax, eax
je 0x40311d
mov esi, dword [ebp - 0x48]
test esi, esi
jne 0x4030b3
cmp dword [ebp - 0x44], 0x8001
jne 0x403104
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [ebp - 0x40]
jmp 0x403056
cmp dword [eax + 4], 1
je 0x4030ce
mov dword [esp], esi
call dword [sym.imp.USER32.dll_GetParent]
push edx
test eax, eax
je 0x4030ce
mov esi, eax
mov dword [esp + 4], 0xffffffeb
mov edi, dword [sym.imp.USER32.dll_GetWindowLongW]
mov dword [esp], esi
call edi
push edx
push edx
test eax, eax
jne 0x40309d
jmp 0x4030a3
mov dword [esp + 4], 0xffffffeb
mov dword [esp], esi
call edi
push ecx
push ecx
test eax, eax
je 0x403104
mov eax, dword [eax + 0x30]
test eax, eax
je 0x403104
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 0x403056
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 0x403056
mov eax, dword [0x407480]
test eax, eax
je 0x403212
mov ebx, dword [eax + 0x12c]
test ebx, ebx
je 0x403176
mov dword [esp + 4], 0x3e8
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edx
push edx
test eax, eax
jne 0x403167
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 [0x407480]
mov dword [eax + 0x12c], 0
mov eax, dword [0x407480]
mov ebx, dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [eax + 0x15c]
mov dword [esp], eax
call ebx
mov eax, dword [0x407480]
push esi
mov eax, dword [eax + 0x170]
mov dword [esp], eax
call ebx
mov eax, dword [0x407480]
push edi
mov eax, dword [eax + 0x134]
mov dword [esp], eax
call sub.gdiplus.dll_GdiplusShutdown
push eax
test byte [0x407060], 1
je 0x4031dc
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 [0x407480]
mov dword [esp + 4], 0
mov dword [0x40705c], 0
mov dword [esp + 8], eax
mov eax, dword [0x407058]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [0x407480], 0
sub esp, 0xc
cmp dword [ebp - 0x5c], 0
setne bl
movzx ebx, bl
mov edi, dword [0x407064]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x4032a7
mov eax, dword [edi]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [0x407058]
mov dword [esp], eax
call esi
mov eax, dword [edi + 4]
sub esp, 0xc
mov dword [esp + 8], eax
mov eax, dword [0x407058]
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 [0x407058]
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 [0x407058]
mov dword [esp + 4], 0
mov dword [esp], eax
call esi
sub esp, 0xc
jmp 0x4032a7
mov ebx, 1
jmp 0x40321c
mov eax, dword [0x407064]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [0x407058]
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