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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4f4
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x2e8]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x40b3a3
mov eax, 0x7f
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401000
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x2e8]
push 0x5c
push eax
call fcn.0040109a
add esp, 8
test eax, eax
je 0x40b38f
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x4f0]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x4f0]
push 0x104
push eax
call fcn.0040107b
add esp, 8
cmp word [ebp + eax*2 - 0x4f2], 0x5c
jne 0x40b40a
lea eax, [eax*2 - 2]
cmp eax, 0x208
jae 0x40b5cf
xor ecx, ecx
mov word [ebp + eax - 0x4f0], cx
lea eax, [ebp - 0x4f0]
lea ecx, [ebp - 0x2e8]
mov dx, word [ecx]
cmp dx, word [eax]
jne 0x40b43c
test dx, dx
je 0x40b438
mov dx, word [ecx + 2]
cmp dx, word [eax + 2]
jne 0x40b43c
add ecx, 4
add eax, 4
test dx, dx
jne 0x40b416
xor eax, eax
jmp 0x40b441
sbb eax, eax
or eax, 1
test eax, eax
je 0x40b452
lea eax, [ebp - 0x2e8]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push str._twsetup3.dll
lea eax, [ebp - 0x2e8]
push 0x104
push eax
call fcn.0040100f
add esp, 0xc
test eax, eax
jne 0x40b38f
push edi
push 0xdc
push eax
lea eax, [ebp - 0xe0]
push eax
call fcn.00403350
push esi
lea eax, [ebp - 0xe0]
push 0x6e
push eax
call fcn.004015e7
push str.__DEVICEDEPEND
lea eax, [ebp - 0xe0]
push 0x6e
push eax
call fcn.0040100f
add esp, 0x24
lea eax, [ebp - 0x2e8]
mov esi, 0x7f
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
je 0x40b5bd
push str.TW_SetupEntryPointW
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40b4e9
push dword [ebp + 0xc]
lea ecx, [ebp - 0xe0]
push ecx
push 0
push 0
call eax
mov esi, eax
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
je 0x40b500
cmp esi, 0x80
jne 0x40b5bd
push 0xdc
lea eax, [ebp - 0xe0]
push 0
push eax
call fcn.00403350
push str._VERSIONCHECK
lea eax, [ebp - 0xe0]
push 0x6e
push eax
call fcn.004015e7
push str.__COMMON
lea eax, [ebp - 0xe0]
push 0x6e
push eax
call fcn.0040100f
add esp, 0x24
lea eax, [ebp - 0x2e8]
mov edi, 0x7f
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x4f4], eax
test eax, eax
je 0x40b586
push str.TW_SetupEntryPointW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40b57a
push dword [ebp + 0xc]
lea ecx, [ebp - 0xe0]
push ecx
push 0
push 0
call eax
mov edi, eax
push dword [ebp - 0x4f4]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp esi, 0x80
jne 0x40b5ab
test edi, edi
je 0x40b596
cmp edi, esi
jne 0x40b5ab
pop edi
mov eax, 0x80
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401000
mov esp, ebp
pop ebp
ret
mov eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401000
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
xor ecx, ebp
pop esi
call fcn.00401000
mov esp, ebp
pop ebp
ret
call fcn.0040150b
int3