Function at 0x40d940
Capabilities:
Get common file path
Resolve function by parsing pe exports
Set current directory

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x41f51a
push eax
mov dword fs:[0], esp
sub esp, 0x294
push ebx
push ebp
push esi
push edi
push str.CMainFrame::DeleteRegEBAPILocal___n
mov esi, ecx
call fcn.00403770
add esp, 4
push 0x104
lea eax, [esp + 0x64]
push eax
mov ebp, 1
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea ecx, [esp + 0x60]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea edx, [esp + 0x164]
push edx
push str.epbidapi.dll
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
je 0x40d9b4
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, ebp
jmp 0x40dd79
mov ecx, esi
call fcn.00406540
test eax, eax
je 0x40dd79
push ecx
lea edi, [esi + 0x8c]
mov ecx, esp
mov dword [esp + 0x20], esp
push edi
call fcn.00402330
lea eax, [esp + 0x28]
push eax
mov ecx, esi
call fcn.00408a70
lea ebx, [esi + 0xa0]
push eax
mov ecx, ebx
mov dword [esp + 0x2b0], 0
call fcn.00401940
lea ecx, [esp + 0x24]
mov dword [esp + 0x2ac], 0xffffffff
call fcn.00401910
mov ecx, dword [ebx]
push ecx
push str.CMainFrame::DeleteRegEBAPILocal___m_csInfFileName_:__s_n
call fcn.00403770
add esp, 8
mov ecx, ebx
call fcn.00401d50
test eax, eax
je 0x40da42
push 0
push 0xc8
push 3
call fcn.00403950
add esp, 0xc
xor ebp, ebp
jmp 0x40dd69
lea edx, [esp + 0x28]
push edx
mov ecx, esi
call fcn.00408990
push 0x4202c0
push eax
lea eax, [esp + 0x2c]
push eax
mov dword [esp + 0x2b8], 1
call fcn.004024e0
push edi
push eax
lea ecx, [esp + 0x34]
push ecx
mov byte [esp + 0x2c4], 2
call fcn.00402410
add esp, 0x18
lea ecx, [esp + 0x24]
mov byte [esp + 0x2ac], 5
call fcn.00401910
lea ecx, [esp + 0x28]
mov byte [esp + 0x2ac], 4
call fcn.00401910
mov eax, dword [esi + 0x2c]
test eax, eax
push 0x10
je 0x40dae8
call fcn.0041563f
mov edi, eax
add esp, 4
mov dword [esp + 0x18], edi
test edi, edi
mov byte [esp + 0x2ac], 6
je 0x40db23
mov edx, dword [esi + 0x78]
push 0xf003f
push 1
push edx
lea ecx, [esp + 0x2c]
call fcn.00402cb0
push eax
push 0x80000002
mov ecx, edi
call fcn.00413990
jmp 0x40db25
call fcn.0041563f
mov esi, eax
add esp, 4
mov dword [esp + 0x18], esi
test esi, esi
mov byte [esp + 0x2ac], 7
je 0x40db23
push 0xf003f
push 0
push 0
lea ecx, [esp + 0x2c]
call fcn.00402cb0
push eax
push 0x80000002
mov ecx, esi
call fcn.00413990
jmp 0x40db25
xor eax, eax
mov esi, eax
test esi, esi
mov byte [esp + 0x2ac], 4
je 0x40dd42
mov eax, dword [esi + 8]
test eax, eax
je 0x40dd42
lea ecx, [esp + 0x14]
call fcn.004017b0
lea ecx, [esp + 0x30]
mov byte [esp + 0x2ac], 8
call fcn.00404aa0
lea ecx, [esp + 0x10]
mov byte [esp + 0x2ac], 9
call fcn.004017b0
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push str.Install
mov byte [esp + 0x2b4], 0xa
call fcn.00402390
push ecx
mov ecx, esp
mov dword [esp + 0x24], esp
push ebx
mov byte [esp + 0x2b8], 0xb
call fcn.00402330
lea ecx, [esp + 0x38]
mov byte [esp + 0x2b4], 0xa
call fcn.004050a0
test eax, eax
jne 0x40dbc4
push eax
push 8
push 6
call fcn.00403950
add esp, 0xc
xor ebp, ebp
jmp 0x40dd05
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x34]
call fcn.004053f0
test eax, eax
je 0x40dd05
lea ebx, [ebx]
lea ecx, [esp + 0x14]
call fcn.00402370
lea ecx, [esp + 0x10]
push str.LPT_ReadTotalTimeOut_NT40
push ecx
call fcn.004015c0
add esp, 8
test al, al
jne 0x40dcc3
lea edx, [esp + 0x10]
push str.LPT_ReadTotalTimeOut
push edx
call fcn.004015c0
add esp, 8
test al, al
jne 0x40dcc3
lea eax, [esp + 0x10]
push str.SETLPT
push eax
call fcn.004015c0
add esp, 8
test al, al
je 0x40dc76
push ecx
lea edx, [esp + 0x3c]
mov ecx, esp
mov dword [esp + 0x30], esp
push edx
call fcn.00402330
lea eax, [esp + 0x20]
push eax
call fcn.00404b20
add esp, 8
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x2b0], 0xc
call fcn.00401940
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2ac], 0xa
call fcn.00401910
jmp 0x40dcd1
push 4
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [esp + 0x18]
call fcn.00402a80
push str.LPT_
push eax
mov byte [esp + 0x2b4], 0xd
call fcn.004015c0
add esp, 8
lea ecx, [esp + 0x18]
mov bl, al
mov byte [esp + 0x2ac], 0xa
call fcn.00401910
test bl, bl
je 0x40dcd1
lea edx, [esp + 0x10]
push edx
lea ecx, [esp + 0x18]
call fcn.00401940
jmp 0x40dcd1
push str.LPT_ReadTotalTimeOut
lea ecx, [esp + 0x18]
call fcn.004019c0
lea ecx, [esp + 0x14]
call fcn.00401d50
test eax, eax
jne 0x40dcef
lea ecx, [esp + 0x14]
call fcn.00402cb0
push eax
mov ecx, esi
call fcn.004136f0
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x34]
call fcn.004053f0
test eax, eax
jne 0x40dbe0
mov edx, dword [esi]
push 1
mov ecx, esi
call dword [edx]
lea ecx, [esp + 0x10]
mov byte [esp + 0x2ac], 9
call fcn.00401910
lea ecx, [esp + 0x30]
mov byte [esp + 0x2ac], 8
call fcn.00405030
lea ecx, [esp + 0x14]
mov byte [esp + 0x2ac], 4
call fcn.00401910
jmp 0x40dd55
push 0
push 0xc9
push 3
call fcn.00403950
add esp, 0xc
xor ebp, ebp
lea ecx, [esp + 0x20]
mov dword [esp + 0x2ac], 0xffffffff
call fcn.00401910
push ebp
push str.CMainFrame::DeleteRegEBAPILocal___result_:__d_n
call fcn.00403770
add esp, 8
mov eax, ebp
mov ecx, dword [esp + 0x2a4]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x2a0
ret