Function at 0x403040
Capabilities:
Check mutex on windows
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4ba008
mov eax, dword fs:[0]
push eax
sub esp, 0x7d8
mov eax, dword [0x4e88d0]
xor eax, esp
mov dword [esp + 0x7d0], eax
push ebx
push esi
push edi
mov eax, dword [0x4e88d0]
xor eax, esp
push eax
lea eax, [esp + 0x7e8]
mov dword fs:[0], eax
xor ebx, ebx
push ebx
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x4c5b40
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40310f
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.RobotSoft_AutoHotkey_TrayWnd_IZKRFW2N
push ebx
call dword [sym.imp.USER32.dll_FindWindowW]
cmp eax, ebx
je 0x4030e9
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
push ebx
push ebx
push 0x8001
push eax
call edi
mov esi, eax
cmp esi, ebx
je 0x4030e9
push ebx
push 0x3f3
push 0x111
push esi
call edi
push esi
call dword [sym.imp.USER32.dll_SetForegroundWindow]
xor eax, eax
mov ecx, dword [esp + 0x7e8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x7d0]
xor ecx, esp
call fcn.00491581
mov esp, ebp
pop ebp
ret
call fcn.00402fa0
push 0x4f3e18
mov dword [0x4f3e18], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
call fcn.00402d50
push 0x4f3f30
mov ecx, 0x4f4370
call fcn.00405200
mov edx, dword [0x4f437c]
mov eax, dword [edx - 8]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x104
or eax, ecx
jge 0x40316c
push 0x104
mov ecx, 0x4f437c
call fcn.004020a0
mov edx, dword [0x4f437c]
mov esi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push ebx
push 0x1a
push edx
push ebx
call esi
mov eax, dword [0x4f437c]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00491b18
add esp, 8
cmp eax, ebx
jl 0x403378
mov ecx, dword [0x4f437c]
cmp eax, dword [ecx - 8]
jg 0x403378
mov dword [ecx - 0xc], eax
mov edx, dword [0x4f437c]
xor ecx, ecx
push 0x27
mov word [edx + eax*2], cx
push str.RobotSoftAutomatic_Mouse_and_Keyboard
mov ecx, 0x4f437c
call fcn.00404e80
mov eax, dword [0x4f437c]
push eax
call fcn.00402de0
mov ecx, dword [0x4f437c]
add esp, 4
push ecx
push str._s_amk.ini
push 0x4f4380
call fcn.004021f0
mov edx, dword [0x4f4374]
mov eax, dword [edx - 8]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x104
add esp, 0xc
or eax, ecx
jge 0x403218
push 0x104
mov ecx, 0x4f4374
call fcn.004020a0
mov edx, dword [0x4f4374]
push ebx
push 5
push edx
push ebx
call esi
mov eax, dword [0x4f4374]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00491b18
add esp, 8
cmp eax, ebx
jl 0x403378
mov ecx, dword [0x4f4374]
cmp eax, dword [ecx - 8]
jg 0x403378
mov dword [ecx - 0xc], eax
mov ecx, dword [0x4f4374]
xor edx, edx
push 0x1d
mov word [ecx + eax*2], dx
push 0x4c5c58
mov ecx, 0x4f4374
call fcn.00404e80
push str.Scripts
lea edx, [esp + 0x14]
push 0x4f4374
push edx
call fcn.00404bf0
add esp, 0xc
push eax
mov ecx, 0x4f4378
mov dword [esp + 0x7f4], ebx
call fcn.00401e10
or esi, 0xffffffff
mov dword [esp + 0x7f0], esi
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4032ba
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ebx
call fcn.00437540
add esp, 4
xor ecx, ecx
cmp eax, esi
setne cl
push ebx
lea edx, [esp + 0x20]
push edx
lea eax, [edi + 0xa4]
push eax
mov dword [esp + 0x28], 1
mov dword [0x4f3e14], ecx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
call sub.gdiplus.dll_GdiplusStartup
lea ecx, [esp + 0x14]
push ecx
mov dword [esp + 0x18], 8
mov dword [esp + 0x1c], 0xff
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
mov ecx, edi
call fcn.0047c0ce
push ebx
call fcn.0047d1f0
add esp, 4
push str.Local_AppWizard_Generated_Applications
mov ecx, edi
call fcn.0047d6c3
push ebx
call fcn.00491d11
add esp, 4
push eax
call fcn.00491cdd
add esp, 4
lea edx, [esp + 0x2c]
push edx
call fcn.00426840
lea eax, [esp + 0x2c]
mov dword [esp + 0x7f0], 1
mov ecx, eax
mov dword [edi + 0x20], eax
call fcn.00472dfc
lea ecx, [esp + 0x2c]
push ecx
mov dword [esp + 0x7f4], esi
call fcn.00403390
jmp 0x4030e9
push 0x80070057
call fcn.00402120
int3