Function at 0x499650
Capabilities:
Get common file path

Disassembly:
sub esp, 0x22c
mov eax, dword [0x517b6c]
xor eax, esp
mov dword [esp + 0x224], eax
push ebx
push ebp
push esi
push edi
xor edi, edi
push 0x105
lea eax, [esp + 0x12c]
push edi
push eax
mov esi, ecx
mov dword [esp + 0x24], edi
call fcn.004b2fa0
add esp, 0xc
push 0x104
lea ecx, [esp + 0x12c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x499d7f
push 0x105
lea edx, [esp + 0x24]
push edi
push edx
call fcn.004b2fa0
mov ebp, dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x30]
push str._sddraw.dll
push ecx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499790
mov edi, dword [esp + 0x14]
cmp edi, 0x40002
ja 0x4996fc
mov eax, dword [esp + 0x10]
jb 0x499723
cmp eax, 0x5f
ja 0x4996fc
jb 0x499723
lea edx, [esi + 0xc]
push 0x4dd3e4
mov ebx, 1
push edx
mov dword [esi + 4], ebx
mov dword [esi + 8], 0
call ebp
mov eax, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x18], ebx
jmp 0x499728
mov ebx, 1
cmp edi, 0x40003
ja 0x49973b
jb 0x49975f
cmp eax, 0x448
ja 0x49973b
jb 0x49975f
lea eax, [esi + 0xc]
push 0x4dd3e4
push eax
mov dword [esi + 4], 2
mov dword [esi + 8], 0
call ebp
mov eax, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x18], ebx
cmp edi, 0x40004
ja 0x499770
jb 0x499790
cmp eax, 0x44
ja 0x499770
jb 0x499790
lea ecx, [esi + 0xc]
push 0x4dd3e4
push ecx
mov dword [esi + 4], 3
mov dword [esi + 8], 0
call ebp
add esp, 8
mov dword [esp + 0x18], ebx
push 0x105
lea edx, [esp + 0x24]
push 0
push edx
call fcn.004b2fa0
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x30]
push str._sd3drg8x.dll
push ecx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499805
mov eax, dword [esp + 0x14]
cmp eax, 0x40004
ja 0x4997e1
jb 0x499805
mov eax, dword [esp + 0x10]
cmp eax, 0x46
ja 0x4997e1
jb 0x499805
lea edx, [esi + 0xc]
push 0x4ed098
push edx
mov dword [esi + 4], 3
mov dword [esi + 8], 0
call ebp
add esp, 8
mov dword [esp + 0x18], 1
push 0x105
lea eax, [esp + 0x24]
push 0
push eax
call fcn.004b2fa0
lea ecx, [esp + 0x134]
push ecx
lea edx, [esp + 0x30]
push str._sddraw.dll
push edx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x4998f3
mov edi, dword [esp + 0x14]
cmp edi, 0x40005
ja 0x49985d
mov eax, dword [esp + 0x10]
jb 0x499888
cmp eax, 0x9b
ja 0x49985d
jb 0x499888
lea eax, [esi + 0xc]
push 0x4dd3e4
push eax
mov dword [esi + 4], 5
mov dword [esi + 8], 0
call ebp
mov eax, dword [esp + 0x18]
mov ebx, 1
add esp, 8
mov dword [esp + 0x18], ebx
jmp 0x49988d
mov ebx, 1
cmp edi, 0x40006
ja 0x4998a0
jb 0x4998c4
cmp eax, 0x13e
ja 0x4998a0
jb 0x4998c4
lea ecx, [esi + 0xc]
push 0x4dd3e4
push ecx
mov dword [esi + 4], 6
mov dword [esi + 8], 0
call ebp
mov eax, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x18], ebx
cmp edi, 0x40006
ja 0x4998d7
jb 0x4998f3
cmp eax, 0x1b4
ja 0x4998d7
jb 0x4998f3
lea edx, [esi + 0xc]
push 0x4dd3e4
push edx
mov dword [esi + 4], 6
mov dword [esi + 8], ebx
call ebp
add esp, 8
mov dword [esp + 0x18], ebx
push 0x105
lea eax, [esp + 0x24]
push 0
push eax
call fcn.004b2fa0
lea ecx, [esp + 0x134]
push ecx
lea edx, [esp + 0x30]
push str._sdplayx.dll
push edx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499967
mov eax, dword [esp + 0x14]
cmp eax, 0x40006
ja 0x499946
jb 0x499967
mov eax, dword [esp + 0x10]
cmp eax, 0x30206
ja 0x499946
jb 0x499967
lea eax, [esi + 0xc]
push 0x4ed098
mov edi, 1
push eax
mov dword [esi + 4], 6
mov dword [esi + 8], edi
call ebp
add esp, 8
mov dword [esp + 0x18], edi
push 0x105
lea ecx, [esp + 0x24]
push 0
push ecx
call fcn.004b2fa0
lea edx, [esp + 0x134]
push edx
lea eax, [esp + 0x30]
push str._sddraw.dll
push eax
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x4999de
mov eax, dword [esp + 0x14]
cmp eax, 0x40007
ja 0x4999ba
jb 0x4999de
mov eax, dword [esp + 0x10]
cmp eax, 0x2bc
ja 0x4999ba
jb 0x4999de
lea ecx, [esi + 0xc]
push 0x4dd3e4
push ecx
mov dword [esi + 4], 7
mov dword [esi + 8], 0
call ebp
add esp, 8
mov dword [esp + 0x18], 1
push 0x105
lea edx, [esp + 0x24]
push 0
push edx
call fcn.004b2fa0
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x30]
push str._sdinput.dll
push ecx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499a55
mov eax, dword [esp + 0x14]
cmp eax, 0x40007
ja 0x499a31
jb 0x499a55
mov eax, dword [esp + 0x10]
cmp eax, 0x2cc
ja 0x499a31
jb 0x499a55
lea edx, [esi + 0xc]
push 0x4ed098
push edx
mov dword [esi + 4], 7
mov dword [esi + 8], 0
call ebp
add esp, 8
mov dword [esp + 0x18], 1
push 0x105
lea eax, [esp + 0x24]
push 0
push eax
call fcn.004b2fa0
lea ecx, [esp + 0x134]
push ecx
lea edx, [esp + 0x30]
push str._sddraw.dll
push edx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499af9
mov edx, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov edi, edx
shr edi, 0x10
cmp di, 4
jne 0x499ab8
mov eax, 0x40008
push eax
mov ecx, 0x190
push ecx
push edx
push ebx
call fcn.00499e50
test eax, eax
jge 0x499ad5
cmp di, 5
jne 0x499af9
mov eax, 0x50001
push eax
mov ecx, 0x8d20190
push ecx
push edx
push ebx
call fcn.00499e50
test eax, eax
jl 0x499af9
lea eax, [esi + 0xc]
push 0x4dd3e4
push eax
mov dword [esi + 4], 8
mov dword [esi + 8], 0
call ebp
add esp, 8
mov dword [esp + 0x18], 1
push 0x105
lea ecx, [esp + 0x24]
push 0
push ecx
call fcn.004b2fa0
lea edx, [esp + 0x134]
push edx
lea eax, [esp + 0x30]
push str._sd3d8.dll
push eax
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499c07
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov edx, edi
shr edx, 0x10
cmp dx, 4
mov dword [esp + 0x1c], edx
jne 0x499b64
mov eax, 0x40008
push eax
mov ecx, 0x10371
push ecx
push edi
push ebx
call fcn.00499e50
test eax, eax
jge 0x499b81
cmp dx, 5
jne 0x499ba9
mov eax, 0x50001
push eax
mov ecx, 0xa280371
push ecx
push edi
push ebx
call fcn.00499e50
test eax, eax
jl 0x499ba9
lea ecx, [esi + 0xc]
push 0x4dd3e4
push ecx
mov dword [esi + 4], 8
mov dword [esi + 8], 1
call ebp
mov edx, dword [esp + 0x24]
add esp, 8
mov dword [esp + 0x18], 1
cmp dx, 4
jne 0x499bc6
mov eax, 0x40008
push eax
mov ecx, 0x10385
push ecx
push edi
push ebx
call fcn.00499e50
test eax, eax
jge 0x499be3
cmp dx, 5
jne 0x499c07
mov eax, 0x50001
push eax
mov ecx, 0xa280385
push ecx
push edi
push ebx
call fcn.00499e50
test eax, eax
jl 0x499c07
lea edx, [esi + 0xc]
push 0x4ed098
push edx
mov dword [esi + 4], 8
mov dword [esi + 8], 1
call ebp
add esp, 8
mov dword [esp + 0x18], 1
push 0x105
lea eax, [esp + 0x24]
push 0
push eax
call fcn.004b2fa0
lea ecx, [esp + 0x134]
push ecx
lea edx, [esp + 0x30]
push str._smpg2splt.dll
push edx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499c7b
mov eax, dword [esp + 0x14]
cmp eax, 0x60003
ja 0x499c5a
jb 0x499c7b
mov eax, dword [esp + 0x10]
cmp eax, 0x10375
ja 0x499c5a
jb 0x499c7b
lea eax, [esi + 0xc]
push 0x4ed09c
mov edi, 1
push eax
mov dword [esi + 4], 8
mov dword [esi + 8], edi
call ebp
add esp, 8
mov dword [esp + 0x18], edi
push 0x105
lea ecx, [esp + 0x24]
push 0
push ecx
call fcn.004b2fa0
lea edx, [esp + 0x134]
push edx
lea eax, [esp + 0x30]
push str._sdpnet.dll
push eax
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499d1f
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov edx, edi
shr edx, 0x10
cmp dx, 4
jne 0x499cde
mov eax, 0x40009
push eax
mov ecx, 0x86
push ecx
push edi
push ebx
call fcn.00499e50
test eax, eax
jge 0x499cfb
cmp dx, 5
jne 0x499d1f
mov eax, 0x50002
push eax
mov ecx, 0xe5d0086
push ecx
push edi
push ebx
call fcn.00499e50
test eax, eax
jl 0x499d1f
lea ecx, [esi + 0xc]
push 0x4dd3e4
push ecx
mov dword [esi + 4], 8
mov dword [esi + 8], 2
call ebp
add esp, 8
mov dword [esp + 0x18], 1
push 0x105
lea edx, [esp + 0x24]
push 0
push edx
call fcn.004b2fa0
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x30]
push str._sd3d9.dll
push ecx
call ebp
add esp, 0x18
lea ebx, [esp + 0x10]
lea edi, [esp + 0x20]
call fcn.00499db0
test eax, eax
je 0x499d76
mov dword [esi + 4], 9
mov dword [esi + 8], 0
push 0x4dd3e4
add esi, 0xc
push esi
call ebp
add esp, 8
jmp 0x499d85
cmp dword [esp + 0x18], 0
jne 0x499d85
xor edi, edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov ecx, dword [esp + 0x234]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov eax, 1
call fcn.004acfa0
add esp, 0x22c
ret