Function at 0x4029db
Capabilities:
Allocate thread local storage
Parse pe header
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff910
push ebx
push esi
push edi
lea edi, [ebp - 0x6f0]
xor eax, eax
mov dword [ebp - 0x1c], eax
xor edx, edx
mov dword [ebp - 0x58], edx
xor ebx, ebx
jmp 0x402a02
inc byte [ebx + str.ODMRSXKDR]
inc ebx
cmp byte [ebx + str.ODMRSXKDR], 0
jne 0x4029fb
lea eax, [ebp - 0x28]
push eax
lea edx, [ebp - 0x5c]
push edx
push 0xa
push str.ODMRSXKDR
push dword [ebp + 8]
call fcn.00405644
add esp, 0x14
mov esi, eax
test eax, eax
jne 0x40303c
cmp dword [ebp - 0x28], 0x138
jae 0x402a42
mov esi, 0x1b
jmp 0x40303c
push dword [ebp - 0x28]
push 0
call sub.KERNEL32.DLL_GlobalAlloc
mov dword [ebp - 0x58], eax
test eax, eax
je 0x40303c
push dword [ebp - 0x28]
push dword [ebp - 0x5c]
push dword [ebp - 0x58]
call sub.CC32100.DLL__memmove
add esp, 0xc
xor ebx, ebx
jmp 0x402a73
inc byte [ebx + str.CQ_VHMEN]
inc ebx
cmp byte [ebx + str.CQ_VHMEN], 0
jne 0x402a6c
lea eax, [ebp - 8]
push eax
lea edx, [ebp - 0x5c]
push edx
push 0xa
push str.CQ_VHMEN
push dword [ebp + 8]
call fcn.00405644
add esp, 0x14
mov esi, eax
test eax, eax
jne 0x40303c
cmp dword [ebp - 8], 0x400
je 0x402ab3
mov esi, 0x1b
jmp 0x40303c
push edi
call fcn.004024d2
pop ecx
mov eax, dword [ebp - 0x5c]
mov dl, byte [eax]
mov byte [ebp - 0x4f0], dl
xor ecx, ecx
mov al, byte [edi + ecx]
sub byte [ebp - 0x4f0], al
inc ecx
cmp ecx, 0x200
jb 0x402ac7
mov ecx, 1
mov edx, dword [ebp - 0x5c]
xor eax, eax
mov al, byte [edx + ecx - 1]
xor edx, edx
div ecx
mov eax, dword [ebp - 0x5c]
mov ebx, dword [ebp - 0x5c]
mov bl, byte [ebx + ecx]
mov esi, ecx
and esi, 0x1ff
sub bl, byte [edi + esi]
sub bl, byte [eax + edx]
mov byte [ebp + ecx - 0x4f0], bl
inc ecx
cmp ecx, 0x200
jb 0x402ade
mov esi, dword [ebp - 0x58]
cmp dword [ebp - 0x28], 0
je 0x402b9a
cmp dword [ebp - 0x28], 0x200
jbe 0x402b2d
mov dword [ebp - 8], pe_nt_image_headers32
jmp 0x402b33
mov eax, dword [ebp - 0x28]
mov dword [ebp - 8], eax
mov edx, esi
mov cl, byte [edx]
mov byte [edi], cl
xor ecx, ecx
mov al, byte [ebp + ecx - 0x4f0]
sub byte [edi], al
inc ecx
cmp ecx, 0x200
jb 0x402b3b
mov ecx, 1
cmp ecx, dword [ebp - 8]
jae 0x402b7e
xor eax, eax
mov al, byte [esi + ecx - 1]
xor edx, edx
div ecx
mov eax, ecx
and eax, 0x1ff
mov bl, byte [esi + ecx]
sub bl, byte [ebp + eax - 0x4f0]
sub bl, byte [esi + edx]
mov byte [edi + ecx], bl
inc ecx
cmp ecx, dword [ebp - 8]
jb 0x402b57
push dword [ebp - 8]
push edi
push esi
call sub.CC32100.DLL__memmove
add esp, 0xc
mov eax, dword [ebp - 8]
sub dword [ebp - 0x28], eax
add esi, dword [ebp - 8]
cmp dword [ebp - 0x28], 0
jne 0x402b1b
push 0x40
push dword [ebp - 0x58]
lea edx, [ebp - 0xcc]
push edx
call sub.CC32100.DLL__memmove
add esp, 0xc
movzx ecx, word [ebp - 0xcc]
cmp ecx, 0x5a4d
je 0x402bc7
mov esi, 0x1b
jmp 0x40303c
push 0xf8
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x90]
push eax
lea edx, [ebp - 0x1c4]
push edx
call sub.CC32100.DLL__memmove
add esp, 0xc
cmp dword [ebp - 0x1c4], 0x4550
je 0x402bfb
mov esi, 0x1b
jmp 0x40303c
mov ebx, dword [ebp - 0x190]
push 4
push 0x3000
push dword [ebp - 0x174]
push ebx
call sub.KERNEL32.DLL_VirtualAlloc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x402c34
push 4
push 0x3000
push dword [ebp - 0x174]
push 0
call sub.KERNEL32.DLL_VirtualAlloc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x402c44
mov esi, 0x16
jmp 0x40303c
mov eax, dword [ebp - 0x1c]
sub eax, ebx
mov dword [ebp - 0x50], eax
push 0x40
lea edx, [ebp - 0xcc]
push edx
push dword [ebp - 0x1c]
call sub.CC32100.DLL__memmove
add esp, 0xc
push 0xf8
lea ecx, [ebp - 0x1c4]
push ecx
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x90]
push eax
call sub.CC32100.DLL__memmove
add esp, 0xc
mov edx, dword [ebp - 0x1c]
add edx, dword [ebp - 0x90]
add edx, 0xf8
mov dword [ebp - 0x2c], edx
movzx ecx, word [ebp - 0x1be]
mov dword [ebp - 0x44], ecx
mov edi, dword [ebp - 0x44]
shl edi, 3
lea edi, [edi + edi*4]
mov eax, dword [ebp - 0x18c]
mov dword [ebp - 0x48], eax
push edi
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x90]
add edx, 0xf8
push edx
push dword [ebp - 0x2c]
call sub.CC32100.DLL__memmove
add esp, 0xc
mov esi, dword [ebp - 0x1c]
add esi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x30], eax
xor ebx, ebx
cmp ebx, dword [ebp - 0x44]
jae 0x402d15
mov eax, dword [ebp - 0x30]
push dword [eax + 0x10]
mov edx, dword [ebp - 0x30]
mov ecx, dword [edx + 0x14]
add ecx, dword [ebp - 0x58]
push ecx
push esi
call sub.CC32100.DLL__memmove
add esp, 0xc
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 8]
add eax, dword [ebp - 0x48]
dec eax
xor edx, edx
div dword [ebp - 0x48]
mov edi, eax
imul edi, dword [ebp - 0x48]
add esi, edi
inc ebx
add dword [ebp - 0x30], 0x28
cmp ebx, dword [ebp - 0x44]
jb 0x402cdb
lea eax, [ebp - 0x54]
push eax
push dword [ebp - 0x28]
push dword [ebp - 0x24]
push 1
push dword [ebp - 0x1c]
push dword [ebp + 8]
call fcn.0040267c
add esp, 0x18
mov esi, eax
test eax, eax
jne 0x40303c
cmp dword [ebp - 0x50], 0
je 0x402e59
mov edx, dword [ebp - 0x1c]
add edx, dword [ebp - 0x124]
mov dword [ebp - 0x40], edx
mov ecx, dword [ebp - 0x120]
mov dword [ebp - 0x4c], ecx
mov eax, dword [ebp - 0x50]
shr eax, 0x10
mov word [ebp - 0x5e], ax
mov dx, word [ebp - 0x50]
and dx, 0xffff
mov word [ebp - 0x60], dx
xor ebx, ebx
cmp ebx, dword [ebp - 0x4c]
jae 0x402e59
mov eax, dword [ebp - 0x40]
cmp dword [eax], 0
jne 0x402dab
mov edx, dword [ebp - 0x40]
cmp dword [edx + 4], 0
je 0x402d9c
mov edi, dword [ebp - 0x40]
mov edi, dword [edi + 4]
add edi, 3
shr edi, 2
shl edi, 2
jmp 0x402da1
mov edi, 8
add ebx, edi
add dword [ebp - 0x40], edi
jmp 0x402e50
mov esi, dword [ebp - 0x40]
mov esi, dword [esi]
add esi, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x40]
add eax, 8
mov edx, dword [ebp - 0x40]
mov ecx, dword [edx + 4]
sub ecx, 8
shr ecx, 1
mov dword [ebp - 0x6c], ecx
xor edx, edx
mov dword [ebp - 0x68], edx
mov ecx, dword [ebp - 0x68]
cmp ecx, dword [ebp - 0x6c]
jae 0x402e3c
mov edx, eax
movzx edx, word [edx]
sar edx, 0xc
mov cx, word [eax]
and cx, 0xfff
mov word [ebp - 0x62], cx
sub dx, 1
jb 0x402e2e
je 0x402e08
dec dx
je 0x402e16
dec dx
je 0x402dfc
jmp 0x402e24
movzx edx, word [ebp - 0x62]
mov ecx, dword [ebp - 0x50]
add dword [esi + edx], ecx
jmp 0x402e2e
movzx edx, word [ebp - 0x62]
mov cx, word [ebp - 0x5e]
add word [esi + edx], cx
jmp 0x402e2e
movzx edx, word [ebp - 0x62]
mov cx, word [ebp - 0x60]
add word [esi + edx], cx
jmp 0x402e2e
mov esi, 0x1b
jmp 0x40303c
inc dword [ebp - 0x68]
add eax, 2
mov edx, dword [ebp - 0x68]
cmp edx, dword [ebp - 0x6c]
jb 0x402dd4
mov edi, dword [ebp - 0x40]
mov edi, dword [edi + 4]
add edi, 3
shr edi, 2
shl edi, 2
add ebx, edi
add dword [ebp - 0x40], edi
cmp ebx, dword [ebp - 0x4c]
jb 0x402d7a
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x144]
mov dword [ebp - 0x38], eax
jmp 0x402efc
mov esi, dword [ebp - 0x38]
mov esi, dword [esi + 0xc]
add esi, dword [ebp - 0x1c]
push esi
call sub.KERNEL32.DLL_GetModuleHandleA
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x402e8c
mov esi, 0x1b
jmp 0x40303c
mov ebx, dword [ebp - 0x38]
mov ebx, dword [ebx]
add ebx, dword [ebp - 0x1c]
mov edi, dword [ebp - 0x38]
mov edi, dword [edi + 0x10]
add edi, dword [ebp - 0x1c]
jmp 0x402ef3
test byte [ebx + 3], 0x80
je 0x402ec8
push edi
mov ax, word [ebx]
and ax, 0xffff
movzx edx, ax
push edx
push dword [ebp - 0x20]
call fcn.004027f3
add esp, 0xc
mov esi, eax
test eax, eax
jne 0x40303c
jmp 0x402eed
mov edx, dword [ebx]
add edx, dword [ebp - 0x1c]
mov dword [ebp - 0x3c], edx
push edi
mov ecx, dword [ebp - 0x3c]
add ecx, 2
push ecx
push dword [ebp - 0x20]
call fcn.004027f3
add esp, 0xc
mov esi, eax
test eax, eax
jne 0x40303c
add ebx, 4
add edi, 4
cmp dword [ebx], 0
jne 0x402e9f
add dword [ebp - 0x38], 0x14
mov edx, dword [ebp - 0x38]
cmp dword [edx], 0
jne 0x402e6a
cmp dword [ebp - 0x104], 0
je 0x402f68
mov ebx, dword [ebp - 0x1c]
add ebx, dword [ebp - 0x104]
call sub.KERNEL32.DLL_TlsAlloc
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x7c]
mov dword [ebx + 8], eax
mov edx, dword [ebx + 4]
sub edx, dword [ebx]
mov dword [ebp - 0x74], edx
mov ecx, dword [ebx + 0x10]
add ecx, dword [ebp - 0x74]
mov dword [ebp - 0x70], ecx
push 4
push 0x3000
push dword [ebp - 0x70]
push 0
call sub.KERNEL32.DLL_VirtualAlloc
mov dword [ebp - 0x78], eax
push dword [ebp - 0x74]
push dword [ebx]
push dword [ebp - 0x78]
call sub.CC32100.DLL__memmove
add esp, 0xc
push dword [ebp - 0x78]
push dword [ebp - 0x7c]
call sub.KERNEL32.DLL_TlsSetValue
mov esi, dword [ebp - 0x1c]
add esi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x30], eax
xor ebx, ebx
cmp ebx, dword [ebp - 0x44]
jae 0x403010
mov eax, dword [ebp - 0x30]
test byte [eax + 0x27], 0x20
je 0x402faf
mov edx, dword [ebp - 0x30]
test byte [edx + 0x27], 0x40
je 0x402fa8
mov ecx, dword [ebp - 0x30]
test byte [ecx + 0x27], 0x80
je 0x402fa1
mov ecx, 0x40
jmp 0x402fd4
mov ecx, 0x20
jmp 0x402fd4
mov ecx, 0x10
jmp 0x402fd4
mov eax, dword [ebp - 0x30]
test byte [eax + 0x27], 0x40
je 0x402fcf
mov edx, dword [ebp - 0x30]
test byte [edx + 0x27], 0x80
je 0x402fc8
mov ecx, 4
jmp 0x402fd4
mov ecx, 2
jmp 0x402fd4
mov ecx, 2
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 8]
add eax, dword [ebp - 0x48]
dec eax
xor edx, edx
div dword [ebp - 0x48]
mov edi, eax
imul edi, dword [ebp - 0x48]
lea eax, [ebp - 8]
push eax
push ecx
push edi
push esi
call sub.KERNEL32.DLL_VirtualProtect
test eax, eax
jne 0x403000
mov esi, 0x16
jmp 0x40303c
add esi, edi
inc ebx
add dword [ebp - 0x30], 0x28
cmp ebx, dword [ebp - 0x44]
jb 0x402f7f
cmp dword [ebp - 0x19c], 0
je 0x40303a
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x19c]
mov dword [ebp - 0x80], eax
push 0
push 1
push dword [ebp - 0x1c]
call dword [ebp - 0x80]
test eax, eax
jne 0x40303a
mov esi, 0x33
jmp 0x40303c
xor esi, esi
cmp dword [ebp - 0x58], 0
je 0x40304a
push dword [ebp - 0x58]
call sub.KERNEL32.DLL_GlobalFree
test esi, esi
je 0x40305e
cmp dword [ebp - 0x1c], 0
je 0x40305e
lea eax, [ebp - 0x1c]
push eax
call fcn.004026d5
pop ecx
cmp dword [ebp + 0xc], 0
je 0x40306c
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x1c]
mov dword [edx], ecx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret