Function at 0x4065e0
Capabilities:
Create directory
Extract resource via kernel32 functions
Print debug messages

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x453087
mov eax, dword fs:[0]
push eax
sub esp, 0x6c0
mov eax, dword [0x46a860]
xor eax, esp
mov dword [esp + 0x6b8], eax
push ebx
push esi
push edi
mov eax, dword [0x46a860]
xor eax, esp
push eax
lea eax, [esp + 0x6d0]
mov dword fs:[0], eax
push 0x1ff
lea eax, [esp + 0x4c9]
mov esi, ecx
push 0
push eax
mov dword [esp + 0x2c], esi
mov byte [esp + 0x4d0], 0
call fcn.004376d0
add esp, 0xc
lea edi, [esi + 0x3c]
push edi
mov dword [esp + 0x54], edi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
push edi
mov dword [esi + 0x38], 0
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
push 4
call fcn.0041968a
add esp, 4
test eax, eax
je 0x406677
mov dword [eax], 0
jmp 0x406679
xor eax, eax
lea ecx, [esi + 0x2c]
push 4
mov dword [esp + 0x48], ecx
mov dword [ecx], eax
call fcn.0041968a
add esp, 4
test eax, eax
je 0x406698
mov dword [eax], 0
jmp 0x40669a
xor eax, eax
lea ecx, [esi + 0x30]
push 4
mov dword [esp + 0x44], ecx
mov dword [ecx], eax
call fcn.0041968a
add esp, 4
test eax, eax
je 0x4066b9
mov dword [eax], 0
jmp 0x4066bb
xor eax, eax
lea ecx, [esi + 0x34]
mov dword [ecx], eax
mov eax, dword [esi + 0x10]
test eax, eax
mov dword [esp + 0x48], ecx
je 0x406c82
lea ecx, [esp + 0x184]
push ecx
push eax
call dword [sym.imp.KERNEL32.DLL_FindFirstFileA]
mov ebx, dword [sym.imp.KERNEL32.DLL_FindClose]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4066fd
push 0xffffffffffffffff
call ebx
mov edx, dword [esi + 0x10]
push 0
push edx
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
push edi
call ebx
push 0x200
lea eax, [esp + 0x4c8]
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
lea ecx, [esp + 0x4c4]
push ecx
call dword [sym.imp.KERNEL32.DLL_LoadLibraryA]
mov edi, eax
test edi, edi
mov dword [esp + 0x30], edi
je 0x406c82
movzx edx, word [ebp + 8]
push str.RT_RCDATA
push edx
push edi
call dword [sym.imp.KERNEL32.DLL_FindResourceA]
mov ebx, eax
test ebx, ebx
je 0x406c82
push ebx
push edi
call dword [sym.imp.KERNEL32.DLL_LoadResource]
test eax, eax
je 0x406c7c
push eax
call dword [sym.imp.KERNEL32.DLL_LockResource]
test eax, eax
mov dword [esp + 0x18], eax
je 0x406c82
push ebx
push edi
call dword [sym.imp.KERNEL32.DLL_SizeofResource]
mov ebx, dword [esp + 0x18]
push 3
push eax
xor edi, edi
call fcn.0040cff0
mov edi, eax
mov eax, dword [esi + 0x10]
push eax
mov eax, edi
call fcn.0040d130
add esp, 0xc
push 0x12c
lea ecx, [esp + 0x58]
push 0
push ecx
call fcn.004376d0
add esp, 0xc
push 0xffffffffffffffff
lea edx, [esp + 0x58]
mov eax, edi
call fcn.0040d0f0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 4]
mov edx, dword [esp + 0x58]
add esp, 4
push 0
push 0
push eax
push ecx
mov dword [esp + 0x24], edx
call dword [sym.imp.USER32.dll_SendMessageA]
xor ebx, ebx
cmp dword [esp + 0x14], ebx
jbe 0x40686d
mov dword [esp + 0x18], ebx
push 0x12c
lea edx, [esp + 0x58]
push 0
push edx
call fcn.004376d0
add esp, 0xc
push ebx
lea edx, [esp + 0x58]
mov eax, edi
call fcn.0040d0f0
add esp, 4
test edi, edi
jne 0x406816
mov dword [0x470000], 0x10000
jmp 0x40683a
cmp dword [edi], 1
je 0x406827
mov dword [0x470000], 0x80000
jmp 0x40683a
mov eax, dword [edi + 4]
push ebx
push eax
lea ecx, [esp + 0x60]
call fcn.0040cc80
mov dword [0x470000], eax
mov eax, dword [esp + 0x18]
xor edx, edx
div dword [esp + 0x14]
mov ecx, dword [esi + 4]
push eax
mov dword [esi + 0x54], eax
mov eax, dword [esi + 8]
push 0
push eax
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
add dword [esp + 0x18], 0x12c
add ebx, 1
cmp ebx, dword [esp + 0x14]
jb 0x4067e3
mov edx, dword [esi + 0x54]
mov eax, dword [esi + 8]
mov ecx, dword [esi + 4]
push edx
push 0
push eax
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
call fcn.0040d170
mov edx, dword [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.DLL_FreeLibrary]
xor edi, edi
mov dword [esp + 0x34], vtable.CFileListXml.0
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], edi
push 0x1ff
lea eax, [esp + 0x2c9]
push edi
mov dword [esp + 0x6e0], edi
push eax
mov byte [esp + 0x2d0], 0
call fcn.004376d0
mov ecx, dword [esi + 0x10]
add esp, 0xc
push ecx
lea edx, [esp + 0x2c8]
push 0x200
push edx
call fcn.004366a7
add esp, 0xc
push 0x45f6dc
lea eax, [esp + 0x2c8]
push 0x200
push eax
call fcn.00436be9
add esp, 0xc
call fcn.004196bf
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x406915
push 0x80004005
call fcn.00402980
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov byte [esp + 0x6d8], 1
call fcn.004196bf
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x406947
push 0x80004005
call fcn.00402980
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x14], edi
lea esi, [esp + 0x24]
call fcn.00405bd0
lea ecx, [esp + 0x18]
push ecx
lea ebx, [esp + 0x2c8]
mov byte [esp + 0x6dc], 3
call fcn.00405690
test eax, eax
mov ebx, dword [esp + 0x18]
je 0x406c12
mov ecx, str.1.0.0
mov eax, ebx
lea esp, [esp]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4069b0
test dl, dl
je 0x4069ac
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4069b0
add eax, 2
add ecx, 2
test dl, dl
jne 0x406990
xor eax, eax
jmp 0x4069b5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x406c12
lea edx, [esp + 0x24]
push edx
lea ebx, [esp + 0x2c8]
call fcn.004057b0
test eax, eax
jne 0x406a1b
push eax
push eax
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 4]
push 0x467
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
lea esi, [esp + 0x24]
call fcn.00405a90
lea ecx, [esp + 0x14]
call fcn.00402ae0
lea ecx, [esp + 0x18]
call fcn.00402ae0
lea esi, [esp + 0x34]
mov dword [esp + 0x6d8], 0xffffffff
call fcn.004052c0
jmp 0x406c82
mov esi, dword [esp + 0x20]
lea edx, [esi + 0x5c]
push edx
lea ebx, [esp + 0x2c8]
call fcn.004057b0
mov eax, dword [esi + 0xc]
push eax
lea ecx, [esp + 0x20]
call fcn.004029f0
push str.LauncherCfgNewUpdateCfg.xml
lea ecx, [esp + 0x20]
mov byte [esp + 0x6dc], 4
call fcn.004043b0
mov ebx, dword [esp + 0x1c]
lea ecx, [esp + 0x14]
push ecx
call fcn.004062b0
mov ebx, dword [esp + 0x24]
mov edi, dword [esp + 0x2c]
push ebx
push edi
mov dword [esp + 0x38], eax
call fcn.00436ac0
add esp, 8
test eax, eax
push edi
mov edi, dword [esp + 0x18]
push edi
jge 0x406acf
call fcn.00436ac0
add esp, 8
test eax, eax
jl 0x406aa1
push ebx
push edi
call fcn.00436ac0
add esp, 8
test eax, eax
jg 0x406aa1
mov ebx, 1
jmp 0x406aa3
xor ebx, ebx
mov edi, dword [sym.imp.KERNEL32.DLL_OutputDebugStringA]
push str.upgrade
call edi
lea ecx, [esp + 0x2c]
call fcn.00408a00
push eax
call edi
lea ecx, [esp + 0x24]
call fcn.00408a00
push eax
call edi
mov edx, dword [esp + 0x14]
push edx
jmp 0x406b1c
call fcn.00436ac0
add esp, 8
test eax, eax
jg 0x406af0
push ebx
push edi
call fcn.00436ac0
add esp, 8
test eax, eax
jl 0x406af0
mov ebx, 1
jmp 0x406af2
xor ebx, ebx
mov edi, dword [sym.imp.KERNEL32.DLL_OutputDebugStringA]
push str.degrade
call edi
lea ecx, [esp + 0x2c]
call fcn.00408a00
push eax
call edi
lea ecx, [esp + 0x24]
call fcn.00408a00
push eax
call edi
mov eax, dword [esp + 0x14]
push eax
call edi
cmp dword [esp + 0x30], 0
je 0x406bf1
test ebx, ebx
je 0x406bf1
mov ecx, dword [esp + 0x44]
push ecx
lea edx, [esp + 0x2c8]
push edx
lea ecx, [esp + 0x3c]
call fcn.004053a0
mov dword [esi + 0x58], eax
mov eax, dword [esp + 0x48]
push eax
lea ecx, [esp + 0x2c8]
push ecx
lea ecx, [esp + 0x3c]
call fcn.004053a0
mov edx, dword [esp + 0x40]
push edx
lea eax, [esp + 0x2c8]
push eax
lea ecx, [esp + 0x3c]
call fcn.004053a0
mov ecx, dword [esi + 0xc]
push ecx
lea ecx, [esp + 0x50]
call fcn.004029f0
mov edx, dword [esi + 0xc]
push edx
call fcn.00414e22
mov edi, dword [esp + 0x50]
mov ebx, 1
push edi
mov dword [esi + 0x28], ebx
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
push edi
mov dword [esi + 0x38], ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
lea ecx, [esp + 0x4c]
call fcn.00402ae0
lea ecx, [esp + 0x1c]
call fcn.00402ae0
lea esi, [esp + 0x24]
call fcn.00405a90
lea ecx, [esp + 0x14]
call fcn.00402ae0
lea ecx, [esp + 0x18]
call fcn.00402ae0
lea esi, [esp + 0x34]
mov dword [esp + 0x6d8], 0xffffffff
call fcn.004052c0
mov eax, ebx
jmp 0x406c84
mov eax, dword [esi + 4]
push 0
push 0
push 0x467
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
lea ecx, [esp + 0x1c]
call fcn.00402ae0
jmp 0x4069e7
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 4]
push 0
push 0
push 0x466
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
lea esi, [esp + 0x24]
call fcn.00405a90
lea eax, [edi - 0x10]
mov byte [esp + 0x6d8], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406c56
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebx - 0x10]
mov byte [esp + 0x6d8], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406c82
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x406c82
call dword [sym.imp.KERNEL32.DLL_GetLastError]
xor eax, eax
mov ecx, dword [esp + 0x6d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6b8]
xor ecx, esp
call fcn.00435287
mov esp, ebp
pop ebp
ret 4