Function at 0x18001d8f0
Capabilities:
Print debug messages

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x1c8]
sub rsp, 0x2a0
mov qword [rbp - 0x80], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
xor edi, edi
mov r12d, edi
cmp qword [0x18005bf40], rdi
jle 0x18001dcaf
mov r14, rdi
mov qword [rbp + 0x88], rdi
mov r15, rdi
mov qword [rbp + 0x90], rdi
mov rsi, rdi
mov qword [rbp + 0x98], rdi
mov qword [rbp + 0xa8], 0
lea rcx, str.HID.DLL
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov r13, rax
mov qword [rbp + 0x80], rax
lea rdx, str.HidP_GetExtendedAttributes
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x18005ecf0], rax
lea rdx, str.HidP_InitializeReportForID
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x18005ecf8], rax
cmp qword [0x18005ecf0], 0
je 0x18001d9ad
test rax, rax
jne 0x18001d9bb
lea rcx, str.Fail_to_get_HID_function_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
nop
mov rdx, qword [0x18005bf40]
test rdx, rdx
jne 0x18001d9d3
call fcn.18001d0c0
mov rdx, qword [0x18005bf40]
mov ecx, edi
mov rbx, rdi
test rdx, rdx
jle 0x18001db0a
cmp ecx, r12d
je 0x18001d9f8
inc ecx
inc rbx
movsxd rax, ecx
cmp rax, rdx
jl 0x18001d9e1
jmp 0x18001db0a
test rbx, rbx
js 0x18001dca8
cmp rbx, rdx
jge 0x18001dca8
imul rbx, rbx, 0xf0
add rbx, qword [0x18005bf38]
lea rcx, [rbp + 0xb0]
mov rdx, rbx
mov r8d, 0xf0
call sub.MSVCR100.dll_memcpy
cmp qword [rbp + 0xb8], 0xffffffffffffffff
je 0x18001db0a
lea rcx, [rbp - 0x70]
mov rdx, rbx
mov r8d, 0xf0
call sub.MSVCR100.dll_memcpy
cmp word [rbp - 0x12], 2
jb 0x18001dae1
mov rbx, qword [rbp + 0x50]
movzx eax, word [rbx + 0x14]
inc eax
mov dword [rbp + 0xa0], eax
mov ecx, eax
call qword [sym.imp.MSVCR100.dll_malloc]
mov r15, rax
mov qword [rbp + 0x90], rax
movzx eax, word [rbx + 0x5c]
inc eax
mov dword [rbp + 0xa4], eax
mov ecx, eax
call qword [sym.imp.MSVCR100.dll_malloc]
mov rsi, rax
mov qword [rbp + 0x98], rax
movzx eax, word [rbx + 0xa4]
inc eax
mov dword [rbp + 0xa8], eax
mov ecx, eax
call qword [sym.imp.MSVCR100.dll_malloc]
mov r14, rax
mov qword [rbp + 0x88], rax
test r15, r15
je 0x18001dac8
test rsi, rsi
je 0x18001dac8
test rax, rax
jne 0x18001dad5
lea rcx, str.Error_allocating_memory_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dword [rbp + 0xac], 1
jmp 0x18001db03
lea rcx, str.Error_initializing_flash_and_RW_buffer_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov rsi, qword [rbp + 0x98]
mov r15, qword [rbp + 0x90]
mov r14, qword [rbp + 0x88]
mov r13, qword [rbp + 0x80]
xor eax, eax
mov qword [rbp + 0x1d0], rax
mov r8d, dword [rbp + 0xa4]
xor edx, edx
mov rcx, rsi
call sub.MSVCR100.dll_memset
mov dword [rsi + 3], 0x3ff0000
mov dword [rsi + 7], 0xf6000000
mov edx, dword [reloc.ca_core.dll_Ordinal_1]
movsxd rax, dword [reloc.ca_core.dll_Ordinal_1]
lea rcx, [rax + rax*8]
cmp edx, 1
jne 0x18001db86
mov rax, qword [rbp + 0x50]
lea r8, [rax + rcx*8]
movzx eax, byte [r8 + 2]
mov byte [rsi], al
mov ecx, dword [0x18005b7c8]
cmp ecx, 0x10
jge 0x18001db7e
movzx eax, byte [reloc.ca_core.dll_Ordinal_10]
mov byte [rsi + 1], al
movzx eax, byte [0x18005b7c8]
mov byte [rsi + 2], al
mov edx, dword [reloc.ca_core.dll_Ordinal_1]
jmp 0x18001db8e
mov edx, dword [reloc.ca_core.dll_Ordinal_1]
jmp 0x18001db94
mov rax, qword [rbp + 0x28]
lea r8, [rax + rcx*8]
mov ecx, dword [0x18005b7c8]
mov rax, qword [rbp - 0x68]
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x28], edx
mov rax, qword [rbp - 0x50]
mov qword [rsp + 0x30], rax
movzx eax, word [r8]
mov word [rsp + 0x38], ax
movzx eax, word [r8 + 0x38]
mov word [rsp + 0x3a], ax
movzx eax, word [r8 + 6]
mov word [rsp + 0x3c], ax
movzx eax, byte [r8 + 2]
mov byte [rsp + 0x3e], al
mov qword [rsp + 0x50], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x70], rdi
mov dword [rsp + 0x58], edi
movzx edi, word [r8 + 0x14]
inc di
cmp edx, 1
jne 0x18001dc0f
movzx r8d, di
mov rdx, rsi
mov rbx, qword [rbp + 0x30]
mov rcx, rbx
call sub.MSVCR100.dll_memcpy
mov qword [rsp + 0x40], rbx
jmp 0x18001dc2b
mov rax, qword [rbp + 8]
mov qword [rsp + 0x40], rax
cmp ecx, 0x10
jge 0x18001dc2b
shl ecx, 8
movzx eax, di
or ecx, eax
mov dword [rsp + 0x48], ecx
jmp 0x18001dc32
movzx eax, di
mov dword [rsp + 0x48], eax
xor edi, edi
mov dword [rbp + 0x1d0], edi
lea r8d, [rdi + 9]
lea rdx, [rbp + 0x1d0]
lea rcx, [rsp + 0x20]
call fcn.1800011a0
test eax, eax
jne 0x18001dc61
lea rcx, str.Unknown_error:_Couldnt_execute_REPORT_REG_WRITE_function_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
nop
mov rcx, rsi
call qword [sym.imp.MSVCR100.dll_free]
test r14, r14
je 0x18001dc78
mov rcx, r14
call qword [sym.imp.MSVCR100.dll_free]
test r15, r15
je 0x18001dc86
mov rcx, r15
call qword [sym.imp.MSVCR100.dll_free]
test r13, r13
je 0x18001dc94
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
inc r12d
movsxd rax, r12d
cmp rax, qword [0x18005bf40]
jge 0x18001dcaf
jmp 0x18001d930
call qword [sym.imp.mfc100.dll_Ordinal_2022]
nop
mov eax, 1
lea r11, [rsp + 0x2a0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret