Function at 0x4124f0
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x250
mov eax, dword [0x420eb4]
mov edx, dword [0x420ebc]
push ebx
push esi
push edi
mov ecx, 7
mov esi, str.YmSoftNgsLib_
lea edi, [ebp - 0x44]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [0x420eb8]
mov dword [ebp - 0x24], eax
mov eax, dword [0x420ec0]
movsw word es:[edi], word [esi]
xor edi, edi
mov dword [ebp - 0x20], ecx
mov cx, word [0x420ec4]
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x18], eax
xor eax, eax
mov word [ebp - 0x14], cx
mov dword [edx], edi
mov dword [ebp - 0xc], eax
test edi, edi
jne 0x412766
sub eax, edi
je 0x412685
dec eax
je 0x412590
dec eax
jne 0x4126c6
push 0x104
lea eax, [ebp - 0x24c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [ebp - 0x24c]
push 0x5c
push ecx
call dword [sym.imp.MSVCRT.dll_wcsrchr]
add esp, 8
xor edx, edx
mov word [eax + 2], dx
jmp 0x4126b3
push 0
push 0x2b
lea eax, [ebp - 0x24c]
push eax
push 0
call dword [0x4256c8]
test eax, eax
jne 0x412632
lea ecx, [ebp - 8]
push ecx
push 0x20019
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x4125d0
mov dword [ebp - 8], 0
push 0x420450
push str.CommonFilesDir
lea edx, [ebp - 8]
push edx
mov eax, 0x104
lea esi, [ebp - 0x24c]
call fcn.0041e400
cmp eax, 0xffffffff
je 0x4125fd
cmp word [ebp - 0x24c], 0
jne 0x412624
push 0x104
lea eax, [ebp - 0x24c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ebx, 0x103
mov eax, str.:program_filescommon_files_
lea ecx, [ebp - 0x24a]
call fcn.004064f0
mov eax, dword [ebp - 8]
test eax, eax
je 0x412632
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x24c]
cmp word [eax], 0
je 0x412648
add eax, 2
lea ecx, [ebp - 0x44]
cmp eax, ecx
jb 0x412638
lea edx, [ebp - 0x24c]
cmp eax, edx
jbe 0x412670
cmp word [eax - 2], 0x5c
je 0x412670
lea ecx, [eax + 2]
lea edx, [ebp - 0x44]
cmp ecx, edx
jae 0x412670
mov edx, 0x5c
mov word [eax], dx
xor eax, eax
mov word [ecx], ax
mov ebx, 0x104
lea ecx, [ebp - 0x44]
lea eax, [ebp - 0x24c]
call fcn.00406540
jmp 0x4126b8
lea edx, [ebp - 0x24c]
xor ecx, ecx
push edx
mov word [ebp - 0x24c], cx
call fcn.0041d220
add esp, 4
test al, al
je 0x412756
cmp word [ebp - 0x24c], 0x20
jbe 0x412756
mov ebx, 0x104
lea ecx, [ebp - 0x24]
lea eax, [ebp - 0x24c]
call fcn.00406540
lea eax, [ebp - 0x24c]
push eax
call dword [0x4256b4]
mov edi, eax
test edi, edi
je 0x412756
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x420f90
push edi
call ebx
push str.ngsInitialize
push edi
mov esi, eax
call ebx
mov dword [ebp - 0x10], eax
test esi, esi
je 0x41274d
push 0
push 2
call esi
mov ebx, eax
add esp, 8
cmp ebx, 0x1040
jge 0x412712
mov ecx, dword [ebp + 8]
mov dword [ecx], ebx
jmp 0x41274d
push 0x11065
push 2
call esi
add esp, 8
test eax, eax
jne 0x412737
push 0x11065
push 3
call esi
mov edx, dword [ebp + 8]
add esp, 8
neg eax
mov dword [edx], eax
jmp 0x41274d
test ebx, ebx
je 0x41274d
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x41274d
push 0
call eax
add esp, 4
test al, al
jne 0x412756
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor edi, edi
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0xc], eax
cmp eax, 3
jl 0x412546
mov dword [0x4257d0], edi
mov eax, edi
pop edi
pop esi
mov dword [0x4255ec], 0x41d710
pop ebx
mov esp, ebp
pop ebp
ret