Function at 0x40a130
Capabilities:
Get thread local storage value
Query or enumerate registry value
Set registry value

Disassembly:
push 0xffffffffffffffff
push 0x45b751
mov eax, dword fs:[0]
push eax
sub esp, 0x444
mov eax, dword [0x473354]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x473354]
xor eax, esp
push eax
lea eax, [esp + 0x458]
mov dword fs:[0], eax
mov ebx, dword [esp + 0x468]
mov dword [esp + 0x460], 0
push 1
call fcn.0042f396
mov dword [esp + 0x20], eax
mov byte [eax], 0
mov edi, 0x400
push edi
mov byte [esp + 0x468], 2
call fcn.0042f396
mov ecx, dword [0x4746a8]
mov ebp, dword [esp + 0x474]
add esp, 8
mov esi, eax
lea eax, [esp + 0x18]
push eax
push ecx
mov byte [esp + 0x1f], 1
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
or eax, 0x20019
push eax
push 0
push ebp
push ebx
call fcn.00409f10
mov ebp, eax
add esp, 0x14
test ebp, ebp
je 0x40a207
mov edx, dword [esp + 0x1c]
push edx
call fcn.0042f4d9
mov eax, dword [esp + 0x470]
push eax
call fcn.0042f4d9
mov ecx, dword [esp + 0x478]
push ecx
call fcn.0042f4d9
add esp, 0xc
mov eax, ebp
jmp 0x40a544
mov edx, dword [esp + 0x18]
push edx
call fcn.00404150
mov ecx, dword [0x4746a8]
mov ebp, dword [esp + 0x474]
add esp, 4
push 0
mov dword [esp + 0x34], eax
lea eax, [esp + 0x2c]
push eax
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
or eax, 0x20006
push eax
push 0
push 0
push 0
push ebp
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
mov ebp, eax
test ebp, ebp
jne 0x40a1d9
mov byte [esp + 0x54], al
mov dword [esp + 0x20], ebp
cmp byte [esp + 0x17], 0
jne 0x40a28a
mov eax, dword [esp + 0x38]
cmp eax, 0xffffffff
jne 0x40a26f
mov dword [esp + 0x20], 0
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
push edx
push esi
push eax
push 0
lea eax, [esp + 0x64]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
jmp 0x40a28f
mov byte [esp + 0x17], 0
lea edx, [esp + 0x20]
push edx
push esi
lea eax, [esp + 0x40]
push eax
mov eax, dword [esp + 0x24]
push 0
lea ecx, [esp + 0x44]
push ecx
lea edx, [esp + 0x68]
push edx
push ebp
push eax
mov dword [esp + 0x54], 0x400
mov dword [esp + 0x40], edi
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
inc ebp
mov dword [esp + 0x24], ebp
cmp eax, 0xea
jne 0x40a319
dec ebp
jmp 0x40a2d0
mov eax, dword [esp + 0x20]
add eax, 0x400
push eax
push esi
mov dword [esp + 0x28], eax
mov edi, eax
call fcn.0042f567
add esp, 8
lea ecx, [esp + 0x20]
push ecx
mov esi, eax
push esi
lea edx, [esp + 0x40]
push edx
mov edx, dword [esp + 0x24]
push 0
lea eax, [esp + 0x44]
push eax
lea ecx, [esp + 0x68]
push ecx
push ebp
push edx
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
cmp eax, 0xea
je 0x40a2d0
mov ebp, dword [esp + 0x24]
test eax, eax
je 0x40a257
push 1
call fcn.0042f396
mov edi, eax
mov dword [esp + 0x4c], edi
mov byte [edi], 0
push 1
call fcn.0042f396
mov ebp, eax
mov dword [esp + 0x44], ebp
mov byte [ebp], 0
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x24]
push eax
push 0
push ecx
mov byte [esp + 0x474], 4
mov dword [esp + 0x38], 0
call fcn.00416b90
mov esi, eax
add esp, 0x14
cmp esi, 0x103
je 0x40a4a9
test esi, esi
jne 0x40a4a9
lea edx, [esp + 0x46c]
push edx
mov eax, 0x460cb4
lea ecx, [esp + 0x54]
call fcn.004068d0
lea ecx, [esp + 0x20]
push ecx
lea esi, [esp + 0x4c]
call fcn.004068a0
mov eax, dword [eax]
push eax
mov esi, edi
call fcn.0042f484
mov edi, eax
push esi
mov dword [esp + 0x58], edi
call fcn.0042f4d9
mov edx, dword [esp + 0x54]
push edx
call fcn.0042f4d9
mov eax, dword [esp + 0x64]
push eax
call fcn.0042f4d9
lea ecx, [esp + 0x488]
push ecx
mov eax, 0x460cb4
lea ecx, [esp + 0x48]
call fcn.004068d0
lea edx, [esp + 0x38]
push edx
lea esi, [esp + 0x60]
call fcn.004068a0
mov eax, dword [eax]
push eax
mov esi, ebp
call fcn.0042f484
mov ebp, eax
push esi
mov dword [esp + 0x64], ebp
call fcn.0042f4d9
mov eax, dword [esp + 0x68]
push eax
call fcn.0042f4d9
mov ecx, dword [esp + 0x58]
push ecx
call fcn.0042f4d9
add esp, 0x2c
mov dword [esp + 0x50], esp
mov esi, esp
push ebp
call fcn.0042f484
mov dword [esi], eax
mov dword [esp + 0x54], esp
mov esi, esp
push edi
call fcn.0042f484
add esp, 4
push ebx
mov dword [esi], eax
call fcn.0040a130
mov edx, dword [esp + 0x24]
add esp, 0xc
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [0x4746a8]
mov esi, dword [esp + 0x46c]
lea eax, [esp + 0x18]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
or eax, 0x20019
push eax
push 0
push esi
push ebx
call fcn.00409f10
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x40a4a9
mov eax, dword [esp + 0x24]
inc eax
lea edx, [esp + 0x1c]
push edx
push eax
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x20]
push eax
call fcn.00416b90
mov esi, eax
add esp, 0xc
cmp esi, 0x103
jne 0x40a374
mov edx, dword [esp + 0x30]
lea ecx, [esp + 0x28]
push ecx
push edx
push 0
push 0
call fcn.004041b0
mov ecx, dword [0x4746a8]
mov eax, dword [esp + 0x47c]
add esp, 0x10
push ecx
mov dword [esp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [esp + 0x2c]
push eax
push edx
push ebx
call fcn.00404200
mov eax, dword [esp + 0x24]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add esp, 0xc
push eax
call ebx
mov ecx, dword [esp + 0x28]
push ecx
call ebx
mov edx, dword [esp + 0x30]
push edx
call fcn.0042f4d9
push ebp
call fcn.0042f4d9
push edi
call fcn.0042f4d9
mov eax, dword [esp + 0x28]
push eax
call fcn.0042f4d9
mov ecx, dword [esp + 0x47c]
push ecx
call fcn.0042f4d9
mov edx, dword [esp + 0x484]
push edx
call fcn.0042f4d9
mov eax, esi
sub eax, 0x103
add esp, 0x18
neg eax
sbb eax, eax
and eax, esi
mov ecx, dword [esp + 0x458]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
xor ecx, esp
call fcn.00430430
add esp, 0x450
ret