Function at 0x515730
Capabilities:
Encode data using xor
Generate random numbers using a mersenne twister
Generate random numbers via rtlgenrandom

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
sub esp, 0x50
mov eax, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [esp + 0x48], eax
mov eax, dword [ebp + 0xc]
test edx, edx
mov dword [esp + 0x40], eax
je 0x515e1d
cmp ecx, 0x73d700
mov dword [esp + 0x4c], ecx
je 0x515d56
mov edi, dword [esp + 0x40]
cmp dword [esp + 0x48], edi
je 0x515d94
mov esi, dword [esp + 0x4c]
pxor xmm2, xmm2
movdqa xmm6, xmmword [0x74e570]
lea eax, [esi + 4]
movdqa xmm5, xmmword [0x74e580]
shr eax, 2
movdqa xmm4, xmmword [0x74e590]
neg eax
mov edi, eax
mov eax, 0xe3
and edi, 3
movdqa xmm3, xmmword [0x74e5a0]
sub eax, edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x10], eax
lea eax, [edi*4 + 4]
lea edi, [esi + eax]
mov dword [esp + 0xc], edi
lea edi, [esi + eax + 4]
lea eax, [esi + eax + 0x634]
mov dword [esp + 4], eax
lea eax, [esi + 0x390]
mov dword [esp + 8], edi
shr eax, 2
neg eax
mov edi, eax
mov eax, 0x18c
and edi, 3
sub eax, edi
mov dword [esp + 0x3c], edi
mov edx, eax
mov dword [esp + 0x1c], eax
shr eax, 2
mov dword [esp + 0x18], eax
lea eax, [edi*4 + 0x390]
and edx, 0xfffffffc
mov dword [esp + 0x14], edx
lea ebx, [esi + eax + 4]
lea edi, [esi + eax]
lea esi, [esi + eax - 0x38c]
mov dword [esp + 0x34], ebx
mov dword [esp + 0x44], esi
jmp 0x515875
mov ecx, dword [esp + 0x4c]
lea edx, [eax + 1]
mov eax, dword [ecx + eax*4 + 4]
mov dword [ecx + 0x9c4], edx
mov ecx, dword [esp + 0x48]
mov edx, eax
shr edx, 0xb
add ecx, 4
xor eax, edx
mov edx, eax
shl edx, 7
and edx, 0x9d2c5680
xor edx, eax
mov eax, edx
shl eax, 0xf
and eax, 0xefc60000
xor eax, edx
mov edx, eax
shr edx, 0x12
xor eax, edx
mov dword [ecx - 4], eax
cmp dword [esp + 0x40], ecx
mov dword [esp + 0x48], ecx
je 0x515da0
mov eax, dword [esp + 0x4c]
mov eax, dword [eax + 0x9c4]
cmp eax, 0x26f
jbe 0x515825
mov ebx, dword [esp + 0x38]
test ebx, ebx
je 0x515e08
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x38], ebx
mov esi, dword [ecx + 4]
mov edx, dword [ecx + 8]
mov eax, edx
mov edx, esi
and edx, 0x80000000
mov dword [esp + 0x30], eax
and eax, 0x7fffffff
or edx, eax
mov eax, dword [ecx + 0x638]
mov esi, edx
shr esi, 1
xor eax, esi
mov esi, eax
xor esi, 0x9908b0df
and edx, 1
cmovne eax, esi
cmp ebx, 1
mov dword [ecx + 4], eax
je 0x515dc9
mov edx, dword [esp + 0x30]
mov esi, dword [ecx + 0xc]
and edx, 0x80000000
mov eax, edx
mov edx, esi
and edx, 0x7fffffff
or eax, edx
mov edx, eax
shr edx, 1
xor edx, dword [ecx + 0x63c]
mov ebx, edx
xor ebx, 0x9908b0df
test al, 1
cmovne edx, ebx
cmp dword [esp + 0x38], 2
mov dword [ecx + 8], edx
je 0x515db4
mov eax, dword [ecx + 0x10]
mov dword [esp + 0x28], 0xe0
mov dword [esp + 0x2c], 3
mov edx, eax
mov dword [esp + 0x30], eax
mov eax, esi
and eax, 0x80000000
and edx, 0x7fffffff
or edx, eax
mov eax, edx
shr eax, 1
xor eax, dword [ecx + 0x640]
mov ebx, eax
xor ebx, 0x9908b0df
and edx, 1
cmovne eax, ebx
mov dword [ecx + 0xc], eax
mov dword [esp + 0x30], edi
mov esi, dword [esp + 0x44]
xor eax, eax
mov ecx, dword [esp + 0xc]
mov ebx, dword [esp + 8]
xor edx, edx
mov edi, dword [esp + 4]
movdqa xmm1, xmmword [ecx + eax]
add edx, 1
movdqu xmm0, xmmword [ebx + eax]
pand xmm1, xmm6
pand xmm0, xmm5
movdqu xmm7, xmmword [edi + eax]
por xmm0, xmm1
movdqa xmm1, xmm0
pand xmm0, xmm4
psrld xmm1, 1
pxor xmm1, xmm7
pcmpeqd xmm0, xmm2
movdqa xmm7, xmm1
pand xmm1, xmm0
pxor xmm7, xmm3
pandn xmm0, xmm7
por xmm0, xmm1
movaps xmmword [ecx + eax], xmm0
add eax, 0x10
cmp edx, 0x38
jne 0x515974
cmp dword [esp + 0x10], 0xe0
mov ecx, dword [esp + 0x2c]
mov edi, dword [esp + 0x30]
mov dword [esp + 0x44], esi
lea eax, [ecx + 0xe0]
je 0x515acd
mov ebx, dword [esp + 0x4c]
lea edx, [ebx + eax*4]
lea eax, [ecx + 0xe1]
mov esi, dword [edx + 4]
mov dword [esp + 0x30], eax
mov eax, dword [edx + 8]
and esi, 0x80000000
mov dword [esp + 0x2c], eax
and eax, 0x7fffffff
or eax, esi
mov dword [esp + 0x24], eax
shr eax, 1
xor eax, dword [edx + 0x638]
mov esi, eax
xor esi, 0x9908b0df
test byte [esp + 0x24], 1
cmovne eax, esi
mov esi, dword [esp + 0x28]
mov dword [edx + 4], eax
cmp esi, 0xe1
je 0x515acd
add ecx, 0xe2
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x30]
and eax, 0x80000000
lea edx, [ebx + ecx*4]
mov dword [esp + 0x30], edx
mov edx, dword [edx + 8]
mov dword [esp + 0x2c], edx
and edx, 0x7fffffff
or eax, edx
mov ecx, eax
shr ecx, 1
mov edx, ecx
mov ecx, dword [esp + 0x30]
xor edx, dword [ecx + 0x638]
mov ecx, edx
xor ecx, 0x9908b0df
test al, 1
cmovne edx, ecx
mov ecx, dword [esp + 0x30]
cmp esi, 0xe2
mov dword [ecx + 4], edx
je 0x515acd
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
lea edx, [ebx + ecx*4]
and eax, 0x80000000
mov esi, dword [edx + 8]
and esi, 0x7fffffff
or eax, esi
mov ecx, eax
shr eax, 1
xor eax, dword [edx + 0x638]
mov esi, eax
xor esi, 0x9908b0df
and ecx, 1
cmovne eax, esi
mov dword [edx + 4], eax
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x515df3
mov ecx, dword [esp + 0x4c]
mov edx, dword [ecx + 0x394]
mov esi, dword [ecx + 0x390]
mov eax, edx
mov edx, esi
and edx, 0x80000000
mov dword [esp + 0x30], eax
and eax, 0x7fffffff
or edx, eax
mov eax, dword [ecx + 4]
mov ebx, edx
shr ebx, 1
xor eax, ebx
mov ebx, eax
xor ebx, 0x9908b0df
and edx, 1
cmovne eax, ebx
cmp dword [esp + 0x3c], 1
mov dword [ecx + 0x390], eax
je 0x515dde
mov edx, dword [esp + 0x30]
mov esi, dword [ecx + 0x398]
and edx, 0x80000000
mov eax, edx
mov edx, esi
and edx, 0x7fffffff
or eax, edx
mov edx, eax
shr edx, 1
xor edx, dword [ecx + 8]
mov ebx, edx
xor ebx, 0x9908b0df
test al, 1
cmovne edx, ebx
cmp dword [esp + 0x3c], 2
mov dword [ecx + 0x394], edx
je 0x515e2e
mov eax, dword [ecx + 0x39c]
mov dword [esp + 0x2c], 0x189
mov dword [esp + 0x30], 0xe6
mov edx, eax
mov eax, esi
and eax, 0x80000000
and edx, 0x7fffffff
or edx, eax
mov eax, edx
shr eax, 1
xor eax, dword [ecx + 0xc]
mov esi, eax
xor esi, 0x9908b0df
and edx, 1
cmovne eax, esi
mov dword [ecx + 0x398], eax
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x34]
xor eax, eax
mov esi, dword [esp + 0x44]
xor edx, edx
lea esi, [esi]
movdqa xmm1, xmmword [edi + eax]
add edx, 1
movdqu xmm0, xmmword [ebx + eax]
pand xmm1, xmm6
pand xmm0, xmm5
movdqu xmm7, xmmword [esi + eax]
por xmm0, xmm1
movdqa xmm1, xmm0
pand xmm0, xmm4
psrld xmm1, 1
pxor xmm1, xmm7
pcmpeqd xmm0, xmm2
movdqa xmm7, xmm1
pand xmm1, xmm0
pxor xmm7, xmm3
pandn xmm0, xmm7
por xmm0, xmm1
movaps xmmword [edi + eax], xmm0
add eax, 0x10
cmp edx, ecx
jb 0x515bc0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x34], ebx
mov dword [esp + 0x44], esi
add ecx, eax
cmp dword [esp + 0x1c], eax
mov edx, eax
not edx
mov dword [esp + 0x30], edx
je 0x515d0c
mov ebx, dword [esp + 0x4c]
lea esi, [ecx + 1]
mov dword [esp + 0x28], esi
lea edx, [ebx + ecx*4]
mov eax, dword [edx + 8]
mov esi, dword [edx + 4]
mov dword [esp + 0x24], eax
and esi, 0x80000000
and eax, 0x7fffffff
or eax, esi
mov dword [esp + 0x20], eax
shr eax, 1
xor eax, dword [edx - 0x388]
mov esi, eax
xor esi, 0x9908b0df
test byte [esp + 0x20], 1
cmovne eax, esi
mov esi, dword [esp + 0x2c]
add esi, dword [esp + 0x30]
mov dword [edx + 4], eax
mov dword [esp + 0x30], esi
je 0x515d0c
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
add ecx, 2
lea edx, [ebx + edx*4]
and eax, 0x80000000
mov esi, edx
mov edx, dword [edx + 8]
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edx
and edx, 0x7fffffff
or edx, eax
mov eax, edx
shr eax, 1
xor eax, dword [esi - 0x388]
mov esi, eax
xor esi, 0x9908b0df
and edx, 1
cmovne eax, esi
cmp dword [esp + 0x30], 1
mov esi, dword [esp + 0x28]
mov dword [esi + 4], eax
je 0x515d0c
lea edx, [ebx + ecx*4]
mov eax, dword [esp + 0x2c]
mov ebx, dword [edx + 8]
and eax, 0x80000000
and ebx, 0x7fffffff
or eax, ebx
mov ecx, eax
shr eax, 1
xor eax, dword [edx - 0x388]
mov ebx, eax
xor ebx, 0x9908b0df
and ecx, 1
cmovne eax, ebx
mov dword [edx + 4], eax
mov ecx, dword [esp + 0x4c]
mov eax, dword [ecx + 0x9c0]
mov edx, eax
mov eax, dword [ecx + 4]
and edx, 0x80000000
mov dword [esp + 0x30], eax
and eax, 0x7fffffff
or edx, eax
mov eax, edx
shr eax, 1
xor eax, dword [ecx + 0x634]
mov ebx, eax
xor ebx, 0x9908b0df
and edx, 1
mov edx, 1
cmovne eax, ebx
mov dword [ecx + 0x9c0], eax
xor eax, eax
jmp 0x51582c
xor eax, eax
mov edx, 1
lock cmpxchg dword [0x73d6c0], edx
jne 0x515e43
mov edi, dword [esp + 0x40]
cmp dword [esp + 0x48], edi
jne 0x515772
mov eax, 1
xor edx, edx
lock cmpxchg dword [0x73d6c0], edx
je 0x515d94
mov ecx, 0x73d6c0
call fcn.004b6900
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8
cmp dword [esp + 0x4c], 0x73d700
je 0x515d79
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov dword [esp + 0x28], 0xe1
mov dword [esp + 0x2c], 2
jmp 0x51595c
mov dword [esp + 0x28], 0xe2
mov dword [esp + 0x2c], 1
jmp 0x51595c
mov dword [esp + 0x2c], 0x18b
mov dword [esp + 0x30], 0xe4
jmp 0x515ba9
mov dword [esp + 0x2c], 0x18c
mov dword [esp + 0x30], 0xe3
jmp 0x515ba9
mov dword [esp + 0x28], 0xe3
mov dword [esp + 0x2c], 0
jmp 0x51595c
lea esp, [ebp - 0xc]
mov ecx, 0x73d6c8
pop ebx
pop esi
pop edi
pop ebp
jmp fcn.00515e60
mov dword [esp + 0x2c], 0x18a
mov dword [esp + 0x30], 0xe5
jmp 0x515ba9
mov ecx, 0x73d6c0
call fcn.004b67b0
jmp 0x515d6b