Function at 0x402140
Capabilities:
Check mutex on windows
Clear file content
Create directory
Create process on windows
Create process suspended
Delete directory
Delete file
Get common file path
Get file size
Move file
Read file on windows
Resolve function by parsing pe exports
Set current directory
Write and execute a file
Write file on windows

Disassembly:
mov eax, 0x21e8
call fcn.004038a0
mov eax, dword [0x413040]
xor eax, esp
mov dword [esp + 0x21e4], eax
push ebx
mov ebx, dword [esp + 0x21f0]
push ebp
push esi
mov esi, dword [esp + 0x2200]
lea eax, [esp + 0x54]
push eax
mov dword [0x4143bc], ebx
mov dword [esp + 0x58], 8
mov dword [esp + 0x5c], 0xff
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
push str.Panasonic_UnPacker_Exclusive_Mutex
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov ebp, eax
push 0x3e8
push ebp
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x402292
push esi
call fcn.00401a20
add esp, 4
push 0x104
lea ecx, [esp + 0xfd4]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0xfd0]
push edx
lea eax, [esp + 0x19fc]
push 0x40f4dc
push eax
call fcn.004019e0
add esp, 0xc
lea ecx, [esp + 0xfd0]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea edx, [esp + 0xfd0]
push edx
push 0x40f4dc
push 0x413fa0
call fcn.004019e0
add esp, 0xc
push 0x413fa0
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
lea eax, [esp + 0x1a10]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
test esi, esi
jne 0x4022a0
mov esi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea ecx, [esp + 0x41c]
push ecx
push 2
push ebx
call esi
push 0x64
lea edx, [esp + 0x354]
push edx
push 1
push ebx
call esi
push 0x40
lea eax, [esp + 0x354]
push eax
lea ecx, [esp + 0x420]
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
test ebp, ebp
je 0x402299
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x402cf6
push edi
lea edx, [esp + 0x50]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
sub eax, 8
push 0
sbb ecx, 0
push ecx
push eax
push esi
call edi
push 0
lea eax, [esp + 0x14]
push eax
push 8
lea ecx, [esp + 0x54]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x10], 8
je 0x402324
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 2
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
lea ecx, [esp + 0x358]
push ecx
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
lea eax, [esp + 0x11dc]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jne 0x402379
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea ecx, [esp + 0x420]
push ecx
push 8
push ebx
call edi
push 0x64
lea edx, [esp + 0x358]
push edx
push 1
push ebx
call edi
push 0x30
lea eax, [esp + 0x358]
push eax
lea ecx, [esp + 0x424]
push ecx
jmp 0x402cd4
mov edx, dword [esp + 0x4c]
mov eax, dword [esp + 0x48]
push 0
push 0
push edx
push eax
push esi
call edi
lea ecx, [esp + 0x15ec]
push ecx
push esi
call fcn.00401630
add esp, 8
test eax, eax
jne 0x4023dd
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 4
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
lea ecx, [esp + 0x358]
push ecx
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
push 0x206
lea eax, [esp + 0x5b2]
push 0
push eax
mov word [esp + 0x5b8], 0
call fcn.00403800
lea ecx, [esp + 0x5b8]
push ecx
push esi
call fcn.00401630
add esp, 0x14
test eax, eax
jne 0x40244e
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 4
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
lea ecx, [esp + 0x358]
push ecx
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
push 0x4143c0
push esi
call fcn.00401630
add esp, 8
test eax, eax
je 0x402c9b
mov edi, 0x4145c8
lea esp, [esp]
cmp edi, 0x420fc8
jge 0x402c9b
push edi
push esi
call fcn.00401630
add esp, 8
test eax, eax
je 0x402c9b
mov cx, word [edi]
add edi, 0x200
cmp cx, 0x23
jne 0x402470
mov edi, 0x420fc8
cmp edi, 0x42d9c8
jge 0x402c60
push edi
push esi
call fcn.00401630
add esp, 8
test eax, eax
je 0x402c60
push 0x40f490
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
add edi, 0x200
test eax, eax
jne 0x4024a2
cmp dword [0x413020], eax
je 0x402593
cmp word [0x4145c8], 0x23
je 0x40253b
call fcn.00401560
mov edi, eax
call fcn.00401b70
test edi, edi
je 0x402500
test eax, eax
jne 0x40253b
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 3
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
push 0x4143c0
lea ecx, [esp + 0x424]
push ecx
jmp 0x402cd4
push 0x40f490
push 0x420fc8
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x402593
call fcn.00401ff0
test eax, eax
jne 0x402593
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 3
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
push 0x4143c0
lea ecx, [esp + 0x424]
push ecx
jmp 0x402cd4
push 0x4141b0
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
mov dword [esp + 0x14], eax
je 0x4025ff
lea edx, [esp + 0x5ac]
push 0x5c
push edx
call fcn.004031d6
mov edi, eax
add esp, 8
test edi, edi
je 0x4025e5
push 0x104
push edi
call fcn.0040387a
add eax, dword [esp + 0x1c]
add esp, 8
cmp eax, 0x103
jae 0x4025e5
push edi
push 0x4141b0
call fcn.00401a00
add esp, 8
push 0x4141b0
lea eax, [esp + 0x5b0]
push 0x104
push eax
call fcn.0040378e
add esp, 0xc
cmp dword [0x4141a8], 0
jne 0x40268f
push 0
push 0x401c90
push 0
push 0x66
push ebx
call dword [sym.imp.USER32.dll_DialogBoxParamW]
cmp dword [0x42d9c8], 0
jne 0x402651
push 0xc8
lea ecx, [esp + 0x420]
push ecx
push 0x10
push ebx
call dword [sym.imp.USER32.dll_LoadStringW]
push 0x40
push 0x4143c0
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
lea eax, [esp + 0x5ac]
push eax
call fcn.00401d90
add esp, 4
test eax, eax
jne 0x40268f
push 0xc8
lea ecx, [esp + 0x420]
push ecx
push 0x10
push ebx
call dword [sym.imp.USER32.dll_LoadStringW]
push 0x40
push 0x4143c0
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
lea eax, [esp + 0x15ec]
push eax
lea ecx, [esp + 0x11e0]
push ecx
lea edx, [esp + 0x7bc]
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [esp + 0xfc]
push eax
lea ecx, [esp + 0x7b8]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
je 0x40273d
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 5
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
lea ecx, [esp + 0x7b4]
push ecx
lea edx, [esp + 0x420]
push edx
lea eax, [esp + 0xdd4]
push eax
call fcn.004019e0
add esp, 0xc
push 0x30
lea ecx, [esp + 0x358]
push ecx
lea edx, [esp + 0xdd4]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x402cdc
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
lea ecx, [esp + 0x7cc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4027a2
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 6
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
lea ecx, [esp + 0x358]
push ecx
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
mov dword [esp + 0x10], 1
lea ebx, [ebx]
push 0
lea eax, [esp + 0x14]
push eax
push 0x3e8
lea ecx, [esp + 0x1c10]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4027ea
mov eax, dword [esp + 0x10]
push 0
lea edx, [esp + 0x74]
push edx
push eax
lea ecx, [esp + 0x1c10]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x10], 0
jne 0x4027b0
push 2
push 0
or ecx, 0xffffffff
push ecx
mov eax, 0xfffffff8
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call edi
lea edx, [esp + 0x1fec]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [esp + 0x17f4]
push eax
push 0
push str.unpack
lea ecx, [esp + 0x11e8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea edx, [esp + 0x17f4]
push edx
lea eax, [esp + 0x11e0]
push eax
lea ecx, [esp + 0x9c4]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea edx, [esp + 0x9bc]
push edx
call esi
push 0
lea eax, [esp + 0x9c0]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push 0x44
lea ecx, [esp + 0xbc]
push 0
push ecx
call fcn.00403800
mov edx, dword [0x40f4c4]
mov eax, dword [0x40f4c8]
add esp, 0xc
mov dword [esp + 0x34c], edx
lea ecx, [esp + 0x60]
push ecx
lea edx, [esp + 0xbc]
push edx
mov dword [esp + 0x358], eax
lea eax, [esp + 0x9c4]
push eax
push 0
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x36c]
push ecx
lea edx, [esp + 0x7d8]
push edx
mov dword [esp + 0xe0], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x40296c
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea eax, [esp + 0x420]
push eax
push 7
push ebx
call edi
push 0x64
lea ecx, [esp + 0x358]
push ecx
push 1
push ebx
call edi
push 0x30
lea edx, [esp + 0x358]
push edx
lea eax, [esp + 0x424]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
lea ecx, [esp + 0x7b4]
push ecx
call esi
lea edx, [esp + 0x9bc]
push edx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test ebp, ebp
je 0x402cf3
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402cf3
mov eax, dword [esp + 0x60]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor edi, edi
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x206
lea ecx, [esp + 0xbca]
push edi
push ecx
mov word [esp + 0xbd0], di
call fcn.00403800
lea edx, [esp + 0x9c8]
push edx
lea eax, [esp + 0xbd4]
push 0x104
push eax
call fcn.00403714
push str..
lea ecx, [esp + 0xbe0]
push 0x104
push ecx
call fcn.00403714
add esp, 0x24
mov dword [esp + 0x28], edi
lea eax, [esp + 0x5ac]
lea edx, [esp + 0xbc4]
mov edi, 1
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea edx, [esp + 0x28]
lea ecx, [esp + 0x5ac]
push edx
mov dword [esp + 0x38], ecx
mov word [esp + 0x3c], 0x210
mov dword [esp + 0x46], 0x40f4b4
call dword [sym.imp.SHELL32.dll_SHFileOperationW]
test eax, eax
je 0x402ace
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea eax, [esp + 0x420]
push eax
push 9
push ebx
call edi
push 0x64
lea ecx, [esp + 0x358]
push ecx
push 1
push ebx
call edi
push 0x30
lea edx, [esp + 0x358]
push edx
lea eax, [esp + 0x424]
push eax
xor edi, edi
push edi
call dword [sym.imp.USER32.dll_MessageBoxW]
lea edx, [esp + 0x28]
lea ecx, [esp + 0xbc4]
push edx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], 3
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], edi
mov word [esp + 0x3c], 0x210
mov dword [esp + 0x46], 0x40f4b4
call dword [sym.imp.SHELL32.dll_SHFileOperationW]
lea eax, [esp + 0x9bc]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
lea ecx, [esp + 0x7b4]
push ecx
call esi
cmp ebp, edi
je 0x402cf3
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402cf3
lea edx, [esp + 0x9bc]
push edx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
lea eax, [esp + 0x7b4]
push eax
call esi
cmp dword [0x4141ac], edi
jne 0x402bf6
push 0x206
lea ecx, [esp + 0x13ea]
push 0
push ecx
mov word [esp + 0x13f0], 0
call fcn.00403800
mov ecx, 6
mov esi, str.pinstall.bat
lea edi, [esp + 0xdd8]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
push 0x1ee
xor edi, edi
lea edx, [esp + 0xdf6]
push edi
push edx
call fcn.00403800
push 0x40
lea eax, [esp + 0x94]
push edi
push eax
mov dword [esp + 0x98], edi
call fcn.00403800
add esp, 0x24
lea ecx, [esp + 0x13e4]
xor eax, eax
push ecx
push 0x104
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea edx, [esp + 0x5ac]
push edx
call esi
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x78]
push ecx
push edi
push edi
push edi
push 1
push edi
push edi
lea edx, [esp + 0xdec]
push edx
push edi
mov dword [esp + 0x9c], 0x44
mov dword [esp + 0xc8], 1
mov word [esp + 0xcc], di
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x402bec
mov eax, dword [esp + 0x18]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esp + 0x1c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call edi
mov edx, dword [esp + 0x18]
push edx
call edi
lea eax, [esp + 0x13e4]
push eax
call esi
cmp dword [0x4141a8], 0
jne 0x402c2c
push 0xc8
lea ecx, [esp + 0x420]
push ecx
push 0xa
push ebx
call dword [sym.imp.USER32.dll_LoadStringW]
push 0x40
push 0x4143c0
lea edx, [esp + 0x424]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
test ebp, ebp
je 0x402c42
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
jmp 0x402c48
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x60]
push eax
call esi
mov ecx, dword [esp + 0x64]
push ecx
call esi
mov eax, 1
jmp 0x402cf5
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea edx, [esp + 0x420]
push edx
push 3
push ebx
call edi
push 0x64
lea eax, [esp + 0x358]
push eax
push 1
push ebx
call edi
push 0x30
lea ecx, [esp + 0x358]
push ecx
lea edx, [esp + 0x424]
push edx
jmp 0x402cd4
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0xc8
lea eax, [esp + 0x420]
push eax
push 4
push ebx
call edi
push 0x64
lea ecx, [esp + 0x358]
push ecx
push 1
push ebx
call edi
push 0x30
lea edx, [esp + 0x358]
push edx
lea eax, [esp + 0x424]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
test ebp, ebp
je 0x402cf3
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call esi
xor eax, eax
pop edi
mov ecx, dword [esp + 0x21f0]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00403136
add esp, 0x21e8
ret 0x10