Function at 0x408000
Capabilities:
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x418
mov eax, dword [0x5bc684]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x418], esi
test esi, esi
je 0x408279
test ebx, ebx
je 0x408279
mov eax, dword [ebp + 0x10]
push edi
dec eax
push eax
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp byte [0x5c19c0], 0
jne 0x408056
cmp byte [0x5c1cf8], 0
je 0x40816c
push 0x5c
push ebx
call fcn.004ff460
add esp, 8
test eax, eax
je 0x40816c
inc eax
lea edx, [ebp - 0x414]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x408072
xor eax, eax
mov edi, edi
mov cl, byte [eax + 0x5c19c0]
mov byte [ebp + eax - 0x108], cl
inc eax
test cl, cl
jne 0x408080
lea ecx, [ebp - 0x108]
push 0x5c
push ecx
call fcn.004ff460
add esp, 8
test eax, eax
je 0x40816c
mov byte [eax + 1], 0
cmp byte [ebp - 0x108], 0
je 0x40816c
lea edx, [ebp - 0x108]
push edx
call fcn.004bf2e0
lea eax, [ebp - 0x108]
push eax
call fcn.004c67c0
add esp, 8
test eax, eax
je 0x408114
lea ecx, [ebp - 0x310]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea edx, [ebp - 0x108]
push edx
call esi
lea eax, [ebp - 0x108]
push eax
call fcn.00406d80
add esp, 4
lea ecx, [ebp - 0x310]
push ecx
call esi
lea eax, [ebp - 0x108]
mov edx, ebx
mov ecx, eax
sub edx, ecx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x408120
push ebx
call fcn.004bf2e0
lea eax, [ebp - 0x414]
add esp, 4
mov esi, eax
jmp 0x408140
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408140
sub eax, esi
lea edi, [ebx - 1]
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408150
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x418]
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408171
sub eax, edx
mov byte [eax + ebx - 4], 0x5f
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408184
sub eax, edx
mov byte [eax + ebx - 3], cl
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408196
sub eax, edx
mov edi, eax
mov esi, edi
mov edx, dword [ebp - 0x418]
cmp byte [edx + esi - 1], 0x5c
je 0x4081b3
dec esi
jmp 0x4081a3
push 0x103
lea eax, [ebp - 0x20b]
push 0
push eax
mov byte [ebp - 0x20c], 0
call fcn.004ff6f0
mov ecx, dword [ebp - 0x418]
push esi
push ecx
lea edx, [ebp - 0x20c]
push edx
call fcn.004ff0c0
push 0x103
lea eax, [ebp - 0x107]
push 0
push eax
mov byte [ebp - 0x108], 0
call fcn.004ff6f0
add esp, 0x24
cmp esi, edi
jae 0x408225
lea ecx, [ebp - 0x108]
sub ecx, esi
lea ebx, [ebx]
mov edx, dword [ebp - 0x418]
mov al, byte [edx + esi]
cmp al, 0x2e
je 0x408225
mov byte [ecx + esi], al
inc esi
cmp esi, edi
jb 0x408210
lea eax, [ebp - 0x108]
mov esi, eax
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408230
sub eax, esi
lea edi, [ebx - 1]
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408240
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebx - 1]
pop edi
lea ebx, [ebx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x408260
mov ecx, dword [0x54f278]
mov dword [eax], ecx
mov dl, byte [0x54f27c]
mov byte [eax + 4], dl
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.004fe1f5
mov esp, ebp
pop ebp
ret