Function at 0x401f11
Capabilities:
Check if file exists
Create directory
Delete file
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push 0x7c
mov eax, 0x4c0076
call fcn.0049f5ab
mov eax, dword [ebp + 0x24]
mov esi, ecx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x38], esi
xor ebx, ebx
push str.CSystemCommands::ExtractResource___szPath
lea ecx, [ebp - 0x54]
mov dword [ebp - 4], ebx
call fcn.00404bd0
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x54]
push eax
mov byte [ebp - 4], 1
call fcn.00401985
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], bl
call fcn.004058b3
cmp dword [ebp + 0x20], 8
mov eax, dword [ebp + 0xc]
jae 0x401f67
lea eax, [ebp + 0xc]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x401fc3
call edi
mov esi, eax
cmp esi, 0xb7
je 0x401fc0
push str.CSystemCommands::ExtractResource___CreateDirectory_last_error
lea ecx, [ebp - 0x54]
call fcn.00404bd0
lea eax, [ebp - 0x54]
push esi
push eax
mov byte [ebp - 4], 2
call fcn.004018c5
pop ecx
pop ecx
lea ecx, [ebp - 0x54]
push ebx
push 1
call fcn.004058b3
push ebx
push 1
lea ecx, [ebp + 8]
call fcn.004058b3
xor al, al
call fcn.0049f62e
ret
mov esi, dword [ebp - 0x38]
mov eax, dword [ebp + 0x1c]
dec eax
push eax
lea ecx, [ebp + 8]
call fcn.00404c63
cmp word [eax], 0x5c
je 0x401fe3
push 0x4d5480
lea ecx, [ebp + 8]
call fcn.004052dd
push ebx
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x14], 7
call fcn.00405ece
cmp dword [ebp + 0x28], ebx
mov byte [ebp - 4], 3
mov dword [ebp - 0x38], ebx
jle 0x40226a
mov eax, dword [ebp - 0x30]
sub eax, esi
mov dword [ebp - 0x58], esi
mov esi, dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [ebp - 0x60], eax
push str.CSystemCommands::ExtractResource___Resource_id
lea ecx, [ebp - 0x54]
call fcn.00404bd0
mov ecx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x60]
add eax, ecx
mov byte [ebp - 4], 4
push dword [eax]
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x54]
push eax
call fcn.004018c5
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 3
call fcn.004058b3
push str.CSystemCommands::ExtractResource___Resource_name
lea ecx, [ebp - 0x54]
call fcn.00404bd0
mov eax, dword [ebp - 0x58]
mov byte [ebp - 4], 5
push dword [eax]
lea ecx, [ebp - 0x88]
call fcn.00404bd0
push eax
lea eax, [ebp - 0x54]
push eax
mov byte [ebp - 4], 6
call fcn.00401985
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x88]
call fcn.004058b3
push ebx
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 3
call fcn.004058b3
push ebx
call esi
mov eax, dword [ebp - 0x30]
movzx eax, word [eax]
push str.COMP
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0x30], eax
cmp eax, ebx
je 0x402273
push ebx
call esi
push dword [ebp - 0x30]
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x64], eax
cmp eax, ebx
je 0x4022a7
push ebx
call esi
push dword [ebp - 0x30]
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x30], eax
cmp eax, ebx
je 0x4022be
push ebx
call esi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x6c], eax
cmp eax, ebx
je 0x4022d5
push 0xffffffffffffffff
push ebx
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x2c]
call fcn.00405301
mov eax, dword [ebp - 0x58]
push dword [eax]
lea ecx, [ebp - 0x2c]
call fcn.004052dd
push str.CSystemCommands::ExtractResource___File_to_create
lea ecx, [ebp - 0x54]
call fcn.00404bd0
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x54]
push eax
mov byte [ebp - 4], 0xb
call fcn.00401985
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 3
call fcn.004058b3
push ebx
call esi
cmp dword [ebp - 0x14], 8
mov eax, dword [ebp - 0x28]
jae 0x40215c
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov dword [ebp - 0x5c], eax
call edi
mov dword [ebp - 0x30], eax
cmp eax, ebx
je 0x402182
push str.CSystemCommands::ExtractResource___PathFileExists._error
lea ecx, [ebp - 0x54]
call fcn.00404bd0
mov byte [ebp - 4], 0xc
jmp 0x4021e2
cmp dword [ebp - 0x5c], 1
jne 0x4021ff
push str.CSystemCommands::ExtractResource___File_exist_lets_delete_it.
lea ecx, [ebp - 0x54]
call fcn.00404bd0
lea eax, [ebp - 0x54]
push eax
mov byte [ebp - 4], 0xd
call fcn.004017f5
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 3
call fcn.004058b3
push ebx
call esi
cmp dword [ebp - 0x14], 8
mov eax, dword [ebp - 0x28]
jae 0x4021c1
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
call edi
mov dword [ebp - 0x30], eax
cmp eax, ebx
je 0x4021ff
push str.CSystemCommands::ExtractResource___DeleteFile._error
lea ecx, [ebp - 0x54]
call fcn.00404bd0
mov byte [ebp - 4], 0xe
push dword [ebp - 0x30]
lea eax, [ebp - 0x54]
push eax
call fcn.004018c5
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 3
call fcn.004058b3
push ebx
call esi
cmp dword [ebp - 0x14], 8
mov eax, dword [ebp - 0x28]
jae 0x40220e
lea eax, [ebp - 0x28]
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x30], eax
cmp eax, 0xffffffff
je 0x4022ec
push ebx
mov dword [ebp - 0x68], ebx
call esi
push ebx
lea eax, [ebp - 0x68]
push eax
push dword [ebp - 0x64]
push dword [ebp - 0x6c]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402303
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [ebp - 0x38]
mov eax, dword [ebp - 0x38]
add dword [ebp - 0x58], 4
cmp eax, dword [ebp + 0x28]
jl 0x402014
mov byte [ebp - 0x31], 1
jmp 0x40233b
call edi
push str.CSystemCommands::ExtractResource___FindResource_failed._error
lea ecx, [ebp - 0x54]
mov esi, eax
call fcn.00404bd0
mov byte [ebp - 4], 7
lea eax, [ebp - 0x54]
push esi
push eax
call fcn.004018c5
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
call fcn.004058b3
lea ecx, [ebp - 0x2c]
jmp 0x401fa5
call edi
push str.CSystemCommands::ExtractResource___SizeofResource_is_zero._error
lea ecx, [ebp - 0x54]
mov esi, eax
call fcn.00404bd0
mov byte [ebp - 4], 8
jmp 0x402288
call edi
push str.CSystemCommands::ExtractResource___LoadResource_failed._error
lea ecx, [ebp - 0x54]
mov esi, eax
call fcn.00404bd0
mov byte [ebp - 4], 9
jmp 0x402288
call edi
push str.CSystemCommands::ExtractResource___LockResource_failed._error
lea ecx, [ebp - 0x54]
mov esi, eax
call fcn.00404bd0
mov byte [ebp - 4], 0xa
jmp 0x402288
call edi
push str.CSystemCommands::ExtractResource___CreateFile_failed._GetLastError
lea ecx, [ebp - 0x54]
mov esi, eax
call fcn.00404bd0
mov byte [ebp - 4], 0xf
jmp 0x402288
call edi
push str.CSystemCommands::ExtractResource___WriteFile_failed._error
lea ecx, [ebp - 0x54]
mov esi, eax
call fcn.00404bd0
lea eax, [ebp - 0x54]
push esi
push eax
mov byte [ebp - 4], 0x10
call fcn.004018c5
pop ecx
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x54]
call fcn.004058b3
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 0x31], bl
push ebx
push 1
lea ecx, [ebp - 0x2c]
call fcn.004058b3
push ebx
push 1
lea ecx, [ebp + 8]
call fcn.004058b3
mov al, byte [ebp - 0x31]
jmp 0x401fba