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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c5c40
mov eax, dword fs:[0]
push eax
sub esp, 0x158
mov eax, dword [0x50c380]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push 0x104
lea eax, [ebp - 0x114]
push 0
push eax
call fcn.004a0950
add esp, 0xc
lea eax, [ebp - 0x114]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push 0
lea eax, [ebp - 0x114]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
mov eax, dword [0x50fdb4]
test eax, eax
jne 0x40d2d9
push 0x108
call fcn.0049ec5b
mov edi, eax
add esp, 4
mov dword [ebp - 0x14c], edi
mov dword [ebp - 4], 0
test edi, edi
je 0x40d2cb
push 0x108
push 0
push edi
call fcn.004a0950
add esp, 0xc
mov ecx, edi
call fcn.0040f4e0
jmp 0x40d2cd
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov dword [0x50fdb4], eax
push str.DATA
push str.7ZDATA
mov ecx, eax
call sym.Install.exe_public:_wchar_t_const____thiscall_DuiLib::CDuiString::operator_wchar_t_const__void_const
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
test edi, edi
je 0x40d4d0
push edi
call fcn.0040c830
mov ecx, eax
call sym.Install.exe_public:_wchar_t_const____thiscall_DuiLib::CDuiString::operator_wchar_t_const__void_const
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push edi
mov ebx, eax
call fcn.0040c830
mov ecx, eax
call sym.Install.exe_public:_wchar_t_const____thiscall_DuiLib::CDuiString::operator_wchar_t_const__void_const
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
lea edx, [ebp - 0x114]
mov dword [ebp - 0x14c], eax
dec edx
nop dword [eax]
mov cl, byte [edx + 1]
lea edx, [edx + 1]
test cl, cl
jne 0x40d340
mov eax, dword [str.7zData.7z]
mov dword [edx], eax
mov eax, dword [0x4c99f4]
mov dword [edx + 4], eax
mov ax, word [0x4c99f8]
mov word [edx + 8], ax
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x40d3b1
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0x130]
push eax
call fcn.00401680
add esp, 8
lea eax, [ebp - 0x130]
cmp dword [ebp - 0x11c], 7
mov ecx, esi
cmova eax, dword [ebp - 0x130]
push eax
call fcn.0040cf10
lea ecx, [ebp - 0x130]
call fcn.00402f40
push 0
push 0x80
push 1
push 0
push 1
push 0x40000000
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40d3ff
push 0
lea eax, [ebp - 0x118]
mov dword [ebp - 0x118], 0
push eax
push dword [ebp - 0x14c]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x164]
push eax
call fcn.0040c830
mov ecx, eax
call fcn.0040fb50
cmp dword [eax + 0x14], 0xf
mov dword [ebp - 4], 1
jbe 0x40d421
mov eax, dword [eax]
push eax
lea eax, [ebp - 0x148]
push eax
call fcn.00401680
add esp, 8
mov ecx, dword [ebp - 0x150]
mov byte [ebp - 4], 3
cmp ecx, 0xf
jbe 0x40d46f
mov edx, dword [ebp - 0x164]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d465
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d4ec
push ecx
push edx
call fcn.0049ec8b
add esp, 8
lea eax, [esi + 8]
mov dword [ebp - 0x154], 0
neg esi
mov dword [ebp - 0x150], 0xf
lea ecx, [ebp - 0x114]
mov byte [ebp - 0x164], 0
sbb esi, esi
and esi, eax
cmp dword [ebp - 0x134], 7
push esi
lea eax, [ebp - 0x148]
cmova eax, dword [ebp - 0x148]
push ecx
push eax
call fcn.00403d10
add esp, 0xc
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [ebp - 0x148]
call fcn.00402f40
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0049ec00
mov esp, ebp
pop ebp
ret
call fcn.004a943a
int3