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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x4fb2a0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov eax, 0x4d5dd0
lea esi, [ebp - 0x214]
call fcn.00403290
mov eax, dword [0x50012c]
xor ebx, ebx
cmp eax, ebx
jne 0x40b7c1
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x40b7ba
mov esi, eax
call fcn.004112e0
jmp 0x40b7bc
xor eax, eax
mov dword [0x50012c], eax
push edi
lea edi, [eax + 0x410]
cmp eax, ebx
jne 0x40b7ed
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x40b7e6
mov esi, eax
call fcn.004112e0
jmp 0x40b7e8
xor eax, eax
mov dword [0x50012c], eax
lea edx, [eax + 0xe38]
sub edx, edi
movzx ecx, word [edi]
mov word [edx + edi], cx
add edi, 2
cmp cx, bx
jne 0x40b7f5
cmp eax, ebx
jne 0x40b829
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x40b822
mov esi, eax
call fcn.004112e0
jmp 0x40b824
xor eax, eax
mov dword [0x50012c], eax
push 0x4d5c5c
add eax, 0xe38
push 0x104
push eax
call fcn.0043091a
mov eax, dword [0x50012c]
add esp, 0xc
cmp eax, ebx
jne 0x40b86b
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x40b864
mov esi, eax
call fcn.004112e0
jmp 0x40b866
xor eax, eax
mov dword [0x50012c], eax
push 0x4d660c
add eax, 0xe38
push 0x104
push eax
call fcn.0043091a
push 0x206
lea ecx, [ebp - 0x20a]
xor eax, eax
push ebx
push ecx
mov word [ebp - 0x20c], ax
call fcn.00438200
add esp, 0x18
cmp dword [0x50012c], ebx
jne 0x40b8cb
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x40b8c5
mov esi, eax
call fcn.004112e0
mov dword [0x50012c], eax
jmp 0x40b8cb
mov dword [0x50012c], 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 0x40b9cb
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 0x40b9cb
lea edi, [ebp - 0x20c]
add edi, 0xfffffffe
lea ecx, [ecx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x40b920
mov eax, dword [0x4d5c5c]
mov ebx, dword [ebp - 0x214]
mov dword [edi], eax
cmp dword [ebx - 4], 1
jle 0x40b955
mov ecx, dword [ebx - 0xc]
push ecx
lea edx, [ebp - 0x214]
push edx
call fcn.00403600
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 0x40b960
lea edi, [ebp - 0x20c]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x40b976
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.0042f176
add esp, 8
test eax, eax
js 0x40b9c1
cmp eax, dword [ebx - 8]
jg 0x40b9c1
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 0x40b9d1
push 0x80070057
call fcn.00403050
mov ebx, dword [ebp - 0x214]
mov eax, dword [0x4fc44c]
mov edx, dword [eax + 0xc]
mov ecx, 0x4fc44c
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.00403db0
mov edx, dword [0x4fc44c]
mov eax, dword [edx + 0xc]
add esp, 8
mov ecx, 0x4fc44c
call eax
add eax, 0x10
mov dword [ebp - 0x218], eax
mov eax, dword [0x50012c]
test eax, eax
jne 0x40ba46
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40ba3f
mov esi, eax
call fcn.004112e0
jmp 0x40ba41
xor eax, eax
mov dword [0x50012c], eax
add eax, 0x410
push eax
push str._s_resdesk.ico
lea edi, [ebp - 0x218]
call fcn.00403db0
mov esi, 1
add esp, 8
cmp dword [ebx - 4], esi
jle 0x40ba7f
mov ecx, dword [ebx - 0xc]
push ecx
lea edx, [ebp - 0x214]
push edx
call fcn.00403600
mov ebx, dword [ebp - 0x214]
mov eax, dword [ebp - 0x210]
cmp dword [eax - 4], esi
jle 0x40ba9a
mov eax, dword [eax - 0xc]
push eax
lea ecx, [ebp - 0x210]
push ecx
call fcn.00403600
mov eax, dword [0x50012c]
test eax, eax
jne 0x40bac4
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40babd
mov esi, eax
call fcn.004112e0
jmp 0x40babf
xor eax, eax
mov dword [0x50012c], eax
mov edi, eax
test eax, eax
jne 0x40baf3
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bae9
mov esi, eax
call fcn.004112e0
mov dword [0x50012c], eax
jmp 0x40baf3
mov dword [0x50012c], 0
mov esi, dword [ebp - 0x210]
mov edx, dword [ebp - 0x218]
push esi
add edi, 0xc30
push edi
push edx
mov edx, 0x4d5b00
lea ecx, [ebp - 0x20c]
call fcn.0040cec0
mov eax, dword [esi - 8]
push eax
push esi
call fcn.0042f176
add esp, 8
test eax, eax
js 0x40b9c1
cmp eax, dword [esi - 8]
jg 0x40b9c1
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov eax, dword [ebx - 8]
push eax
push ebx
call fcn.0042f176
add esp, 8
test eax, eax
js 0x40b9c1
cmp eax, dword [ebx - 8]
jg 0x40b9c1
xor edx, edx
mov dword [ebx - 0xc], eax
mov word [ebx + eax*2], dx
mov eax, dword [0x50012c]
test eax, eax
jne 0x40bb96
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bb8f
mov esi, eax
call fcn.004112e0
mov esi, dword [ebp - 0x210]
jmp 0x40bb91
xor eax, eax
mov dword [0x50012c], eax
mov edi, eax
test eax, eax
jne 0x40bbc3
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bbbc
mov esi, eax
call fcn.004112e0
mov esi, dword [ebp - 0x210]
jmp 0x40bbbe
xor eax, eax
mov dword [0x50012c], eax
lea ecx, [edi + 0xe38]
push eax
call fcn.0040c920
call fcn.00406990
call fcn.00404da0
test eax, eax
jne 0x40bcbf
mov ecx, dword [0x50012c]
test ecx, ecx
jne 0x40bc0f
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bc07
mov esi, eax
call fcn.004112e0
mov ecx, eax
jmp 0x40bc09
xor ecx, ecx
mov dword [0x50012c], ecx
mov dword [ebp - 0x214], ecx
test ecx, ecx
jne 0x40bc3d
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bc35
mov esi, eax
call fcn.004112e0
mov ecx, eax
jmp 0x40bc37
xor ecx, ecx
mov dword [0x50012c], ecx
mov dword [ebp - 0x21c], ecx
test ecx, ecx
jne 0x40bc6b
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bc63
mov esi, eax
call fcn.004112e0
mov ecx, eax
jmp 0x40bc65
xor ecx, ecx
mov dword [0x50012c], ecx
mov edi, ecx
test ecx, ecx
jne 0x40bc95
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40bc8d
mov esi, eax
call fcn.004112e0
mov ecx, eax
jmp 0x40bc8f
xor ecx, ecx
mov dword [0x50012c], ecx
mov eax, dword [ebp - 0x214]
add eax, 0xa28
push eax
mov eax, dword [ebp - 0x21c]
add edi, 0x410
push edi
add eax, 0x820
push ecx
call fcn.0040cc40
mov esi, dword [ebp - 0x210]
mov eax, dword [ebp - 0x218]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
pop edi
test edx, edx
jg 0x40bce2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bcfe
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebx - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
pop esi
pop ebx
test edx, edx
jg 0x40bd1c
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.0042e217
mov esp, ebp
pop ebp
ret