Function at 0x51a020
Capabilities:
Create thread
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55517b
mov eax, dword fs:[0]
push eax
mov eax, 0x3008
call fcn.00530230
mov eax, dword [0x58cb30]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x3014], ebx
push 0x800
test eax, eax
jne 0x51a0b1
push 0x558718
lea eax, [ebp - 0x1010]
push eax
push str.ExternalViewer
push 0x55925c
call fcn.004d0210
push 0x800
lea eax, [ebp - 0x3010]
push eax
lea eax, [ebp - 0x1010]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x51a0be
cmp eax, 0x800
jae 0x51a0be
push 0x800
lea eax, [ebp - 0x3010]
push eax
lea eax, [ebp - 0x1010]
push eax
call fcn.004bdae0
cmp word [ebp - 0x1010], 0
je 0x51a277
push 0x800
push ebx
lea eax, [ebp - 0x2010]
push eax
call fcn.004bdae0
push 0x800
lea eax, [ebp - 0x2010]
push eax
call fcn.004d8b80
lea eax, [ebp - 0x1010]
push eax
call fcn.00491350
test al, al
jne 0x51a1f8
cmp word [ebp - 0x1010], 0x22
jne 0x51a128
lea eax, [ebp - 0x100e]
push 0x22
push eax
call fcn.005317e5
add esp, 8
test eax, eax
je 0x51a1f8
jmp 0x51a130
lea eax, [ebp - 0x1010]
mov edi, edi
push 0x56df00
push eax
call fcn.0053d1de
mov edi, eax
add esp, 8
test edi, edi
je 0x51a1f2
movzx ecx, word [edi]
mov esi, edi
push ecx
call fcn.004bd6c0
test al, al
je 0x51a168
movzx eax, word [esi + 2]
add esi, 2
push eax
call fcn.004bd6c0
test al, al
jne 0x51a157
push 0x800
push esi
lea eax, [ebp - 0x3010]
push eax
call fcn.004bdae0
push 0x800
push 0x55bb90
lea eax, [ebp - 0x3010]
push eax
call fcn.004bda80
push 0x800
lea eax, [ebp - 0x2010]
push eax
lea eax, [ebp - 0x3010]
push eax
call fcn.004bda80
movzx ebx, word [edi]
xor eax, eax
mov word [edi], ax
cmp word [ebp - 0x1010], 0x22
je 0x51a1da
lea eax, [ebp - 0x1010]
push eax
call fcn.00491350
test al, al
jne 0x51a1da
lea eax, [esi + 2]
mov word [edi], bx
test eax, eax
jne 0x51a130
jmp 0x51a1f2
push 0x800
lea eax, [ebp - 0x3010]
push eax
lea eax, [ebp - 0x2010]
push eax
call fcn.004bdae0
mov ebx, dword [ebp - 0x3014]
mov eax, dword fs:[0x2c]
mov ecx, dword [0x6355f8]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x6089f4]
cmp eax, dword [ecx + 4]
jg 0x51a2e6
push 1
push ebx
mov ecx, 0x6049c0
call fcn.0051a8b0
mov bl, byte [ebp + 0xc]
push 0
push 0x6049c0
mov al, bl
xor al, 1
movzx eax, al
push eax
lea eax, [ebp - 0x2010]
push eax
push 0
lea eax, [ebp - 0x1010]
push eax
push 0
call fcn.0051b9c0
test al, al
jne 0x51a27b
mov eax, dword [0x6049c8]
cmp eax, 0xffffffff
je 0x51a26d
push eax
call dword [sym.imp.KERNEL32.dll_FindCloseChangeNotification]
mov dword [0x6049c8], 0xffffffff
mov ecx, 0x6089e4
call fcn.004baba0
xor al, al
jmp 0x51a2c8
test bl, bl
je 0x51a2a1
cmp dword [0x6049c0], 0
je 0x51a2a1
push 0x6049c0
push 0x10000
push 0x519360
call fcn.00539c1c
add esp, 0xc
jmp 0x51a2c6
mov eax, dword [0x6049c8]
cmp eax, 0xffffffff
je 0x51a2bc
push eax
call dword [sym.imp.KERNEL32.dll_FindCloseChangeNotification]
mov dword [0x6049c8], 0xffffffff
mov ecx, 0x6089e4
call fcn.004baba0
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00530218
mov esp, ebp
pop ebp
ret 0xc
push 0x6089f4
call fcn.00530ada
add esp, 4
cmp dword [0x6089f4], 0xffffffff
jne 0x51a218
mov dword [ebp - 4], 0
mov ecx, 0x6089e4
call fcn.004ba930
mov byte [ebp - 4], 0
push 0x555f80
call fcn.005308d4
mov dword [ebp - 4], 0xffffffff
push 0x6089f4
call fcn.00530a90
add esp, 8
jmp 0x51a218