Function at 0x404c40
Capabilities:
Check if file exists
Create directory
Delete file
Extract resource via kernel32 functions
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4adf68
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x4d25ac]
xor eax, esp
mov dword [esp + 0x6c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4d25ac]
xor eax, esp
push eax
lea eax, [esp + 0x84]
mov dword fs:[0], eax
mov eax, dword [esp + 0xb0]
mov ebp, dword [esp + 0xb4]
mov dword [esp + 0x30], eax
xor ebx, ebx
mov dword [esp + 0x8c], ebx
xor ecx, ecx
push 0x29
mov eax, str.CSystemCommands::ExtractResource___szPath
lea esi, [esp + 0x38]
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], ebx
mov word [esp + 0x3c], cx
call fcn.00401f30
mov edx, esi
push edx
lea ecx, [esp + 0x98]
mov byte [esp + 0x90], 1
call fcn.004035d0
mov esi, 8
add esp, 4
mov byte [esp + 0x8c], bl
cmp dword [esp + 0x4c], esi
jb 0x404cec
mov eax, dword [esp + 0x38]
push eax
call fcn.00491101
add esp, 4
mov eax, dword [esp + 0x98]
cmp dword [esp + 0xac], esi
jae 0x404d03
lea eax, [esp + 0x98]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x404d89
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp edi, 0xb7
je 0x404d89
xor ecx, ecx
push 0x3d
mov eax, str.CSystemCommands::ExtractResource___CreateDirectory_last_error
lea esi, [esp + 0x38]
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], ebx
mov word [esp + 0x3c], cx
call fcn.00401f30
mov ecx, edi
mov byte [esp + 0x8c], 2
call fcn.00403270
mov esi, 8
cmp dword [esp + 0x4c], esi
jb 0x404d69
mov edx, dword [esp + 0x38]
push edx
call fcn.00491101
add esp, 4
cmp dword [esp + 0xac], esi
jb 0x404d82
mov eax, dword [esp + 0x98]
push eax
call fcn.00491101
add esp, 4
xor al, al
jmp 0x4051ca
mov eax, dword [esp + 0xa8]
lea esi, [eax - 1]
cmp esi, eax
jbe 0x404d9c
call fcn.00492a5a
cmp dword [esp + 0xac], 8
mov eax, dword [esp + 0x98]
jae 0x404db4
lea eax, [esp + 0x98]
cmp word [eax + esi*2], 0x5c
je 0x404dce
push 1
mov eax, 0x4b4d78
lea ecx, [esp + 0x98]
call fcn.00403430
xor ecx, ecx
mov dword [esp + 0x7c], 7
mov dword [esp + 0x78], ebx
mov word [esp + 0x68], cx
cmp dword [esp + 0xb8], ebx
mov byte [esp + 0x8c], 3
mov dword [esp + 0x54], ebx
jle 0x40519b
mov eax, dword [esp + 0x30]
sub eax, ebp
mov dword [esp + 0x50], ebp
mov ebp, dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [esp + 0x30], eax
mov edi, edi
xor edx, edx
push 0x2e
mov eax, str.CSystemCommands::ExtractResource___Resource_id
lea esi, [esp + 0x38]
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], ebx
mov word [esp + 0x3c], dx
call fcn.00401f30
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x50]
mov byte [esp + 0x8c], 4
mov ecx, dword [eax + edi]
call fcn.00403270
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x4c], 8
jb 0x404e67
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00491101
add esp, 4
xor edx, edx
push 0x30
mov eax, str.CSystemCommands::ExtractResource___Resource_name
lea esi, [esp + 0x18]
mov dword [esp + 0x30], 7
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], dx
call fcn.00401f30
mov byte [esp + 0x8c], 5
mov eax, dword [edi]
xor ecx, ecx
mov word [esp + 0x38], cx
mov ecx, eax
mov dword [esp + 0x4c], 7
mov dword [esp + 0x48], ebx
lea esi, [ecx + 2]
lea esp, [esp]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x404eb0
sub ecx, esi
sar ecx, 1
push ecx
lea esi, [esp + 0x38]
call fcn.00401f30
lea edx, [esp + 0x14]
push edx
mov ecx, esi
mov byte [esp + 0x90], 6
call fcn.004035d0
add esp, 4
cmp dword [esp + 0x4c], 8
jb 0x404ef4
mov eax, dword [esp + 0x38]
push eax
call fcn.00491101
add esp, 4
xor ecx, ecx
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x2c], 8
mov dword [esp + 0x4c], 7
mov dword [esp + 0x48], ebx
mov word [esp + 0x38], cx
jb 0x404f23
mov edx, dword [esp + 0x18]
push edx
call fcn.00491101
add esp, 4
push ebx
call ebp
mov eax, dword [esp + 0x30]
movzx ecx, word [eax + edi]
push str.COMP
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
cmp esi, ebx
je 0x4051ec
push ebx
call ebp
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [esp + 0x58], eax
cmp eax, ebx
je 0x405289
push ebx
call ebp
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
cmp esi, ebx
je 0x405322
push ebx
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esp + 0x60], eax
cmp eax, ebx
je 0x4053bb
push 0xffffffffffffffff
push ebx
lea eax, [esp + 0x9c]
lea ecx, [esp + 0x6c]
call fcn.00401c20
mov eax, dword [edi]
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x404fa1
sub ecx, esi
sar ecx, 1
push ecx
lea ecx, [esp + 0x68]
call fcn.00403430
xor edx, edx
push 0x31
mov eax, str.CSystemCommands::ExtractResource___File_to_create
lea esi, [esp + 0x18]
mov dword [esp + 0x30], 7
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], dx
call fcn.00401f30
mov eax, esi
push eax
lea ecx, [esp + 0x68]
mov byte [esp + 0x90], 0xb
call fcn.004035d0
mov esi, 8
add esp, 4
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x2c], esi
jb 0x405014
mov ecx, dword [esp + 0x18]
push ecx
call fcn.00491101
add esp, 4
push ebx
call ebp
mov eax, dword [esp + 0x68]
cmp dword [esp + 0x7c], esi
jae 0x405025
lea eax, [esp + 0x68]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, ebx
je 0x405080
mov eax, str.CSystemCommands::ExtractResource___PathFileExists._error
lea ecx, [esp + 0x14]
call fcn.00401fe0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0xc
call fcn.00403270
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x2c], 8
jb 0x405110
mov edx, dword [esp + 0x18]
push edx
call fcn.00491101
add esp, 4
jmp 0x405110
cmp edi, 1
jne 0x405110
mov eax, str.CSystemCommands::ExtractResource___File_exist_lets_delete_it.
lea ecx, [esp + 0x14]
call fcn.00401fe0
lea eax, [esp + 0x14]
push eax
mov byte [esp + 0x90], 0xd
call fcn.00403780
add esp, 4
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 3
call fcn.0040a810
push ebx
call ebp
cmp dword [esp + 0x7c], 8
mov eax, dword [esp + 0x68]
jae 0x4050cf
lea eax, [esp + 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, ebx
je 0x405110
mov eax, str.CSystemCommands::ExtractResource___DeleteFile._error
lea ecx, [esp + 0x14]
call fcn.00401fe0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0xe
call fcn.00403270
mov byte [esp + 0x8c], 3
call fcn.0040a810
push ebx
call ebp
cmp dword [esp + 0x7c], 8
mov eax, dword [esp + 0x68]
jae 0x405122
lea eax, [esp + 0x68]
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4053f4
push ebx
mov dword [esp + 0x60], ebx
call ebp
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x60]
push ebx
lea ecx, [esp + 0x60]
push ecx
push edx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40547f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x54]
add dword [esp + 0x50], 4
inc eax
cmp eax, dword [esp + 0xb8]
mov dword [esp + 0x54], eax
jl 0x404e10
cmp dword [esp + 0x7c], 8
jb 0x40519b
mov ecx, dword [esp + 0x68]
push ecx
call fcn.00491101
add esp, 4
xor edx, edx
cmp dword [esp + 0xac], 8
mov dword [esp + 0x7c], 7
mov dword [esp + 0x78], ebx
mov word [esp + 0x68], dx
jb 0x4051c8
mov eax, dword [esp + 0x98]
push eax
call fcn.00491101
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x84]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x6c]
xor ecx, esp
call fcn.0049110c
add esp, 0x7c
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
xor ecx, ecx
mov ebp, 7
push 0x3d
mov eax, str.CSystemCommands::ExtractResource___FindResource_failed._error
lea esi, [esp + 0x18]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], cx
call fcn.00401f30
mov byte [esp + 0x8c], 7
mov ecx, edi
lea esi, [esp + 0x14]
call fcn.00403270
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x405243
mov edx, dword [esp + 0x18]
push edx
call fcn.00491101
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x405256
mov eax, dword [esp + 0x68]
push eax
call fcn.00491101
add esp, 4
xor ecx, ecx
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x78], ebx
mov word [esp + 0x68], cx
cmp dword [esp + 0xac], esi
jb 0x404d82
mov edx, dword [esp + 0x98]
push edx
call fcn.00491101
add esp, 4
xor al, al
jmp 0x4051ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
xor eax, eax
mov word [esp + 0x18], ax
mov ebp, 7
push 0x40
mov eax, str.CSystemCommands::ExtractResource___SizeofResource_is_zero._error
lea esi, [esp + 0x18]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], ebx
call fcn.00401f30
mov ecx, edi
mov byte [esp + 0x8c], 8
call fcn.00403270
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x4052dc
mov ecx, dword [esp + 0x18]
push ecx
call fcn.00491101
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x4052ef
mov edx, dword [esp + 0x68]
push edx
call fcn.00491101
add esp, 4
xor eax, eax
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x78], ebx
mov word [esp + 0x68], ax
cmp dword [esp + 0xac], esi
jb 0x404d82
mov ecx, dword [esp + 0x98]
push ecx
call fcn.00491101
add esp, 4
xor al, al
jmp 0x4051ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
xor edx, edx
mov ebp, 7
push 0x3d
mov eax, str.CSystemCommands::ExtractResource___LoadResource_failed._error
lea esi, [esp + 0x18]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], dx
call fcn.00401f30
mov ecx, edi
mov byte [esp + 0x8c], 9
call fcn.00403270
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x405375
mov eax, dword [esp + 0x18]
push eax
call fcn.00491101
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x405388
mov ecx, dword [esp + 0x68]
push ecx
call fcn.00491101
add esp, 4
xor edx, edx
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x78], ebx
mov word [esp + 0x68], dx
cmp dword [esp + 0xac], esi
jb 0x404d82
mov eax, dword [esp + 0x98]
push eax
call fcn.00491101
add esp, 4
xor al, al
jmp 0x4051ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
xor ecx, ecx
mov ebp, 7
push 0x3d
mov eax, str.CSystemCommands::ExtractResource___LockResource_failed._error
lea esi, [esp + 0x18]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], cx
call fcn.00401f30
mov byte [esp + 0x8c], 0xa
jmp 0x405220
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, str.CSystemCommands::ExtractResource___CreateFile_failed._GetLastError
lea ecx, [esp + 0x14]
call fcn.00401fe0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0xf
call fcn.00403270
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x405435
mov eax, dword [esp + 0x18]
push eax
call fcn.00491101
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x405448
mov ecx, dword [esp + 0x68]
push ecx
call fcn.00491101
add esp, 4
xor edx, edx
mov dword [esp + 0x7c], 7
mov dword [esp + 0x78], ebx
mov word [esp + 0x68], dx
cmp dword [esp + 0xac], esi
jb 0x404d82
mov eax, dword [esp + 0x98]
push eax
call fcn.00491101
add esp, 4
xor al, al
jmp 0x4051ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, str.CSystemCommands::ExtractResource___WriteFile_failed._error
lea ecx, [esp + 0x14]
call fcn.00401fe0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0x10
call fcn.00403270
call fcn.0040a810
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esi, [esp + 0x64]
call fcn.0040a810
lea esi, [esp + 0x94]
call fcn.0040a810
xor al, al
jmp 0x4051ca