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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x24
push ebx
push esi
mov esi, dword [ecx + 0xa4]
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi + 4]
mov dword [esp + 0x1c], ecx
mov ecx, dword [0x4c6060]
mov ebx, esi
push ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], esi
sar ebx, 3
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sar esi, 5
lea edx, [esi*4 + 0x30]
mov esi, dword [eax + 0x20]
and edx, 0xfffffff0
lea ecx, [esi + edx]
cmp ecx, dword [eax + 0x2c]
ja 0x478683
mov dword [eax + 0x20], ecx
jmp 0x47868f
mov esi, dword [eax]
push edx
mov edx, dword [esi + 0x14]
mov ecx, eax
call edx
mov esi, eax
sar ebx, 4
mov ecx, esi
js 0x4786af
fldz
mov eax, ecx
fst dword [eax]
add ecx, 0x10
sub ebx, 1
fst dword [eax + 4]
fst dword [eax + 8]
fst dword [eax + 0xc]
jns 0x478698
fstp st(0)
xor edx, edx
cmp dword [esp + 0x14], edx
jle 0x4786d9
mov eax, dword [edi]
mov ecx, dword [eax + edx*4]
mov ecx, dword [ecx]
mov eax, ecx
and ecx, 0x1f
mov ebx, 1
shl ebx, cl
sar eax, 5
add edx, 1
xor dword [esi + eax*4], ebx
cmp edx, dword [esp + 0x14]
jl 0x4786b7
mov edx, dword [ebp + 0xc]
mov ebx, dword [esp + 0x1c]
push ecx
mov eax, esp
push edx
push esi
mov ecx, ebx
mov byte [eax], 0
call fcn.004774e0
mov eax, dword [0x4c6060]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp esi, dword [eax + 0x28]
mov dword [eax + 0x20], esi
jne 0x47870d
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x18]
push esi
call eax
xor eax, eax
cmp dword [esp + 0x14], eax
mov dword [esp + 0x20], eax
jle 0x47874c
lea esp, [esp]
mov ecx, dword [edi]
mov edx, dword [ecx + eax*4]
mov ecx, dword [edx]
mov edx, dword [ebx + 0xa0]
shl ecx, 4
lea esi, [esp + 0x20]
mov dword [ecx + edx + 0xc], esi
mov ecx, dword [edi]
mov edx, dword [ecx + eax*4]
add eax, 1
cmp eax, dword [esp + 0x14]
mov dword [edx], 0
jl 0x478720
mov eax, dword [0x4c6060]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, dword [esp + 0x18]
mov ebx, dword [eax + 0x20]
lea ecx, [edi*4 + 0x10]
and ecx, 0xfffffff0
lea edx, [ebx + ecx]
cmp edx, dword [eax + 0x2c]
ja 0x47877a
mov dword [eax + 0x20], edx
mov dword [esp + 0x10], ebx
jmp 0x47878a
mov edx, dword [eax]
push ecx
mov ecx, eax
mov eax, dword [edx + 0x14]
call eax
mov ebx, eax
mov dword [esp + 0x10], eax
add edi, 0xffffffff
xor esi, esi
test edi, edi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x18], edi
jl 0x47886c
mov ecx, edi
shl ecx, 4
xor edx, edx
jmp 0x4787b0
mov eax, dword [esp + 0x1c]
mov eax, dword [eax + 0xa0]
lea ebx, [esp + 0x20]
cmp dword [ecx + eax + 0xc], ebx
jne 0x4787de
mov ebx, dword [esp + 0x10]
mov dword [ebx + edi*4], 0xffffffff
sub edi, 1
mov dword [esp + 0x18], edi
sub ecx, 0x10
jmp 0x478864
lea edi, [edx + eax + 0xc]
lea ebx, [esp + 0x20]
cmp dword [edi], ebx
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x24], edi
jne 0x478857
mov edi, dword [ecx + eax]
mov dword [edx + eax], edi
mov edi, dword [ecx + eax + 4]
mov dword [edx + eax + 4], edi
mov edi, dword [ecx + eax + 8]
mov dword [edx + eax + 8], edi
mov edi, dword [ecx + eax + 0xc]
mov dword [edx + eax + 0xc], edi
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
mov dword [ebx + edi*4], esi
mov dword [ebx + esi*4], 0xffffffff
mov eax, dword [eax]
test al, 1
jne 0x478836
sub edi, 1
mov dword [eax], esi
mov dword [esp + 0x18], edi
sub ecx, 0x10
jmp 0x47885e
mov ebx, dword [esp + 0x1c]
mov ebx, dword [ebx + 0xd8]
and eax, 0xfffffffe
sub edi, 1
mov word [eax + ebx], si
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x18], edi
sub ecx, 0x10
jmp 0x47885e
mov edi, dword [esp + 0x18]
mov dword [ebx + esi*4], esi
add esi, 1
add edx, 0x10
cmp esi, edi
jle 0x4787b0
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 0xa8]
lea ecx, [edi + 1]
lea edi, [esi + 0xa0]
and eax, 0x3fffffff
cmp eax, ecx
mov dword [esp + 0x18], ecx
jge 0x4788a4
add eax, eax
cmp ecx, eax
jl 0x478894
mov eax, ecx
push 0x10
push eax
push edi
call fcn.004026b0
mov ecx, dword [esp + 0x24]
add esp, 0xc
mov dword [edi + 4], ecx
mov edx, dword [edi]
lea ecx, [esp + 0x28]
push ecx
push 0
push edx
lea ecx, [esi + 0xac]
call fcn.00472bf0
mov ecx, dword [edi]
lea eax, [esp + 0x28]
push eax
push 1
push ecx
lea ecx, [esi + 0xb8]
call fcn.00472bf0
mov eax, dword [edi]
lea edx, [esp + 0x28]
push edx
push 2
push eax
lea ecx, [esi + 0xc4]
call fcn.00472bf0
mov eax, dword [esi + 0xd0]
xor ecx, ecx
cmp eax, ecx
je 0x478965
mov edx, dword [esp + 0x14]
add edx, edx
cmp eax, ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x18], ecx
jle 0x478965
mov dword [esp + 0x1c], ecx
mov ecx, dword [esi + 0xd8]
add ecx, dword [esp + 0x1c]
movzx eax, word [ecx]
shl eax, 4
add eax, dword [esi + 0xa0]
sub word [eax + 4], dx
sub word [eax + 6], dx
xor eax, eax
cmp dword [ecx + 8], eax
jle 0x47894d
lea ecx, [ecx]
mov edx, dword [ecx + 4]
movzx edi, word [edx + eax*2]
mov di, word [ebx + edi*4]
lea edx, [edx + eax*2]
add eax, 1
mov word [edx], di
cmp eax, dword [ecx + 8]
jl 0x478930
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x18]
add dword [esp + 0x1c], 0x10
add eax, 1
cmp eax, dword [esi + 0xd0]
mov dword [esp + 0x18], eax
jl 0x478908
mov eax, dword [0x4c6060]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp ebx, dword [eax + 0x28]
mov dword [eax + 0x20], ebx
jne 0x478983
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 8