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

Disassembly:
push 0xffffffffffffffff
push 0x43d831
mov eax, dword fs:[0]
push eax
sub esp, 0x358
mov eax, dword [0x45302c]
xor eax, esp
mov dword [esp + 0x354], eax
push ebp
push esi
push edi
mov eax, dword [0x45302c]
xor eax, esp
push eax
lea eax, [esp + 0x368]
mov dword fs:[0], eax
mov eax, dword [esp + 0x378]
mov ebp, ecx
lea ecx, [esp + 0x164]
push ecx
push 0x100
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
call fcn.00419bf9
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40eca4
push 0x80004005
call fcn.00401000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x10], edi
mov dword [esp + 0x370], 0
xor eax, eax
mov cl, byte [esp + eax + 0x164]
mov byte [esp + eax + 0x264], cl
add eax, 1
test cl, cl
jne 0x40ecc1
mov ecx, dword [str..fd]
mov dl, byte [0x443acc]
mov esi, dword [sym.imp.KERNEL32.dll_FindFirstFileA]
lea eax, [esp + 0x1c]
mov dword [esp + 0x15c], ecx
push eax
lea ecx, [esp + 0x160]
push ecx
mov byte [esp + 0x168], dl
call esi
cmp eax, 0xffffffff
jne 0x40edad
lea edx, [esp + 0x164]
push edx
push str.CurDir
call fcn.0040d800
add esp, 8
lea edx, [esp + 0x264]
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx], cl
add eax, 1
add edx, 1
test cl, cl
jne 0x40ed30
lea eax, [esp + 0x264]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push 0
push str.CurDir
call fcn.0040d720
add esp, 8
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x160]
push edx
call esi
cmp eax, 0xffffffff
jne 0x40edad
push 0
push 0
push str.There_isnt_any_ROM_file_in_this_directory
mov ecx, ebp
call fcn.00415412
lea eax, [edi - 0x10]
mov dword [esp + 0x370], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40eda6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x40ef29
lea eax, [esp + 0x264]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40edb7
sub eax, edx
push eax
lea ecx, [esp + 0x268]
push ecx
lea ecx, [esp + 0x18]
call fcn.00403580
mov edx, dword [esp + 0x10]
cmp dword [edx - 0xc], 1
jge 0x40ee05
lea eax, [esp + 0x164]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40ede8
sub eax, edx
push eax
lea eax, [esp + 0x168]
push eax
lea ecx, [esp + 0x18]
call fcn.00403580
push 0x5c
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x1c]
push edx
call fcn.0040e300
add esp, 0xc
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x374], 1
call fcn.00403790
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x370], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ee53
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x48]
push ecx
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
push eax
call fcn.0040e140
add esp, 0xc
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x374], 2
call fcn.00403790
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x370], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40eea4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [esp + 0x10]
mov eax, dword [edi - 0xc]
xor esi, esi
test eax, eax
jle 0x40eee4
test esi, esi
jl 0x40ef52
cmp esi, eax
jg 0x40ef52
cmp byte [esi + edi], 0x5c
jne 0x40eeda
push 0x5c
push esi
lea ecx, [esp + 0x18]
call fcn.0040df30
mov edi, dword [esp + 0x10]
add esi, 3
mov eax, dword [edi - 0xc]
add esi, 1
cmp esi, eax
jl 0x40eeb1
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x1c]
call fcn.00403790
lea edx, [esp + 0x164]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea eax, [edi - 0x10]
mov dword [esp + 0x370], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ef27
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [esp + 0x368]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x354]
xor ecx, esp
call fcn.00424179
add esp, 0x364
ret 4
push 0x80070057
call fcn.00401000
int3