Function at 0x40d860
Capabilities:
Create directory
Extract resource via kernel32 functions
Link many functions at runtime

Disassembly:
push 0xffffffffffffffff
push 0x5ac808
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6336a0]
xor eax, esp
push eax
lea eax, [esp + 0x24]
mov dword fs:[0], eax
mov esi, dword [esp + 0x34]
push esi
call fcn.0040e360
call fcn.00413a80
mov eax, dword [0x63c664]
add eax, 0xfffffff0
push eax
call fcn.00402110
lea ebp, [eax + 0x10]
add esp, 4
mov dword [esp + 0x14], ebp
xor ebx, ebx
mov dword [esp + 0x2c], ebx
cmp dword [ebp - 0xc], ebx
je 0x40d8d3
push ebp
call fcn.0044adc0
add esp, 4
test eax, eax
jne 0x40d8d3
lea ecx, [esp + 0x14]
call fcn.00402180
mov ebp, dword [esp + 0x14]
mov eax, dword [ebp - 0xc]
cmp eax, ebx
jne 0x40d952
push str.TGMusic
lea eax, [esp + 0x24]
push 0x63c674
push eax
call fcn.00401ba0
add esp, 0xc
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x30], 1
call fcn.00402330
mov byte [esp + 0x2c], bl
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d924
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebp, dword [esp + 0x14]
push ebp
call fcn.0044adc0
add esp, 4
test eax, eax
jne 0x40d952
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40d952
add esi, 4
push esi
lea ecx, [esp + 0x18]
call fcn.00402330
mov ebp, dword [esp + 0x14]
cmp dword [ebp - 0xc], ebx
je 0x40d95e
mov edx, ebp
call fcn.0040c890
mov esi, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 2
mov dword [0x63c438], ebx
mov dword [0x63c43c], ebx
mov dword [0x63c430], ebx
mov dword [0x63c434], ebx
mov dword [0x63c440], ebx
mov dword [0x63c444], ebx
mov dword [0x63c468], ebx
call esi
push 3
mov dword [0x63c648], eax
call esi
mov ecx, dword [0x63c0bc]
mov dword [0x63c64c], eax
mov dword [0x63c648], 0x10
mov dword [0x63c080], 0x2206f0
cmp dword [ecx - 0xc], ebx
jne 0x40d9d5
push 0x17
push 2
push str._d._.2d
push 0x63c0bc
call fcn.00404650
add esp, 0x10
push str._tgupdate.down
lea edx, [esp + 0x24]
push 0x63c670
push edx
call fcn.00401ba0
add esp, 0xc
push eax
mov ecx, 0x63c1cc
mov byte [esp + 0x30], 2
call fcn.00402330
mov byte [esp + 0x2c], bl
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40da20
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push str._tgupdate.exe
lea ecx, [esp + 0x24]
push 0x63c670
push ecx
call fcn.00401ba0
add esp, 0xc
push eax
mov ecx, 0x63c1d0
mov byte [esp + 0x30], 3
call fcn.00402330
mov byte [esp + 0x2c], bl
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40da6b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x5d64ec
push 0xa1
push ebx
mov dword [0x63c618], ebx
mov dword [0x63c650], ebx
mov dword [0x63c654], ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push 3
push eax
mov ebx, edi
call fcn.00503eb0
mov ecx, dword [esp + 0x3c]
add esp, 8
push 8
mov dword [ecx], eax
push str.templ223
mov ecx, 0x63c6c0
call fcn.00402270
push str._binwmdll3.dll
lea ecx, [esp + 0x20]
call fcn.004023b0
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x1c]
push 0x63c670
push eax
mov byte [esp + 0x38], 4
call fcn.00401ae0
mov ecx, dword [esp + 0x24]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
mov dword [0x63c800], eax
je 0x40dbb7
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CreateReader
push eax
call esi
mov edx, dword [0x63c800]
push str.DeleteReader
push edx
mov dword [0x63c804], eax
call esi
mov dword [0x63c808], eax
mov eax, dword [0x63c800]
push str.OpenAudioFile
push eax
call esi
mov ecx, dword [0x63c800]
push str.GetInfo
push ecx
mov dword [0x63c80c], eax
call esi
mov edx, dword [0x63c800]
push str.ReadPCMBlock
push edx
mov dword [0x63c810], eax
call esi
mov dword [0x63c814], eax
mov eax, dword [0x63c800]
push str.GetCurPos
push eax
call esi
mov ecx, dword [0x63c800]
push str.SetCurPos
push ecx
mov dword [0x63c818], eax
call esi
mov edx, dword [0x63c800]
push str.IsOpened
push edx
mov dword [0x63c81c], eax
call esi
mov dword [0x63c820], eax
mov eax, dword [0x63c800]
push str.SetCallBack
push eax
call esi
mov dword [0x63c824], eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dbd7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x2c], 0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dbfc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov dword [esp + 0x2c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dc20
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x24]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 4