Function at 0x401230
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40f526
mov eax, dword fs:[0]
push eax
sub esp, 0xa48
mov eax, dword [0x4142e0]
xor eax, esp
mov dword [esp + 0xa40], eax
push ebx
push esi
push edi
mov eax, dword [0x4142e0]
xor eax, esp
push eax
lea eax, [esp + 0xa58]
mov dword fs:[0], eax
xor edi, edi
push 0x206
lea eax, [esp + 0x242]
push edi
push eax
mov word [esp + 0x248], di
call fcn.00404c80
add esp, 0xc
push 0x104
lea ecx, [esp + 0x240]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x23c]
push 0x5c
push edx
call fcn.00403d13
mov word [eax + 2], di
add esp, 8
mov ecx, 0x82
lea eax, [esp + 0x23c]
cmp word [eax], di
je 0x4012d5
add eax, 2
sub ecx, 1
jne 0x4012c6
jmp 0x4012f8
cmp ecx, edi
je 0x4012f8
mov eax, 0x82
sub eax, ecx
mov edx, 0x82
sub edx, eax
lea ecx, [esp + eax*2 + 0x23c]
mov eax, str.controls_
call fcn.004011d0
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
lea edx, [esp + 0x1c]
lea ecx, [esp + 0x23c]
mov dword [esp + 0xa60], edi
call fcn.00402350
push 0x206
lea eax, [esp + 0x64a]
push edi
push eax
mov word [esp + 0x650], di
call fcn.00404c80
add esp, 0xc
push 0x104
lea ecx, [esp + 0x648]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
cmp eax, edi
je 0x401392
mov ecx, 0x82
lea eax, [esp + 0x644]
lea esp, [esp]
cmp word [eax], di
je 0x40136f
add eax, 2
sub ecx, 1
jne 0x401360
jmp 0x401392
cmp ecx, edi
je 0x401392
mov eax, 0x82
sub eax, ecx
mov edx, 0x82
sub edx, eax
lea ecx, [esp + eax*2 + 0x644]
mov eax, str._system32_
call fcn.004011d0
mov ebx, dword [esp + 0x20]
cmp ebx, dword [esp + 0x24]
jbe 0x4013a1
call fcn.00403d03
mov dword [esp + 0x30], ebx
call fcn.00402630
mov byte [esp + 0x17], al
mov edi, edi
mov esi, dword [esp + 0x24]
cmp dword [esp + 0x20], esi
jbe 0x4013bf
call fcn.00403d03
cmp ebx, esi
je 0x401760
cmp ebx, dword [esp + 0x24]
jb 0x4013d2
call fcn.00403d03
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
jle 0x401610
push 0x2e
push eax
call fcn.0040382c
add esp, 8
cmp eax, edi
je 0x401610
sub eax, dword [ebx]
sar eax, 1
mov esi, eax
cmp esi, 0xffffffff
je 0x401610
cmp ebx, dword [esp + 0x24]
jb 0x40140a
call fcn.00403d03
lea ecx, [esi + 1]
lea esi, [esp + 0x18]
mov edx, ebx
call fcn.00401990
mov byte [esp + 0xa60], 1
mov esi, dword [esp + 0x18]
push 0x411c1c
push esi
call fcn.00403a3a
add esp, 8
test eax, eax
je 0x401465
push 0x411c24
push esi
call fcn.00403a3a
add esp, 8
test eax, eax
je 0x401465
lea eax, [esi - 0x10]
mov byte [esp + 0xa60], 0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x401604
push 0x206
lea ecx, [esp + 0x3a]
push edi
push ecx
mov word [esp + 0x40], di
call fcn.00404c80
add esp, 0xc
cmp ebx, dword [esp + 0x24]
jb 0x401488
call fcn.00403d03
mov eax, dword [ebx]
push eax
lea edx, [esp + 0x648]
push edx
push str._s_s
mov eax, 0x104
lea edi, [esp + 0x40]
call fcn.00401170
add esp, 0xc
mov eax, edi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4014f5
push 0x208
mov ecx, edi
push 0
push ecx
call fcn.00404c80
add esp, 0xc
cmp ebx, dword [esp + 0x24]
jb 0x4014d4
call fcn.00403d03
mov eax, dword [ebx]
push eax
lea edx, [esp + 0x240]
push edx
push str._s_s
mov eax, 0x104
lea edi, [esp + 0x40]
call fcn.00401170
add esp, 0xc
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
test esi, esi
je 0x401629
push str.DllRegisterServer
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x4015e1
call edi
mov ebx, eax
test ebx, ebx
je 0x4015dd
cmp ebx, 0x800401f0
jne 0x401540
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
call edi
mov ebx, eax
test ebx, ebx
je 0x4015dd
cmp byte [esp + 0x17], 0
je 0x4015bc
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor esi, esi
push 0x1fe
lea ecx, [esp + 0x44a]
push esi
push ecx
mov word [esp + 0x450], si
call fcn.00404c80
add esp, 0xc
lea edx, [esp + 0x34]
push edx
push str.__s___s
mov eax, 0x200
lea edi, [esp + 0x44c]
call fcn.00401170
mov eax, edi
push eax
call fcn.00402590
add esp, 0xc
cmp eax, 1
jne 0x4016af
lea eax, [esp + 0x18]
mov byte [esp + 0xa60], 0
call fcn.00401970
mov ebx, dword [esp + 0x30]
jmp 0x401610
cmp ebx, 0x80070005
jne 0x4016af
call fcn.004026b0
test eax, eax
jne 0x4016af
call edi
mov ebx, eax
test ebx, ebx
jmp 0x40159f
mov ebx, dword [esp + 0x30]
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov byte [esp + 0xa60], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x401610
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp ebx, dword [esp + 0x24]
jb 0x40161b
call fcn.00403d03
add ebx, 4
mov dword [esp + 0x30], ebx
xor edi, edi
jmp 0x4013b0
cmp ebx, dword [esp + 0x24]
jb 0x401634
call fcn.00403d03
mov ebx, dword [ebx]
push ebx
push 0x411c38
mov eax, 0x100
lea edi, [esp + 0x44c]
call fcn.00401170
add esp, 8
push 0x10
push 0x411c60
mov ecx, edi
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov byte [esp + 0xa60], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40168a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4016a8
mov edi, dword [esp + 0x24]
call fcn.00401c70
mov ecx, dword [esp + 0x20]
push ecx
call fcn.00403818
add esp, 4
xor eax, eax
jmp 0x4017b7
push 0x1fe
lea edx, [esp + 0x852]
push 0
push edx
mov word [esp + 0x858], 0
call fcn.00404c80
mov edi, dword [esp + 0x3c]
add esp, 0xc
cmp edi, dword [esp + 0x24]
jb 0x4016df
call fcn.00403d03
mov eax, dword [edi]
push ebx
push eax
push 0x411cf0
mov eax, 0x100
lea edi, [esp + 0x858]
call fcn.00401170
add esp, 0xc
cmp ebx, 0x80070005
je 0x401718
push 0x10
push 0x411c60
mov eax, edi
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x401724
lea ecx, [esp + 0x84c]
call fcn.004017e0
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov byte [esp + 0xa60], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x401753
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea esi, [esp + 0x1c]
call fcn.004019b0
xor eax, eax
jmp 0x4017b7
mov dword [esp + 0xa60], 0xffffffff
mov esi, dword [esp + 0x20]
cmp esi, edi
je 0x4017b2
mov edi, dword [esp + 0x24]
cmp esi, edi
je 0x4017a5
jmp 0x401780
mov eax, dword [esi]
sub eax, 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40179e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add esi, 4
cmp esi, edi
jne 0x401780
mov ecx, dword [esp + 0x20]
push ecx
call fcn.00403818
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0xa58]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xa40]
xor ecx, esp
call fcn.0040381d
mov esp, ebp
pop ebp
ret