Function at 0x401a40
Capabilities:
Extract resource via kernel32 functions
Get common file path
Write file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x518
mov eax, dword [0x428014]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
lea eax, [ebp - 0x418]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, 0x104
ja 0x402024
test eax, eax
je 0x402024
mov edi, dword [sym.imp.USER32.dll_CharLowerW]
push 0x41
call edi
movzx edx, ax
mov ecx, 0x42395c
lea eax, [ebp - 0x4d0]
push eax
call fcn.004020f0
add esp, 4
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x450], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0x440], xmm0
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x438], eax
lea eax, [ebp - 0x210]
push eax
push 0
lea eax, [ebp - 0x450]
push eax
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x401b54
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x41
mov esi, eax
call edi
movzx edx, ax
mov ecx, 0x423920
lea eax, [ebp - 0x4f0]
push eax
call fcn.00402150
add esp, 4
movups xmm0, xmmword [eax]
push esi
movups xmmword [ebp - 0x470], xmm0
movups xmm0, xmmword [eax + 0x10]
movups xmmword [ebp - 0x460], xmm0
movups xmm0, xmmword [eax + 0x20]
movups xmmword [ebp - 0x450], xmm0
movq xmm0, qword [eax + 0x30]
movq qword [ebp - 0x440], xmm0
mov eax, dword [eax + 0x38]
mov dword [ebp - 0x438], eax
lea eax, [ebp - 0x470]
jmp 0x4020c5
push 0x100
push 0x71
push 0x400000
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
je 0x401fb4
push esi
push 0x400000
call dword [sym.imp.KERNEL32.dll_LoadResource]
push esi
push 0x400000
mov dword [ebp - 0x41c], eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x428], eax
mov eax, dword [ebp - 0x41c]
test eax, eax
je 0x401fb4
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x494], eax
test eax, eax
je 0x401fb4
push 0x41
call edi
movzx edx, ax
mov ecx, 0x4238d4
lea eax, [ebp - 0x4c0]
push eax
call fcn.004021b0
add esp, 4
movq xmm0, qword [eax]
movq qword [ebp - 0x4ac], xmm0
mov ax, word [eax + 8]
mov word [ebp - 0x4a4], ax
lea eax, [ebp - 0x4ac]
push eax
lea eax, [ebp - 0x210]
push 0x104
push eax
call fcn.0040fed7
add esp, 0xc
lea eax, [ebp - 0x210]
xor esi, esi
mov dword [ebp - 0x424], esi
push esi
push 0x80
push 2
push esi
push 7
push 2
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x420], eax
cmp eax, 0xffffffff
je 0x401c80
push esi
lea ecx, [ebp - 0x41c]
mov dword [ebp - 0x41c], esi
push ecx
push dword [ebp - 0x428]
push dword [ebp - 0x494]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401c64
mov eax, dword [ebp - 0x428]
cmp dword [ebp - 0x41c], eax
je 0x401c72
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0x424], eax
push dword [ebp - 0x420]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401c8e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0x424], esi
push 0x41
call edi
movzx edi, ax
test esi, esi
je 0x401d3e
push 0x3a
lea eax, [ebp - 0x470]
push 0
push eax
call fcn.0040cde0
add esp, 0xc
xor esi, esi
mov ecx, edi
test esi, esi
je 0x401ccc
lea edx, [esi - 1]
call fcn.004029d0
imul ecx, eax, 0x19660d
add ecx, 0x3c6ef35f
mov ax, word [esi*2 + 0x423898]
xor ax, cx
mov word [ebp + esi*2 - 0x470], ax
inc esi
cmp esi, 0x1d
jb 0x401cb2
movaps xmm0, xmmword [ebp - 0x470]
mov ax, word [ebp - 0x438]
push dword [ebp - 0x424]
movaps xmmword [ebp - 0x4f0], xmm0
movaps xmm0, xmmword [ebp - 0x460]
movaps xmmword [ebp - 0x4e0], xmm0
movaps xmm0, xmmword [ebp - 0x450]
movaps xmmword [ebp - 0x4d0], xmm0
movq xmm0, qword [ebp - 0x440]
mov word [ebp - 0x4b8], ax
lea eax, [ebp - 0x4f0]
movq qword [ebp - 0x4c0], xmm0
jmp 0x4020c5
xorps xmm0, xmm0
xor esi, esi
movaps xmmword [ebp - 0x450], xmm0
nop word [eax + eax]
mov ecx, edi
test esi, esi
je 0x401d6a
lea edx, [esi - 1]
call fcn.004029d0
imul ecx, eax, 0x19660d
add ecx, 0x3c6ef35f
mov ax, word [esi*2 + 0x423888]
xor ax, cx
mov word [ebp + esi*2 - 0x450], ax
inc esi
cmp esi, 8
jb 0x401d50
movaps xmm0, xmmword [ebp - 0x450]
lea eax, [ebp - 0x4b0]
push 0x800
push 0
push eax
movaps xmmword [ebp - 0x4b0], xmm0
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [ebp - 0x420], eax
test eax, eax
jne 0x401dfd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x420], eax
mov eax, dword [sym.imp.USER32.dll_CharLowerW]
push 0x41
call eax
movzx edx, ax
mov ecx, 0x423838
lea eax, [ebp - 0x508]
push eax
call fcn.00402210
mov esi, eax
lea edi, [ebp - 0x488]
mov ecx, 0x13
lea eax, [ebp - 0x488]
rep movsd dword es:[edi], dword [esi]
add esp, 4
movsw word es:[edi], word [esi]
push dword [ebp - 0x420]
jmp 0x4020c5
mov eax, dword [sym.imp.USER32.dll_CharLowerW]
push 0x41
call eax
xorps xmm0, xmm0
movzx edi, ax
movq qword [ebp - 0x4c8], xmm0
xor esi, esi
mov dword [ebp - 0x4c0], 0
mov word [ebp - 0x4bc], 0
nop dword [eax]
mov ecx, edi
test esi, esi
je 0x401e4a
lea edx, [esi - 1]
call fcn.004029d0
imul ecx, eax, 0x19660d
add ecx, 0x3c6ef35f
mov al, byte [esi + 0x423824]
xor al, cl
mov byte [ebp + esi - 0x4c8], al
inc esi
cmp esi, 0xe
jb 0x401e30
mov eax, dword [ebp - 0x4c0]
movq xmm0, qword [ebp - 0x4c8]
mov dword [ebp - 0x43c], eax
mov ax, word [ebp - 0x4bc]
mov word [ebp - 0x438], ax
lea eax, [ebp - 0x444]
push eax
push dword [ebp - 0x420]
movq qword [ebp - 0x444], xmm0
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x401eed
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x41
mov dword [ebp - 0x420], eax
call dword [sym.imp.USER32.dll_CharLowerW]
movzx edx, ax
mov ecx, 0x4237c8
lea eax, [ebp - 0x510]
push eax
call fcn.004017d0
add esp, 4
lea edi, [ebp - 0x490]
mov esi, eax
mov ecx, 0x17
rep movsd dword es:[edi], dword [esi]
push dword [ebp - 0x420]
lea eax, [ebp - 0x490]
jmp 0x4020c5
mov esi, dword [sym.imp.USER32.dll_CharLowerW]
push 0x41
call esi
movzx edx, ax
mov ecx, 0x4237b8
lea eax, [ebp - 0x4c0]
push eax
call fcn.004021b0
add esp, 4
movq xmm0, qword [eax]
push 1
push 0
movq qword [ebp - 0x4ac], xmm0
mov ax, word [eax + 8]
mov word [ebp - 0x4a4], ax
lea eax, [ebp - 0x210]
push 0
push eax
lea eax, [ebp - 0x4ac]
push eax
push 0
call edi
mov edi, eax
cmp edi, 0x20
ja 0x401f9f
push 0x41
call esi
movzx edx, ax
mov ecx, 0x423780
lea eax, [ebp - 0x4f0]
push eax
call fcn.00402270
add esp, 4
movups xmm0, xmmword [eax]
push edi
movups xmmword [ebp - 0x470], xmm0
movups xmm0, xmmword [eax + 0x10]
movups xmmword [ebp - 0x460], xmm0
movups xmm0, xmmword [eax + 0x20]
movups xmmword [ebp - 0x450], xmm0
mov ecx, dword [eax + 0x30]
mov dword [ebp - 0x440], ecx
mov ax, word [eax + 0x34]
mov word [ebp - 0x43c], ax
lea eax, [ebp - 0x470]
jmp 0x4020c5
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b05b
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x41
mov esi, eax
call edi
movzx edx, ax
mov ecx, 0x4238e0
lea eax, [ebp - 0x4f8]
push eax
call fcn.00401830
add esp, 4
movups xmm0, xmmword [eax]
push esi
movups xmmword [ebp - 0x480], xmm0
movups xmm0, xmmword [eax + 0x10]
movups xmmword [ebp - 0x470], xmm0
movups xmm0, xmmword [eax + 0x20]
movups xmmword [ebp - 0x460], xmm0
movq xmm0, qword [eax + 0x30]
movq qword [ebp - 0x450], xmm0
mov ecx, dword [eax + 0x38]
mov dword [ebp - 0x448], ecx
mov ax, word [eax + 0x3c]
mov word [ebp - 0x444], ax
lea eax, [ebp - 0x480]
jmp 0x4020c5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x41
mov dword [ebp - 0x420], eax
call dword [sym.imp.USER32.dll_CharLowerW]
push 0x34
movzx edi, ax
lea eax, [ebp - 0x470]
push 0
push eax
call fcn.0040cde0
add esp, 0xc
xor esi, esi
mov ecx, edi
test esi, esi
je 0x40206a
lea edx, [esi - 1]
call fcn.004029d0
imul ecx, eax, 0x19660d
add ecx, 0x3c6ef35f
mov ax, word [esi*2 + 0x423978]
xor ax, cx
mov word [ebp + esi*2 - 0x470], ax
inc esi
cmp esi, 0x1a
jb 0x402050
movaps xmm0, xmmword [ebp - 0x470]
mov eax, dword [ebp - 0x440]
push dword [ebp - 0x420]
movaps xmmword [ebp - 0x4f0], xmm0
movaps xmm0, xmmword [ebp - 0x460]
movaps xmmword [ebp - 0x4e0], xmm0
movaps xmm0, xmmword [ebp - 0x450]
mov dword [ebp - 0x4c0], eax
lea eax, [ebp - 0x4f0]
movaps xmmword [ebp - 0x4d0], xmm0
push eax
push 0x10
push str.Error
push 0
call fcn.00401170
mov ecx, dword [ebp - 4]
add esp, 0x14
xor ecx, ebp
pop edi
pop esi
call fcn.0040b05b
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret