Function at 0x405020
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
mov eax, dword [ebp + 8]
sub esp, 0x58
mov dword [0x4af0ec], eax
push esi
push edi
push 0x4af0d4
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 1
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push 0x4aef88
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jne 0x40512c
mov byte [0x4aef88], al
mov edi, 0x49e065
mov ecx, 1
mov dword [0x4af0d0], edi
mov edi, dword [0x4ae0a8]
xor dl, dl
mov byte [esp + 0x14], 0
mov esi, ecx
mov byte [esp + 0xa], dl
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], edi
cmp edi, ecx
jle 0x40522b
mov eax, dword [0x4ae0ac]
mov edi, dword [eax + esi*4]
test dl, dl
je 0x40518d
push ecx
lea eax, [esp + 0x44]
push 0x49e084
push eax
call fcn.00485e6d
add esp, 0xc
mov dword [esp + 0x1c], eax
cmp byte [esp + 0x40], 0
je 0x40570d
lea ecx, [esp + 0xb]
push ecx
push 3
lea ecx, [esp + 0x20]
push ecx
push eax
lea eax, [esp + 0x50]
mov ecx, 0x4b09a0
push eax
call fcn.00421d40
test eax, eax
jne 0x405110
cmp byte [esp + 0xb], al
mov ecx, 0x4b09a0
setne al
inc eax
push eax
push dword [esp + 0x1c]
lea eax, [esp + 0x48]
push dword [esp + 0x24]
push eax
call fcn.00421fd0
test eax, eax
je 0x40570d
push 1
push 0
push 0xffffffffffffffff
push edi
mov ecx, eax
call fcn.004759c0
mov ecx, dword [esp + 0xc]
inc ecx
mov dword [esp + 0xc], ecx
jmp 0x405216
cmp byte [0x4aef88], 0
je 0x405063
mov esi, 0x4aef88
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x405141
sub esi, ecx
lea ecx, [esi + 1]
call fcn.0046ffd0
mov edi, eax
test edi, edi
jne 0x405171
push 0x4aef88
push str.Out_of_memory.
mov ecx, 0x4b09a0
call fcn.0042e360
jmp 0x405068
test esi, esi
je 0x405184
push esi
push 0x4aef88
push edi
call fcn.0048e4b0
add esp, 0xc
mov byte [edi + esi], 0
jmp 0x405068
push 0x49e088
push edi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x40520d
push str._restart
push edi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x40520d
push 0x49e098
push edi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x405204
push str._force
push edi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x405204
push str._ErrorStdOut
push edi
call fcn.004855c8
mov ecx, dword [esp + 0x14]
add esp, 8
test eax, eax
jne 0x4051f4
mov byte [0x4b0fb7], 1
jmp 0x405216
dec esi
mov dl, 1
mov byte [esp + 0xa], dl
lea edi, [esi + 1]
mov dword [esp + 0x10], edi
jmp 0x40521e
mov byte [0x4af0be], 1
jmp 0x405212
mov byte [esp + 0x14], 1
mov ecx, dword [esp + 0xc]
mov edi, dword [esp + 0x10]
mov dl, byte [esp + 0xa]
inc esi
cmp esi, dword [0x4ae0a8]
jl 0x405096
lea eax, [esp + 0xb]
mov ecx, 0x4b09a0
push eax
push 3
lea eax, [esp + 0x24]
push eax
push 0
push 0x49e080
call fcn.00421d40
mov esi, eax
test esi, esi
jne 0x405275
cmp byte [esp + 0xb], al
mov ecx, 0x4b09a0
setne al
inc eax
push eax
push dword [esp + 0x20]
push esi
push 0x49e080
call fcn.00421fd0
mov esi, eax
test esi, esi
je 0x40570d
cmp byte [esi + 0x17], 0
jne 0x40527e
mov esi, dword [esi + 0xc]
mov al, byte [esi + 0x15]
test al, 2
je 0x405292
and al, 0x3d
mov byte [esi + 0x15], al
mov eax, dword [esi]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov eax, dword [esp + 0xc]
dec eax
cdq
mov dword [esi], eax
mov al, byte [esi + 0x15]
and al, 0x8b
mov dword [esi + 4], edx
or al, 0x18
mov byte [esi + 0x15], al
jns 0x4052b6
mov ecx, esi
call fcn.004023f0
and byte [esi + 0x15], 0x8f
jmp 0x4052db
cmp dword [0x4af0b8], 0
je 0x4052c3
test al, 0x10
jne 0x4052d0
cmp dword [0x4af0b4], 0
je 0x4052db
test al, 0x20
je 0x4052db
test al, 8
je 0x4052db
mov ecx, esi
call fcn.004023f0
lea eax, [esp + 0xa]
mov ecx, 0x4b09a0
push eax
push 0xc1
lea eax, [esp + 0x20]
push eax
push 6
push str.A_Args
call fcn.00421d40
mov esi, eax
test esi, esi
jne 0x40532e
cmp byte [esp + 0xa], al
mov ecx, 0x4b09a0
setne al
inc eax
or eax, 0xc0
push eax
push dword [esp + 0x1c]
push 6
push str.A_Args
call fcn.00421fd0
mov esi, eax
test esi, esi
je 0x40570d
mov ecx, dword [0x4ae0ac]
mov edx, dword [0x4ae0a8]
sub edx, edi
lea ecx, [ecx + edi*4]
call fcn.0046c240
test eax, eax
je 0x40570d
push eax
mov ecx, esi
call fcn.00475ca0
call fcn.00404eb0
call fcn.00401d30
test eax, eax
je 0x40571a
movdqu xmm0, xmmword [str._IxkgzkZnxkgjK]
mov al, byte [0x49df84]
lea ecx, [esp + 0x20]
mov byte [esp + 0x30], al
lea esi, [ecx + 1]
movdqu xmmword [esp + 0x20], xmm0
xor edx, edx
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405386
sub ecx, esi
test cl, cl
jle 0x4053b0
add byte [esp + edx + 0x20], 0xfa
lea ecx, [esp + 0x20]
inc edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4053a0
sub ecx, esi
movsx eax, cl
cmp edx, eax
jl 0x405393
lea eax, [esp + 0x20]
push eax
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
push 0
test esi, esi
je 0x4053fb
push 0x10000
push 0x1000
push 0
push 4
push 0
push 0x401d10
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
push 0
push 0x1fffff
push 0x4afb94
call esi
jmp 0x405413
push 0
push 0
push 0x401d10
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x4afb94], eax
lea ecx, [esp + 0x20]
xor edx, edx
lea esi, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405420
sub ecx, esi
test cl, cl
jle 0x405450
lea ecx, [ecx]
add byte [esp + edx + 0x20], 6
lea ecx, [esp + 0x20]
inc edx
lea esi, [ecx + 1]
lea ecx, [ecx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405440
sub ecx, esi
movsx eax, cl
cmp edx, eax
jl 0x405430
push dword [esp + 0x14]
mov ecx, 0x4b09a0
sub esp, 8
call fcn.00416980
cmp eax, 1
jne 0x40570d
mov esi, dword [0x4ac1d8]
mov ecx, 0x3a
mov edi, 0x4aee98
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x4b09a0
call fcn.00417740
cmp eax, 0xffffffff
je 0x40570d
test eax, eax
je 0x405703
mov eax, dword [0x4af0cc]
test eax, eax
jne 0x4054df
mov eax, dword [0x4ad8fc]
cmp word [eax], 0
jne 0x4054d3
cmp dword [0x4afb10], 0
jne 0x4054d3
cmp dword [0x4af0c8], 0
jne 0x4054d3
cmp dword [0x4af0c4], 0
jne 0x4054d3
cmp byte [0x4af0bd], 0
je 0x40555b
mov dword [0x4af0cc], 1
jmp 0x4054e4
cmp eax, 4
je 0x40555b
cmp byte [esp + 0x14], 0
jne 0x405566
cmp byte [0x4af0be], 0
jne 0x4055ee
push dword [0x4b0fb0]
push str.AutoHotkey
call dword [sym.imp.USER32.dll_FindWindowA]
mov edi, eax
test edi, edi
je 0x4055ee
mov eax, dword [0x4af0cc]
cmp eax, 3
je 0x405703
cmp eax, 2
je 0x405554
sub esp, 8
xorps xmm0, xmm0
mov edx, 4
mov ecx, str.An_older_instance_of_this_script_is_already_running.__Replace_it_with_this_instance__nNote:_To_avoid_this_message__see_SingleInstance_in_the_help_file.
movsd qword [esp], xmm0
push 0
push dword [0x4b0fa4]
call fcn.00477510
add esp, 0x10
cmp eax, 7
je 0x405703
mov eax, 0x407
jmp 0x405582
cmp byte [esp + 0x14], 0
je 0x4055ee
push dword [0x4b0fb0]
push str.AutoHotkey
call dword [sym.imp.USER32.dll_FindWindowA]
mov edi, eax
test edi, edi
je 0x4055ee
mov eax, 0x406
push 0
push eax
push 0x44
push edi
call dword [sym.imp.USER32.dll_PostMessageA]
push 0x14
xor esi, esi
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4055e6
cmp esi, 0x64
jne 0x4055d2
sub esp, 8
lea edx, [esi - 0x60]
xorps xmm0, xmm0
mov ecx, str.Could_not_close_the_previous_instance_of_this_script.__Keep_waiting_
movsd qword [esp], xmm0
push 0
push 0
call fcn.00477510
add esp, 0x10
cmp eax, 7
je 0x40570d
xor esi, esi
push 0x14
inc esi
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
jne 0x4055a3
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [sym.imp.USER32.dll_SystemParametersInfoA]
push 0
push 0x4af1e8
push 0
push 0x2000
call esi
test eax, eax
je 0x40561e
cmp dword [0x4af1e8], 0
je 0x40561e
push 2
push 0
push 0
push 0x2001
call esi
mov ecx, 0x4b09a0
call fcn.00416c00
cmp eax, 1
jne 0x40570d
push 0
push 4
push 0
call fcn.00486091
add eax, 0x20
push eax
call fcn.00485ef1
mov eax, dword [0x4ac1dc]
add esp, 0x10
test eax, eax
je 0x405672
imul esi, eax, 0x70
push esi
call fcn.00485a15
add esp, 4
mov dword [0x4af0c0], eax
test eax, eax
je 0x405672
push esi
push 0
push eax
call fcn.0048fd00
add esp, 0xc
call fcn.0040b0d0
lea eax, [esp + 0xb]
mov byte [0x4b0fb4], 1
push eax
push 3
lea eax, [esp + 0x24]
mov byte [0x4af0bc], 0
push eax
push 0
push str.Clipboard
mov ecx, 0x4b09a0
call fcn.00421d40
mov esi, eax
test esi, esi
jne 0x4056cb
cmp byte [esp + 0xb], al
mov ecx, 0x4b09a0
setne al
inc eax
push eax
push dword [esp + 0x20]
push esi
push str.Clipboard
call fcn.00421fd0
mov esi, eax
test esi, esi
je 0x4056eb
cmp byte [esi + 0x17], 0
jne 0x4056d4
mov esi, dword [esi + 0xc]
test byte [esi + 0x15], 0x80
jne 0x4056eb
mov ecx, esi
call fcn.004023f0
mov al, byte [esi + 0x15]
and al, 0xf
or al, 0x80
mov byte [esi + 0x15], al
mov ecx, 0x4b09a0
call fcn.004171e0
test eax, eax
je 0x40570d
xor edx, edx
lea ecx, [edx + 0xa]
call fcn.004027d0
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x10
pop edi
mov eax, 2
pop esi
mov esp, ebp
pop ebp
ret 0x10
call fcn.004011d0
int3