Function at 0x416140
Capabilities:
Get common file path
Write file on windows

Disassembly:
sub esp, 0x140
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
push ebp
push esi
xor esi, esi
mov dword [esp + 0x18], esi
push edi
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], ecx
cmp dword [eax + 0x84], esi
jbe 0x4163d1
mov edx, dword [eax + 0x80]
add edx, ecx
mov dword [esp + 0x14], edx
cmp dword [eax + 0x8c], esi
je 0x4162c6
mov ebp, dword [eax + 0x88]
lea edx, [esp + 0x40]
push edx
xor eax, eax
push 0x104
add ebp, ecx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x28], 0x20
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea edi, [esp + eax + 0x40]
mov ecx, 9
mov esi, str.AutoHotkey.MemoryModule.temp.manifest
rep movsd dword es:[edi], dword [esi]
xor ecx, ecx
lea eax, [esp + 0x40]
movsw word es:[edi], word [esi]
mov dword [esp + 0x28], eax
cmp dword [0x4bdefc], ecx
je 0x4162c6
movzx edx, word [ebp + 0xe]
movzx eax, word [ebp + 0xc]
add edx, eax
test edx, edx
jle 0x4162c6
lea eax, [ebp + 0x10]
nop
test dword [eax + 4], 0x80000000
je 0x41620f
cmp word [eax], 0x18
je 0x41621c
inc ecx
add eax, 8
cmp ecx, edx
jl 0x416200
jmp 0x4162c6
mov ecx, dword [eax + 4]
push 0
push pe_nt_image_headers32
push 2
and ecx, 0x7fffffff
mov edx, dword [ecx + ebp + 0x14]
push 0
and edx, 0x7fffffff
mov esi, dword [edx + ebp + 0x14]
push 0
push 0x40000000
lea eax, [esp + 0x58]
add esi, ebp
mov ebp, dword [sym.imp.KERNEL32.dll_CreateFileA]
push eax
call ebp
mov edi, eax
cmp edi, 0xffffffff
je 0x4162c6
push 0
mov dword [esp + 0x1c], 0
mov eax, dword [esi]
mov edx, dword [esi + 4]
add eax, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
push edx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
cmp dword [esp + 0x18], 0
je 0x4162c6
lea ecx, [esp + 0x20]
push ecx
call dword [0x4bdefc]
push 0
push 0x4000100
push 3
push 0
push 4
push 0x40000000
lea edx, [esp + 0x58]
push edx
mov esi, eax
call ebp
push eax
call edi
cmp esi, 0xffffffff
je 0x4162c6
lea eax, [esp + 0x1c]
push eax
push esi
call dword [0x4bdf04]
mov ecx, dword [esp + 0x14]
push 0x14
push ecx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4163d1
jmp 0x4162e0
mov edx, dword [esp + 0x14]
mov eax, dword [edx + 0xc]
test eax, eax
je 0x4163d1
mov ecx, dword [ebx + 0x20]
add eax, dword [esp + 0x10]
push ecx
push eax
mov eax, dword [ebx + 0x14]
call eax
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x4163f5
mov ecx, dword [ebx + 0xc]
mov eax, dword [ebx + 8]
lea edx, [ecx*4 + 4]
push edx
push eax
call fcn.004924ea
add esp, 8
test eax, eax
je 0x416407
mov ecx, dword [ebx + 0xc]
mov dword [ebx + 8], eax
mov dword [eax + ecx*4], ebp
inc dword [ebx + 0xc]
mov ecx, dword [esp + 0x14]
mov esi, dword [ecx]
test esi, esi
je 0x41634c
mov eax, dword [esp + 0x10]
mov edi, dword [ecx + 0x10]
add esi, eax
add edi, eax
jmp 0x416355
mov esi, dword [ecx + 0x10]
add esi, dword [esp + 0x10]
mov edi, esi
mov eax, dword [esi]
test eax, eax
je 0x41639a
sub edi, esi
mov ecx, dword [ebx + 0x20]
push ecx
test eax, eax
jns 0x416373
mov edx, dword [ebx + 0x18]
and eax, 0xffff
push eax
push ebp
call edx
jmp 0x416382
mov edx, dword [esp + 0x14]
mov ecx, dword [ebx + 0x18]
lea eax, [eax + edx + 2]
push eax
push ebp
call ecx
add esp, 0xc
mov dword [edi + esi], eax
test eax, eax
je 0x4163b4
mov eax, dword [esi + 4]
add esi, 4
test eax, eax
jne 0x41635d
mov ecx, dword [esp + 0x14]
add ecx, 0x14
push 0x14
push ecx
mov dword [esp + 0x1c], ecx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
je 0x4162e0
jmp 0x4163d1
mov ecx, dword [ebx + 0x20]
mov edx, dword [ebx + 0x1c]
push ecx
push ebp
mov dword [esp + 0x14], 0
call edx
add esp, 8
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [0x4bdf00]
test eax, eax
je 0x4163e7
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x4163e7
push ecx
push 0
call eax
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebp
add esp, 0x140
ret
push 0x7e
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [esp + 0xc], 0
jmp 0x4163d1
mov edx, dword [ebx + 0x20]
mov eax, dword [ebx + 0x1c]
push edx
push ebp
call eax
add esp, 8
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [esp + 0xc], 0
jmp 0x4163d1