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

Disassembly:
push ebp
lea ebp, [esp - 0x3a8]
sub esp, 0x428
mov eax, dword [0x415010]
xor eax, ebp
mov dword [ebp + 0x3a4], eax
push ebx
push esi
mov esi, dword [sym.imp.USER32.dll_wsprintfW]
push edi
mov edi, 0x416cd0
push edi
push 0x416368
mov ebx, 0x4113e0
lea eax, [ebp + 0x19c]
push ebx
push eax
call esi
add esp, 0x10
lea eax, [ebp + 0x19c]
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4020e8
lea eax, [ebp + 0x19c]
push eax
call fcn.0040127e
pop ecx
test eax, eax
jne 0x4020e8
mov dword [ebp - 0x70], 0x65
push dword [ebp - 0x70]
push str.LiuPack
push str._s__d_
push edi
call esi
push edi
push 0x416368
lea eax, [ebp + 0x19c]
push ebx
push eax
call esi
add esp, 0x20
lea eax, [ebp + 0x19c]
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4020e8
inc dword [ebp - 0x70]
cmp dword [ebp - 0x70], 0xc8
jle 0x40208d
lea eax, [ebp + 0x19c]
push eax
push str.Error:_UnpackFiles___01____s
call fcn.00401186
pop ecx
pop ecx
xor eax, eax
jmp 0x40220c
xor ebx, ebx
push ebx
lea eax, [ebp + 0x19c]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateDirectoryW]
test eax, eax
lea eax, [ebp + 0x19c]
push eax
jne 0x40210a
push str.Error:_UnpackFiles___02____s
jmp 0x4020da
lea eax, [ebp - 0x6c]
push str._sliupack
push eax
call esi
add esp, 0xc
push 0x411484
push 0x8a
push ebx
call dword [sym.imp.KERNEL32.DLL_FindResourceW]
mov edi, eax
cmp edi, ebx
je 0x4021ba
push edi
push ebx
call dword [sym.imp.KERNEL32.DLL_SizeofResource]
push edi
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.DLL_LoadResource]
mov dword [ebp - 0x80], eax
cmp eax, ebx
je 0x4021ba
push eax
call dword [sym.imp.KERNEL32.DLL_LockResource]
mov dword [ebp - 0x74], eax
cmp eax, ebx
je 0x4021b1
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [ebp - 0x70], eax
cmp eax, 0xffffffff
je 0x4021b1
mov edi, dword [sym.imp.KERNEL32.DLL_WriteFile]
push ebx
lea ecx, [ebp - 0x7c]
push ecx
mov ecx, dword [ebp - 0x74]
mov eax, esi
shr eax, 1
sub ecx, eax
push eax
add ecx, esi
push ecx
push dword [ebp - 0x70]
mov dword [ebp - 0x78], eax
call edi
sub esi, dword [ebp - 0x78]
push ebx
lea eax, [ebp - 0x7c]
push eax
push esi
push dword [ebp - 0x74]
push dword [ebp - 0x70]
call edi
push dword [ebp - 0x70]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [ebp - 0x80]
call dword [sym.imp.KERNEL32.DLL_FreeResource]
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4021d7
lea eax, [ebp - 0x6c]
push eax
push str.Error:_UnpackFiles___03____s
jmp 0x4020da
lea eax, [ebp + 0x19c]
push eax
push str.liupack
call fcn.0040308b
pop ecx
pop ecx
test eax, eax
jne 0x4021ff
lea eax, [ebp + 0x19c]
push eax
push str.Error:_UnpackFiles___04____s
jmp 0x4020da
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.KERNEL32.DLL_DeleteFileW]
xor eax, eax
inc eax
mov ecx, dword [ebp + 0x3a4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040762a
add ebp, 0x3a8
leave
ret