Function at 0x499760
Capabilities:
Authenticate hmac
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x338
cmp dword [ebx + 0x20], 0x100000
push esi
push edi
mov edi, 0x40
mov dword [ebp - 0x14], 8
mov esi, 0x28
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x48], esi
mov byte [ebp - 1], 1
jb 0x4997b9
push 0x53ae04
push 0x1c7
push 0x53adac
call fcn.0045c570
add esp, 0xc
push dword [ebx + 8]
call fcn.00454cb0
push eax
call fcn.00454d40
add esp, 8
cmp eax, 0x2a0
jg 0x49987e
je 0x49984f
cmp eax, 4
je 0x499814
cmp eax, 0x40
jne 0x49988f
lea eax, [ebp - 0x238]
push eax
call fcn.004607a0
add esp, 4
test eax, eax
jle 0x499f3e
mov dword [ebp - 0x2c], 0x49a2f0
mov eax, 0x14
mov dword [ebp - 8], 0x4607e0
jmp 0x499942
lea eax, [ebp - 0x238]
push eax
call fcn.00457da0
add esp, 4
test eax, eax
jle 0x499f3e
mov esi, 0x30
mov dword [ebp - 0x2c], 0x49a270
mov dword [ebp - 8], 0x457de0
mov eax, 0x10
mov dword [ebp - 0x48], esi
mov byte [ebp - 1], 0
jmp 0x499942
lea eax, [ebp - 0x238]
push eax
call fcn.004afae0
add esp, 4
test eax, eax
jle 0x499f3e
mov dword [ebp - 0x2c], 0x49a390
mov eax, 0x20
mov dword [ebp - 8], 0x4afb40
jmp 0x499942
sub eax, 0x2a1
je 0x499909
dec eax
je 0x4998ee
dec eax
je 0x4998c2
push 0x51134c
push 0x209
push 0x53adac
call fcn.0045c570
mov eax, dword [ebx + 0x10]
add esp, 0xc
test eax, eax
je 0x499f3e
mov dword [eax], 0
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
lea eax, [ebp - 0x238]
push eax
call fcn.004af7a0
add esp, 4
test eax, eax
jle 0x499f3e
mov dword [ebp - 0x2c], 0x49a390
mov eax, 0x1c
mov dword [ebp - 8], 0x4afb40
jmp 0x499942
lea eax, [ebp - 0x238]
push eax
call fcn.004b0280
add esp, 4
test eax, eax
jle 0x499f3e
mov eax, edi
jmp 0x499925
lea eax, [ebp - 0x238]
push eax
call fcn.004afc40
add esp, 4
test eax, eax
jle 0x499f3e
mov eax, 0x30
mov edi, 0x80
mov dword [ebp - 0x14], 0x10
mov dword [ebp - 0x30], edi
mov dword [ebp - 8], 0x4b0330
mov dword [ebp - 0x2c], 0x49a480
cmp byte [ebx + 0x2c], 0
mov edx, 0xd
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x40], edx
je 0x49995e
mov edx, dword [ebx + 0x28]
add edx, 0xb
add edx, esi
mov dword [ebp - 0x40], edx
xor ecx, ecx
mov esi, edx
cmp byte [ebx + 0x2c], cl
sete cl
sub esi, eax
mov eax, dword [ebp - 0x14]
xor edx, edx
add eax, esi
add eax, edi
lea ecx, [ecx*4 + 2]
mov dword [ebp - 0x28], ecx
mov ecx, dword [ebx + 0x20]
dec ecx
add eax, ecx
mov ecx, dword [ebx + 0x1c]
div edi
add ecx, esi
xor edx, edx
mov dword [ebp - 0x24], eax
xor eax, eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0xc], eax
mov eax, ecx
div edi
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x14]
add eax, ecx
mov dword [ebp - 0x44], edx
xor edx, edx
xor ecx, ecx
div edi
cmp byte [ebx + 0x2c], cl
mov edx, dword [ebp - 0x28]
setne cl
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x24]
add ecx, edx
cmp eax, ecx
jbe 0x4999d3
sub eax, edx
mov esi, eax
mov dword [ebp - 0x38], eax
imul esi, edi
mov dword [ebp - 0xc], esi
jmp 0x4999d5
xor esi, esi
mov eax, dword [ebp - 0x34]
shl eax, 3
cmp byte [ebx + 0x2c], 0
mov dword [ebp - 0x1c], eax
jne 0x499ab1
lea eax, [eax + edi*8]
push edi
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x160]
push 0
push eax
call fcn.004f7a50
mov eax, dword [ebx + 0x28]
add esp, 0xc
cmp eax, 0x80
jbe 0x499a24
push 0x53ae34
push 0x271
push 0x53adac
call fcn.0045c570
mov eax, dword [ebx + 0x28]
add esp, 0xc
push eax
push dword [ebx + 0x24]
lea eax, [ebp - 0x160]
push eax
call fcn.004f8270
add esp, 0xc
xor ecx, ecx
test edi, edi
je 0x499a9d
cmp edi, 0x20
jb 0x499a86
movdqa xmm1, xmmword [0x5396d0]
mov eax, edi
and eax, 0x1f
mov edx, edi
sub edx, eax
lea eax, [ebp - 0x150]
lea esp, [esp]
movdqu xmm0, xmmword [eax - 0x10]
add ecx, 0x20
lea eax, [eax + 0x20]
pxor xmm0, xmm1
movdqu xmmword [eax - 0x30], xmm0
movdqu xmm0, xmmword [eax - 0x20]
pxor xmm0, xmm1
movdqu xmmword [eax - 0x20], xmm0
cmp ecx, edx
jb 0x499a60
cmp ecx, edi
jae 0x499a9d
lea ebx, [ebx]
xor byte [ebp + ecx - 0x160], 0x36
inc ecx
cmp ecx, edi
jb 0x499a90
lea eax, [ebp - 0x160]
push eax
lea eax, [ebp - 0x238]
push eax
call dword [ebp - 8]
add esp, 8
cmp byte [ebp - 1], 0
je 0x499af3
mov eax, dword [ebp - 0x14]
add eax, 0xfffffffc
push eax
lea eax, [ebp - 0x58]
push 0
push eax
call fcn.004f7a50
mov ecx, dword [ebp - 0x1c]
add esp, 0xc
mov edx, dword [ebp - 0x14]
mov eax, ecx
shr eax, 0x18
mov byte [ebp + edx - 0x5c], al
mov eax, ecx
shr eax, 0x10
mov byte [ebp + edx - 0x5b], al
mov eax, ecx
shr eax, 8
mov byte [ebp + edx - 0x5a], al
mov byte [ebp + edx - 0x59], cl
jmp 0x499b29
push dword [ebp - 0x14]
lea eax, [ebp - 0x58]
push 0
push eax
call fcn.004f7a50
mov ecx, dword [ebp - 0x1c]
add esp, 0xc
mov edx, dword [ebp - 0x14]
mov eax, ecx
shr eax, 0x18
mov byte [ebp + edx - 0x5d], al
mov eax, ecx
shr eax, 0x10
mov byte [ebp + edx - 0x5e], al
mov eax, ecx
shr eax, 8
mov byte [ebp + edx - 0x5f], al
mov byte [ebp + edx - 0x60], cl
test esi, esi
je 0x499c48
cmp byte [ebx + 0x2c], 0
je 0x499bcf
mov eax, dword [ebp - 0x40]
cmp eax, edi
jbe 0x499f3e
push dword [ebx + 0x14]
mov esi, eax
lea eax, [ebp - 0x238]
push eax
sub esi, edi
call dword [ebp - 8]
mov eax, dword [ebx + 0x14]
add eax, edi
push esi
push eax
lea eax, [ebp - 0x2b8]
push eax
call fcn.004f8270
mov eax, edi
sub eax, esi
push eax
push dword [ebx + 0x18]
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x2b8]
add eax, esi
push eax
call fcn.004f8270
lea eax, [ebp - 0x2b8]
push eax
lea eax, [ebp - 0x238]
push eax
call dword [ebp - 8]
mov esi, dword [ebp - 0xc]
xor edx, edx
mov eax, esi
add esp, 0x28
div edi
lea ecx, [eax - 1]
cmp ecx, 1
jbe 0x499c48
mov esi, dword [ebp - 0x24]
lea eax, [ecx - 1]
add esi, dword [ebx + 0x18]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x238]
push esi
push eax
call dword [ebp - 8]
add esp, 8
add esi, edi
dec dword [ebp - 0x18]
jne 0x499bb8
jmp 0x499c45
mov ecx, dword [ebx + 0x14]
mov eax, dword [ecx + 8]
movq xmm0, qword [ecx]
mov dword [ebp - 0x2b0], eax
mov al, byte [ecx + 0xc]
mov byte [ebp - 0x2ac], al
lea eax, [edi - 0xd]
push eax
push dword [ebx + 0x18]
lea eax, [ebp - 0x2ab]
movq qword [ebp - 0x2b8], xmm0
push eax
call fcn.004f8270
lea eax, [ebp - 0x2b8]
push eax
lea eax, [ebp - 0x238]
push eax
call dword [ebp - 8]
xor edx, edx
mov eax, esi
div edi
add esp, 0x14
cmp eax, 1
jbe 0x499c48
mov esi, dword [ebx + 0x18]
add esi, 0xfffffff3
add esi, edi
dec eax
mov dword [ebp - 0x18], eax
mov edi, edi
lea eax, [ebp - 0x238]
push esi
push eax
call dword [ebp - 8]
add esp, 8
add esi, edi
dec dword [ebp - 0x18]
jne 0x499c30
mov esi, dword [ebp - 0xc]
push 0x40
lea eax, [ebp - 0xd0]
push 0
push eax
call fcn.004f7a50
mov eax, dword [ebp - 0x28]
add esp, 0xc
mov edx, dword [ebp - 0x38]
add eax, edx
mov dword [ebp - 0x64], eax
cmp edx, eax
ja 0x499e98
mov edi, edi
mov eax, edx
xor eax, dword [ebp - 0x78]
lea ecx, [eax - 1]
not eax
shr ecx, 0x1f
shr eax, 0x1f
and cl, al
mov eax, edx
xor eax, dword [ebp - 0x60]
neg cl
mov dword [ebp - 0x34], ecx
xor edx, edx
mov dword [ebp - 0x1c], edx
lea ecx, [eax - 1]
not eax
shr ecx, 0x1f
shr eax, 0x1f
and cl, al
neg cl
movsx eax, cl
mov dword [ebp - 0x24], ecx
movd xmm0, eax
punpcklbw xmm0, xmm0
punpcklwd xmm0, xmm0
pshufd xmm0, xmm0, 0
movdqa xmmword [ebp - 0xe0], xmm0
test edi, edi
je 0x499dce
mov edx, dword [ebp - 0x44]
not cl
lea eax, [edx + 1]
mov dword [ebp - 0x3c], eax
mov eax, edx
shr dword [ebp - 0x3c], 0x1f
shr eax, 0x1f
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x34]
or cl, al
movzx edx, al
mov eax, edi
sub eax, dword [ebp - 0x14]
mov dword [ebp - 0x74], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x6c], edx
sub eax, edi
lea edx, [ebp - 0x58]
mov byte [ebp - 0x1d], cl
mov ecx, dword [ebp - 0x44]
add eax, edx
mov edx, dword [ebp - 0x1c]
neg ecx
mov dword [ebp - 0x18], eax
mov eax, dword [ebx + 0x18]
sub eax, dword [ebp - 0x40]
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x40]
mov byte [ebp - 1], 0
cmp esi, eax
jae 0x499d28
mov eax, dword [ebx + 0x14]
mov al, byte [esi + eax]
jmp 0x499d35
add eax, dword [ebx + 0x20]
cmp esi, eax
jae 0x499d38
mov eax, dword [ebp - 0x70]
mov al, byte [eax + esi]
mov byte [ebp - 1], al
mov eax, dword [ebp - 0x5c]
inc esi
shr edx, 0x1f
shr ecx, 0x1f
xor cl, al
xor al, dl
or cl, al
mov eax, dword [ebp - 0x28]
dec eax
xor cl, dl
shr eax, 0x1f
dec cl
xor al, byte [ebp - 0x3c]
mov dword [ebp - 0xc], eax
mov al, byte [ebp - 0x3c]
xor al, dl
movzx ecx, cl
or byte [ebp - 0xc], al
xor byte [ebp - 0xc], dl
and ecx, dword [ebp - 0x6c]
mov edx, dword [ebp - 0xc]
mov al, cl
dec dl
not al
and dl, byte [ebp - 0x34]
and cl, 0x80
and al, byte [ebp - 1]
not dl
or al, cl
and dl, al
mov eax, dword [ebp - 0x74]
and dl, byte [ebp - 0x1d]
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0x1c], eax
jb 0x499da6
mov eax, dword [ebp - 0x24]
movzx ecx, al
mov eax, dword [ebp - 0x18]
mov dl, cl
not dl
and dl, byte [ebp - 0xc]
mov al, byte [eax]
and al, cl
or dl, al
mov ecx, dword [ebp - 0x28]
lea eax, [ebp - 0x338]
add eax, dword [ebp - 0x44]
inc dword [ebp - 0x18]
mov edi, dword [ebp - 0x30]
mov byte [eax + ecx], dl
inc ecx
mov edx, dword [ebp - 0x1c]
inc edx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x1c], edx
cmp edx, edi
jb 0x499d15
lea eax, [ebp - 0x338]
push eax
lea eax, [ebp - 0x238]
push eax
call dword [ebp - 8]
lea eax, [ebp - 0x338]
push eax
lea eax, [ebp - 0x238]
push eax
call dword [ebp - 0x2c]
mov edx, dword [ebp - 0x10]
add esp, 0x10
xor eax, eax
test edx, edx
je 0x499e88
cmp edx, 0x20
jb 0x499e64
movdqa xmm2, xmmword [ebp - 0xe0]
mov ecx, edx
and ecx, 0x1f
sub edx, ecx
movdqu xmm0, xmmword [ebp + eax - 0xd0]
movdqu xmm1, xmmword [ebp + eax - 0x338]
pand xmm1, xmm2
por xmm1, xmm0
movdqu xmmword [ebp + eax - 0xd0], xmm1
movdqu xmm1, xmmword [ebp + eax - 0x328]
movdqu xmm0, xmmword [ebp + eax - 0xc0]
pand xmm1, xmm2
por xmm1, xmm0
movdqu xmmword [ebp + eax - 0xc0], xmm1
add eax, 0x20
cmp eax, edx
jb 0x499e14
mov edx, dword [ebp - 0x10]
cmp eax, edx
jae 0x499e88
mov edx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x10]
mov edi, edi
mov cl, byte [ebp + eax - 0x338]
and cl, dl
or byte [ebp + eax - 0xd0], cl
inc eax
cmp eax, edi
jb 0x499e70
mov edi, dword [ebp - 0x30]
mov edx, dword [ebp - 0x38]
inc edx
mov dword [ebp - 0x38], edx
cmp edx, dword [ebp - 0x64]
jbe 0x499c70
lea eax, [ebp - 0x90]
push eax
call fcn.0045e1b0
mov eax, dword [ebx + 8]
push 0
push dword [eax]
lea eax, [ebp - 0x90]
push eax
call fcn.0045dd90
add esp, 0x10
test eax, eax
jle 0x499f2f
cmp byte [ebx + 0x2c], 0
je 0x499f49
mov esi, dword [ebp - 0x48]
lea eax, [ebp - 0x160]
push esi
push 0x5c
push eax
call fcn.004f7a50
push dword [ebx + 0x28]
lea eax, [ebp - 0x90]
push dword [ebx + 0x24]
push eax
call fcn.0045df40
add esp, 0x18
test eax, eax
jle 0x499f2f
push esi
lea eax, [ebp - 0x160]
push eax
lea eax, [ebp - 0x90]
push eax
call fcn.0045df40
add esp, 0xc
test eax, eax
jle 0x499f2f
push dword [ebp - 0x10]
lea eax, [ebp - 0xd0]
push eax
lea eax, [ebp - 0x90]
push eax
call fcn.0045df40
add esp, 0xc
test eax, eax
jg 0x499fed
lea eax, [ebp - 0x90]
push eax
call fcn.0045df50
add esp, 4
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
xor ecx, ecx
test edi, edi
je 0x499fad
cmp edi, 0x20
jb 0x499f96
movdqa xmm1, xmmword [0x5396e0]
mov eax, edi
and eax, 0x1f
mov edx, edi
sub edx, eax
lea eax, [ebp - 0x150]
jmp 0x499f70
movdqu xmm0, xmmword [eax - 0x10]
add ecx, 0x20
lea eax, [eax + 0x20]
pxor xmm0, xmm1
movdqu xmmword [eax - 0x30], xmm0
movdqu xmm0, xmmword [eax - 0x20]
pxor xmm0, xmm1
movdqu xmmword [eax - 0x20], xmm0
cmp ecx, edx
jb 0x499f70
cmp ecx, edi
jae 0x499fad
lea ebx, [ebx]
xor byte [ebp + ecx - 0x160], 0x6a
inc ecx
cmp ecx, edi
jb 0x499fa0
push edi
lea eax, [ebp - 0x160]
push eax
lea eax, [ebp - 0x90]
push eax
call fcn.0045df40
add esp, 0xc
test eax, eax
jle 0x499f2f
push dword [ebp - 0x10]
lea eax, [ebp - 0xd0]
push eax
lea eax, [ebp - 0x90]
push eax
call fcn.0045df40
add esp, 0xc
test eax, eax
jle 0x499f2f
lea eax, [ebp - 0x68]
push eax
push dword [ebx + 0xc]
lea eax, [ebp - 0x90]
push eax
call fcn.0045dcb0
mov ecx, dword [ebx + 0x10]
add esp, 0xc
test ecx, ecx
je 0x49a00f
mov eax, dword [ebp - 0x68]
mov dword [ecx], eax
lea eax, [ebp - 0x90]
push eax
call fcn.0045df50
add esp, 4
mov eax, 1
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret