Function at 0x403130
Capabilities:
Authenticate hmac
Encode data using xor
Hash data via wincrypt

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xd28
mov ebx, edx
test r8d, r8d
mov r15, rcx
mov dword [rsp + 0xd80], r8d
sete dl
test ebx, ebx
mov r13d, r9d
mov qword [rsp + 0x88], 0
sete al
mov dword [rsp + 0x7c], 0
mov qword [rsp + 0x90], 0
or dl, al
jne 0x403ad6
test rcx, rcx
je 0x403ad6
mov ecx, dword [rsp + 0xda8]
xor edx, edx
test ecx, ecx
je 0x4039ba
cmp qword [rsp + 0xdb0], 0
je 0x403ad6
cmp ebx, 0x280
ja 0x403ad6
mov dword [rsp + 0x20], 0
lea r9, [rsp + 0x80]
lea r8, [rsp + 0x7c]
mov rcx, r15
mov dword [rsp + 0x80], 4
mov edx, 4
mov r12, qword [sym.imp.ADVAPI32.dll_CryptGetHashParam]
call r12
test eax, eax
je 0x403ad6
cmp dword [rsp + 0x7c], 0x280
ja 0x403ad6
lea rbp, [rsp + 0xaa0]
mov ecx, 0x50
xor eax, eax
mov dword [rsp + 0x5a0], 0
mov qword [rsp + 0x820], 0
mov rdi, rbp
rep stosq qword [rdi], rax
cmp ebx, r13d
jae 0x4039d0
mov rax, qword [sym.imp.ADVAPI32.dll_CryptDuplicateHash]
mov rcx, r15
xor r8d, r8d
xor edx, edx
lea rsi, [rsp + 0x820]
mov r9, rsi
mov qword [rsp + 0x40], rax
call rax
mov rcx, qword [rsp + 0x820]
test eax, eax
je 0x403bb5
test rcx, rcx
je 0x403b4a
xor r9d, r9d
mov r8d, r13d
mov rdx, qword [rsp + 0xd90]
call qword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x403b2b
lea rax, [rsp + 0x5a0]
mov dword [rsp + 0x20], 0
mov r8, rbp
mov edx, 2
mov qword [rsp + 0x58], rax
mov r9, rax
mov rcx, qword [rsp + 0x820]
mov dword [rsp + 0x5a0], 0x280
call r12
test eax, eax
je 0x403b75
mov r9, qword [rsp + 0x820]
lea r12, [rsp + 0x320]
mov rdi, r12
cmp ebx, 8
jb 0x4032f6
movabs rax, 0x5c5c5c5c5c5c5c5c
mov ecx, ebx
shr ecx, 3
rep stosq qword [rdi], rax
test bl, 4
je 0x403305
mov dword [rdi], 0x5c5c5c5c
add rdi, 4
test bl, 2
je 0x403317
mov edx, 0x5c5c
add rdi, 2
mov word [rdi - 2], dx
test bl, 1
je 0x40331f
mov byte [rdi], 0x5c
lea r13, [rsp + 0xa0]
mov rdi, r13
cmp ebx, 8
jb 0x403341
movabs rax, 0x3636363636363636
mov ecx, ebx
shr ecx, 3
rep stosq qword [rdi], rax
test bl, 4
je 0x403350
mov dword [rdi], 0x36363636
add rdi, 4
test bl, 2
je 0x403362
mov eax, 0x3636
add rdi, 2
mov word [rdi - 2], ax
test bl, 1
je 0x40336a
mov byte [rdi], 0x36
test ebx, ebx
mov r11d, 1
cmovne r11d, ebx
cmp ebx, 0xf
jbe 0x403ae0
mov edx, r11d
mov r8, r13
mov rcx, rbp
shr edx, 4
mov rax, r12
lea r10d, [rdx - 1]
lea rdx, [r13 + 0x10]
shl r10, 4
add r10, rdx
jmp 0x4033a4
add rdx, 0x10
movdqa xmm0, xmmword [rcx]
movdqa xmm1, xmmword [r8]
add rcx, 0x10
add rax, 0x10
pxor xmm1, xmm0
pxor xmm0, xmmword [rax - 0x10]
movaps xmmword [r8], xmm1
mov r8, rdx
movaps xmmword [rax - 0x10], xmm0
cmp rdx, r10
jne 0x4033a0
mov eax, r11d
and eax, 0xfffffff0
cmp r11d, eax
je 0x403564
mov edx, eax
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 1]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 2]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 3]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 4]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 5]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 6]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 7]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 8]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 9]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 0xa]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 0xb]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 0xc]
cmp ebx, edx
jbe 0x403564
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
lea edx, [rax + 0xd]
cmp ebx, edx
jbe 0x403564
add eax, 0xe
movzx ecx, byte [rsp + rdx + 0xaa0]
xor byte [r13 + rdx], cl
xor byte [r12 + rdx], cl
cmp ebx, eax
jbe 0x403564
movzx edx, byte [rsp + rax + 0xaa0]
xor byte [r13 + rax], dl
xor byte [r12 + rax], dl
test r9, r9
jne 0x403ab0
mov rdi, rbp
mov ecx, 0x280
xor eax, eax
rep stosb byte [rdi], al
mov rax, qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov dword [rsp + 0x64], 1
mov qword [rsp + 0x38], r12
mov r14, qword [sym.imp.ADVAPI32.dll_CryptHashData]
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x48], r13
mov r13, qword [rsp + 0x58]
mov eax, dword [rsp + 0x64]
mov rdi, qword [rsp + 0x90]
lea r9, [rsp + 0x88]
bswap eax
mov dword [rsp + 0x84], eax
test rdi, rdi
jne 0x40365f
mov rcx, r15
lea r9, [rsp + 0x98]
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x98], 0
mov rax, qword [rsp + 0x40]
call rax
mov rcx, qword [rsp + 0x98]
test eax, eax
je 0x403aef
test rcx, rcx
je 0x403aef
xor r9d, r9d
mov r8d, ebx
mov rdx, qword [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x403ae7
mov rdi, qword [rsp + 0x98]
mov qword [rsp + 0x88], rdi
test rdi, rdi
je 0x403657
mov rcx, rdi
xor r9d, r9d
mov r8d, dword [rsp + 0xd98]
mov rdx, qword [rsp + 0xda0]
call qword [sym.imp.ADVAPI32.dll_CryptHashData]
mov rdi, qword [rsp + 0x88]
lea r9, [rsp + 0x90]
xor r8d, r8d
xor edx, edx
mov rcx, rdi
mov rax, qword [rsp + 0x40]
call rax
test eax, eax
je 0x403b06
mov rcx, qword [rsp + 0x88]
test rcx, rcx
je 0x40369a
lea rdx, [rsp + 0x84]
xor r9d, r9d
mov r8d, 4
call qword [sym.imp.ADVAPI32.dll_CryptHashData]
mov qword [rsp + 0x20], rbp
mov r8, qword [rsp + 0x38]
mov r9d, ebx
mov rcx, r15
lea rdi, [rsp + 0x88]
mov rdx, rdi
call fcn.00402ff0
test eax, eax
jne 0x403b1a
mov r8d, dword [rsp + 0x7c]
mov rdx, rbp
mov rcx, r13
mov r12, r8
call sub.msvcrt.dll_memcpy
cmp dword [rsp + 0xd80], 1
jbe 0x403902
lea rax, [rsp + 0x98]
mov r12d, 1
mov qword [rsp + 0x50], rax
nop word cs:[rax + rax]
mov rcx, r15
mov r9, qword [rsp + 0x50]
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x98], 0
mov rax, qword [rsp + 0x40]
call rax
mov rcx, qword [rsp + 0x98]
test eax, eax
je 0x403a3c
test rcx, rcx
je 0x403a3c
xor r9d, r9d
mov r8d, ebx
mov rdx, qword [rsp + 0x48]
call r14
mov rcx, qword [rsp + 0x98]
test eax, eax
je 0x403a3c
mov qword [rsp + 0x88], rcx
mov r8d, dword [rsp + 0x7c]
test rcx, rcx
je 0x403772
xor r9d, r9d
mov rdx, rbp
call r14
mov qword [rsp + 0x20], rsi
mov r8, qword [rsp + 0x38]
mov r9d, ebx
mov rdx, rdi
mov rcx, r15
call fcn.00402ff0
test eax, eax
jne 0x403950
mov r8d, dword [rsp + 0x7c]
test r8d, r8d
je 0x4038e0
lea eax, [r8 - 1]
cmp eax, 0xe
jbe 0x403a2e
lea r9d, [r8 - 0x10]
mov rax, r13
mov rcx, rsi
xor edx, edx
shr r9d, 4
add r9d, 1
movdqa xmm0, xmmword [rax]
pxor xmm0, xmmword [rcx]
add edx, 1
add rax, 0x10
add rcx, 0x10
movaps xmmword [rax - 0x10], xmm0
cmp r9d, edx
ja 0x4037c1
shl r9d, 4
mov ecx, r8d
mov edx, r9d
sub ecx, r9d
lea rax, [r13 + rdx]
add rdx, rsi
cmp r8d, r9d
je 0x4038e0
movzx r9d, byte [rdx]
xor byte [rax], r9b
cmp ecx, 1
je 0x4038e0
movzx r9d, byte [rdx + 1]
xor byte [rax + 1], r9b
cmp ecx, 2
je 0x4038e0
movzx r9d, byte [rdx + 2]
xor byte [rax + 2], r9b
cmp ecx, 3
je 0x4038e0
movzx r9d, byte [rdx + 3]
xor byte [rax + 3], r9b
cmp ecx, 4
je 0x4038e0
movzx r9d, byte [rdx + 4]
xor byte [rax + 4], r9b
cmp ecx, 5
je 0x4038e0
movzx r9d, byte [rdx + 5]
xor byte [rax + 5], r9b
cmp ecx, 6
je 0x4038e0
movzx r9d, byte [rdx + 6]
xor byte [rax + 6], r9b
cmp ecx, 7
je 0x4038e0
movzx r9d, byte [rdx + 7]
xor byte [rax + 7], r9b
cmp ecx, 8
je 0x4038e0
movzx r9d, byte [rdx + 8]
xor byte [rax + 8], r9b
cmp ecx, 9
je 0x4038e0
movzx r9d, byte [rdx + 9]
xor byte [rax + 9], r9b
cmp ecx, 0xa
je 0x4038e0
movzx r9d, byte [rdx + 0xa]
xor byte [rax + 0xa], r9b
cmp ecx, 0xb
je 0x4038e0
movzx r9d, byte [rdx + 0xb]
xor byte [rax + 0xb], r9b
cmp ecx, 0xc
je 0x4038e0
movzx r9d, byte [rdx + 0xc]
xor byte [rax + 0xc], r9b
cmp ecx, 0xd
je 0x4038e0
movzx r9d, byte [rdx + 0xd]
xor byte [rax + 0xd], r9b
cmp ecx, 0xe
je 0x4038e0
movzx edx, byte [rdx + 0xe]
xor byte [rax + 0xe], dl
nop dword [rax + rax]
mov rdx, rsi
mov rcx, rbp
add r12d, 1
call sub.msvcrt.dll_memcpy
cmp dword [rsp + 0xd80], r12d
jne 0x403700
mov r12d, dword [rsp + 0x7c]
cmp r12d, dword [rsp + 0xda8]
ja 0x403bbf
mov edi, r12d
mov rcx, qword [rsp + 0xdb0]
mov rdx, r13
mov r8, rdi
call sub.msvcrt.dll_memcpy
add qword [rsp + 0xdb0], rdi
add dword [rsp + 0x64], 1
sub dword [rsp + 0xda8], r12d
jne 0x4035a3
mov r13, qword [rsp + 0x48]
mov r12, qword [rsp + 0x38]
xor edx, edx
jmp 0x40395c
mov r13, qword [rsp + 0x48]
mov r12, qword [rsp + 0x38]
mov edx, eax
mov r8d, 0x280
xor eax, eax
mov rdi, r13
mov rcx, r8
rep stosb byte [rdi], al
mov rdi, r12
mov rcx, r8
rep stosb byte [rdi], al
mov rdi, qword [rsp + 0x58]
mov rcx, r8
rep stosb byte [rdi], al
mov rdi, rsi
mov rcx, r8
rep stosb byte [rdi], al
mov rdi, rbp
mov rcx, r8
rep stosb byte [rdi], al
mov rcx, qword [rsp + 0x88]
test rcx, rcx
jne 0x403a9d
mov rcx, qword [rsp + 0x90]
test rcx, rcx
je 0x4039ba
mov dword [rsp + 0x38], edx
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov edx, dword [rsp + 0x38]
mov eax, edx
add rsp, 0xd28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdi, rbp
mov rsi, qword [rsp + 0xd90]
cmp r13d, 8
jae 0x403a86
xor eax, eax
test r13b, 4
jne 0x403a71
test r13b, 2
jne 0x403a5d
test r13b, 1
jne 0x403a54
mov rax, qword [sym.imp.ADVAPI32.dll_CryptDuplicateHash]
mov dword [rsp + 0x5a0], r13d
xor r9d, r9d
lea rsi, [rsp + 0x820]
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x5a0]
mov qword [rsp + 0x58], rax
jmp 0x4032d4
mov ecx, r8d
mov rdx, rsi
mov rax, r13
jmp 0x4037fb
mov rax, qword [rsp + 0x68]
call rax
mov qword [rsp + 0x88], 0
jmp 0x403772
movzx edx, byte [rsi + rax]
mov byte [rdi + rax], dl
jmp 0x4039fd
movzx edx, word [rsi + rax]
mov word [rdi + rax], dx
add rax, 2
test r13b, 1
je 0x4039fd
jmp 0x403a54
mov eax, dword [rsi]
mov dword [rdi], eax
mov eax, 4
test r13b, 2
je 0x4039f7
jmp 0x403a5d
mov ecx, r13d
xor eax, eax
shr ecx, 3
rep movsq qword [rdi], qword [rsi]
test r13b, 4
je 0x4039f1
jmp 0x403a71
mov dword [rsp + 0x38], edx
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov edx, dword [rsp + 0x38]
jmp 0x40399f
mov rcx, r9
mov rdi, rbp
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov ecx, 0x280
xor eax, eax
mov qword [rsp + 0x820], 0
rep stosb byte [rdi], al
jmp 0x403579
mov edx, 0xffffffff
jmp 0x4039ba
xor eax, eax
jmp 0x4033dd
mov rcx, qword [rsp + 0x98]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov qword [rsp + 0x88], 0
jmp 0x403657
mov r13, qword [rsp + 0x48]
mov r12, qword [rsp + 0x38]
mov edx, 0xffffffff
jmp 0x40395c
mov r13, qword [rsp + 0x48]
mov r12, qword [rsp + 0x38]
mov edx, eax
jmp 0x40395c
mov rcx, qword [rsp + 0x820]
test rcx, rcx
je 0x403b4a
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov qword [rsp + 0x820], 0
mov rdi, rbp
mov ecx, 0x280
xor eax, eax
rep stosb byte [rdi], al
lea rax, [rsp + 0x5a0]
lea r12, [rsp + 0x320]
mov qword [rsp + 0x58], rax
lea r13, [rsp + 0xa0]
jmp 0x403b10
mov rcx, qword [rsp + 0x820]
test rcx, rcx
je 0x403b94
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov qword [rsp + 0x820], 0
mov rdi, rbp
mov ecx, 0x280
xor eax, eax
rep stosb byte [rdi], al
lea r12, [rsp + 0x320]
lea r13, [rsp + 0xa0]
jmp 0x403b10
test rcx, rcx
je 0x403b4a
jmp 0x403b38
mov rdx, qword [rsp + 0x58]
mov r8d, dword [rsp + 0xda8]
mov rcx, qword [rsp + 0xdb0]
mov r13, qword [rsp + 0x48]
mov r12, qword [rsp + 0x38]
call sub.msvcrt.dll_memcpy
xor edx, edx
jmp 0x40395c