Function at 0x477f80
Capabilities:
Encode data using xor
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0xa4
mov eax, dword [ebp + 0xc]
cmp dword [eax + 4], 1
push ebx
push esi
push edi
mov edi, ecx
mov dword [esp + 0x18], edi
jl 0x47861f
mov ecx, dword [edi + 0xa4]
mov edx, dword [ebp + 8]
mov esi, dword [edi + 0xa4]
mov eax, dword [edi + 0xa8]
lea ebx, [edi + 0xa0]
mov dword [esp + 0x40], ecx
mov ecx, dword [edx + 4]
add esi, ecx
and eax, 0x3fffffff
cmp eax, esi
mov dword [esp + 0x44], ecx
jge 0x477feb
add eax, eax
cmp esi, eax
jl 0x477fdb
mov eax, esi
push 0x10
push eax
push ebx
call fcn.004026b0
mov ecx, dword [esp + 0x50]
add esp, 0xc
mov dword [ebx + 4], esi
mov eax, dword [edi + 0xb0]
mov edx, dword [edi + 0xbc]
mov dword [esp + 0x64], eax
mov eax, dword [edi + 0xc8]
lea esi, [edi + 0xac]
mov dword [esp + 0x6c], eax
mov eax, dword [esi + 8]
add ecx, ecx
mov dword [esp + 0x68], edx
mov edx, dword [esi + 4]
lea ebx, [ecx + edx]
and eax, 0x3fffffff
cmp eax, ebx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], ecx
jge 0x47804a
add eax, eax
cmp ebx, eax
jl 0x478036
mov eax, ebx
push 4
push eax
push esi
call fcn.004026b0
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x28]
add esp, 0xc
mov eax, dword [esi]
mov dword [esi + 4], ebx
lea edx, [eax + edx*4]
mov eax, dword [edi + 0xc0]
lea esi, [edi + 0xb8]
mov dword [esp + 0x54], edx
mov edx, dword [esi + 4]
lea ebx, [edx + ecx]
and eax, 0x3fffffff
cmp eax, ebx
mov dword [esp + 0x1c], edx
jge 0x478091
add eax, eax
cmp ebx, eax
jl 0x47807d
mov eax, ebx
push 4
push eax
push esi
call fcn.004026b0
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x28]
add esp, 0xc
mov eax, dword [esi]
mov dword [esi + 4], ebx
lea edx, [eax + edx*4]
mov eax, dword [edi + 0xcc]
lea esi, [edi + 0xc4]
mov dword [esp + 0x58], edx
mov edx, dword [esi + 4]
lea ebx, [edx + ecx]
and eax, 0x3fffffff
cmp eax, ebx
mov dword [esp + 0x14], edx
jge 0x4780d4
add eax, eax
cmp ebx, eax
jl 0x4780c4
mov eax, ebx
push 4
push eax
push esi
call fcn.004026b0
mov edx, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [esi]
fldz
mov dword [esi + 4], ebx
xor esi, esi
cmp dword [esp + 0x44], esi
lea ecx, [eax + edx*4]
mov dword [esp + 0x5c], ecx
jle 0x47844a
mov eax, dword [esp + 0x40]
fld qword [0x4b9f08]
mov ebx, dword [esp + 0x58]
mov edx, dword [esp + 0x58]
mov dword [esp + 0x14], eax
shl eax, 4
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x54]
sub ebx, eax
mov dword [esp + 0x60], ebx
mov ebx, dword [esp + 0x5c]
sub ebx, eax
lea ecx, [eax + 4]
mov eax, dword [esp + 0x5c]
add edx, 6
sub eax, dword [esp + 0x58]
mov dword [esp + 0x1c], esi
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], eax
jmp 0x478139
fxch st(1)
mov eax, dword [ebp + 0xc]
mov ebx, dword [eax]
add ebx, dword [esp + 0x1c]
fld dword [ebx]
fadd dword [edi + 0x40]
fstp dword [esp + 0x30]
fld dword [ebx + 4]
fadd dword [edi + 0x44]
fstp dword [esp + 0x34]
fld dword [ebx + 8]
fadd dword [edi + 0x48]
fstp dword [esp + 0x38]
fld dword [esp + 0x30]
fmul dword [edi + 0x60]
fstp dword [esp + 0x30]
fld dword [esp + 0x34]
fmul dword [edi + 0x64]
fstp dword [esp + 0x34]
fld dword [edi + 0x68]
fmul dword [esp + 0x38]
fstp dword [esp + 0x38]
fld dword [esp + 0x30]
fld dword [0x4c59c0]
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 0x41
je 0x478199
fst dword [esp + 0x30]
fld dword [esp + 0x34]
fld dword [0x4c59c4]
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 0x41
je 0x4781b2
fst dword [esp + 0x34]
fld dword [esp + 0x38]
fld dword [0x4c59c8]
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 0x41
je 0x4781cb
fst dword [esp + 0x38]
fxch st(4)
fcom dword [esp + 0x30]
fnstsw ax
test ah, 5
jnp 0x4781dc
fst dword [esp + 0x30]
fcom dword [esp + 0x34]
fnstsw ax
test ah, 5
jnp 0x4781eb
fst dword [esp + 0x34]
fcom dword [esp + 0x38]
fnstsw ax
test ah, 5
jnp 0x4781fa
fst dword [esp + 0x38]
fld dword [esp + 0x30]
fadd st(4)
fstp dword [esp + 0x30]
mov eax, dword [esp + 0x30]
fld dword [esp + 0x34]
shr eax, 7
fadd st(4)
mov word [esp + 0x70], ax
fstp dword [esp + 0x34]
mov eax, dword [esp + 0x34]
fld dword [esp + 0x38]
shr eax, 7
fadd st(4)
mov word [esp + 0x72], ax
fstp dword [esp + 0x38]
mov eax, dword [esp + 0x38]
fld dword [ebx + 0x10]
shr eax, 7
fadd dword [edi + 0x50]
mov word [esp + 0x74], ax
fstp dword [esp + 0x20]
fld dword [ebx + 0x14]
fadd dword [edi + 0x54]
fstp dword [esp + 0x24]
fld dword [ebx + 0x18]
fadd dword [edi + 0x58]
fstp dword [esp + 0x28]
fld dword [esp + 0x20]
fmul dword [edi + 0x60]
fstp dword [esp + 0x20]
fld dword [esp + 0x24]
fmul dword [edi + 0x64]
fstp dword [esp + 0x24]
fld dword [edi + 0x68]
fmul dword [esp + 0x28]
fstp dword [esp + 0x28]
fld dword [esp + 0x20]
fcomp st(3)
fnstsw ax
test ah, 5
jnp 0x478290
fxch st(2)
fstp dword [esp + 0x20]
jmp 0x478292
fstp st(2)
fld dword [esp + 0x24]
fcomp st(1)
fnstsw ax
test ah, 5
jnp 0x4782a5
fstp dword [esp + 0x24]
jmp 0x4782a7
fstp st(0)
fld dword [esp + 0x28]
fcomp st(3)
fnstsw ax
test ah, 5
jnp 0x4782bc
fxch st(2)
fstp dword [esp + 0x28]
jmp 0x4782be
fstp st(2)
fxch st(1)
fcom dword [esp + 0x20]
fnstsw ax
test ah, 5
jnp 0x4782cf
fst dword [esp + 0x20]
fcom dword [esp + 0x24]
fnstsw ax
test ah, 5
jnp 0x4782de
fst dword [esp + 0x24]
fcom dword [esp + 0x28]
fnstsw ax
test ah, 5
jnp 0x4782ed
fst dword [esp + 0x28]
fld dword [esp + 0x20]
add dword [esp + 0x1c], 0x20
fadd st(2)
add esi, 1
add ecx, 8
add edx, 8
fstp dword [esp + 0x20]
mov eax, dword [esp + 0x20]
fld dword [esp + 0x24]
shr eax, 7
fadd st(2)
movzx eax, ax
or eax, 1
mov dword [esp + 0x90], eax
fstp dword [esp + 0x24]
mov edi, dword [esp + 0x24]
fld dword [esp + 0x28]
shr edi, 7
movzx eax, di
fadd st(2)
mov edi, dword [esp + 0x18]
fstp dword [esp + 0x28]
mov ebx, dword [esp + 0x28]
shr ebx, 7
mov word [esp + 0xa4], bx
mov ebx, dword [esp + 0x70]
and ebx, 0xfffe
or eax, 1
mov dword [esp + 0x80], ebx
mov ebx, dword [esp + 0x72]
mov dword [esp + 0x94], eax
movzx eax, word [esp + 0xa4]
and ebx, 0xfffe
or eax, 1
mov dword [esp + 0x84], ebx
mov ebx, dword [esp + 0x74]
add edi, 0xa0
mov edi, dword [edi]
mov dword [esp + 0x98], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax + esi*4 - 4]
and ebx, 0xfffe
mov dword [esp + 0x88], ebx
mov ebx, dword [esp + 0x50]
mov dword [ebx + edi + 0xc], eax
mov edi, dword [esp + 0x14]
mov dword [eax], edi
mov ax, word [esp + 0x80]
mov ebx, dword [esp + 0x60]
mov word [ecx - 0xc], ax
movzx eax, di
movzx edi, word [esp + 0x90]
mov word [ecx - 0xa], ax
mov word [ecx - 8], di
movzx edi, word [esp + 0x84]
add dword [esp + 0x50], 0x10
add dword [esp + 0x14], 1
cmp esi, dword [esp + 0x44]
mov word [ecx - 6], ax
mov word [edx - 0xe], di
movzx edi, word [esp + 0x94]
mov word [edx - 0xc], ax
mov word [ebx + ecx - 8], di
mov edi, dword [esp + 0x5c]
mov bx, word [esp + 0x88]
mov word [edx - 8], ax
mov word [edi + esi*8 - 8], bx
mov ebx, dword [esp + 0x48]
mov word [edi + esi*8 - 6], ax
movzx edi, word [esp + 0x98]
mov word [ebx + ecx - 8], di
mov edi, dword [esp + 0x4c]
mov word [edi + edx - 8], ax
mov edi, dword [esp + 0x18]
jl 0x478137
fstp st(0)
mov ecx, dword [edi + 0xa0]
fstp st(0)
mov dword [esp + 0x48], ecx
xor esi, esi
mov ebx, dword [esp + 0x44]
add ebx, ebx
cmp ebx, 1
mov byte [esp + 0x4c], 0
jle 0x478480
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + esi*4 + 0x54]
push edx
lea eax, [ebx - 1]
push eax
push 0
push ecx
call fcn.004791d0
add esp, 0x10
add esi, 1
cmp esi, 3
jl 0x478458
mov edx, dword [0x4c6060]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, dword [esp + 0x64]
mov edx, dword [eax + 0x20]
lea ecx, [ecx*4 + 0x10]
and ecx, 0xfffffff0
lea esi, [edx + ecx]
cmp esi, dword [eax + 0x2c]
ja 0x4784b7
mov dword [eax + 0x20], esi
mov dword [esp + 0x14], edx
jmp 0x4784c5
mov edx, dword [eax]
push ecx
mov ecx, eax
mov eax, dword [edx + 0x14]
call eax
mov dword [esp + 0x14], eax
lea eax, [edi + 0xac]
xor esi, esi
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + esi*4 + 0x64]
mov eax, dword [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x1c]
push esi
push ebx
push edx
push eax
call fcn.00472140
add dword [esp + 0x18], 0xc
add esi, 1
cmp esi, 3
jl 0x4784d1
mov ecx, dword [0x4c6060]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, dword [esp + 0x14]
cmp ecx, dword [eax + 0x28]
mov dword [eax + 0x20], ecx
jne 0x47851b
mov edx, dword [eax]
push ecx
mov ecx, eax
mov eax, dword [edx + 0x18]
call eax
mov eax, dword [edi + 0xd0]
test eax, eax
je 0x478559
xor ecx, ecx
test eax, eax
jle 0x478559
xor edx, edx
lea ecx, [ecx]
mov eax, dword [edi + 0xd8]
movzx eax, word [eax + edx]
shl eax, 4
add eax, dword [edi + 0xa0]
add ecx, 1
add word [eax + 4], bx
add word [eax + 6], bx
add edx, 0x10
cmp ecx, dword [edi + 0xd0]
jl 0x478530
mov ebx, dword [edi + 0xa4]
mov ecx, dword [0x4c6060]
mov esi, ebx
push ecx
sar esi, 3
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sar ebx, 5
lea edx, [ebx*4 + 0x30]
mov ebx, dword [eax + 0x20]
and edx, 0xfffffff0
lea ecx, [ebx + edx]
cmp ecx, dword [eax + 0x2c]
ja 0x47858e
mov dword [eax + 0x20], ecx
jmp 0x47859a
mov ebx, dword [eax]
push edx
mov edx, dword [ebx + 0x14]
mov ecx, eax
call edx
mov ebx, eax
sar esi, 4
mov ecx, ebx
js 0x4785ba
fldz
mov eax, ecx
fst dword [eax]
add ecx, 0x10
sub esi, 1
fst dword [eax + 4]
fst dword [eax + 8]
fst dword [eax + 0xc]
jns 0x4785a3
fstp st(0)
mov eax, dword [esp + 0x44]
test eax, eax
jle 0x4785ee
mov edx, dword [esp + 0x40]
mov dword [esp + 0x40], eax
lea ebx, [ebx]
mov ecx, edx
and ecx, 0x1f
mov esi, 1
shl esi, cl
mov eax, edx
sar eax, 5
add edx, 1
xor dword [ebx + eax*4], esi
sub dword [esp + 0x40], 1
jne 0x4785d0
push ecx
mov eax, esp
mov byte [eax], 1
mov eax, dword [ebp + 0x10]
push eax
push ebx
mov ecx, edi
call fcn.004774e0
mov ecx, dword [0x4c6060]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp ebx, dword [eax + 0x28]
mov dword [eax + 0x20], ebx
jne 0x47861f
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x18]
push ebx
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc