Function at 0x4599b0
Capabilities:
Get common file path

Disassembly:
sub esp, 0x408
push ebx
push ebp
push 0x104
lea eax, [esp + 0x214]
push eax
xor ebx, ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
mov ebp, dword [esp + 0x414]
je 0x45a2e0
mov byte [esp + 0x313], bl
xor eax, eax
jmp 0x4599f0
mov cl, byte [esp + eax + 0x210]
mov byte [esp + eax + 0x10], cl
inc eax
test cl, cl
jne 0x4599f0
push edi
lea edi, [esp + 0x14]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459a06
mov ecx, dword [str.ddraw.dll]
mov edx, dword [0x4a6be8]
mov ax, word [0x4a6bec]
mov dword [edi], ecx
mov cl, byte [0x4a6bee]
mov dword [edi + 4], edx
push esi
mov word [edi + 8], ax
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push eax
mov byte [edi + 0xa], cl
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459b26
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov eax, 0x40002
cmp edx, eax
mov ecx, 0x5f
ja 0x459a6b
jb 0x459a9c
cmp esi, ecx
ja 0x459a6b
jb 0x459a9c
test ebp, ebp
je 0x459a76
mov dword [ebp], 1
mov edi, dword [esp + 0x420]
test edi, edi
je 0x459a87
mov dword [edi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459a95
mov byte [eax], 0x20
mov ebx, 1
jmp 0x459aa3
mov edi, dword [esp + 0x420]
mov eax, 0x40003
cmp edx, eax
mov ecx, 0x448
ja 0x459ab9
jb 0x459ae1
cmp esi, ecx
ja 0x459ab9
jb 0x459ae1
test ebp, ebp
je 0x459ac4
mov dword [ebp], 2
test edi, edi
je 0x459ace
mov dword [edi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459adc
mov byte [eax], 0x20
mov ebx, 1
mov eax, 0x40004
cmp edx, eax
mov ecx, 0x44
ja 0x459afe
jb 0x459b26
cmp esi, ecx
ja 0x459af7
jb 0x459b26
mov edi, dword [esp + 0x420]
test ebp, ebp
je 0x459b09
mov dword [ebp], 3
test edi, edi
je 0x459b13
mov dword [edi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459b21
mov byte [eax], 0x20
mov ebx, 1
xor eax, eax
jmp 0x459b30
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459b30
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459b45
mov ecx, dword [str.d3drg8x.dll]
mov edx, dword [0x4a6bd8]
mov eax, dword [0x4a6bdc]
mov dword [edi], ecx
mov cl, byte [0x4a6be0]
mov dword [edi + 4], edx
mov dword [edi + 8], eax
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push eax
mov byte [edi + 0xc], cl
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459bd2
mov edx, dword [esp + 0x14]
mov eax, 0x40004
cmp edx, eax
mov ecx, 0x46
ja 0x459ba3
jb 0x459bd2
mov eax, dword [esp + 0x10]
cmp eax, ecx
ja 0x459ba3
jb 0x459bd2
test ebp, ebp
je 0x459bae
mov dword [ebp], 3
mov eax, dword [esp + 0x420]
test eax, eax
je 0x459bbf
mov dword [eax], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459bcd
mov byte [eax], 0x61
mov ebx, 1
xor eax, eax
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459bd4
lea edi, [esp + 0x18]
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459bf0
mov ecx, dword [str.ddraw.dll]
mov edx, dword [0x4a6be8]
mov ax, word [0x4a6bec]
mov dword [edi], ecx
mov cl, byte [0x4a6bee]
mov dword [edi + 4], edx
mov word [edi + 8], ax
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push eax
mov byte [edi + 0xa], cl
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459d0f
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov eax, 0x40005
cmp edx, eax
mov ecx, 0x9b
ja 0x459c54
jb 0x459c85
cmp esi, ecx
ja 0x459c54
jb 0x459c85
test ebp, ebp
je 0x459c5f
mov dword [ebp], 5
mov edi, dword [esp + 0x420]
test edi, edi
je 0x459c70
mov dword [edi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459c7e
mov byte [eax], 0x20
mov ebx, 1
jmp 0x459c8c
mov edi, dword [esp + 0x420]
mov eax, 0x40006
cmp edx, eax
mov ecx, 0x13e
ja 0x459ca2
jb 0x459cca
cmp esi, ecx
ja 0x459ca2
jb 0x459cca
test ebp, ebp
je 0x459cad
mov dword [ebp], 6
test edi, edi
je 0x459cb7
mov dword [edi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459cc5
mov byte [eax], 0x20
mov ebx, 1
mov eax, 0x40006
cmp edx, eax
mov ecx, 0x1b4
ja 0x459ce7
jb 0x459d0f
cmp esi, ecx
ja 0x459ce0
jb 0x459d0f
mov edi, dword [esp + 0x420]
test ebp, ebp
je 0x459cf2
mov dword [ebp], 6
test edi, edi
je 0x459cfc
mov dword [edi], 1
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459d0a
mov byte [eax], 0x20
mov ebx, 1
xor eax, eax
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459d11
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459d26
mov ecx, dword [str.dplayx.dll]
mov edx, dword [0x4a6bcc]
mov eax, dword [0x4a6bd0]
mov dword [edi], ecx
mov dword [edi + 4], edx
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x1c]
push edx
mov dword [edi + 8], eax
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459dac
mov edx, dword [esp + 0x14]
mov eax, 0x40006
cmp edx, eax
mov ecx, 0x30206
ja 0x459d7b
jb 0x459dac
mov eax, dword [esp + 0x10]
cmp eax, ecx
ja 0x459d7b
jb 0x459dac
test ebp, ebp
je 0x459d86
mov dword [ebp], 6
mov esi, dword [esp + 0x420]
test esi, esi
je 0x459d97
mov dword [esi], 1
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459da5
mov byte [eax], 0x61
mov ebx, 1
jmp 0x459db3
mov esi, dword [esp + 0x420]
xor eax, eax
jmp 0x459dc0
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459dc0
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459dd5
mov eax, dword [str.ddraw.dll]
mov ecx, dword [0x4a6be8]
mov dx, word [0x4a6bec]
mov dword [edi], eax
mov al, byte [0x4a6bee]
mov dword [edi + 4], ecx
mov word [edi + 8], dx
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x1c]
push edx
mov byte [edi + 0xa], al
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459e5c
mov edx, dword [esp + 0x14]
mov eax, 0x40007
cmp edx, eax
mov ecx, 0x2bc
ja 0x459e34
jb 0x459e5c
mov eax, dword [esp + 0x10]
cmp eax, ecx
ja 0x459e34
jb 0x459e5c
test ebp, ebp
je 0x459e3f
mov dword [ebp], 7
test esi, esi
je 0x459e49
mov dword [esi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459e57
mov byte [eax], 0x20
mov ebx, 1
xor eax, eax
mov edi, edi
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459e60
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459e75
mov eax, dword [str.dinput.dll]
mov ecx, dword [0x4a6bc0]
mov edx, dword [0x4a6bc4]
mov dword [edi], eax
mov dword [edi + 4], ecx
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov dword [edi + 8], edx
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459ef2
mov edx, dword [esp + 0x14]
mov eax, 0x40007
cmp edx, eax
mov ecx, 0x2cc
ja 0x459eca
jb 0x459ef2
mov eax, dword [esp + 0x10]
cmp eax, ecx
ja 0x459eca
jb 0x459ef2
test ebp, ebp
je 0x459ed5
mov dword [ebp], 7
test esi, esi
je 0x459edf
mov dword [esi], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459eed
mov byte [eax], 0x61
mov ebx, 1
xor eax, eax
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459ef4
lea edi, [esp + 0x18]
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459f10
mov edx, dword [str.ddraw.dll]
mov eax, dword [0x4a6be8]
mov cx, word [0x4a6bec]
mov dword [edi], edx
mov dl, byte [0x4a6bee]
mov dword [edi + 4], eax
mov word [edi + 8], cx
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov byte [edi + 0xa], dl
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x459fc8
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov esi, ecx
shr esi, 0x10
cmp si, 4
jne 0x459f79
mov eax, 0x40008
cmp ecx, eax
mov edx, 0x190
ja 0x459f99
jb 0x459f79
cmp edi, edx
jae 0x459f99
cmp si, 5
jne 0x459fc8
mov eax, 0x50001
push eax
mov edx, 0x8d20190
push edx
push ecx
push edi
call fcn.00459980
add esp, 0x10
test eax, eax
jl 0x459fc8
test ebp, ebp
je 0x459fa4
mov dword [ebp], 8
mov eax, dword [esp + 0x420]
test eax, eax
je 0x459fb5
mov dword [eax], 0
mov eax, dword [esp + 0x424]
test eax, eax
je 0x459fc3
mov byte [eax], 0x20
mov ebx, 1
xor eax, eax
lea ebx, [ebx]
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x459fd0
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x459fe5
mov edx, dword [0x4a6bb0]
mov eax, dword [0x4a6bb4]
mov cx, word [0x4a6bb8]
mov dword [edi], edx
mov dword [edi + 4], eax
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push eax
mov word [edi + 8], cx
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x45a101
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov edi, edx
shr edi, 0x10
cmp di, 4
jne 0x45a049
mov eax, 0x40008
cmp edx, eax
mov ecx, 0x10371
ja 0x45a069
jb 0x45a049
cmp esi, ecx
jae 0x45a069
cmp di, 5
jne 0x45a098
mov eax, 0x50001
push eax
mov ecx, 0xa280371
push ecx
push edx
push esi
call fcn.00459980
add esp, 0x10
test eax, eax
jl 0x45a098
test ebp, ebp
je 0x45a074
mov dword [ebp], 8
mov eax, dword [esp + 0x420]
test eax, eax
je 0x45a085
mov dword [eax], 1
mov eax, dword [esp + 0x424]
test eax, eax
je 0x45a093
mov byte [eax], 0x20
mov ebx, 1
cmp di, 4
jne 0x45a0b2
mov eax, 0x40008
cmp edx, eax
mov ecx, 0x10385
ja 0x45a0d2
jb 0x45a0b2
cmp esi, ecx
jae 0x45a0d2
cmp di, 5
jne 0x45a101
mov eax, 0x50001
push eax
mov ecx, 0xa280385
push ecx
push edx
push esi
call fcn.00459980
add esp, 0x10
test eax, eax
jl 0x45a101
test ebp, ebp
je 0x45a0dd
mov dword [ebp], 8
mov eax, dword [esp + 0x420]
test eax, eax
je 0x45a0ee
mov dword [eax], 1
mov eax, dword [esp + 0x424]
test eax, eax
je 0x45a0fc
mov byte [eax], 0x61
mov ebx, 1
xor eax, eax
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x45a103
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x45a118
mov ecx, dword [str.mpg2splt.ax]
mov edx, dword [0x4a6ba4]
mov eax, dword [0x4a6ba8]
mov dword [edi], ecx
mov cl, byte [0x4a6bac]
mov dword [edi + 4], edx
mov dword [edi + 8], eax
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push eax
mov byte [edi + 0xc], cl
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x45a1a5
mov edx, dword [esp + 0x14]
mov eax, 0x60003
cmp edx, eax
mov ecx, 0x10375
ja 0x45a176
jb 0x45a1a5
mov eax, dword [esp + 0x10]
cmp eax, ecx
ja 0x45a176
jb 0x45a1a5
test ebp, ebp
je 0x45a181
mov dword [ebp], 8
mov eax, dword [esp + 0x420]
test eax, eax
je 0x45a192
mov dword [eax], 1
mov eax, dword [esp + 0x424]
test eax, eax
je 0x45a1a0
mov byte [eax], 0x62
mov ebx, 1
xor eax, eax
jmp 0x45a1b0
mov cl, byte [esp + eax + 0x218]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x45a1b0
lea edi, [esp + 0x18]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x45a1c5
mov ecx, dword [str.dpnet.dll]
mov edx, dword [0x4a6b98]
mov ax, word [0x4a6b9c]
mov dword [edi], ecx
mov cl, byte [0x4a6b9e]
mov dword [edi + 4], edx
mov word [edi + 8], ax
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push eax
mov byte [edi + 0xa], cl
call fcn.004598b0
add esp, 8
test eax, eax
jl 0x45a27d
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov esi, ecx
shr esi, 0x10
cmp si, 4
jne 0x45a22e
mov eax, 0x40009
cmp ecx, eax
mov edx, 0x86
ja 0x45a24e
jb 0x45a22e
cmp edi, edx
jae 0x45a24e
cmp si, 5
jne 0x45a27d
mov eax, 0x50002
push eax
mov edx, 0xe5d0086
push edx
push ecx
push edi
call fcn.00459980
add esp, 0x10
test eax, eax
jl 0x45a27d
test ebp, ebp
je 0x45a259
mov dword [ebp], 8
mov eax, dword [esp + 0x420]
test eax, eax
je 0x45a26a
mov dword [eax], 2
mov eax, dword [esp + 0x424]
test eax, eax
je 0x45a278
mov byte [eax], 0x20
mov ebx, 1
xor eax, eax
pop esi
mov cl, byte [esp + eax + 0x214]
mov byte [esp + eax + 0x14], cl
inc eax
test cl, cl
jne 0x45a280
lea edi, [esp + 0x14]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x45a295
mov ecx, dword [str.d3d9.dll]
mov edx, dword [0x4a6b8c]
mov ax, word [0x4a6b90]
mov dword [edi], ecx
mov dword [edi + 4], edx
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x18]
push edx
mov word [edi + 8], ax
call fcn.004598b0
add esp, 8
test eax, eax
pop edi
jl 0x45a2dc
test ebp, ebp
je 0x45a2eb
mov dword [ebp], 9
jmp 0x45a2eb
test ebx, ebx
jne 0x45a30a
test ebp, ebp
je 0x45a2eb
mov dword [ebp], 0
mov eax, dword [esp + 0x418]
test eax, eax
je 0x45a2fc
mov dword [eax], 0
mov eax, dword [esp + 0x41c]
test eax, eax
je 0x45a30a
mov byte [eax], 0x20
pop ebp
xor eax, eax
pop ebx
add esp, 0x408
ret