Function at 0x4014cb
Capabilities:
Extract resource via kernel32 functions
Get common file path
Get file size
Query environment variable
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
push ebx
push 0x1000
push 0x403450
call sub.kernel32.dll_GetSystemDirectoryA
push 0x403450
call dword [0x4106ac]
push 0x1000
push 0x404450
call sub.kernel32.dll_GetWindowsDirectoryA
push 0x404450
call dword [0x4106ac]
push 0x405450
push 0x1000
call sub.kernel32.dll_GetTempPathA
push 0x405450
call dword [0x4106ac]
push 0x200
push 0x410460
push 0
call sub.kernel32.dll_GetModuleFileNameA
push 0x410460
call dword [0x4106a8]
mov byte [eax], 0
push 0x1000
push 0x407450
push str.APPDATA
call sub.kernel32.dll_GetEnvironmentVariableA
push 0x407450
call dword [0x4106ac]
push 1
push 7
push 0x408450
push 0
call dword [0x4106a0]
push 0x408450
call dword [0x4106ac]
push 1
push 0x10
push 0x409450
push 0
call dword [0x4106a0]
push 0x409450
call dword [0x4106ac]
call fcn.00401189
call fcn.0040117e
call fcn.00401a6f
mov ebx, dword [0x4106cc]
xor ecx, ecx
inc ecx
push ecx
push 0xa
push ecx
push 0
call sub.kernel32.dll_FindResourceA
or eax, eax
jne 0x4015c2
jmp 0x4019e6
mov dword [0x410674], eax
push eax
push 0
call sub.kernel32.dll_SizeofResource
or eax, eax
jne 0x4015d8
jmp 0x4019e6
mov dword [0x410678], eax
push dword [0x410674]
push 0
call sub.kernel32.dll_LoadResource
or eax, eax
jne 0x4015f3
jmp 0x4019e6
mov dword [0x41067c], eax
push eax
call sub.kernel32.dll_LockResource
or eax, eax
jne 0x401607
jmp 0x4019e6
mov dword [0x410680], eax
push dword [0x410678]
push 0x40
call sub.kernel32.dll_GlobalAlloc
or eax, eax
jne 0x401622
jmp 0x4019e6
mov dword [0x410684], eax
mov eax, dword [0x410680]
mov ecx, dword [eax]
mov dword [ebp - 0x2c], ecx
mov ecx, dword [eax + 4]
mov dword [ebp - 0x20], ecx
add eax, 8
mov ecx, dword [0x410678]
sub ecx, 8
push ecx
push eax
push dword [0x410684]
call sub.kernel32.dll_RtlMoveMemory
push dword [0x410678]
push dword [0x410684]
call fcn.00401312
push dword [ebp - 0x20]
push 0x40
call sub.kernel32.dll_GlobalAlloc
or eax, eax
jne 0x401674
jmp 0x4019e6
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x2c], 0
jne 0x401690
push dword [ebp - 0x20]
push dword [0x410684]
push dword [ebp - 0x24]
call sub.kernel32.dll_RtlMoveMemory
jmp 0x4016b1
lea eax, [ebp - 0x28]
push eax
mov eax, dword [0x410678]
sub eax, 8
push eax
push dword [0x410684]
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push 2
call dword [0x4106c4]
push dword [0x410684]
call sub.kernel32.dll_GlobalFree
mov eax, dword [ebx]
add ebx, 4
push eax
push eax
push ebx
push 0x410060
call sub.kernel32.dll_lstrcpynA
pop eax
add ebx, eax
mov eax, dword [ebx]
mov dword [ebp - 4], eax
add ebx, 4
mov eax, dword [ebx]
mov dword [ebp - 8], eax
add ebx, 4
mov eax, dword [ebx]
mov dword [ebp - 0xc], eax
add ebx, 4
mov eax, dword [ebx]
mov dword [ebp - 0x10], eax
add ebx, 4
mov eax, dword [ebx]
mov dword [ebp - 0x14], eax
add ebx, 4
mov eax, dword [ebx]
mov dword [ebp - 0x18], eax
add ebx, 4
cmp eax, 0
jbe 0x40171c
push ebx
push 0x40334d
call sub.kernel32.dll_lstrcpyA
push ebx
call sub.kernel32.dll_lstrlenA
add ebx, eax
add ebx, 1
mov eax, dword [ebx]
mov dword [ebp - 0x1c], eax
add ebx, 4
cmp eax, 0
jbe 0x40173f
push ebx
push 0x40324d
call sub.kernel32.dll_lstrcpyA
push ebx
call sub.kernel32.dll_lstrlenA
add ebx, eax
add ebx, 1
mov eax, dword [ebp - 4]
or eax, eax
jne 0x40174e
lea eax, [0x403450]
jmp 0x4017a7
cmp eax, 1
jne 0x40175b
lea eax, [0x404450]
jmp 0x4017a7
cmp eax, 2
jne 0x401768
lea eax, [0x405450]
jmp 0x4017a7
cmp eax, 3
jne 0x401775
lea eax, [0x410460]
jmp 0x4017a7
cmp eax, 4
jne 0x401782
lea eax, [0x407450]
jmp 0x4017a7
cmp eax, 5
jne 0x40178f
lea eax, [0x408450]
jmp 0x4017a7
cmp eax, 6
jne 0x40179c
lea eax, [0x409450]
jmp 0x4017a7
cmp eax, 0xffffffff
jne 0x4017a7
lea eax, [0x40334d]
mov dword [0x41068c], eax
push dword [0x41068c]
push 0x406450
call sub.kernel32.dll_lstrcpyA
push 0x406450
call dword [0x4106ac]
push 0x410060
push 0x406450
call sub.kernel32.dll_lstrcatA
cmp dword [0x4106e0], 2
jne 0x4017fa
pop ecx
mov eax, ecx
push ecx
cmp eax, dword [0x4106ec]
jne 0x4017fa
push 0x406450
push 0x40a450
call sub.kernel32.dll_lstrcpyA
push 0
push pe_nt_image_headers32
push 2
push 0
push 3
push 0xc0000000
push 0x406450
call sub.kernel32.dll_CreateFileA
mov dword [0x410690], eax
push 0
push 0x410694
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push dword [0x410690]
call sub.kernel32.dll_WriteFile
cmp dword [0x4106e0], 2
jne 0x401935
pop ecx
mov eax, ecx
push ecx
cmp eax, dword [0x4106ec]
jne 0x401935
cmp dword [0x4106e4], 1
jne 0x4018ae
mov eax, dword [0x4106e8]
mov ecx, dword [ebp - 0x20]
cmp ecx, eax
jae 0x401935
sub eax, ecx
mov dword [ebp - 0x30], eax
push dword [ebp - 0x30]
push 8
push dword [0x410670]
call sub.kernel32.dll_HeapAlloc
mov dword [ebp - 0x34], eax
push 0
push 0x410694
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [0x410690]
call sub.kernel32.dll_WriteFile
push dword [ebp - 0x34]
push 0
push dword [0x410670]
call sub.kernel32.dll_HeapFree
jmp 0x401935
cmp dword [0x4106e4], 0
jne 0x401935
push 0
push pe_nt_image_headers32
push 3
push 0
push 1
push 0x80000000
push 0x40b450
call sub.kernel32.dll_CreateFileA
mov dword [ebp - 0x38], eax
push 0
push dword [ebp - 0x38]
call sub.kernel32.dll_GetFileSize
mov dword [ebp - 0x3c], eax
push dword [ebp - 0x38]
call sub.kernel32.dll_CloseHandle
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x20]
cmp eax, ecx
jbe 0x401935
sub eax, ecx
mov dword [ebp - 0x30], eax
push dword [ebp - 0x30]
push 8
push dword [0x410670]
call sub.kernel32.dll_HeapAlloc
mov dword [ebp - 0x34], eax
push 0
push 0x410694
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [0x410690]
call sub.kernel32.dll_WriteFile
push dword [ebp - 0x34]
push 0
push dword [0x410670]
call sub.kernel32.dll_HeapFree
push dword [0x410690]
call sub.kernel32.dll_CloseHandle
push dword [ebp - 0x24]
call sub.kernel32.dll_GlobalFree
push dword [ebp - 8]
push 0x406450
call sub.kernel32.dll_SetFileAttributesA
cmp dword [ebp - 0x14], 1
jne 0x401965
push 0x406450
call fcn.00401468
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4019ce
mov eax, dword [ebp - 0xc]
cmp eax, 1
jne 0x401978
push 5
jmp 0x40198c
cmp eax, 2
jne 0x401981
push 0
jmp 0x40198c
cmp eax, 3
jne 0x40198a
push 3
jmp 0x40198c
push 6
push 0x406450
push 0x410260
call sub.kernel32.dll_lstrcpyA
push 0x410260
call sub.shlwapi.dll_PathFindFileNameA
mov byte [eax], 0
push 0x410260
cmp dword [ebp - 0x1c], 0
jbe 0x4019ba
push 0x40334d
jmp 0x4019bc
push 0
push 0x406450
push str.open
push 0
call dword [0x41069c]
push dword [0x41067c]
call sub.kernel32.dll_FreeResource
pop ecx
cmp ecx, dword [0x410688]
jl 0x4015ad
cmp dword [0x4106e0], 1
jne 0x4019f6
call fcn.00401a92
jmp 0x401a04
cmp dword [0x4106e0], 2
jne 0x401a04
call fcn.00401a0b
push 0
call sub.kernel32.dll_ExitProcess