Function at 0x50e960
Capabilities:
Authenticate hmac
Encode data using xor
Resolve function by parsing pe exports

Disassembly:
mov eax, 0x31c
call fcn.00544cc0
mov eax, dword [0x5ca120]
xor eax, esp
mov dword [esp + 0x318], eax
cmp dword [esp + 0x338], 0x100000
mov ecx, dword [esp + 0x324]
mov edx, dword [esp + 0x32c]
mov eax, dword [esp + 0x320]
push ebx
push ebp
mov ebp, dword [esp + 0x330]
push esi
mov dword [esp + 0x54], ecx
mov ecx, dword [esp + 0x33c]
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0x348]
mov esi, 0x28
mov ebx, 8
push edi
mov dword [esp + 0x74], eax
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x34], ecx
mov dword [esp + 0x50], edx
mov edi, 0x40
mov dword [esp + 0x48], esi
mov dword [esp + 0x30], ebx
mov byte [esp + 0x12], 1
jae 0x50f0c9
push eax
call fcn.004ccac0
push eax
call fcn.00449630
add esp, 8
cmp eax, 0x2a0
jg 0x50eab6
je 0x50ea84
cmp eax, 4
je 0x50ea44
cmp eax, edi
jne 0x50eac3
lea eax, [esp + 0x80]
push eax
call fcn.00504800
add esp, 4
test eax, eax
jle 0x50f0c9
mov dword [esp + 0x20], 0x50e740
mov dword [esp + 0x14], 0x4a3010
lea ebp, [edi - 0x2c]
jmp 0x50eb5b
lea ecx, [esp + 0x80]
push ecx
call fcn.004a5950
add esp, 4
test eax, eax
jle 0x50f0c9
mov esi, 0x30
mov dword [esp + 0x20], 0x50e6c0
mov dword [esp + 0x14], 0x4a6310
mov ebp, 0x10
mov dword [esp + 0x48], esi
mov byte [esp + 0x12], 0
jmp 0x50eb5b
lea edx, [esp + 0x80]
push edx
call fcn.004a31d0
add esp, 4
test eax, eax
jle 0x50f0c9
mov dword [esp + 0x20], 0x50e7e0
mov dword [esp + 0x14], 0x4a43f0
mov ebp, 0x20
jmp 0x50eb5b
sub eax, 0x2a1
je 0x50eb22
dec eax
je 0x50eb06
dec eax
je 0x50ead7
test ebp, ebp
je 0x50f0c9
mov dword [ebp], 0
jmp 0x50f0c9
lea eax, [esp + 0x80]
push eax
call fcn.004a3170
add esp, 4
test eax, eax
jle 0x50f0c9
mov dword [esp + 0x20], 0x50e7e0
mov dword [esp + 0x14], 0x4a43f0
mov ebp, 0x1c
jmp 0x50eb5b
lea ecx, [esp + 0x80]
push ecx
call fcn.004a48f0
add esp, 4
test eax, eax
jle 0x50f0c9
mov ebp, edi
jmp 0x50eb3f
lea edx, [esp + 0x80]
push edx
call fcn.004a4850
add esp, 4
test eax, eax
jle 0x50f0c9
mov ebp, 0x30
mov ebx, 0x10
mov dword [esp + 0x30], ebx
lea edi, [ebx + 0x70]
mov dword [esp + 0x14], 0x4a58a0
mov dword [esp + 0x20], 0x50e8d0
cmp byte [esp + 0x354], 0
mov ecx, 0xd
mov dword [esp + 0x18], ebp
mov dword [esp + 0x38], ecx
je 0x50eb88
mov eax, dword [esp + 0x350]
lea ecx, [esi + eax + 0xb]
mov dword [esp + 0x38], ecx
mov esi, 2
jmp 0x50eb96
lea eax, [edi + ebp + 0xff]
xor edx, edx
div edi
lea esi, [eax + 1]
mov eax, dword [esp + 0x348]
sub ecx, ebp
lea edx, [ecx + ebx]
add edx, edi
lea eax, [edx + eax - 1]
xor edx, edx
div edi
add ecx, dword [esp + 0x344]
xor edx, edx
mov dword [esp + 0x2c], esi
mov ebp, eax
xor eax, eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], eax
mov eax, ecx
div edi
mov dword [esp + 0x54], eax
mov dword [esp + 0x4c], edx
xor edx, edx
lea eax, [ecx + ebx]
div edi
mov dword [esp + 0x60], eax
xor eax, eax
cmp byte [esp + 0x354], al
setne al
add eax, esi
cmp ebp, eax
jbe 0x50ebfd
sub ebp, esi
mov eax, ebp
imul eax, edi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x24], eax
cmp byte [esp + 0x354], 0
lea ebx, [ecx*8]
jne 0x50ec7a
push edi
lea ecx, [esp + 0x1ac]
push 0
push ecx
lea ebx, [ebx + edi*8]
call sub.MSVCR100.dll_memset
mov eax, dword [esp + 0x35c]
add esp, 0xc
cmp eax, 0x80
ja 0x50f0c9
mov edx, dword [esp + 0x50]
push eax
push edx
lea eax, [esp + 0x1b0]
push eax
call sub.MSVCR100.dll_memcpy
add esp, 0xc
xor eax, eax
test edi, edi
je 0x50ec5f
xor byte [esp + eax + 0x1a8], 0x36
inc eax
cmp eax, edi
jb 0x50ec52
mov ebp, dword [esp + 0x14]
lea ecx, [esp + 0x1a8]
push ecx
lea edx, [esp + 0x84]
push edx
call ebp
add esp, 8
jmp 0x50ec7e
mov ebp, dword [esp + 0x14]
cmp byte [esp + 0x12], 0
mov esi, dword [esp + 0x30]
je 0x50ecc3
lea eax, [esi - 4]
push eax
lea ecx, [esp + 0x15c]
push 0
push ecx
call sub.MSVCR100.dll_memset
lea eax, [esp + esi + 0x164]
mov edx, ebx
shr edx, 0x18
mov byte [eax - 4], dl
mov ecx, ebx
shr ecx, 0x10
mov edx, ebx
add esp, 0xc
shr edx, 8
mov byte [eax - 3], cl
mov byte [eax - 2], dl
mov byte [eax - 1], bl
jmp 0x50ecf8
push esi
lea eax, [esp + 0x15c]
push 0
push eax
call sub.MSVCR100.dll_memset
lea eax, [esp + esi + 0x164]
mov ecx, ebx
shr ecx, 0x18
mov byte [eax - 5], cl
mov edx, ebx
shr edx, 0x10
mov ecx, ebx
add esp, 0xc
shr ecx, 8
mov byte [eax - 6], dl
mov byte [eax - 7], cl
mov byte [eax - 8], bl
mov ebx, dword [esp + 0x24]
test ebx, ebx
je 0x50ee23
cmp byte [esp + 0x354], 0
je 0x50eda8
mov esi, dword [esp + 0x38]
cmp esi, edi
jbe 0x50f0c9
mov ebp, dword [esp + 0x44]
mov ebx, dword [esp + 0x14]
lea edx, [esp + 0x80]
push ebp
push edx
sub esi, edi
call ebx
push esi
add ebp, edi
lea eax, [esp + 0x234]
push ebp
push eax
call sub.MSVCR100.dll_memcpy
mov edx, dword [esp + 0x48]
mov ecx, edi
sub ecx, esi
push ecx
push edx
lea eax, [esp + esi + 0x244]
push eax
call sub.MSVCR100.dll_memcpy
lea ecx, [esp + 0x248]
push ecx
lea edx, [esp + 0xa4]
push edx
call ebx
mov eax, dword [esp + 0x4c]
xor edx, edx
div edi
add esp, 0x28
dec eax
cmp eax, 1
jbe 0x50ee23
mov ebp, dword [esp + 0x34]
sub ebp, esi
add ebp, edi
lea esi, [eax - 1]
lea ecx, [ecx]
lea eax, [esp + 0x80]
push ebp
push eax
call ebx
add esp, 8
add ebp, edi
dec esi
jne 0x50ed90
jmp 0x50ee23
mov eax, dword [esp + 0x44]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov esi, dword [esp + 0x34]
mov dword [esp + 0x228], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x22c], edx
mov dl, byte [eax + 0xc]
lea eax, [edi - 0xd]
push eax
mov dword [esp + 0x234], ecx
lea ecx, [esp + 0x239]
push esi
push ecx
mov byte [esp + 0x240], dl
call sub.MSVCR100.dll_memcpy
lea edx, [esp + 0x234]
push edx
lea eax, [esp + 0x90]
push eax
call ebp
xor edx, edx
mov eax, ebx
div edi
add esp, 0x14
cmp eax, 1
jbe 0x50ee23
lea esi, [esi + edi - 0xd]
lea ebx, [eax - 1]
lea ecx, [esp + 0x80]
push esi
push ecx
call ebp
add esp, 8
add esi, edi
dec ebx
jne 0x50ee10
push 0x40
lea edx, [esp + 0x16c]
push 0
push edx
call sub.MSVCR100.dll_memset
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
add eax, ecx
add esp, 0xc
mov dword [esp + 0x28], ecx
mov dword [esp + 0x7c], eax
cmp ecx, eax
ja 0x50f028
mov ecx, dword [esp + 0x28]
mov eax, ecx
xor eax, dword [esp + 0x54]
xor esi, esi
lea edx, [eax - 1]
not eax
shr eax, 0x1f
shr edx, 0x1f
and dl, al
mov eax, ecx
xor eax, dword [esp + 0x60]
neg dl
lea ebx, [eax - 1]
shr ebx, 0x1f
not eax
shr eax, 0x1f
and bl, al
neg bl
mov byte [esp + 0x1e], dl
mov byte [esp + 0x13], bl
test edi, edi
je 0x50efbe
mov ebp, dword [esp + 0x4c]
movzx ecx, dl
mov dword [esp + 0x6c], ecx
lea ecx, [ebp + 1]
shr ecx, 0x1f
mov dword [esp + 0x68], ecx
mov cl, bl
not cl
or cl, dl
mov edx, dword [esp + 0x30]
mov byte [esp + 0x1f], cl
mov eax, ebp
mov ecx, edi
sub ecx, edx
shr eax, 0x1f
neg ebp
sub edx, edi
lea edx, [esp + edx + 0x158]
mov dword [esp + 0x70], eax
mov dword [esp + 0x78], ecx
mov dword [esp + 0x2c], edx
jmp 0x50eee4
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x38]
mov byte [esp + 0x12], 0
cmp ecx, edx
jae 0x50ef02
mov edx, dword [esp + 0x44]
mov cl, byte [edx + ecx]
mov byte [esp + 0x12], cl
jmp 0x50ef1c
mov ebx, dword [esp + 0x348]
add ebx, edx
cmp ecx, ebx
jae 0x50ef1c
mov ebx, dword [esp + 0x34]
sub ebx, edx
mov dl, byte [ebx + ecx]
mov byte [esp + 0x12], dl
mov ecx, esi
shr ecx, 0x1f
mov edx, ebp
shr edx, 0x1f
xor dl, al
mov bl, cl
xor bl, al
or dl, bl
xor dl, cl
dec dl
movzx eax, dl
and eax, dword [esp + 0x6c]
inc dword [esp + 0x24]
mov dword [esp + 0x3c], eax
not eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x40]
and al, byte [esp + 0x12]
mov edx, dword [esp + 0x3c]
and dl, 0x80
or al, dl
mov edx, dword [esp + 0x4c]
inc edx
mov ebx, esi
sub ebx, edx
mov dl, byte [esp + 0x68]
shr ebx, 0x1f
xor bl, dl
xor dl, cl
or bl, dl
xor bl, cl
dec bl
and bl, byte [esp + 0x1e]
not bl
and bl, byte [esp + 0x1f]
and al, bl
mov bl, byte [esp + 0x13]
cmp esi, dword [esp + 0x78]
jb 0x50efa9
movzx ecx, bl
mov dword [esp + 0x40], ecx
not ecx
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
and cl, al
mov eax, dword [esp + 0x2c]
and dl, byte [eax]
or cl, dl
mov al, cl
inc dword [esp + 0x2c]
mov byte [esp + esi + 0x2a8], al
inc esi
inc ebp
cmp esi, edi
jb 0x50eee0
lea ecx, [esp + 0x2a8]
push ecx
lea edx, [esp + 0x84]
push edx
call dword [esp + 0x1c]
lea eax, [esp + 0x2b0]
push eax
lea ecx, [esp + 0x8c]
push ecx
call dword [esp + 0x30]
mov esi, dword [esp + 0x28]
add esp, 0x10
xor eax, eax
test esi, esi
je 0x50f015
jmp 0x50f000
mov dl, byte [esp + eax + 0x2a8]
and dl, bl
or byte [esp + eax + 0x168], dl
inc eax
cmp eax, esi
jb 0x50f000
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, dword [esp + 0x7c]
jbe 0x50ee51
call fcn.00472250
mov esi, eax
test esi, esi
je 0x50f0c0
mov eax, dword [esp + 0x74]
push 0
push eax
call fcn.004ccac0
add esp, 4
push eax
push esi
call fcn.00472290
add esp, 0xc
test eax, eax
jle 0x50f0c0
cmp byte [esp + 0x354], 0
je 0x50f0e4
mov edi, dword [esp + 0x48]
push edi
lea ecx, [esp + 0x1ac]
push 0x5c
push ecx
call sub.MSVCR100.dll_memset
mov edx, dword [esp + 0x35c]
mov eax, dword [esp + 0x5c]
push edx
push eax
push esi
call fcn.00472440
add esp, 0x18
test eax, eax
jle 0x50f0c0
push edi
lea ecx, [esp + 0x1ac]
push ecx
push esi
call fcn.00472440
add esp, 0xc
test eax, eax
jle 0x50f0c0
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x16c]
push eax
push esi
call fcn.00472440
add esp, 0xc
test eax, eax
jg 0x50f12d
push esi
call fcn.00472270
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x328]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005448c8
add esp, 0x31c
ret
xor eax, eax
test edi, edi
je 0x50f0fd
lea ebx, [ebx]
xor byte [esp + eax + 0x1a8], 0x6a
inc eax
cmp eax, edi
jb 0x50f0f0
push edi
lea ecx, [esp + 0x1ac]
push ecx
push esi
call fcn.00472440
add esp, 0xc
test eax, eax
jle 0x50f0c0
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x16c]
push eax
push esi
call fcn.00472440
add esp, 0xc
test eax, eax
jle 0x50f0c0
mov edx, dword [esp + 0x58]
lea ecx, [esp + 0x64]
push ecx
push edx
push esi
call fcn.004727e0
add esp, 0xc
test eax, eax
je 0x50f152
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x50f152
mov ecx, dword [esp + 0x64]
mov dword [eax], ecx
push esi
call fcn.00472270
add esp, 4
mov eax, 1
jmp 0x50f0cb