Function at 0x406642
Capabilities:
Check for time delay via gettickcount
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Query environment variable
Read file on windows
Read pipe
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50ea45
mov eax, dword fs:[0]
push eax
mov eax, 0xa2e0
call fcn.004a1280
mov eax, dword [0x551bd0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
push 0x535d58
mov dword [ebp - 0xa264], eax
mov dword [ebp - 0xa280], ecx
mov dword [ebp - 0xa268], ebx
mov dword [ebp - 0xa270], ebx
call fcn.00401829
xor eax, eax
lea edi, [ebp - 0xa28c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov esi, 0xa000
push esi
lea eax, [ebp - 0xa290]
push eax
lea eax, [ebp - 0xa270]
push eax
lea eax, [ebp - 0xa268]
push eax
mov dword [ebp - 0xa290], 0xc
mov dword [ebp - 0xa28c], ebx
mov dword [ebp - 0xa288], 1
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x406af4
push 0x44
pop edi
push edi
lea eax, [ebp - 0xa2ec]
push ebx
push eax
call fcn.0049d740
add esp, 0xc
lea eax, [ebp - 0xa2ec]
push eax
mov dword [ebp - 0xa2ec], edi
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
mov eax, dword [ebp - 0xa270]
mov dword [ebp - 0xa2ac], eax
mov dword [ebp - 0xa2b0], eax
xor eax, eax
lea edi, [ebp - 0xa2a0]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
push 0x206
mov word [ebp - 0x21c], ax
lea eax, [ebp - 0x21a]
push ebx
push eax
mov dword [ebp - 0xa2c0], 0x101
call fcn.0049d740
add esp, 0xc
push 0x104
lea eax, [ebp - 0x21c]
push eax
push str._appdata_SogouApkToolAndroid_aapt.exe
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0xa2a0]
push eax
lea eax, [ebp - 0xa2ec]
push eax
push ebx
push ebx
push 0x8000000
push 1
push ebx
push ebx
push dword [ebp - 0xa264]
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
push esi
mov dword [ebp - 0xa264], eax
lea eax, [ebp - 0xa223]
push ebx
push eax
mov byte [ebp - 0xa224], bl
call fcn.0049d740
add esp, 0xc
push ebx
lea ecx, [ebp - 0xa25c]
mov dword [ebp - 0xa278], ebx
mov dword [ebp - 0xa244], 7
call fcn.00401afa
mov dword [ebp - 4], ebx
mov byte [ebp - 0xa25d], bl
call edi
sub eax, dword [ebp - 0xa264]
cmp eax, 0x4e20
ja 0x406967
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, 0xfde9
push ebx
lea eax, [ebp - 0xa274]
push eax
push ebx
push ebx
push ebx
push dword [ebp - 0xa268]
mov dword [ebp - 0xa274], ebx
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x406933
cmp dword [ebp - 0xa274], ebx
je 0x406933
push 0xa001
lea eax, [ebp - 0xa224]
push ebx
push eax
call fcn.0049d740
add esp, 0xc
push ebx
lea eax, [ebp - 0xa278]
push eax
push 0xa000
lea eax, [ebp - 0xa224]
push eax
push dword [ebp - 0xa268]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0xa27c], eax
cmp dword [ebp - 0xa278], ebx
jbe 0x406927
lea eax, [ebp - 0xa224]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x406881
sub eax, edx
je 0x406927
push ebx
push ebx
push 0xffffffffffffffff
lea eax, [ebp - 0xa224]
push eax
push ebx
push esi
call edi
xor ecx, ecx
push 2
pop edx
mov dword [ebp - 0xa26c], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00499a0f
pop ecx
mov dword [ebp - 0xa284], eax
cmp eax, ebx
je 0x406927
push dword [ebp - 0xa26c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0xa224]
push eax
push ebx
push esi
call edi
push dword [ebp - 0xa284]
lea ecx, [ebp - 0xa240]
call fcn.00401685
push dword [ebp - 0xa284]
mov byte [ebp - 4], 1
call fcn.0049ac10
pop ecx
cmp dword [ebp - 0xa22c], ebx
je 0x406916
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0xa240]
push eax
lea ecx, [ebp - 0xa25c]
call fcn.004039ea
push ebx
push 1
lea ecx, [ebp - 0xa240]
mov byte [ebp - 4], bl
call fcn.0040184d
cmp dword [ebp - 0xa27c], ebx
je 0x406aa9
push 0x1f4
push dword [ebp - 0xa2a0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x406980
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0xa264]
cmp eax, 0x4e20
jbe 0x406800
push ebx
push dword [ebp - 0xa2a0]
mov byte [ebp - 0xa25d], 1
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x406aaf
push ebx
lea eax, [ebp - 0xa274]
push eax
push ebx
push ebx
push ebx
push dword [ebp - 0xa268]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x406aaf
cmp dword [ebp - 0xa274], ebx
je 0x406aaf
push 0xa001
lea eax, [ebp - 0xa224]
push ebx
push eax
call fcn.0049d740
add esp, 0xc
push ebx
lea eax, [ebp - 0xa278]
push eax
push 0xa000
lea eax, [ebp - 0xa224]
push eax
push dword [ebp - 0xa268]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0xa27c], eax
cmp dword [ebp - 0xa278], ebx
jbe 0x406aa1
lea eax, [ebp - 0xa224]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4069fb
sub eax, edx
je 0x406aa1
push ebx
push ebx
push 0xffffffffffffffff
lea eax, [ebp - 0xa224]
push eax
push ebx
push esi
call edi
xor ecx, ecx
push 2
pop edx
mov dword [ebp - 0xa26c], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00499a0f
pop ecx
mov dword [ebp - 0xa264], eax
cmp eax, ebx
je 0x406aa1
push dword [ebp - 0xa26c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0xa224]
push eax
push ebx
push esi
call edi
push dword [ebp - 0xa264]
lea ecx, [ebp - 0xa240]
call fcn.00401685
push dword [ebp - 0xa264]
mov byte [ebp - 4], 2
call fcn.0049ac10
pop ecx
cmp dword [ebp - 0xa22c], ebx
je 0x406a90
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0xa240]
push eax
lea ecx, [ebp - 0xa25c]
call fcn.004039ea
push ebx
push 1
lea ecx, [ebp - 0xa240]
mov byte [ebp - 4], bl
call fcn.0040184d
cmp dword [ebp - 0xa27c], ebx
jne 0x406aaf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0xa29c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0xa2a0]
call esi
cmp byte [ebp - 0xa25d], bl
je 0x406add
push ebx
push 1
lea ecx, [ebp - 0xa25c]
call fcn.0040184d
jmp 0x406afa
mov ecx, dword [ebp - 0xa280]
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0xa25c]
push eax
call fcn.004019f3
jmp 0x406acd
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xa268], ebx
je 0x406b0a
push dword [ebp - 0xa268]
call esi
cmp dword [ebp - 0xa270], ebx
je 0x406b1a
push dword [ebp - 0xa270]
call esi
mov eax, dword [ebp - 0xa280]
cmp dword [eax + 0x14], ebx
setne al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0049a49b
leave
ret