Function at 0x406c50
Capabilities:
Accept command line arguments
Check for time delay via gettickcount
Create directory
Create process on windows
Create process suspended
Get common file path
Set file attributes

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4fb0
call fcn.00407eb0
mov eax, dword [0x410058]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor edi, edi
push edi
push str.ama:install:8194c72de67725b067870d4300f2dae0ot
push edi
mov dword [ebp - 0x4e64], edi
mov dword [ebp - 0x4e68], edi
mov dword [ebp - 0x4eb0], 1
call fcn.004080c4
mov esi, eax
lea eax, [esi + esi + 2]
push eax
call fcn.004076a7
inc esi
push esi
push str.ama:install:8194c72de67725b067870d4300f2dae0ot
push eax
mov dword [ebp - 0x4e98], eax
call fcn.004080c4
add esp, 0x1c
call fcn.00401100
lea ecx, [ebp - 0x4ebc]
push ecx
mov dword [ebp - 0x4e8c], 0x401000
mov dword [ebp - 0x4e88], 0x401020
mov dword [ebp - 0x4ed0], 0x401000
mov dword [ebp - 0x4ecc], 0x401020
call fcn.00401eb0
lea edx, [ebp - 0x4e60]
push edi
push edx
call fcn.00404470
add esp, 0xc
push 0x104
lea eax, [ebp - 0x82c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, edi
je 0x407690
cmp eax, 0x104
ja 0x407690
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
xor edx, edx
movzx ecx, word [eax]
cmp ecx, 0x22
jne 0x406d3c
xor ecx, ecx
cmp edx, edi
sete cl
add eax, 2
mov edx, ecx
jmp 0x406d26
cmp cx, di
je 0x406d4f
cmp ecx, 0x20
jne 0x406d4a
cmp edx, edi
je 0x406d4f
add eax, 2
jmp 0x406d26
lea edx, [ebp - 0x620]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, edi
je 0x407690
cmp eax, 0x104
ja 0x407690
lea eax, [ebp - 0x620]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x406d80
sub eax, edx
sar eax, 1
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea ebx, [eax*4]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, eax
xor esi, ebx
shl esi, 0xc
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov ebx, eax
add edi, edi
xor ebx, esi
sub edi, 0x40d2d0
mov dword [ebp - 0x4e6c], 0
lea edi, [ebp + edi - 0x620]
nop
mov eax, 0x40d2d0
movzx ecx, word [eax]
mov word [eax + edi], cx
add eax, 2
test cx, cx
jne 0x406dd5
lea eax, [ebp - 0x620]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406df0
sub eax, edx
sar eax, 1
lea edx, [ebp + eax*2 - 0x620]
mov ecx, ebx
mov eax, ebx
and ecx, 0xf
shr eax, 4
cmp ecx, 0xa
jae 0x406e1a
add ecx, 0x30
jmp 0x406e1d
add ecx, 0x37
movsx cx, cl
mov esi, eax
and esi, 0xf
shr eax, 4
mov word [edx + 0xe], cx
lea ecx, [esi + 0x30]
cmp esi, 0xa
jb 0x406e38
lea ecx, [esi + 0x37]
movsx cx, cl
mov esi, eax
and esi, 0xf
shr eax, 4
mov word [edx + 0xc], cx
lea ecx, [esi + 0x30]
cmp esi, 0xa
jb 0x406e53
lea ecx, [esi + 0x37]
movsx cx, cl
mov esi, eax
and esi, 0xf
shr eax, 4
mov word [edx + 0xa], cx
lea ecx, [esi + 0x30]
cmp esi, 0xa
jb 0x406e6e
lea ecx, [esi + 0x37]
movsx cx, cl
mov esi, eax
and esi, 0xf
shr eax, 4
mov word [edx + 8], cx
lea ecx, [esi + 0x30]
cmp esi, 0xa
jb 0x406e89
lea ecx, [esi + 0x37]
movsx cx, cl
mov esi, eax
and esi, 0xf
shr eax, 4
mov word [edx + 6], cx
lea ecx, [esi + 0x30]
cmp esi, 0xa
jb 0x406ea4
lea ecx, [esi + 0x37]
movsx cx, cl
mov esi, eax
and esi, 0xf
shr eax, 4
mov word [edx + 4], cx
lea ecx, [esi + 0x30]
cmp esi, 0xa
jb 0x406ebf
lea ecx, [esi + 0x37]
movsx cx, cl
and eax, 0xf
mov word [edx + 2], cx
cmp eax, 0xa
jae 0x406ed4
add eax, 0x30
jmp 0x406ed7
add eax, 0x37
cbw
mov word [edx], ax
xor ecx, ecx
mov word [edx + 0x10], cx
lea edx, [ebp - 0x620]
push edx
call fcn.00406a00
add esp, 4
test eax, eax
jne 0x406f14
push eax
lea eax, [ebp - 0x620]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x406f54
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x406f32
mov esi, dword [ebp - 0x4e6c]
inc esi
mov dword [ebp - 0x4e6c], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add ebx, eax
cmp esi, 0x64
jb 0x406dd0
mov eax, str.Cant_create_temp_folder
call fcn.00406850
pop ebx
pop edi
mov eax, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00407775
mov esp, ebp
pop ebp
ret 0x10
lea edi, [ebp - 0x620]
add edi, 0xfffffffe
xor ebx, ebx
nop
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x406f60
mov ecx, dword [0x40d1b8]
lea eax, [ebp - 0x620]
mov dword [edi], ecx
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x406f80
sub eax, edx
sar eax, 1
lea edx, [ebp - 0x82c]
mov dword [ebp - 0x4e6c], eax
push edx
lea eax, [ebp - 0x4eb4]
push eax
call fcn.00401c80
add esp, 8
test eax, eax
je 0x406fc5
mov dword [ebp - 0x4e68], str.can_not_open_input_file
mov dword [ebp - 0x4e64], 0xb
jmp 0x407032
lea ecx, [ebp - 0x4eb4]
push ecx
lea edi, [ebp - 0x4e94]
mov dword [ebp - 0x4e94], ebx
mov dword [ebp - 0x4e90], ebx
call fcn.00406890
add esp, 4
test eax, eax
je 0x407001
push ebx
mov edx, edi
push edx
lea eax, [ebp - 0x4eb4]
push eax
call fcn.00401dd0
add esp, 0xc
test eax, eax
je 0x407017
mov dword [ebp - 0x4e64], 0xb
mov dword [ebp - 0x4e68], str.Cant_find_7z_archive
jmp 0x407032
lea edx, [ebp - 0x4e60]
lea ecx, [ebp - 0x4ebc]
push edx
mov dword [ebp - 0x4e50], ecx
call fcn.004044a0
add esp, 4
lea eax, [ebp - 0x4f6c]
push eax
call fcn.004021a0
add esp, 4
cmp dword [ebp - 0x4e64], ebx
jne 0x407442
lea ecx, [ebp - 0x4ed0]
push ecx
lea edx, [ebp - 0x4e8c]
push edx
lea eax, [ebp - 0x4e60]
push eax
lea ecx, [ebp - 0x4f6c]
push ecx
call fcn.00404030
add esp, 0x10
mov dword [ebp - 0x4e64], eax
cmp eax, ebx
jne 0x407442
or eax, 0xffffffff
mov dword [ebp - 0x4ea8], eax
mov dword [ebp - 0x4eac], 0x40000000
mov dword [ebp - 0x4ec4], eax
mov dword [ebp - 0x4e74], ebx
mov dword [ebp - 0x4ec0], ebx
mov dword [ebp - 0x4e70], ebx
cmp dword [ebp - 0x4f50], ebx
jbe 0x40739d
mov dword [ebp - 0x4e7c], ebx
lea esp, [esp]
mov edx, dword [ebp - 0x4e70]
mov ecx, dword [ebp - 0x4e7c]
add ecx, dword [ebp - 0x4f5c]
xor eax, eax
push eax
mov dword [ebp - 0x4ea4], eax
mov dword [ebp - 0x4e80], eax
push edx
lea eax, [ebp - 0x4f6c]
push eax
mov dword [ebp - 0x4ea0], ecx
call fcn.00403530
add esp, 0xc
cmp eax, 0x104
jae 0x4073a7
mov ebx, dword [ebp - 0x4e6c]
mov esi, dword [ebp - 0x4e70]
lea ebx, [ebp + ebx*2 - 0x620]
push ebx
lea ecx, [ebp - 0x4f6c]
push esi
push ecx
call fcn.00403530
lea edx, [ebp - 0x4ed0]
push edx
lea eax, [ebp - 0x4e8c]
push eax
lea ecx, [ebp - 0x4e80]
push ecx
lea edx, [ebp - 0x4ea4]
push edx
lea eax, [ebp - 0x4ec0]
push eax
lea ecx, [ebp - 0x4e74]
push ecx
lea edx, [ebp - 0x4ec4]
push edx
push esi
lea eax, [ebp - 0x4e60]
push eax
lea ecx, [ebp - 0x4f6c]
push ecx
call fcn.00404070
xor edi, edi
add esp, 0x34
mov dword [ebp - 0x4e64], eax
cmp eax, edi
jne 0x407429
mov dword [ebp - 0x4e84], edi
cmp word [ebx], di
je 0x4071ba
mov esi, ebx
cmp word [esi], 0x2f
jne 0x4071af
xor edx, edx
lea eax, [ebp - 0x620]
mov word [esi], dx
call fcn.00406870
mov eax, 0x5c
lea ecx, [edi + 1]
mov word [esi], ax
mov dword [ebp - 0x4e84], ecx
inc edi
cmp word [ebx + edi*2], 0
lea esi, [ebx + edi*2]
jne 0x407188
mov edx, dword [ebp - 0x4ea0]
cmp byte [edx + 0x19], 0
je 0x4071d6
lea eax, [ebp - 0x620]
call fcn.00406870
jmp 0x407372
mov eax, dword [ebp - 0x4e84]
lea esi, [ebx + eax*2]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4071e4
sub eax, edx
sar eax, 1
lea edi, [ebp - 0x4ec8]
mov ebx, eax
call fcn.004067a0
mov dword [ebp - 0x4e90], eax
mov eax, dword [ebp - 0x4ec8]
sub ebx, eax
lea ecx, [esi + ebx*2]
push ecx
push 7
push 0x41002c
mov ebx, eax
call fcn.004067e0
mov ebx, dword [ebp - 0x4e90]
push esi
push 4
push 0x410048
mov edi, eax
call fcn.004067e0
mov ecx, dword [ebp - 0x4e84]
add esp, 0x18
neg ecx
sbb ecx, ecx
and ecx, 0x1000
mov edx, edi
add eax, ecx
shl edx, 6
add eax, edx
cmp dword [ebp - 0x4eac], eax
jbe 0x407279
xor ecx, ecx
cmp edi, 1
setne cl
mov dword [ebp - 0x4eac], eax
mov eax, dword [ebp - 0x4e70]
mov dword [ebp - 0x4ea8], eax
mov dword [ebp - 0x4eb0], ecx
lea edx, [ebp - 0x620]
push edx
call fcn.00406a00
add esp, 4
test eax, eax
jne 0x4073b3
lea eax, [ebp - 0x620]
push eax
lea ecx, [ebp - 0x4e78]
push ecx
call fcn.00401ca0
add esp, 8
test eax, eax
jne 0x4073c9
mov edx, dword [ebp - 0x4e80]
mov dword [ebp - 0x4e9c], edx
mov edx, dword [ebp - 0x4ea4]
add edx, dword [ebp - 0x4e74]
lea eax, [ebp - 0x4e9c]
push eax
push edx
lea eax, [ebp - 0x4e78]
push eax
call fcn.00401d60
add esp, 0xc
test eax, eax
jne 0x4072ef
mov ecx, dword [ebp - 0x4e9c]
cmp ecx, dword [ebp - 0x4e80]
je 0x407303
mov dword [ebp - 0x4e68], str.Cant_write_output_file
mov dword [ebp - 0x4e64], 0xb
mov esi, dword [ebp - 0x4ea0]
cmp byte [esi + 0x1c], 0
je 0x407338
mov edx, dword [esi]
mov eax, dword [esi + 4]
lea ecx, [ebp - 0x4ed8]
push ecx
push 0
mov dword [ebp - 0x4ed8], edx
mov edx, dword [ebp - 0x4e78]
push 0
push edx
mov dword [ebp - 0x4ed4], eax
call dword [sym.imp.KERNEL32.dll_SetFileTime]
lea eax, [ebp - 0x4e78]
push eax
call fcn.00401cc0
add esp, 4
cmp dword [ebp - 0x4e64], 0
jne 0x407429
test eax, eax
jne 0x4073df
cmp byte [esi + 0x1d], al
je 0x407372
mov ecx, dword [esi + 0x14]
push ecx
lea edx, [ebp - 0x620]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [ebp - 0x4e70]
add dword [ebp - 0x4e7c], 0x20
inc eax
mov dword [ebp - 0x4e70], eax
cmp eax, dword [ebp - 0x4f50]
jb 0x4070c0
mov eax, dword [ebp - 0x4ea8]
cmp eax, 0xffffffff
jne 0x4073e7
mov dword [ebp - 0x4e68], str.There_is_no_file_to_execute
mov dword [ebp - 0x4e64], 0xb
jmp 0x407429
mov dword [ebp - 0x4e68], str.Duplicate_file
mov dword [ebp - 0x4e64], 0xb
jmp 0x407429
mov dword [ebp - 0x4e68], str.Cant_open_output_file
mov dword [ebp - 0x4e64], 0xb
jmp 0x407429
mov dword [ebp - 0x4e64], eax
jmp 0x407429
mov esi, dword [ebp - 0x4e6c]
lea esi, [ebp + esi*2 - 0x620]
push esi
push eax
lea eax, [ebp - 0x4f6c]
push eax
call fcn.00403530
xor ecx, ecx
add esp, 0xc
cmp word [esi], cx
je 0x407429
mov eax, esi
mov edi, edi
cmp word [eax], 0x2f
jne 0x40741e
mov edx, 0x5c
mov word [eax], dx
inc ecx
cmp word [esi + ecx*2], 0
lea eax, [esi + ecx*2]
jne 0x407410
mov eax, dword [ebp - 0x4e74]
push eax
lea ecx, [ebp - 0x4e8c]
push ecx
call dword [ebp - 0x4e88]
add esp, 8
xor ebx, ebx
lea edx, [ebp - 0x4e8c]
push edx
lea eax, [ebp - 0x4f6c]
push eax
call fcn.004021d0
lea ecx, [ebp - 0x4eb4]
push ecx
call fcn.00401cc0
add esp, 0xc
cmp dword [ebp - 0x4e64], ebx
jne 0x4075e7
cmp dword [ebp - 0x4eb0], ebx
je 0x407514
push 0x3c
lea edx, [ebp - 0x4f1c]
push ebx
push edx
call fcn.004080f0
mov esi, dword [ebp - 0x4e98]
lea eax, [ebp - 0x620]
mov dword [ebp - 0x4f0c], eax
mov eax, esi
add esp, 0xc
mov dword [ebp - 0x4f1c], 0x3c
mov dword [ebp - 0x4f18], 0x140
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4074c0
sub eax, edx
sar eax, 1
je 0x4074d7
mov dword [ebp - 0x4f08], esi
lea ecx, [ebp - 0x4f1c]
push ecx
mov dword [ebp - 0x4f00], 1
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
cmp eax, ebx
je 0x4075b4
mov eax, dword [ebp - 0x4efc]
cmp eax, 0x20
ja 0x407509
cmp eax, ebx
jne 0x4075b4
mov esi, dword [ebp - 0x4ee4]
jmp 0x4075d3
xor eax, eax
jmp 0x407520
movzx ecx, word [ebp + eax - 0x620]
mov word [ebp + eax - 0xe44], cx
add eax, 2
cmp cx, bx
jne 0x407520
mov eax, dword [ebp - 0x4e98]
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x407540
lea edi, [ebp - 0xe44]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x407556
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
push 0x44
mov ecx, eax
lea edx, [ebp - 0x4fb0]
and ecx, 3
push ebx
push edx
rep movsb byte es:[edi], byte [esi]
call fcn.004080f0
add esp, 0xc
lea eax, [ebp - 0x4ee0]
push eax
lea ecx, [ebp - 0x4fb0]
push ecx
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
lea edx, [ebp - 0xe44]
push edx
push ebx
mov dword [ebp - 0x4fb0], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x4075c0
mov dword [ebp - 0x4e64], 0xb
jmp 0x4075e7
mov eax, dword [ebp - 0x4edc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x4ee0]
cmp esi, ebx
je 0x4075e7
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x4e6c]
lea eax, [ebp - 0x620]
xor ecx, ecx
push eax
mov word [ebp + edx*2 - 0x620], cx
call fcn.00406a60
mov eax, dword [ebp - 0x4e64]
add esp, 4
cmp eax, ebx
jne 0x407625
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00407775
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 4
jne 0x40763f
mov dword [ebp - 0x4e68], str.Decoder_doesnt_support_this_archive
mov eax, dword [ebp - 0x4e68]
jmp 0x406f37
cmp eax, 2
jne 0x407659
mov dword [ebp - 0x4e68], str.Cant_allocate_required_memory
mov eax, dword [ebp - 0x4e68]
jmp 0x406f37
cmp eax, 3
jne 0x407673
mov dword [ebp - 0x4e68], str.CRC_error
mov eax, dword [ebp - 0x4e68]
jmp 0x406f37
cmp dword [ebp - 0x4e68], ebx
jne 0x407685
mov dword [ebp - 0x4e68], str.ERROR
mov eax, dword [ebp - 0x4e68]
jmp 0x406f37
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
mov eax, 1
pop esi
call fcn.00407775
mov esp, ebp
pop ebp
ret 0x10