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, 0x51b4
call fcn.00407f60
mov eax, dword [0x410058]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor edi, edi
push 0x1fc
lea eax, [ebp - 0x81c]
push edi
push eax
mov dword [ebp - 0x5064], edi
mov dword [ebp - 0x820], edi
call fcn.004081a0
push edi
push str.ama:install:1c08a3cf8ff3a29587a20821741d3bd8ot
push edi
mov dword [ebp - 0x5068], edi
mov dword [ebp - 0x50b0], 1
call fcn.00408174
mov esi, eax
lea ecx, [esi + esi + 2]
push ecx
call fcn.00407757
inc esi
push esi
push str.ama:install:1c08a3cf8ff3a29587a20821741d3bd8ot
push eax
mov dword [ebp - 0x509c], eax
call fcn.00408174
add esp, 0x28
call fcn.00401100
lea edx, [ebp - 0x50d4]
push edx
mov dword [ebp - 0x5090], 0x401000
mov dword [ebp - 0x508c], 0x401020
mov dword [ebp - 0x50c0], 0x401000
mov dword [ebp - 0x50bc], 0x401020
call fcn.00401eb0
lea eax, [ebp - 0x5060]
push edi
push eax
call fcn.00404470
add esp, 0xc
push 0x104
lea ecx, [ebp - 0xa2c]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, edi
je 0x407740
cmp eax, 0x104
ja 0x407740
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
xor edx, edx
mov edi, edi
movzx ecx, word [eax]
cmp ecx, 0x22
jne 0x406d56
xor ecx, ecx
cmp edx, edi
sete cl
add eax, 2
mov edx, ecx
jmp 0x406d40
cmp cx, di
je 0x406d69
cmp ecx, 0x20
jne 0x406d64
cmp edx, edi
je 0x406d69
add eax, 2
jmp 0x406d40
lea edx, [ebp - 0x620]
push edx
push 0x104
mov dword [ebp - 0x5074], eax
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, edi
je 0x407740
cmp eax, 0x104
ja 0x407740
lea eax, [ebp - 0x620]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x406da0
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, 0x40d2d4
mov dword [ebp - 0x506c], 0
lea edi, [ebp + edi - 0x620]
nop
mov eax, 0x40d2d4
movzx ecx, word [eax]
mov word [eax + edi], cx
add eax, 2
test cx, cx
jne 0x406df5
lea eax, [ebp - 0x620]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406e10
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 0x406e3a
add ecx, 0x30
jmp 0x406e3d
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 0x406e58
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 0x406e73
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 0x406e8e
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 0x406ea9
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 0x406ec4
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 0x406edf
lea ecx, [esi + 0x37]
movsx cx, cl
and eax, 0xf
mov word [edx + 2], cx
cmp eax, 0xa
jae 0x406ef4
add eax, 0x30
jmp 0x406ef7
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 0x406f34
push eax
lea eax, [ebp - 0x620]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x406f74
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x406f52
mov esi, dword [ebp - 0x506c]
inc esi
mov dword [ebp - 0x506c], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add ebx, eax
cmp esi, 0x64
jb 0x406df0
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.00407825
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 0x406f80
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 0x406fa0
sub eax, edx
sar eax, 1
lea edx, [ebp - 0xa2c]
mov dword [ebp - 0x506c], eax
push edx
lea eax, [ebp - 0x50cc]
push eax
call fcn.00401c80
add esp, 8
test eax, eax
je 0x406fe5
mov dword [ebp - 0x5068], str.can_not_open_input_file
mov dword [ebp - 0x5064], 0xb
jmp 0x407052
lea ecx, [ebp - 0x50cc]
push ecx
lea edi, [ebp - 0x5098]
mov dword [ebp - 0x5098], ebx
mov dword [ebp - 0x5094], ebx
call fcn.00406890
add esp, 4
test eax, eax
je 0x407021
push ebx
mov edx, edi
push edx
lea eax, [ebp - 0x50cc]
push eax
call fcn.00401dd0
add esp, 0xc
test eax, eax
je 0x407037
mov dword [ebp - 0x5064], 0xb
mov dword [ebp - 0x5068], str.Cant_find_7z_archive
jmp 0x407052
lea edx, [ebp - 0x5060]
lea ecx, [ebp - 0x50d4]
push edx
mov dword [ebp - 0x5050], ecx
call fcn.004044a0
add esp, 4
lea eax, [ebp - 0x5170]
push eax
call fcn.004021a0
add esp, 4
cmp dword [ebp - 0x5064], ebx
jne 0x407462
lea ecx, [ebp - 0x50c0]
push ecx
lea edx, [ebp - 0x5090]
push edx
lea eax, [ebp - 0x5060]
push eax
lea ecx, [ebp - 0x5170]
push ecx
call fcn.00404030
add esp, 0x10
mov dword [ebp - 0x5064], eax
cmp eax, ebx
jne 0x407462
or eax, 0xffffffff
mov dword [ebp - 0x50b4], eax
mov dword [ebp - 0x50a4], 0x40000000
mov dword [ebp - 0x50c8], eax
mov dword [ebp - 0x5080], ebx
mov dword [ebp - 0x50b8], ebx
mov dword [ebp - 0x5070], ebx
cmp dword [ebp - 0x5154], ebx
jbe 0x4073bd
mov dword [ebp - 0x5078], ebx
lea esp, [esp]
mov edx, dword [ebp - 0x5070]
mov ecx, dword [ebp - 0x5078]
add ecx, dword [ebp - 0x5160]
xor eax, eax
push eax
mov dword [ebp - 0x50a8], eax
mov dword [ebp - 0x5084], eax
push edx
lea eax, [ebp - 0x5170]
push eax
mov dword [ebp - 0x50ac], ecx
call fcn.00403530
add esp, 0xc
cmp eax, 0x104
jae 0x4073c7
mov ebx, dword [ebp - 0x506c]
mov esi, dword [ebp - 0x5070]
lea ebx, [ebp + ebx*2 - 0x620]
push ebx
lea ecx, [ebp - 0x5170]
push esi
push ecx
call fcn.00403530
lea edx, [ebp - 0x50c0]
push edx
lea eax, [ebp - 0x5090]
push eax
lea ecx, [ebp - 0x5084]
push ecx
lea edx, [ebp - 0x50a8]
push edx
lea eax, [ebp - 0x50b8]
push eax
lea ecx, [ebp - 0x5080]
push ecx
lea edx, [ebp - 0x50c8]
push edx
push esi
lea eax, [ebp - 0x5060]
push eax
lea ecx, [ebp - 0x5170]
push ecx
call fcn.00404070
xor edi, edi
add esp, 0x34
mov dword [ebp - 0x5064], eax
cmp eax, edi
jne 0x407449
mov dword [ebp - 0x5088], edi
cmp word [ebx], di
je 0x4071da
mov esi, ebx
cmp word [esi], 0x2f
jne 0x4071cf
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 - 0x5088], ecx
inc edi
cmp word [ebx + edi*2], 0
lea esi, [ebx + edi*2]
jne 0x4071a8
mov edx, dword [ebp - 0x50ac]
cmp byte [edx + 0x19], 0
je 0x4071f6
lea eax, [ebp - 0x620]
call fcn.00406870
jmp 0x407392
mov eax, dword [ebp - 0x5088]
lea esi, [ebx + eax*2]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407204
sub eax, edx
sar eax, 1
lea edi, [ebp - 0x50c4]
mov ebx, eax
call fcn.004067a0
mov dword [ebp - 0x5094], eax
mov eax, dword [ebp - 0x50c4]
sub ebx, eax
lea ecx, [esi + ebx*2]
push ecx
push 7
push 0x41002c
mov ebx, eax
call fcn.004067e0
mov ebx, dword [ebp - 0x5094]
push esi
push 4
push 0x410048
mov edi, eax
call fcn.004067e0
mov ecx, dword [ebp - 0x5088]
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 - 0x50a4], eax
jbe 0x407299
xor ecx, ecx
cmp edi, 1
setne cl
mov dword [ebp - 0x50a4], eax
mov eax, dword [ebp - 0x5070]
mov dword [ebp - 0x50b4], eax
mov dword [ebp - 0x50b0], ecx
lea edx, [ebp - 0x620]
push edx
call fcn.00406a00
add esp, 4
test eax, eax
jne 0x4073d3
lea eax, [ebp - 0x620]
push eax
lea ecx, [ebp - 0x507c]
push ecx
call fcn.00401ca0
add esp, 8
test eax, eax
jne 0x4073e9
mov edx, dword [ebp - 0x5084]
mov dword [ebp - 0x50a0], edx
mov edx, dword [ebp - 0x50a8]
add edx, dword [ebp - 0x5080]
lea eax, [ebp - 0x50a0]
push eax
push edx
lea eax, [ebp - 0x507c]
push eax
call fcn.00401d60
add esp, 0xc
test eax, eax
jne 0x40730f
mov ecx, dword [ebp - 0x50a0]
cmp ecx, dword [ebp - 0x5084]
je 0x407323
mov dword [ebp - 0x5068], str.Cant_write_output_file
mov dword [ebp - 0x5064], 0xb
mov esi, dword [ebp - 0x50ac]
cmp byte [esi + 0x1c], 0
je 0x407358
mov edx, dword [esi]
mov eax, dword [esi + 4]
lea ecx, [ebp - 0x50dc]
push ecx
push 0
mov dword [ebp - 0x50dc], edx
mov edx, dword [ebp - 0x507c]
push 0
push edx
mov dword [ebp - 0x50d8], eax
call dword [sym.imp.KERNEL32.dll_SetFileTime]
lea eax, [ebp - 0x507c]
push eax
call fcn.00401cc0
add esp, 4
cmp dword [ebp - 0x5064], 0
jne 0x407449
test eax, eax
jne 0x4073ff
cmp byte [esi + 0x1d], al
je 0x407392
mov ecx, dword [esi + 0x14]
push ecx
lea edx, [ebp - 0x620]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [ebp - 0x5070]
add dword [ebp - 0x5078], 0x20
inc eax
mov dword [ebp - 0x5070], eax
cmp eax, dword [ebp - 0x5154]
jb 0x4070e0
mov eax, dword [ebp - 0x50b4]
cmp eax, 0xffffffff
jne 0x407407
mov dword [ebp - 0x5068], str.There_is_no_file_to_execute
mov dword [ebp - 0x5064], 0xb
jmp 0x407449
mov dword [ebp - 0x5068], str.Duplicate_file
mov dword [ebp - 0x5064], 0xb
jmp 0x407449
mov dword [ebp - 0x5068], str.Cant_open_output_file
mov dword [ebp - 0x5064], 0xb
jmp 0x407449
mov dword [ebp - 0x5064], eax
jmp 0x407449
mov esi, dword [ebp - 0x506c]
lea esi, [ebp + esi*2 - 0x620]
push esi
push eax
lea eax, [ebp - 0x5170]
push eax
call fcn.00403530
xor ecx, ecx
add esp, 0xc
cmp word [esi], cx
je 0x407449
mov eax, esi
mov edi, edi
cmp word [eax], 0x2f
jne 0x40743e
mov edx, 0x5c
mov word [eax], dx
inc ecx
cmp word [esi + ecx*2], 0
lea eax, [esi + ecx*2]
jne 0x407430
mov eax, dword [ebp - 0x5080]
push eax
lea ecx, [ebp - 0x5090]
push ecx
call dword [ebp - 0x508c]
add esp, 8
xor ebx, ebx
lea edx, [ebp - 0x5090]
push edx
lea eax, [ebp - 0x5170]
push eax
call fcn.004021d0
lea ecx, [ebp - 0x50cc]
push ecx
call fcn.00401cc0
add esp, 0xc
cmp dword [ebp - 0x5064], ebx
jne 0x407697
cmp dword [ebp - 0x50b0], ebx
je 0x4075c9
push 0x3c
lea edx, [ebp - 0x5120]
push ebx
push edx
call fcn.004081a0
lea eax, [ebp - 0x620]
mov dword [ebp - 0x5110], eax
mov eax, dword [ebp - 0x5074]
add esp, 0xc
mov dword [ebp - 0x5120], 0x3c
mov dword [ebp - 0x511c], 0x140
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4074d6
lea edi, [ebp - 0x820]
sub eax, edx
add edi, 0xfffffffe
lea esp, [esp]
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x4074f0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x509c]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x407517
sub eax, edx
sar eax, 1
je 0x407580
lea edi, [ebp - 0x820]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x407531
mov ecx, dword [0x40d228]
mov eax, esi
mov dword [edi], ecx
mov edx, eax
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x407550
lea edi, [ebp - 0x820]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x407566
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebp - 0x5120]
lea edx, [ebp - 0x820]
push eax
mov dword [ebp - 0x510c], edx
mov dword [ebp - 0x5104], 1
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
cmp eax, ebx
je 0x407664
mov eax, dword [ebp - 0x5100]
cmp eax, 0x20
ja 0x4075be
cmp eax, ebx
jne 0x407664
mov esi, dword [ebp - 0x50e8]
jmp 0x407683
xor eax, eax
jmp 0x4075d0
movzx ecx, word [ebp + eax - 0x620]
mov word [ebp + eax - 0x1044], cx
add eax, 2
cmp cx, bx
jne 0x4075d0
mov eax, dword [ebp - 0x509c]
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4075f0
lea edi, [ebp - 0x1044]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x407606
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 0x44
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x51b4]
push ebx
push ecx
call fcn.004081a0
add esp, 0xc
lea edx, [ebp - 0x50e4]
push edx
lea eax, [ebp - 0x51b4]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
lea ecx, [ebp - 0x1044]
push ecx
push ebx
mov dword [ebp - 0x51b4], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x407670
mov dword [ebp - 0x5064], 0xb
jmp 0x407697
mov edx, dword [ebp - 0x50e0]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x50e4]
cmp esi, ebx
je 0x407697
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x506c]
lea edx, [ebp - 0x620]
xor eax, eax
push edx
mov word [ebp + ecx*2 - 0x620], ax
call fcn.00406a60
mov eax, dword [ebp - 0x5064]
add esp, 4
cmp eax, ebx
jne 0x4076d5
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00407825
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 4
jne 0x4076ef
mov dword [ebp - 0x5068], str.Decoder_doesnt_support_this_archive
mov eax, dword [ebp - 0x5068]
jmp 0x406f57
cmp eax, 2
jne 0x407709
mov dword [ebp - 0x5068], str.Cant_allocate_required_memory
mov eax, dword [ebp - 0x5068]
jmp 0x406f57
cmp eax, 3
jne 0x407723
mov dword [ebp - 0x5068], str.CRC_error
mov eax, dword [ebp - 0x5068]
jmp 0x406f57
cmp dword [ebp - 0x5068], ebx
jne 0x407735
mov dword [ebp - 0x5068], str.ERROR
mov eax, dword [ebp - 0x5068]
jmp 0x406f57
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
mov eax, 1
pop esi
call fcn.00407825
mov esp, ebp
pop ebp
ret 0x10