Function at 0x508530
Capabilities:
Create thread
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5400db
mov eax, dword fs:[0]
push eax
mov eax, 0x3008
call fcn.0051dcc0
mov eax, dword [0x572844]
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 0x5085c1
push 0x54266c
lea eax, [ebp - 0x1010]
push eax
push str.ExternalViewer
push 0x5431d4
call fcn.004c3190
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 0x5085ce
cmp eax, 0x800
jae 0x5085ce
push 0x800
lea eax, [ebp - 0x3010]
push eax
lea eax, [ebp - 0x1010]
push eax
call fcn.004b0360
cmp word [ebp - 0x1010], 0
je 0x508787
push 0x800
push ebx
lea eax, [ebp - 0x2010]
push eax
call fcn.004b0360
push 0x800
lea eax, [ebp - 0x2010]
push eax
call fcn.004cbac0
lea eax, [ebp - 0x1010]
push eax
call fcn.004837b0
test al, al
jne 0x508708
cmp word [ebp - 0x1010], 0x22
jne 0x508638
lea eax, [ebp - 0x100e]
push 0x22
push eax
call fcn.0051f225
add esp, 8
test eax, eax
je 0x508708
jmp 0x508640
lea eax, [ebp - 0x1010]
mov edi, edi
push 0x557868
push eax
call fcn.0052a6fe
mov edi, eax
add esp, 8
test edi, edi
je 0x508702
movzx ecx, word [edi]
mov esi, edi
push ecx
call fcn.004aff40
test al, al
je 0x508678
movzx eax, word [esi + 2]
add esi, 2
push eax
call fcn.004aff40
test al, al
jne 0x508667
push 0x800
push esi
lea eax, [ebp - 0x3010]
push eax
call fcn.004b0360
push 0x800
push 0x545b20
lea eax, [ebp - 0x3010]
push eax
call fcn.004b0300
push 0x800
lea eax, [ebp - 0x2010]
push eax
lea eax, [ebp - 0x3010]
push eax
call fcn.004b0300
movzx ebx, word [edi]
xor eax, eax
mov word [edi], ax
cmp word [ebp - 0x1010], 0x22
je 0x5086ea
lea eax, [ebp - 0x1010]
push eax
call fcn.004837b0
test al, al
jne 0x5086ea
lea eax, [esi + 2]
mov word [edi], bx
test eax, eax
jne 0x508640
jmp 0x508702
push 0x800
lea eax, [ebp - 0x3010]
push eax
lea eax, [ebp - 0x2010]
push eax
call fcn.004b0360
mov ebx, dword [ebp - 0x3014]
mov eax, dword fs:[0x2c]
mov ecx, dword [0x618b48]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x5ebdac]
cmp eax, dword [ecx + 4]
jg 0x5087f6
push 1
push ebx
mov ecx, 0x5e7c88
call fcn.00508de0
mov bl, byte [ebp + 0xc]
push 0
push 0x5e7c88
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.00509e00
test al, al
jne 0x50878b
mov eax, dword [0x5e7c90]
cmp eax, 0xffffffff
je 0x50877d
push eax
call dword [sym.imp.KERNEL32.dll_FindCloseChangeNotification]
mov dword [0x5e7c90], 0xffffffff
mov ecx, 0x5ebcaa
call fcn.004ad310
xor al, al
jmp 0x5087d8
test bl, bl
je 0x5087b1
cmp dword [0x5e7c88], 0
je 0x5087b1
push 0x5e7c88
push 0x10000
push 0x5079a0
call fcn.0052713c
add esp, 0xc
jmp 0x5087d6
mov eax, dword [0x5e7c90]
cmp eax, 0xffffffff
je 0x5087cc
push eax
call dword [sym.imp.KERNEL32.dll_FindCloseChangeNotification]
mov dword [0x5e7c90], 0xffffffff
mov ecx, 0x5ebcaa
call fcn.004ad310
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.0051dca8
mov esp, ebp
pop ebp
ret 0xc
push 0x5ebdac
call fcn.0051e56a
add esp, 4
cmp dword [0x5ebdac], 0xffffffff
jne 0x508728
mov dword [ebp - 4], 0
mov ecx, 0x5ebcaa
call fcn.004ad2f0
mov byte [ebp - 4], 0
push 0x540d60
call fcn.0051e364
mov dword [ebp - 4], 0xffffffff
push 0x5ebdac
call fcn.0051e520
add esp, 8
jmp 0x508728