Function at 0x4021fd
Capabilities:
Create directory
Extract resource via kernel32 functions
Get common file path

Disassembly:
push 0x780
mov eax, 0x424b20
call fcn.0040992e
mov ebx, dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea eax, [ebp - 0x318]
push 0x104
push eax
call ebx
lea eax, [ebp - 0x318]
push eax
lea ecx, [ebp - 0x330]
call fcn.0040292b
mov esi, str.InstallerRazerInstaller
xor edi, edi
push esi
mov dword [ebp - 4], edi
call fcn.00401114
pop ecx
push eax
push esi
lea ecx, [ebp - 0x330]
call fcn.00405471
mov esi, 0x432460
push esi
call fcn.00401114
pop ecx
push eax
push esi
lea ecx, [ebp - 0x330]
call fcn.00405471
push 0xa
push 0x539
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
jne 0x402308
push 0xb0
lea eax, [ebp - 0x3f8]
push edi
push eax
call fcn.0040bfb0
pop ecx
lea ecx, [ebp - 0x3f8]
call fcn.00403d82
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov edx, str.Installer_resource_not_found__
lea ecx, [ebp - 0x3e8]
call fcn.0040750e
mov ecx, eax
call fcn.004044f1
mov edx, 0x4324d4
mov ecx, eax
call fcn.0040750e
lea eax, [ebp - 0x78c]
push eax
lea ecx, [ebp - 0x3f8]
call fcn.00403d37
mov byte [ebp - 4], 2
cmp dword [eax + 0x14], 0x10
jb 0x4022eb
mov eax, dword [eax]
push eax
lea ecx, [ebp - 0x774]
call fcn.00401050
push 0x435054
lea eax, [ebp - 0x774]
push eax
call fcn.0040b5de
push esi
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x402385
push 0xb0
lea eax, [ebp - 0x4a8]
push edi
push eax
call fcn.0040bfb0
pop ecx
lea ecx, [ebp - 0x4a8]
call fcn.00403d82
mov byte [ebp - 4], 3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov edx, str.Failed_to_load_resource__
lea ecx, [ebp - 0x498]
call fcn.0040750e
mov ecx, eax
call fcn.004044f1
mov edx, 0x4324d4
mov ecx, eax
call fcn.0040750e
lea eax, [ebp - 0x78c]
push eax
lea ecx, [ebp - 0x4a8]
call fcn.00403d37
mov byte [ebp - 4], 4
cmp dword [eax + 0x14], 0x10
jb 0x4022eb
jmp 0x4022e9
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
test edi, edi
jne 0x4023f6
push 0xb0
push eax
lea eax, [ebp - 0x558]
push eax
call fcn.0040bfb0
pop ecx
lea ecx, [ebp - 0x558]
call fcn.00403d82
mov byte [ebp - 4], 5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov edx, str.Failed_to_lock_resource__
lea ecx, [ebp - 0x548]
call fcn.0040750e
mov ecx, eax
call fcn.004044f1
mov edx, 0x4324d4
mov ecx, eax
call fcn.0040750e
lea eax, [ebp - 0x78c]
push eax
lea ecx, [ebp - 0x558]
call fcn.00403d37
mov byte [ebp - 4], 6
jmp 0x402376
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, eax
test esi, esi
jne 0x40246c
push 0xb0
push eax
lea eax, [ebp - 0x608]
push eax
call fcn.0040bfb0
pop ecx
lea ecx, [ebp - 0x608]
call fcn.00403d82
mov byte [ebp - 4], 7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov edx, str.Failed_to_get_resource_size__
lea ecx, [ebp - 0x5f8]
call fcn.0040750e
mov ecx, eax
call fcn.004044f1
mov edx, 0x4324d4
mov ecx, eax
call fcn.0040750e
lea eax, [ebp - 0x78c]
push eax
lea ecx, [ebp - 0x608]
call fcn.00403d37
mov byte [ebp - 4], 8
jmp 0x402376
push 0x104
lea eax, [ebp - 0x318]
push eax
call ebx
lea eax, [ebp - 0x318]
push eax
lea ecx, [ebp - 0x348]
call fcn.0040292b
mov ebx, str.InstallerRazerInstaller
mov byte [ebp - 4], 9
push ebx
call fcn.00401114
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x348]
call fcn.00405471
cmp dword [ebp - 0x334], 8
lea eax, [ebp - 0x348]
cmovae eax, dword [ebp - 0x348]
xor ebx, ebx
push ebx
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
push 0xb0
lea eax, [ebp - 0x768]
push ebx
push eax
call fcn.0040bfb0
cmp dword [ebp - 0x31c], 8
lea eax, [ebp - 0x330]
lea ecx, [ebp - 0x768]
cmovae eax, dword [ebp - 0x330]
push eax
call fcn.00403572
push ebx
push esi
push edi
lea ecx, [ebp - 0x768]
mov byte [ebp - 4], 0xa
call fcn.00404437
lea ecx, [ebp - 0x768]
call fcn.00403449
mov eax, dword [ebp - 0x768]
mov eax, dword [eax + 4]
test byte [ebp + eax - 0x75c], 6
je 0x4025bd
mov esi, 0x100
lea eax, [ebp - 0x110]
push esi
push ebx
push eax
call fcn.0040bfb0
call fcn.0040e6ac
push dword [eax]
lea eax, [ebp - 0x110]
push esi
push eax
call fcn.0040eae2
push 0xb0
lea eax, [ebp - 0x6b8]
push ebx
push eax
call fcn.0040bfb0
add esp, 0x1c
lea ecx, [ebp - 0x6b8]
call fcn.00403d82
mov edx, str.Failed_to_write_installer_file__
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x6a8]
call fcn.0040750e
lea edx, [ebp - 0x110]
mov ecx, eax
call fcn.0040750e
mov edx, 0x4324d4
mov ecx, eax
call fcn.0040750e
lea eax, [ebp - 0x78c]
push eax
lea ecx, [ebp - 0x6b8]
call fcn.00403d37
mov byte [ebp - 4], 0xc
jmp 0x402376
lea ecx, [ebp - 0x700]
call fcn.0040347b
lea eax, [ebp - 0x700]
mov byte [ebp - 4], 0xd
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004087bd
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x348]
call fcn.004053a1
push ebx
push 1
lea ecx, [ebp - 0x330]
call fcn.004053a1
call fcn.004098d8
ret