Function at 0x402220
Capabilities:
Query environment variable
Resume thread
Terminate process

Disassembly:
sub esp, 0x68c
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x684], eax
mov eax, dword [esp + 0x694]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x69c]
xor ebp, ebp
push edi
mov dword [esp + 0x2c], eax
mov edi, ecx
push 0x104
lea eax, [esp + 0x7c]
mov dword [esp + 0x18], ebp
push eax
push str.WINDIR
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push esi
push ecx
mov edx, edi
mov dword [esp + 0x30], eax
lea ecx, [esp + 0x1c]
call fcn.004020a0
mov ebx, dword [esp + 0x14]
test eax, eax
je 0x402462
mov eax, dword [esp + 0x28]
test eax, eax
je 0x402462
cmp eax, 0x104
jae 0x402462
mov ecx, 0x104
lea eax, [esp + 0x78]
cmp word [eax], bp
je 0x4022b1
add eax, 2
sub ecx, 1
jne 0x4022a4
mov edx, 0x104
mov esi, ecx
mov eax, edx
sub eax, ecx
neg esi
sbb esi, esi
and esi, eax
test ecx, ecx
je 0x402462
lea ecx, [esp + 0x78]
lea ecx, [ecx + esi*2]
sub edx, esi
je 0x4022fa
mov edi, str._sysnative_rundll32.exe
mov eax, 0x7ffffffe
sub edi, ecx
test eax, eax
je 0x4022fa
movzx esi, word [edi + ecx]
test si, si
je 0x4022fa
mov word [ecx], si
dec eax
add ecx, 2
sub edx, 1
jne 0x4022e1
test edx, edx
lea eax, [ecx - 2]
cmovne eax, ecx
xor ecx, ecx
mov word [eax], cx
test edx, edx
je 0x402462
push 0x104
lea eax, [esp + 0x284]
push eax
push 0xffffffffffffffff
lea eax, [ebx + 0xc]
push eax
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp eax, 0x104
jae 0x402462
test eax, eax
jle 0x402462
lea eax, [esp + 0x280]
push eax
push str.rundll32.exe___s__1
lea eax, [esp + 0x490]
push 0x104
push eax
call fcn.00401120
add esp, 0x10
test eax, eax
js 0x402462
lea eax, [esp + 0x18]
mov dword [esp + 0x30], 0x44
push eax
lea eax, [esp + 0x34]
xorps xmm0, xmm0
push eax
push 0
push 0
push 4
push 0
push 0
push 0
lea eax, [esp + 0x4a8]
movlpd qword [esp + 0x54], xmm0
push eax
lea eax, [esp + 0x9c]
movlpd qword [esp + 0x60], xmm0
push eax
movups xmmword [esp + 0x40], xmm0
movlpd qword [esp + 0x6c], xmm0
movlpd qword [esp + 0x74], xmm0
movlpd qword [esp + 0x7c], xmm0
movlpd qword [esp + 0x84], xmm0
movlpd qword [esp + 0x8c], xmm0
movlpd qword [esp + 0x94], xmm0
call dword [esp + 0x54]
test eax, eax
je 0x402462
push dword [ebx]
mov ecx, dword [esp + 0x1c]
mov edx, 0x41aa9c
push ebx
call fcn.00401df0
test eax, eax
jne 0x402417
push 0xffffffffffffffff
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x1c]
call esi
jmp 0x402462
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push 0xffffffffffffffff
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0x1f4
push eax
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
push dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x1c]
call esi
cmp dword [esp + 0x14], ebp
mov eax, 1
cmove ebp, eax
test ebx, ebx
je 0x40246f
push ebx
call fcn.00402ea7
add esp, 4
mov ecx, dword [esp + 0x694]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00402c4e
add esp, 0x68c
ret 8