Function at 0x477980
Capabilities:
Encode data using xor
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x507254]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0xc], 8
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov eax, dword [eax]
mov dword [ebp - 0x1c], eax
jne 0x4779b2
cmp dword [edi + 8], 2
je 0x4779b2
or eax, 2
mov dword [ebp - 0x1c], eax
mov esi, dword [edi + 4]
test esi, esi
je 0x477a12
cmp dword [esi], 0
je 0x477a12
mov eax, dword fs:[0x2c]
mov ecx, dword [0x50afb4]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x50a970]
cmp eax, dword [ecx + 0x58]
jg 0x477c82
movzx ecx, word [ebx]
mov esi, ebx
mov edx, ebx
test cx, cx
je 0x477a09
nop word [eax + eax]
xor cl, byte [0x50a96c]
lea edx, [edx + 1]
add esi, 2
mov byte [edx - 1], cl
movzx eax, word [esi]
mov cl, al
test ax, ax
jne 0x4779f0
mov eax, dword [ebp - 0x1c]
sub esi, ebx
sar esi, 1
jmp 0x477a14
xor esi, esi
test al, 1
je 0x477a22
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [ebp - 0x1c]
test al, 2
je 0x477b09
test esi, esi
je 0x477a3c
push esi
push ebx
mov ecx, edi
call fcn.004722b0
jmp 0x477b06
mov eax, dword [0x50afb4]
mov ecx, dword fs:[0x2c]
mov ecx, dword [ecx + eax*4]
mov eax, dword [0x50a9f0]
cmp eax, dword [ecx + 0x58]
jg 0x477cbe
cmp dword [0x50a9ec], 0
jg 0x477a80
jl 0x477a70
cmp dword [0x50a9e8], 0
jae 0x477a80
push 0
push ebx
lea ecx, [edi + 0x30]
call fcn.00461560
jmp 0x477b06
mov eax, dword [edi + 0xa0]
lea esi, [edi + 0xa0]
xchg dword [esi], eax
push 0
push ebx
mov ecx, eax
mov dword [ebp - 0x24], eax
call fcn.00461560
test al, al
je 0x477b06
lea edx, [edi + 0x2c]
mov ecx, 1
mov dword [ebp - 0x20], edx
xor eax, eax
lock cmpxchg dword [edx], ecx
cmp eax, 1
je 0x477b06
mov eax, dword [esi]
xchg dword [esi], eax
mov edx, dword [ebp - 0x24]
cmp eax, edx
je 0x477ac5
mov ecx, dword [ebp - 0x20]
jmp 0x477b02
lea eax, [edi + 0x30]
mov dword [ebp - 0x20], 0x68
cmp edx, eax
mov ecx, 0x30
cmove ecx, dword [ebp - 0x20]
lea eax, [edi + ecx]
mov ecx, eax
mov dword [ebp - 0x24], eax
call fcn.0046bb80
mov ecx, dword [ebp - 0x24]
call fcn.00472b60
test al, al
je 0x477af8
mov eax, dword [ebp - 0x24]
xchg dword [esi], eax
mov ecx, edi
call fcn.00476150
lea ecx, [edi + 0x2c]
xor eax, eax
xchg dword [ecx], eax
mov eax, dword [ebp - 0x1c]
test al, 4
je 0x477b9a
mov esi, dword [0x50a758]
mov edx, dword [esi]
cmp edx, 0xffffffff
jne 0x477b65
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount64]
call edi
mov ecx, dword [esi + 4]
add ecx, 0x2710
cmp eax, ecx
jbe 0x477b9a
mov edx, dword [esi]
cmp edx, 0xffffffff
jne 0x477b65
push 0
push 0x80
push 3
push 0
push 7
push 0xc0000000
push str..GlobalProcmonDebugLogger
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi], eax
call edi
mov edx, dword [esi]
mov dword [esi + 4], eax
cmp edx, 0xffffffff
je 0x477b9a
mov ecx, ebx
lea esi, [ecx + 2]
nop word [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x477b70
push 0
sub ecx, esi
lea eax, [ebp - 0x18]
push eax
push 0
sar ecx, 1
push 0
lea eax, [ecx + ecx]
push eax
push ebx
push 0x95358204
push edx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test byte [ebp - 0x1c], 8
je 0x477c71
mov edi, dword [0x50a778]
mov eax, dword [edi + 8]
lea esi, [edi + 8]
or eax, dword [esi + 4]
jne 0x477c22
push str.Advapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [edi], eax
test eax, eax
je 0x477c22
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.EventRegister
push eax
call esi
push str.EventUnregister
push dword [edi]
mov dword [edi + 0x10], eax
call esi
push str.EventWrite
push dword [edi]
mov dword [edi + 0x14], eax
call esi
mov ecx, dword [edi + 0x10]
mov dword [edi + 0x18], eax
test ecx, ecx
je 0x477c11
cmp dword [edi + 0x14], 0
je 0x477c11
test eax, eax
je 0x477c11
lea esi, [edi + 8]
push esi
push 0
push 0
push 0x4dc73c
call ecx
jmp 0x477c22
push dword [edi]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [edi], 0
lea esi, [edi + 8]
mov eax, dword [esi]
mov edx, dword [esi + 4]
or eax, edx
je 0x477c71
mov ecx, ebx
lea eax, [ecx + 2]
mov dword [ebp - 0x20], eax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x477c33
sub ecx, dword [ebp - 0x20]
sar ecx, 1
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], 0
mov dword [ebp - 8], 0
lea eax, [ecx*2 + 2]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x14]
push eax
mov eax, dword [edi + 0x18]
push 1
push 0x4dc750
push edx
push dword [esi]
call eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004a6256
mov esp, ebp
pop ebp
ret
push 0x50a970
call fcn.004a6775
add esp, 4
cmp dword [0x50a970], 0xffffffff
jne 0x4779de
mov al, byte [esi + 1]
sub al, byte [esi + 3]
sub al, byte [esi + 2]
add al, byte [esi]
push 0x50a970
mov byte [0x50a96c], al
call fcn.004a672b
add esp, 4
jmp 0x4779de
push 0x50a9f0
call fcn.004a6775
add esp, 4
cmp dword [0x50a9f0], 0xffffffff
jne 0x477a5c
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 0x14]
push 0x50a9f0
mov dword [0x50a9e8], eax
mov dword [0x50a9ec], ecx
call fcn.004a672b
add esp, 4
jmp 0x477a5c