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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x46c4
call fcn.00417390
mov eax, dword [0x43c514]
xor eax, esp
mov dword [esp + 0x46c0], eax
push ebx
push esi
push edi
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], 8
push eax
mov esi, ecx
mov dword [esp + 0x44], 0xff
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
mov ecx, esi
call fcn.00402cbc
xor ebx, ebx
push ebx
call fcn.0041bab3
push eax
call fcn.0041ba1e
pop ecx
pop ecx
lea eax, [esp + 0x2b8]
push eax
push ebx
push ebx
push 0x801c
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push str.Temp
lea eax, [esp + 0x2bc]
push 0x104
push eax
call fcn.0041baf3
add esp, 0xc
mov dword [esp + 0x14], ebx
mov edi, ebx
push 0x17
push str.129
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
je 0x4016ff
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x4012f7
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esp + 0x14], eax
test eax, eax
je 0x4012f9
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
mov eax, dword [esp + 0x14]
jmp 0x4012f9
mov eax, ebx
xor ebx, ebx
shr edi, 1
inc ebx
mov dword [esp + 0x38], edi
xor ecx, ecx
mov dword [esp + 0x28], 0x82
mov byte [esp + 0x24], cl
mov ecx, ebx
mov dword [esp + 0x18], ebx
mov byte [esp + 0x13], bl
mov byte [esp + 0x12], bl
mov dword [esp + 0x20], ecx
cmp edi, ebx
jbe 0x40161e
push 4
pop edx
push 2
mov dword [esp + 0x34], edx
pop esi
cmp word [eax + edx - 2], 0x7c
jne 0x40160b
mov esi, ecx
xor ecx, ecx
sub esi, dword [esp + 0x18]
push 2
pop edx
lea edi, [esi + 1]
mov eax, edi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00401d39
lea ecx, [esi*2 + 2]
mov dword [esp + 0x30], eax
push ecx
xor ecx, ecx
push ecx
push eax
call fcn.00418de0
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
push esi
mov esi, dword [esp + 0x40]
lea ecx, [eax + ecx*2]
push ecx
push edi
push esi
call fcn.0041bc33
mov eax, dword [esp + 0x40]
add esp, 0x20
inc eax
cmp byte [esp + 0x12], 0
mov dword [esp + 0x18], eax
je 0x401427
push 0x436620
mov edi, 0x104
lea eax, [esp + 0x2bc]
push edi
push eax
call fcn.0041baf3
push esi
lea eax, [esp + 0x2c8]
push edi
push eax
call fcn.0041baf3
mov eax, dword [esp + 0x3c]
add esp, 0x18
cmp word [esi + 2], 0x39
movzx eax, al
cmove eax, ebx
xor ecx, ecx
mov dword [esp + 0x24], eax
lea eax, [esp + 0x2b8]
push ecx
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x401406
cmp eax, 0xb7
je 0x401406
cmp eax, 0x50
jne 0x4016ff
push 0x436620
lea eax, [esp + 0x2bc]
push edi
push eax
call fcn.0041baf3
add esp, 0xc
xor eax, eax
mov byte [esp + 0x12], al
jmp 0x4015f1
mov edi, dword [esp + 0x28]
lea eax, [esp + 0x298]
push edi
push 0x4364c8
push 0x10
push eax
call fcn.00401765
add esp, 0x10
mov ecx, esi
inc edi
mov dword [esp + 0x28], edi
xor edi, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x40144f
sub ecx, edx
sar ecx, 1
jmp 0x401467
cmp word [esi + ecx*2], 0x5c
je 0x40146f
sub ecx, 1
jns 0x401460
or ecx, 0xffffffff
mov edi, 0x104
test ecx, ecx
js 0x4014c3
push ecx
push esi
lea eax, [esp + 0x50]
push edi
push eax
call fcn.0041bc33
lea eax, [esp + 0x2c8]
push eax
lea eax, [esp + 0x4d4]
push edi
push eax
call fcn.0041d503
lea eax, [esp + 0x64]
push eax
lea eax, [esp + 0x4e0]
push edi
push eax
call fcn.0041baf3
add esp, 0x28
lea eax, [esp + 0x4c0]
xor ecx, ecx
push ecx
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
lea eax, [esp + 0x2b8]
push eax
lea eax, [esp + 0x4c4]
push edi
push eax
call fcn.0041d503
push esi
lea eax, [esp + 0x4d0]
push edi
push eax
call fcn.0041baf3
add esp, 0x18
cmp byte [esp + 0x13], 0
je 0x401511
lea eax, [esp + 0x4c0]
push eax
lea eax, [esp + 0x26cc]
push edi
push eax
call fcn.0041d503
add esp, 0xc
xor eax, eax
mov byte [esp + 0x13], al
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x4c4]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
je 0x401535
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x4015f1
xor eax, eax
push eax
push 0x80
push 4
push eax
push ebx
push 0x40000000
lea eax, [esp + 0x4d8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x1c], eax
cmp eax, 0xffffffff
je 0x4016ff
push 0x17
lea eax, [esp + 0x29c]
push eax
xor eax, eax
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
xor eax, eax
push esi
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
je 0x4015e2
push esi
xor eax, eax
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esp + 0x34], eax
test eax, eax
je 0x4015e2
lea ecx, [esi + 1]
push ecx
call fcn.00401d39
push esi
push dword [esp + 0x3c]
mov edi, eax
push edi
call fcn.004182e0
xor eax, eax
add esp, 0x10
mov byte [edi + esi], al
mov ecx, eax
test esi, esi
je 0x4015cd
not byte [ecx + edi]
inc ecx
cmp ecx, esi
jb 0x4015c5
push eax
lea eax, [esp + 0x48]
push eax
push esi
mov esi, dword [esp + 0x28]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4015e6
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x2c]
push esi
call fcn.00401d34
mov edi, dword [esp + 0x3c]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x34]
pop ecx
mov ecx, dword [esp + 0x20]
push 2
pop esi
inc ecx
add edx, esi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x30], edx
cmp ecx, edi
jl 0x401334
xor eax, eax
mov edi, 0x4364d0
push edi
mov word [esp + 0x6cc], ax
mov esi, 0x1000
lea eax, [esp + 0x6cc]
push esi
push eax
call fcn.0041baf3
lea eax, [esp + 0x26d4]
push eax
lea eax, [esp + 0x6d8]
push esi
push eax
call fcn.0041baf3
push 0x4364d4
lea eax, [esp + 0x6e4]
push esi
push eax
call fcn.0041baf3
add esp, 0x24
call fcn.0041d580
cmp dword [eax], ebx
jle 0x4016bd
push 0x4364dc
lea eax, [esp + 0x6cc]
push esi
push eax
call fcn.0041baf3
call fcn.0041d586
mov eax, dword [eax]
push dword [eax + ebx*4]
lea eax, [esp + 0x6d8]
push esi
push eax
call fcn.0041baf3
push edi
lea eax, [esp + 0x6e4]
push esi
push eax
call fcn.0041baf3
add esp, 0x24
inc ebx
call fcn.0041d580
cmp ebx, dword [eax]
jl 0x401676
cmp byte [esp + 0x24], 0
je 0x4016dd
push 0x40
push str.HtaEdit
push str.This_executable_has_been_built_with_the_unregistered_version_of_HtaEdit._r_n_r_nThe_registered_version_does_not_display_this_notice.
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.USER32.dll_MessageBoxW]
push 5
push 0x43661c
lea eax, [esp + 0x6d0]
push eax
push str.mshta.exe
push str.open
xor eax, eax
push eax
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
mov ecx, dword [esp + 0x46cc]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00416b50
mov esp, ebp
pop ebp
ret