Function at 0x40c400
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 0x4ba9f8
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x4e27e0]
xor eax, esp
mov dword [esp + 0x6c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4e27e0]
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.004033f0
mov edx, esi
push edx
lea ecx, [esp + 0x98]
mov byte [esp + 0x90], 1
call fcn.00402ec0
mov esi, 8
add esp, 4
mov byte [esp + 0x8c], bl
cmp dword [esp + 0x4c], esi
jb 0x40c4ac
mov eax, dword [esp + 0x38]
push eax
call fcn.0047cc0e
add esp, 4
mov eax, dword [esp + 0x98]
cmp dword [esp + 0xac], esi
jae 0x40c4c3
lea eax, [esp + 0x98]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40c549
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp edi, 0xb7
je 0x40c549
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.004033f0
mov ecx, edi
mov byte [esp + 0x8c], 2
call fcn.00402c10
mov esi, 8
cmp dword [esp + 0x4c], esi
jb 0x40c529
mov edx, dword [esp + 0x38]
push edx
call fcn.0047cc0e
add esp, 4
cmp dword [esp + 0xac], esi
jb 0x40c542
mov eax, dword [esp + 0x98]
push eax
call fcn.0047cc0e
add esp, 4
xor al, al
jmp 0x40c98a
mov eax, dword [esp + 0xa8]
lea esi, [eax - 1]
cmp esi, eax
jbe 0x40c55c
call fcn.0049d4d3
cmp dword [esp + 0xac], 8
mov eax, dword [esp + 0x98]
jae 0x40c574
lea eax, [esp + 0x98]
cmp word [eax + esi*2], 0x5c
je 0x40c58e
push 1
mov eax, 0x4c8610
lea ecx, [esp + 0x98]
call fcn.00402d20
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 0x40c95b
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.004033f0
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x50]
mov byte [esp + 0x8c], 4
mov ecx, dword [eax + edi]
call fcn.00402c10
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x4c], 8
jb 0x40c627
mov ecx, dword [esp + 0x38]
push ecx
call fcn.0047cc0e
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.004033f0
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 0x40c670
sub ecx, esi
sar ecx, 1
push ecx
lea esi, [esp + 0x38]
call fcn.004033f0
lea edx, [esp + 0x14]
push edx
mov ecx, esi
mov byte [esp + 0x90], 6
call fcn.00402ec0
add esp, 4
cmp dword [esp + 0x4c], 8
jb 0x40c6b4
mov eax, dword [esp + 0x38]
push eax
call fcn.0047cc0e
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 0x40c6e3
mov edx, dword [esp + 0x18]
push edx
call fcn.0047cc0e
add esp, 4
push ebx
call ebp
mov eax, dword [esp + 0x30]
movzx ecx, word [eax + edi]
push 0x4caea4
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
cmp esi, ebx
je 0x40c9ac
push ebx
call ebp
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [esp + 0x58], eax
cmp eax, ebx
je 0x40ca49
push ebx
call ebp
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
cmp esi, ebx
je 0x40cae2
push ebx
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esp + 0x60], eax
cmp eax, ebx
je 0x40cb7b
push 0xffffffffffffffff
push ebx
lea eax, [esp + 0x9c]
lea ecx, [esp + 0x6c]
call fcn.004030c0
mov eax, dword [edi]
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x40c761
sub ecx, esi
sar ecx, 1
push ecx
lea ecx, [esp + 0x68]
call fcn.00402d20
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.004033f0
mov eax, esi
push eax
lea ecx, [esp + 0x68]
mov byte [esp + 0x90], 0xb
call fcn.00402ec0
mov esi, 8
add esp, 4
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x2c], esi
jb 0x40c7d4
mov ecx, dword [esp + 0x18]
push ecx
call fcn.0047cc0e
add esp, 4
push ebx
call ebp
mov eax, dword [esp + 0x68]
cmp dword [esp + 0x7c], esi
jae 0x40c7e5
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 0x40c840
mov eax, str.CSystemCommands::ExtractResource___PathFileExists._error
lea ecx, [esp + 0x14]
call fcn.004034a0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0xc
call fcn.00402c10
mov byte [esp + 0x8c], 3
cmp dword [esp + 0x2c], 8
jb 0x40c8d0
mov edx, dword [esp + 0x18]
push edx
call fcn.0047cc0e
add esp, 4
jmp 0x40c8d0
cmp edi, 1
jne 0x40c8d0
mov eax, str.CSystemCommands::ExtractResource___File_exist_lets_delete_it.
lea ecx, [esp + 0x14]
call fcn.004034a0
lea eax, [esp + 0x14]
push eax
mov byte [esp + 0x90], 0xd
call fcn.00403580
add esp, 4
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 3
call fcn.004092a0
push ebx
call ebp
cmp dword [esp + 0x7c], 8
mov eax, dword [esp + 0x68]
jae 0x40c88f
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 0x40c8d0
mov eax, str.CSystemCommands::ExtractResource___DeleteFile._error
lea ecx, [esp + 0x14]
call fcn.004034a0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0xe
call fcn.00402c10
mov byte [esp + 0x8c], 3
call fcn.004092a0
push ebx
call ebp
cmp dword [esp + 0x7c], 8
mov eax, dword [esp + 0x68]
jae 0x40c8e2
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 0x40cbb4
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 0x40cc3f
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 0x40c5d0
cmp dword [esp + 0x7c], 8
jb 0x40c95b
mov ecx, dword [esp + 0x68]
push ecx
call fcn.0047cc0e
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 0x40c988
mov eax, dword [esp + 0x98]
push eax
call fcn.0047cc0e
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.0049bee5
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.004033f0
mov byte [esp + 0x8c], 7
mov ecx, edi
lea esi, [esp + 0x14]
call fcn.00402c10
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x40ca03
mov edx, dword [esp + 0x18]
push edx
call fcn.0047cc0e
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x40ca16
mov eax, dword [esp + 0x68]
push eax
call fcn.0047cc0e
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 0x40c542
mov edx, dword [esp + 0x98]
push edx
call fcn.0047cc0e
add esp, 4
xor al, al
jmp 0x40c98a
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.004033f0
mov ecx, edi
mov byte [esp + 0x8c], 8
call fcn.00402c10
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x40ca9c
mov ecx, dword [esp + 0x18]
push ecx
call fcn.0047cc0e
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x40caaf
mov edx, dword [esp + 0x68]
push edx
call fcn.0047cc0e
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 0x40c542
mov ecx, dword [esp + 0x98]
push ecx
call fcn.0047cc0e
add esp, 4
xor al, al
jmp 0x40c98a
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.004033f0
mov ecx, edi
mov byte [esp + 0x8c], 9
call fcn.00402c10
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x40cb35
mov eax, dword [esp + 0x18]
push eax
call fcn.0047cc0e
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x40cb48
mov ecx, dword [esp + 0x68]
push ecx
call fcn.0047cc0e
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 0x40c542
mov eax, dword [esp + 0x98]
push eax
call fcn.0047cc0e
add esp, 4
xor al, al
jmp 0x40c98a
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.004033f0
mov byte [esp + 0x8c], 0xa
jmp 0x40c9e0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, str.CSystemCommands::ExtractResource___CreateFile_failed._GetLastError
lea ecx, [esp + 0x14]
call fcn.004034a0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0xf
call fcn.00402c10
mov esi, 8
cmp dword [esp + 0x2c], esi
jb 0x40cbf5
mov eax, dword [esp + 0x18]
push eax
call fcn.0047cc0e
add esp, 4
cmp dword [esp + 0x7c], esi
jb 0x40cc08
mov ecx, dword [esp + 0x68]
push ecx
call fcn.0047cc0e
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 0x40c542
mov eax, dword [esp + 0x98]
push eax
call fcn.0047cc0e
add esp, 4
xor al, al
jmp 0x40c98a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, str.CSystemCommands::ExtractResource___WriteFile_failed._error
lea ecx, [esp + 0x14]
call fcn.004034a0
mov ecx, esi
lea esi, [esp + 0x14]
mov byte [esp + 0x8c], 0x10
call fcn.00402c10
call fcn.004092a0
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esi, [esp + 0x64]
call fcn.004092a0
lea esi, [esp + 0x94]
call fcn.004092a0
xor al, al
jmp 0x40c98a