Function at 0x404150
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get thread local storage value
Move file
Read file on windows
Set file attributes

Disassembly:
push ebp
mov ebp, esp
mov ecx, 5
push 0
push 0
dec ecx
jne 0x404158
push ebx
push esi
push edi
mov eax, 0x4040f0
call fcn.00403700
xor eax, eax
push ebp
push 0x4043ef
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0
call sub.KERNEL32.DLL_SetFileAttributesA
call sub.KERNEL32.DLL_ReadFile
push 0
call sub.KERNEL32.DLL_LoadResource
push 0
push 0
push 0
call sub.KERNEL32.DLL_SizeofResource
push 0
call sub.KERNEL32.DLL_GetVersionExA
push 0
call sub.gdi32.dll_DeleteDC
push 0xffffffffffffffff
push 0
call sub.KERNEL32.DLL_LockResource
lea eax, [ebp - 0x18]
call fcn.004039d8
mov eax, dword [ebp - 0x18]
lea edx, [ebp - 0x14]
call fcn.00403ac0
mov edx, dword [ebp - 0x14]
mov eax, 0x4050a8
call fcn.004030fc
cmp dword [0x4050a8], 0
je 0x4043d4
lea eax, [ebp - 0x1c]
call fcn.00403d04
mov edx, dword [ebp - 0x1c]
mov eax, 0x406684
call fcn.004030fc
mov eax, dword [0x4050ac]
mov eax, dword [eax]
call fcn.004032c0
push eax
lea edx, [ebp - 0x24]
xor eax, eax
call fcn.00402678
mov eax, dword [ebp - 0x24]
lea edx, [ebp - 0x20]
call fcn.00403ba0
mov eax, dword [ebp - 0x20]
call fcn.004032c0
push eax
call sub.KERNEL32.DLL_LeaveCriticalSection
test eax, eax
je 0x4042a3
mov ecx, dword [0x4050ac]
mov ecx, dword [ecx]
mov eax, dword [0x4050ac]
mov edx, dword [0x406684]
call fcn.0040323c
push 0x80
mov eax, dword [0x4050ac]
mov eax, dword [eax]
call fcn.004032c0
push eax
call sub.KERNEL32.DLL_LocalFree
mov eax, dword [0x4050ac]
mov eax, dword [eax]
call fcn.004032c0
push eax
call sub.KERNEL32.DLL_GetStdHandle
push 0
mov eax, dword [0x4050ac]
mov eax, dword [eax]
call fcn.004032c0
push eax
lea edx, [ebp - 0x28]
xor eax, eax
call fcn.00402678
mov eax, dword [ebp - 0x28]
call fcn.004032c0
push eax
call sub.KERNEL32.DLL_TlsGetValue
push 6
mov eax, dword [0x4050ac]
mov eax, dword [eax]
call fcn.004032c0
push eax
call sub.KERNEL32.DLL_LocalFree
mov eax, 0x4050a4
mov ecx, 0x404408
mov edx, dword [0x406684]
call fcn.0040323c
mov eax, 0x406688
mov ecx, 0x404420
mov edx, dword [0x406684]
call fcn.0040323c
mov eax, dword [0x406688]
call fcn.004032c0
mov ebx, eax
push ebx
call sub.KERNEL32.DLL_GetStdHandle
push ebx
call sub.shlwapi.dll_PathFileExistsA
test eax, eax
je 0x40431c
mov eax, dword [0x4050a8]
push eax
mov eax, dword [0x4050a4]
call fcn.004032c0
mov ecx, eax
mov edx, 0x404430
mov eax, 0xa
call fcn.004039e8
mov edx, dword [0x4050a4]
mov eax, dword [0x406688]
call fcn.00403c6c
jmp 0x404333
mov eax, dword [0x4050a8]
push eax
mov ecx, ebx
mov edx, 0x404430
mov eax, 0xa
call fcn.004039e8
push 0x404438
push 0x404444
call sub.KERNEL32.DLL_MoveFileExA
test eax, eax
jne 0x4043c5
push ebx
call sub.KERNEL32.DLL_GetModuleFileNameA
mov ebx, eax
test ebx, ebx
je 0x4043c5
push 0x404450
push ebx
call sub.KERNEL32.DLL_ExitProcess
mov edi, eax
push 0x40445c
push ebx
call sub.KERNEL32.DLL_ExitProcess
mov esi, eax
test esi, esi
je 0x4043bf
test edi, edi
je 0x4043bf
push 0
mov eax, dword [0x406650]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0x404468
push 0x404444
push 0
call fcn.00404060
call edi
jmp 0x4043a9
push 0x40668c
call sub.KERNEL32.DLL_LoadLibraryA
push 0
push 0
push 0
push 0x40668c
call sub.KERNEL32.DLL_SetEndOfFile
test eax, eax
jne 0x40439f
call esi
push ebx
call sub.KERNEL32.DLL_RtlUnwind
mov eax, dword [0x406688]
call fcn.004032c0
call fcn.00403dd4
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4043f6
lea eax, [ebp - 0x28]
mov edx, 6
call fcn.004030cc
ret