Function at 0x140022864
Capabilities:
Access the windows event log

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r15
mov rbp, rsp
sub rsp, 0x70
mov rbx, rdx
mov byte [rbp + 0x30], 0
xor r12d, r12d
lea rax, vtable.HModule.0
mov qword [rbp - 0x18], rax
and qword [rbp - 0x10], r12
and qword [rbp - 0x20], r12
mov ecx, 0x208
call fcn.1400e9a18
mov qword [rbp - 0x28], rax
test rbx, rbx
je 0x140022d01
lea r15, str.System
mov rdx, r15
mov rcx, r15
call fcn.1400be21c
test eax, eax
jne 0x140022cb7
lea r8, [rbp - 0x20]
call fcn.1400ac9b0
mov edi, eax
test eax, eax
js 0x140022da6
lea rax, str.SystemEvents.txt
mov qword [rsp + 0x28], rax
lea rax, [0x140123440]
mov qword [rsp + 0x20], rax
mov r9, rbx
lea r8, [0x140123b68]
mov edx, 0x104
mov rcx, qword [rbp - 0x28]
call fcn.140022fcc
mov edi, eax
test eax, eax
jns 0x140022950
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022944
test byte [rcx + 0x1c], 1
je 0x140022944
lea edx, [r12 + 0x30]
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_StringCchPrintfW___failed___lx__n
jmp 0x140022d9e
mov rdx, r15
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenEventLogW]
mov r12, rax
test rax, rax
jne 0x1400229a7
call fcn.1400b4f5c
mov edi, eax
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x14002299b
test byte [rcx + 0x1c], 1
je 0x14002299b
lea edx, [r12 + 0x32]
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_OpenEventLog_System__failed___lx__n
jmp 0x140022d9e
lea r8, [rbp - 0x10]
mov rbx, qword [rbp - 0x20]
mov rdx, rbx
call fcn.1400224e8
mov edi, eax
test eax, eax
jns 0x140022a01
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x1400229ee
test byte [rcx + 0x1c], 1
je 0x1400229ee
mov edx, 0x33
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_GetMesgFileHandle___failed___lx__n
mov edx, edi
call fcn.1400ae8a0
jmp 0x140022d40
xor r8d, r8d
mov rdx, qword [rbp - 0x28]
call fcn.1400ae924
mov edi, eax
test eax, eax
setns byte [rbp + 0x30]
test eax, eax
jns 0x140022a53
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022a4a
test byte [rcx + 0x1c], 1
je 0x140022a4a
mov edx, 0x34
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_Failed_to_open_log_file___lx__n
jmp 0x1400229f5
and dword [rbp - 0x30], 0
and dword [rbp + 0x48], 0
and dword [rbp + 0x40], 0
lea rdx, [rbp - 0x30]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_GetOldestEventLogRecord]
test eax, eax
jne 0x140022ab4
call fcn.1400b4f5c
mov edi, eax
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022aa8
test byte [rcx + 0x1c], 1
je 0x140022aa8
mov edx, 0x35
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_GetOldestEventLogRecord___failed___lx__n
jmp 0x1400229f5
lea rdx, [rbp + 0x48]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_GetNumberOfEventLogRecords]
test eax, eax
jne 0x140022b09
call fcn.1400b4f5c
mov edi, eax
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022afd
test byte [rcx + 0x1c], 1
je 0x140022afd
mov edx, 0x36
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_GetNumberOfEventLogRecords___failed___lx__n
jmp 0x1400229f5
mov edi, dword [rbp + 0x48]
call qword [sym.imp.mpclient.dll_MpClientUtilExportFunctions]
movabs r10, 0xb1e1875a16511370
lea r8, [rbp + 0x40]
mov edx, edi
lea rcx, str.MpSupport_EventLogNumRecsToRead
mov rax, qword [rax + 0xa0]
call qword [case.0x1400bdf0e.0]
mov edi, eax
test eax, eax
jns 0x140022b79
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022b6d
test byte [rcx + 0x1c], 1
je 0x140022b6d
mov edx, 0x37
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_MpConfigGetMiscDwordValue_MpSupport_EventLogRecordNum__failed___lx__n
jmp 0x1400229f5
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022bbc
test byte [rcx + 0x1c], 4
je 0x140022bbc
mov edx, 0x38
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], rbx
mov r9d, dword [rbp + 0x40]
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.140021148
mov rcx, qword [0x140158280]
mov eax, dword [rbp + 0x48]
test eax, eax
jne 0x140022bca
xor edi, edi
jmp 0x140022d40
lea r15d, [rax - 1]
mov edx, dword [rbp - 0x30]
add r15d, edx
cmp r15d, edx
jb 0x140022c86
xor edi, edi
cmp r15d, edx
jb 0x140022d40
mov r9, qword [rbp - 0x10]
mov r8d, r15d
mov rdx, rbx
mov rcx, r12
call fcn.1400214ac
mov edi, eax
test eax, eax
jns 0x140022c6c
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022c45
test byte [rcx + 0x1c], 1
je 0x140022c45
mov edx, 0x3a
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x30], r15d
mov qword [rsp + 0x28], rbx
mov rax, qword [rbp - 0x28]
mov qword [rsp + 0x20], rax
lea r9, str.System
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.140020fcc
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], r15d
mov r9, rbx
mov r8, qword [rbp - 0x28]
lea rdx, str.System
lea rcx, str.ERROR:_ReadAndProcessEventLogRecord__ls___ls___ls___ld__failed__lx_n
call fcn.1400ae8a0
xor edi, edi
jmp 0x140022c7a
test edi, edi
jne 0x140022c7a
add dword [rbp + 0x40], 0xffffffff
je 0x140022d40
dec r15d
cmp r15d, dword [rbp - 0x30]
jmp 0x140022be2
mov edi, 0x80070216
cmp rcx, rsi
je 0x140022cab
test byte [rcx + 0x1c], 1
je 0x140022cab
mov edx, 0x39
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400056e0
lea rcx, str.Event_log_record_number_overflow_n
jmp 0x140022d3b
mov edi, 0x80070032
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022ced
test byte [rcx + 0x1c], 1
je 0x140022ced
mov edx, 0x31
mov r9, r15
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.140005570
mov rdx, r15
lea rcx, str.ERROR:_Unsupported_event_log_name_in_EventLogToFile__ls__n
call fcn.1400ae8a0
jmp 0x140022da6
mov edi, 0x80070057
lea rsi, [0x140158280]
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022d34
test byte [rcx + 0x1c], 1
je 0x140022d34
mov edx, 0x2f
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400056e0
lea rcx, str.ERROR:_NULL_parameter_in_EventLogToFile_...__n
call fcn.1400ae8a0
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0x140022d54
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
and qword [rbp - 0x10], 0
test r12, r12
je 0x140022da6
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseEventLog]
test eax, eax
jne 0x140022da6
call fcn.1400b4f5c
mov edi, eax
mov rcx, qword [0x140158280]
cmp rcx, rsi
je 0x140022d97
test byte [rcx + 0x1c], 1
je 0x140022d97
mov edx, 0x3b
mov r9d, eax
lea r8, [0x1401266a0]
mov rcx, qword [rcx + 0x10]
call fcn.1400059f4
lea rcx, str.ERROR:_CloseEventLog___failed___lx__n
mov edx, edi
call fcn.1400ae8a0
nop
xor ecx, ecx
xchg qword [rbp - 0x28], rcx
test rcx, rcx
je 0x140022db7
call fcn.1400e9470
nop
mov rcx, qword [rbp - 0x20]
test rcx, rcx
je 0x140022dc7
call qword [sym.imp.mpclient.dll_MpFreeMemory]
nop
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0x140022dd7
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
nop
cmp byte [rbp + 0x30], 0
je 0x140022e06
mov rbx, qword [0x140160650]
and qword [0x140160650], 0
test rbx, rbx
je 0x140022e06
mov rcx, rbx
call fcn.1400adcb8
mov edx, 0x48
mov rcx, rbx
call fcn.1400e9768
mov eax, edi
mov rbx, qword [rsp + 0xa8]
add rsp, 0x70
pop r15
pop r12
pop rdi
pop rsi
pop rbp
ret