Function at 0x40b740
Capabilities:
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x4f92a0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov eax, 0x4d3b50
lea esi, [ebp - 0x214]
call fcn.00403260
mov eax, dword [0x4fd894]
xor ebx, ebx
cmp eax, ebx
jne 0x40b792
push 0x24d0
call fcn.0042ec9c
add esp, 4
cmp eax, ebx
je 0x40b78b
mov esi, eax
call fcn.00411220
jmp 0x40b78d
xor eax, eax
mov dword [0x4fd894], eax
lea edi, [eax + 0x410]
cmp eax, ebx
jne 0x40b7bd
push 0x24d0
call fcn.0042ec9c
add esp, 4
cmp eax, ebx
je 0x40b7b6
mov esi, eax
call fcn.00411220
jmp 0x40b7b8
xor eax, eax
mov dword [0x4fd894], eax
lea edx, [eax + 0xe38]
sub edx, edi
movzx ecx, word [edi]
mov word [edx + edi], cx
add edi, 2
cmp cx, bx
jne 0x40b7c5
cmp eax, ebx
jne 0x40b7f9
push 0x24d0
call fcn.0042ec9c
add esp, 4
cmp eax, ebx
je 0x40b7f2
mov esi, eax
call fcn.00411220
jmp 0x40b7f4
xor eax, eax
mov dword [0x4fd894], eax
push 0x4d39dc
add eax, 0xe38
push 0x104
push eax
call fcn.0043095a
mov eax, dword [0x4fd894]
add esp, 0xc
cmp eax, ebx
jne 0x40b83b
push 0x24d0
call fcn.0042ec9c
add esp, 4
cmp eax, ebx
je 0x40b834
mov esi, eax
call fcn.00411220
jmp 0x40b836
xor eax, eax
mov dword [0x4fd894], eax
push 0x4d438c
add eax, 0xe38
push 0x104
push eax
call fcn.0043095a
push 0x206
lea ecx, [ebp - 0x20a]
xor eax, eax
push ebx
push ecx
mov word [ebp - 0x20c], ax
call fcn.00438230
add esp, 0x18
cmp dword [0x4fd894], ebx
jne 0x40b89b
push 0x24d0
call fcn.0042ec9c
add esp, 4
cmp eax, ebx
je 0x40b895
mov esi, eax
call fcn.00411220
mov dword [0x4fd894], eax
jmp 0x40b89b
mov dword [0x4fd894], ebx
lea edx, [ebp - 0x210]
push edx
push 0x17
push ebx
mov dword [ebp - 0x210], ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x40b99b
mov ecx, dword [ebp - 0x210]
lea eax, [ebp - 0x20c]
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
mov edx, dword [ebp - 0x210]
push edx
mov esi, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
cmp esi, ebx
je 0x40b99b
lea edi, [ebp - 0x20c]
add edi, 0xfffffffe
lea ecx, [ecx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x40b8f0
mov eax, dword [0x4d39dc]
mov ebx, dword [ebp - 0x214]
mov dword [edi], eax
cmp dword [ebx - 4], 1
jle 0x40b925
mov ecx, dword [ebx - 0xc]
push ecx
lea edx, [ebp - 0x214]
push edx
call fcn.004035d0
mov ebx, dword [ebp - 0x214]
mov eax, ebx
mov edx, ebx
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40b930
lea edi, [ebp - 0x20c]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x40b946
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx - 8]
push eax
push ebx
call fcn.0042f1b6
add esp, 8
test eax, eax
js 0x40b991
cmp eax, dword [ebx - 8]
jg 0x40b991
xor ecx, ecx
push ecx
lea edx, [ebp - 0x20c]
mov dword [ebx - 0xc], eax
push edx
mov word [ebx + eax*2], cx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x40b9a1
push 0x80070057
call fcn.00403020
mov ebx, dword [ebp - 0x214]
mov eax, dword [0x4fa44c]
mov edx, dword [eax + 0xc]
mov ecx, 0x4fa44c
call edx
add eax, 0x10
mov dword [ebp - 0x210], eax
lea eax, [ebp - 0x20c]
push eax
push str._sGameBuff.lnk
lea edi, [ebp - 0x210]
call fcn.00403d60
mov edx, dword [0x4fa44c]
mov eax, dword [edx + 0xc]
add esp, 8
mov ecx, 0x4fa44c
call eax
add eax, 0x10
mov dword [ebp - 0x218], eax
mov eax, dword [0x4fd894]
test eax, eax
jne 0x40ba16
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40ba0f
mov esi, eax
call fcn.00411220
jmp 0x40ba11
xor eax, eax
mov dword [0x4fd894], eax
add eax, 0x410
push eax
push str._s_resdesk.ico
lea edi, [ebp - 0x218]
call fcn.00403d60
mov esi, 1
add esp, 8
cmp dword [ebx - 4], esi
jle 0x40ba4f
mov ecx, dword [ebx - 0xc]
push ecx
lea edx, [ebp - 0x214]
push edx
call fcn.004035d0
mov ebx, dword [ebp - 0x214]
mov eax, dword [ebp - 0x210]
cmp dword [eax - 4], esi
jle 0x40ba6a
mov eax, dword [eax - 0xc]
push eax
lea ecx, [ebp - 0x210]
push ecx
call fcn.004035d0
mov eax, dword [0x4fd894]
test eax, eax
jne 0x40ba94
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40ba8d
mov esi, eax
call fcn.00411220
jmp 0x40ba8f
xor eax, eax
mov dword [0x4fd894], eax
mov edi, eax
test eax, eax
jne 0x40bac3
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bab9
mov esi, eax
call fcn.00411220
mov dword [0x4fd894], eax
jmp 0x40bac3
mov dword [0x4fd894], 0
mov esi, dword [ebp - 0x210]
mov edx, dword [ebp - 0x218]
push esi
add edi, 0xc30
push edi
push edx
mov edx, 0x4d3880
lea ecx, [ebp - 0x20c]
call fcn.0040ce00
mov eax, dword [esi - 8]
push eax
push esi
call fcn.0042f1b6
add esp, 8
test eax, eax
js 0x40b991
cmp eax, dword [esi - 8]
jg 0x40b991
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov esi, dword [ebp - 0x214]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.0042f1b6
add esp, 8
test eax, eax
js 0x40b991
cmp eax, dword [esi - 8]
jg 0x40b991
xor edx, edx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], dx
mov eax, dword [0x4fd894]
test eax, eax
jne 0x40bb66
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bb5f
mov esi, eax
call fcn.00411220
jmp 0x40bb61
xor eax, eax
mov dword [0x4fd894], eax
mov ebx, eax
test eax, eax
jne 0x40bb8d
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bb86
mov esi, eax
call fcn.00411220
jmp 0x40bb88
xor eax, eax
mov dword [0x4fd894], eax
lea ecx, [ebx + 0xe38]
push eax
call fcn.0040c8f0
call fcn.00406940
call fcn.00404d40
test eax, eax
jne 0x40bc8b
mov eax, dword [0x4fd894]
test eax, eax
jne 0x40bc02
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bbef
mov esi, eax
call fcn.00411220
mov dword [0x4fd894], eax
test eax, eax
jne 0x40bc02
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bbfb
mov esi, eax
call fcn.00411220
jmp 0x40bbfd
mov dword [0x4fd894], 0
jmp 0x40bbd5
xor eax, eax
mov dword [0x4fd894], eax
mov edi, eax
test eax, eax
jne 0x40bc29
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bc22
mov esi, eax
call fcn.00411220
jmp 0x40bc24
xor eax, eax
mov dword [0x4fd894], eax
mov ebx, eax
test eax, eax
jne 0x40bc58
push 0x24d0
call fcn.0042ec9c
add esp, 4
test eax, eax
je 0x40bc4e
mov esi, eax
call fcn.00411220
mov dword [0x4fd894], eax
jmp 0x40bc58
mov dword [0x4fd894], 0
lea eax, [ebp - 0x21c]
push eax
push str.SoftwareGameBuff
push SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x40bc8b
add ebx, 0x410
push ebx
lea eax, [edi + 0x820]
lea ebx, [ebp - 0x21c]
call fcn.0040cc10
mov eax, dword [ebp - 0x218]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
pop edi
pop esi
pop ebx
test edx, edx
jg 0x40bcb0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x210]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bcd2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x214]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bcf4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042e257
mov esp, ebp
pop ebp
ret