Function at 0x402380
Capabilities:
Encode data using xor
Generate random numbers using a mersenne twister

Disassembly:
mov eax, 0x139c
call fcn.0040dc60
push ebx
mov ebx, dword [esp + 0x13a8]
push edi
mov edi, dword [esp + 0x13a8]
cmp edi, ebx
jl 0x4023a9
mov eax, edi
pop edi
pop ebx
add esp, 0x139c
ret
call fcn.0040d18f
mov dword [esp + 0x13a0], 0xffffffff
mov edx, 1
mov dword [esp + 0x20], eax
mov ecx, eax
shr ecx, 0x1e
xor ecx, eax
imul eax, ecx, 0x6c078965
add eax, edx
mov dword [esp + edx*4 + 0x20], eax
inc edx
cmp edx, 0x270
jb 0x4023c2
lea eax, [esp + 0x1c]
mov dword [esp + 0x14], 0x20
cmp edi, 0x80000000
mov dword [esp + 0x10], eax
lea eax, [edi - 0x80000000]
mov dword [esp + 0x18], 0xffffffff
push ebp
lea ecx, [edi - 0x80000000]
cmovae ecx, eax
lea ebp, [ebx - 0x80000000]
cmp ebx, 0x80000000
mov dword [esp + 0x10], ecx
lea eax, [ebx - 0x80000000]
cmovae ebp, eax
push esi
sub ebp, ecx
mov esi, 0x270
mov dword [esp + 0x24], esi
cmp ebp, 0xffffffff
jne 0x402446
lea ecx, [esp + 0x18]
call fcn.004038a0
mov edx, eax
jmp 0x4025f8
lea ebx, [ebp + 1]
mov dword [esp + 0x10], ebx
jmp 0x402453
lea ebx, [ebp + 1]
xor edi, edi
xor eax, eax
test ebp, ebp
je 0x4025d4
cmp esi, 0x270
jne 0x4024b2
lea eax, [esp + 0x2c]
nop dword [eax + eax]
mov edx, dword [eax - 4]
lea eax, [eax + 4]
xor edx, dword [eax - 4]
and edx, 0x7fffffff
xor edx, dword [eax - 8]
mov ecx, edx
and cl, 1
movzx ecx, cl
neg ecx
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [eax + 0x62c]
xor ecx, edx
mov dword [eax + 0x9b8], ecx
sub esi, 1
jne 0x402470
mov esi, dword [esp + 0x24]
jmp 0x40259b
cmp esi, 0x4e0
jb 0x40259b
mov eax, dword [esp + 0x9e8]
lea edi, [esp + 0x9e8]
mov ebx, 0xe3
mov ecx, eax
lea edx, [edi + 4]
xor ecx, dword [edx]
and ecx, 0x7fffffff
xor ecx, eax
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, dword [edi + 0x634]
xor eax, ecx
mov dword [edi - 0x9c0], eax
lea edi, [edx]
mov eax, dword [edx]
sub ebx, 1
jne 0x4024d1
mov eax, dword [esp + 0xd74]
lea edi, [esp + 0xd74]
mov ebx, 0x18c
nop dword [eax]
mov ecx, eax
lea edx, [edi + 4]
xor ecx, dword [edx]
and ecx, 0x7fffffff
xor ecx, eax
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, dword [edi - 0xd4c]
xor eax, ecx
mov dword [edi - 0x9c0], eax
lea edi, [edx]
mov eax, dword [edx]
sub ebx, 1
jne 0x402520
mov ecx, dword [esp + 0x13a4]
lea ebx, [ebp + 1]
xor ecx, dword [esp + 0x28]
and ecx, 0x7fffffff
xor ecx, dword [esp + 0x13a4]
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, ecx
xor eax, dword [esp + 0x658]
xor esi, esi
mov dword [esp + 0x9e4], eax
mov dword [esp + 0x24], esi
mov ecx, dword [esp + esi*4 + 0x28]
mov eax, ecx
shr eax, 0xb
inc esi
and eax, dword [esp + 0x13a8]
xor ecx, eax
mov dword [esp + 0x24], esi
mov eax, ecx
and eax, 0xff3a58ad
shl eax, 7
xor ecx, eax
mov eax, ecx
and eax, 0xffffdf8c
shl eax, 0xf
xor ecx, eax
mov edi, ecx
shr edi, 0x12
xor edi, ecx
or eax, 0xffffffff
xor edx, edx
div ebx
mov ecx, eax
mov ebx, edx
xor edx, edx
mov eax, edi
div dword [esp + 0x10]
cmp eax, ecx
jb 0x4025f0
cmp ebx, ebp
jne 0x402450
mov eax, edi
xor edx, edx
div dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
add ecx, edx
pop esi
pop ebp
cmp ecx, 0x80000000
lea edx, [ecx - 0x80000000]
lea eax, [ecx - 0x80000000]
pop edi
cmovae eax, edx
pop ebx
add esp, 0x139c
ret