Function at 0x402460
Capabilities:
Execute command
Move file
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
mov esi, eax
sub esp, 0x33c
mov eax, dword [0x40a880]
mov dword [esp + 0x28], edx
mov edx, dword [0x40a884]
mov dword [esp + 0x34], ecx
mov byte [edx + eax], 0
mov dword [esp], 0x1f40
mov dword [0x40a88c], eax
mov dword [0x40a054], 0
mov dword [0x40a044], 0x1f4
mov dword [0x40a048], 0
call sub.msvcrt.dll_malloc
mov ebp, dword [0x40a058]
mov dword [0x40a040], eax
lea eax, [esi + esi*4]
shl eax, 4
mov edi, dword [ebp + 0x8c]
mov dword [esp + 0x30], eax
add edi, eax
lea eax, [esp + 0x64]
mov ebx, dword [edi + 0x28]
mov dword [esp + 4], 2
mov dword [esp + 0xc], eax
lea eax, [esp + 0xc8]
mov dword [esp], ebp
mov dword [esp + 0xd0], esi
mov dword [esp + 8], eax
call sub.libX11_6.dll_XGetVisualInfo
mov edx, esi
mov dword [esp + 0x2c], eax
mov eax, str.SCREEN_NUM
call fcn.004020b0
mov edx, dword [edi + 0xc]
mov eax, str.WIDTH
call fcn.004020b0
mov edx, dword [edi + 0x10]
mov eax, str.HEIGHT
call fcn.004020b0
mov ecx, dword [edi + 0x14]
mov eax, dword [edi + 0xc]
test ecx, ecx
je 0x40254f
imul eax, eax, 0x186a0
cdq
idiv ecx
mov edx, 0x51eb851f
lea ecx, [eax + 0x32]
mov eax, ecx
sar ecx, 0x1f
imul edx
sar edx, 5
sub edx, ecx
mov ecx, edx
mov edx, ecx
mov eax, str.X_RESOLUTION
call fcn.004020b0
mov ecx, dword [edi + 0x18]
mov eax, dword [edi + 0x10]
test ecx, ecx
je 0x402584
imul eax, eax, 0x186a0
cdq
idiv ecx
mov edx, 0x51eb851f
lea ecx, [eax + 0x32]
mov eax, ecx
sar ecx, 0x1f
imul edx
sar edx, 5
sub edx, ecx
mov ecx, edx
mov edx, ecx
mov eax, str.Y_RESOLUTION
call fcn.004020b0
mov eax, dword [ebp + 0x8c]
mov ecx, dword [esp + 0x30]
mov edx, dword [eax + ecx + 0x24]
mov eax, str.PLANES
call fcn.004020b0
mov edx, dword [ebx + 0x18]
mov eax, str.BITS_PER_RGB
call fcn.004020b0
mov eax, dword [ebx + 8]
cmp eax, 5
ja 0x402a71
mov edx, dword [eax*4 + 0x4079bc]
mov eax, str.CLASS
lea esi, [esp + 0x12f]
call fcn.00402060
mov eax, dword [ebx + 8]
mov dword [esp + 8], str.CLASS__s
mov dword [esp + 4], 0x32
mov dword [esp], esi
mov eax, dword [eax*4 + 0x4079bc]
mov dword [esp + 0xc], eax
call fcn.00401a00
mov edx, dword [ebx + 4]
mov eax, esi
call fcn.004020b0
mov eax, dword [ebx + 8]
sub eax, 2
cmp eax, 3
jbe 0x402aac
mov edx, dword [esp + 0x64]
xor esi, esi
mov ebx, dword [esp + 0x2c]
lea ebp, [esp + 0x12f]
test edx, edx
jle 0x402665
lea esi, [esi]
mov ecx, dword [ebx + 0x10]
mov eax, ebx
mov edx, esi
jmp 0x402643
sub eax, 0x28
sub edx, 1
js 0x402994
cmp dword [eax - 0x18], ecx
jne 0x402640
mov edi, dword [ebx + 0xc]
cmp dword [eax - 0x1c], edi
jne 0x402640
add esi, 1
add ebx, 0x28
cmp esi, dword [esp + 0x64]
jl 0x402630
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.libX11_6.dll_XFree
mov ebp, dword [0x40a068]
test ebp, ebp
jle 0x4026eb
xor ebx, ebx
jmp 0x4026aa
cmp al, 0x55
je 0x402940
mov edi, str._undef
mov ecx, 7
repe cmpsb byte [esi], byte es:[edi]
jne 0x4026a3
mov eax, dword [0x40600c]
test eax, eax
jne 0x402980
add ebx, 1
cmp ebx, ebp
je 0x4026eb
mov esi, dword [ebx*4 + 0x40a080]
movzx eax, byte [esi + 1]
cmp al, 0x44
jne 0x402680
mov dword [esp + 4], 0x3d
mov dword [esp], esi
call sub.msvcrt.dll_strchr
test eax, eax
mov edi, eax
je 0x4029f0
mov byte [eax], 0
lea edx, [eax + 1]
lea eax, [esi + 2]
add ebx, 1
call fcn.00402060
cmp ebx, ebp
mov byte [edi], 0x3d
jne 0x4026aa
mov eax, dword [esp + 0x28]
test eax, eax
je 0x402abd
mov eax, dword [0x40a058]
mov edi, dword [esp + 0x30]
mov ecx, dword [eax + 0x8c]
add ecx, edi
mov dword [esp], ecx
call sub.libX11_6.dll_XScreenResourceString
mov ebx, eax
mov eax, dword [0x40a058]
mov edx, dword [eax + 0x8c]
mov ecx, dword [edx + edi + 8]
mov dword [esp + 8], 0
mov dword [esp + 4], str.SCREEN_RESOURCES
mov dword [esp], eax
mov dword [esp + 0x30], ecx
call sub.libX11_6.dll_XInternAtom
mov dword [esp + 0x38], eax
mov eax, dword [0x40600c]
test eax, eax
je 0x402af3
cmp eax, 1
je 0x402ba5
cmp eax, 2
je 0x402bd3
cmp eax, 3
je 0x402c88
test ebx, ebx
setne byte [esp + 0x2c]
sub eax, 5
movzx ecx, byte [esp + 0x2c]
cmp eax, 1
ja 0x40278a
test cl, cl
je 0x40278a
cmp byte [ebx], 0
jne 0x402ff0
mov eax, dword [0x40a894]
test eax, eax
je 0x402bf9
mov dword [esp + 4], 0x4076f8
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
je 0x402fda
test byte [eax + 3], 0xdf
mov edx, 0x407064
mov eax, 0x4075a5
cmovne eax, edx
mov esi, eax
mov eax, dword [0x40a8c0]
test eax, eax
je 0x4027fa
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], 0x407699
mov dword [esp], eax
mov dword [esp + 8], edx
call sub.msvcrt.dll_freopen
test eax, eax
je 0x4030f1
mov eax, dword [0x40a894]
test eax, eax
je 0x402c06
mov dword [esp], 0x40a8a0
call sub.msvcrt.dll__mktemp
mov edx, dword [0x40a8c0]
mov eax, 0x407064
mov dword [esp + 0x1c], 0x40a8a0
mov dword [esp + 0xc], esi
mov dword [esp + 4], str._s__s__s__s__s____s
test edx, edx
cmovne eax, edx
mov dword [esp + 0x18], eax
mov eax, dword [0x40a884]
mov dword [esp + 0x14], eax
mov eax, dword [0x40a05c]
mov dword [esp + 0x10], eax
mov eax, dword [0x40a894]
mov dword [esp + 8], eax
lea eax, [esp + 0xc8]
mov dword [esp], eax
call fcn.004043a0
cmp eax, 0xffffffff
je 0x40310f
mov eax, dword [esp + 0xc8]
mov dword [esp], eax
call sub.msvcrt.dll_system
test eax, eax
mov eax, dword [esp + 0xc8]
js 0x4030d8
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp + 4], 0x407699
mov dword [esp], 0x40a8a0
call sub.msvcrt.dll_fopen
test eax, eax
mov ebp, eax
je 0x4030bb
mov dword [esp], ebp
mov dword [0x40a054], 0
lea edi, [esp + 0x12f]
mov dword [esp + 0x3c], ebx
call sub.msvcrt.dll_feof
test eax, eax
jne 0x402b33
lea esi, [esi]
mov dword [esp + 0xc], ebp
mov dword [esp + 8], 0x200
mov dword [esp + 4], 1
mov dword [esp], edi
call sub.msvcrt.dll_fread
test eax, eax
mov esi, eax
jle 0x402b33
mov byte [esp + esi + 0x12f], 0
mov ebx, edi
mov dword [esp], ebx
mov dword [esp + 4], 0xd
call sub.msvcrt.dll_strchr
test eax, eax
mov ebx, eax
je 0x402b15
cmp byte [ebx - 1], 0x5c
jne 0x402900
cmp byte [ebx + 1], 0xa
jne 0x402900
lea eax, [ebx + 2]
sub esi, 3
mov dword [esp + 4], eax
lea eax, [ebx - 1]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
jmp 0x402900
mov eax, dword [0x40a88c]
add esi, 2
test eax, eax
je 0x402a14
mov eax, dword [0x40600c]
test eax, eax
jne 0x402a00
mov edx, 0x40767c
mov eax, 0x40a884
call fcn.00401870
mov eax, esi
call fcn.00401f40
jmp 0x4026a3
mov edx, str.__undef
mov eax, 0x40a884
call fcn.00401870
jmp 0x4026a3
cmp ecx, 5
ja 0x402a30
mov eax, dword [ebx + 0xc]
mov dword [esp + 8], str.CLASS__s__d
add esi, 1
mov dword [esp + 4], 0x32
mov dword [esp], ebp
add ebx, 0x28
mov dword [esp + 0x10], eax
mov eax, dword [ecx*4 + 0x4079bc]
mov dword [esp + 0xc], eax
call fcn.00401a00
mov edx, dword [ebx - 0x24]
mov eax, ebp
call fcn.004020b0
cmp esi, dword [esp + 0x64]
jl 0x402630
jmp 0x402665
lea eax, [esi + 2]
xor edx, edx
call fcn.00401fd0
jmp 0x4026a3
mov edx, 0x407680
mov eax, 0x40a884
call fcn.00401870
jmp 0x40296c
mov edx, 0x407684
mov eax, 0x40a884
call fcn.00401870
jmp 0x40296c
mov eax, dword [ebx + 4]
mov dword [esp + 0xc], ecx
add esi, 1
mov dword [esp + 4], str._s:_unknown_visual_type__d_for_visual_id_0x_lx_n
add ebx, 0x28
mov dword [esp + 0x10], eax
mov eax, dword [0x40a904]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
cmp esi, dword [esp + 0x64]
jl 0x402630
jmp 0x402665
mov edx, dword [ebx + 4]
mov dword [esp + 0xc], eax
mov eax, dword [0x40a904]
mov dword [esp + 4], str._s:_unknown_visual_type__d_for_default_visual_id_0x_lx_n
mov dword [esp + 0x10], edx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [ebx + 8]
sub eax, 2
cmp eax, 3
ja 0x402618
xor edx, edx
mov eax, str.COLOR
call fcn.00401fd0
jmp 0x402618
mov eax, dword [0x40a058]
mov dword [esp], eax
call sub.libX11_6.dll_XResourceManagerString
mov ebx, eax
mov eax, dword [0x40a058]
mov dword [esp + 0x38], 0x17
mov eax, dword [eax + 0x8c]
mov eax, dword [eax + 8]
mov dword [esp + 0x30], eax
mov eax, dword [0x40600c]
test eax, eax
jne 0x40274e
mov eax, dword [0x40a884]
mov dword [esp], eax
call sub.msvcrt.dll_puts
mov edi, dword [esp + 0x34]
test edi, edi
jne 0x402bc5
test ebx, ebx
setne byte [esp + 0x2c]
jmp 0x402b83
mov ecx, esi
mov edx, edi
mov eax, 0x40a04c
call fcn.004019a0
mov dword [esp], ebp
call sub.msvcrt.dll_feof
test eax, eax
je 0x4028d0
mov eax, 0x40a04c
mov ecx, 1
mov edx, 0x407064
mov ebx, dword [esp + 0x3c]
call fcn.004019a0
mov eax, dword [0x40a894]
test eax, eax
je 0x402b5c
mov dword [esp], ebp
call sub.msvcrt.dll_fclose
mov eax, 0x40a040
mov dword [esp], 0
mov ecx, 0x40a054
mov edx, 0x40a04c
call fcn.00401bc0
mov eax, dword [esp + 0x34]
test eax, eax
jne 0x402c20
mov esi, dword [esp + 0x28]
test esi, esi
je 0x402b9a
cmp byte [esp + 0x2c], 0
je 0x402b9a
mov dword [esp], ebx
call sub.libX11_6.dll_XFree
add esp, 0x33c
pop ebx
pop esi
pop edi
pop ebp
ret
test ebx, ebx
je 0x402c11
mov dword [esp + 4], ebx
mov dword [esp], 0x407696
call sub.msvcrt.dll_printf
mov edi, dword [esp + 0x34]
test edi, edi
je 0x402b0c
test ebx, ebx
setne byte [esp + 0x2c]
call fcn.004022c0
jmp 0x402b83
test ebx, ebx
je 0x402c11
mov eax, dword [esp + 0x38]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
mov eax, dword [0x40a058]
mov dword [esp], eax
call sub.libX11_6.dll_XDeleteProperty
jmp 0x402b00
mov eax, dword [0x40a8c0]
test eax, eax
jne 0x403154
mov ebp, dword [sym.imp.msvcrt.dll__iob]
jmp 0x4028a5
mov eax, dword [esp + 0x34]
test eax, eax
je 0x402b9a
mov byte [esp + 0x2c], 0
jmp 0x402bcc
call fcn.004021c0
mov eax, dword [0x40a890]
test eax, eax
je 0x402ed4
mov edx, dword [0x40a054]
test edx, edx
jle 0x402bcc
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], edx
mov dword [esp + 4], 1
add eax, 0x20
mov dword [esp + 0xc], eax
mov eax, dword [0x40a04c]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x40a054]
mov edx, dword [0x40a04c]
cmp byte [edx + eax - 1], 0xa
je 0x402bcc
mov dword [esp], 0xa
call sub.msvcrt.dll_putchar
jmp 0x402bcc
mov eax, dword [0x40a898]
mov dword [esp + 4], 0x407699
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov ebp, eax
mov eax, dword [0x40a898]
mov dword [esp + 8], str._sXXXXXX
mov dword [esp + 4], 0x64
mov dword [esp + 0xc], eax
lea eax, [esp + 0x64]
mov dword [esp], eax
call fcn.00401a00
lea eax, [esp + 0x64]
mov dword [esp], eax
call fcn.00404280
mov dword [esp + 4], 0x4076a4
mov dword [esp], eax
call sub.msvcrt.dll__fdopen
test eax, eax
mov dword [esp + 0x2c], eax
je 0x403137
test ebx, ebx
je 0x402cf9
cmp byte [ebx], 0
jne 0x402fe4
mov dword [esp], 0x2710
mov dword [esp + 0x50], 0x2710
mov dword [esp + 0x54], 0
call sub.msvcrt.dll_malloc
test ebp, ebp
mov dword [esp + 0x4c], eax
je 0x403124
lea esi, [esp + 0x12f]
mov dword [esp + 0x54], 0
mov dword [esp + 8], ebp
mov dword [esp + 4], 0x200
mov dword [esp], esi
mov byte [esp + 0x12f], 0
call sub.msvcrt.dll_fgets
test eax, eax
je 0x402e86
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov ecx, eax
lea eax, [esp + 0x4c]
mov edx, esi
call fcn.004019a0
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x4c]
lea eax, [eax + edx - 1]
cmp byte [eax], 0xa
jne 0x402d30
cmp edx, 1
je 0x402d85
cmp byte [eax - 1], 0x5c
je 0x402d30
lea eax, [esp + 0xc8]
lea ecx, [esp + 0x54]
lea edx, [esp + 0x4c]
mov dword [esp], 1
mov dword [esp + 0xd4], 0
mov dword [esp + 0x58], eax
lea eax, [esp + 0x58]
mov dword [esp + 0xc8], 0
mov dword [esp + 0xcc], 0
mov dword [esp + 0x60], 0
mov dword [esp + 0x5c], 1
call fcn.00401bc0
mov eax, dword [esp + 0x60]
test eax, eax
jle 0x40302e
mov ecx, dword [0x40a048]
test ecx, ecx
jle 0x40302e
mov eax, dword [esp + 0xc8]
mov edi, dword [0x40a040]
xor edx, edx
mov dword [esp + 0x30], eax
mov eax, dword [edi + 0xc]
test eax, eax
je 0x403020
mov eax, dword [esp + 0x30]
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x38], edx
mov dword [esp + 4], eax
mov eax, dword [edi]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
jne 0x403020
mov dword [edi + 0xc], 0
mov eax, dword [esp + 0xcc]
mov dword [esp + 4], eax
mov eax, dword [edi + 4]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x40302e
mov eax, dword [edi + 4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._s:_t_s_n
mov dword [esp + 8], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x402d28
mov ecx, dword [0x40a048]
test ecx, ecx
jle 0x402f04
xor esi, esi
jmp 0x402e9f
add esi, 1
cmp esi, dword [0x40a048]
jge 0x402f00
mov eax, esi
shl eax, 4
add eax, dword [0x40a040]
mov edx, dword [eax + 0xc]
test edx, edx
je 0x402e94
mov edx, dword [eax + 4]
mov dword [esp + 0xc], edx
mov eax, dword [eax]
mov dword [esp + 4], str._s:_t_s_n
mov dword [esp + 8], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x402e94
cmp dword [0x40a054], 1
jg 0x402ee9
mov ebp, dword [esp + 0x28]
test ebp, ebp
jne 0x402ffc
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x30]
mov eax, dword [0x40a058]
call fcn.00401a30
jmp 0x402bcc
test ebp, ebp
je 0x402f0c
mov dword [esp], ebp
call sub.msvcrt.dll_fclose
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov eax, dword [str..bak]
mov dword [esp + 8], str._s_s
mov dword [esp + 4], 0x64
mov dword [esp + 0x10], eax
mov eax, dword [0x40a898]
mov dword [esp + 0xc], eax
lea eax, [esp + 0xc8]
mov dword [esp], eax
call fcn.00401a00
mov eax, dword [0x40a890]
test eax, eax
je 0x403060
lea eax, [esp + 0x64]
mov dword [esp + 4], 0x407699
lea esi, [esp + 0x12f]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov edi, eax
jne 0x402fa1
jmp 0x402fc9
mov ecx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], esi
lea edx, [ecx + 0x20]
mov dword [esp + 0xc], edx
call sub.msvcrt.dll_fwrite
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0x200
mov dword [esp + 4], 1
mov dword [esp], esi
call sub.msvcrt.dll_fread
test eax, eax
jg 0x402f80
mov dword [esp], edi
call sub.msvcrt.dll_fclose
lea eax, [esp + 0x64]
mov dword [esp], eax
call sub.msvcrt.dll__unlink
jmp 0x402b00
mov esi, 0x407064
jmp 0x4027c2
mov eax, ebx
call fcn.00401f10
jmp 0x402cf9
mov eax, ebx
call fcn.00401f10
jmp 0x40278a
mov eax, dword [esp + 0x38]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
mov eax, dword [0x40a058]
mov dword [esp], eax
call sub.libX11_6.dll_XDeleteProperty
jmp 0x402bcc
add edx, 1
add edi, 0x10
cmp edx, ecx
jne 0x402e06
mov eax, dword [esp + 0x2c]
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
jmp 0x402d28
lea eax, [esp + 0xc8]
mov dword [esp + 4], eax
mov eax, dword [0x40a898]
mov dword [esp], eax
call sub.msvcrt.dll_rename
mov eax, dword [0x40a898]
mov dword [esp + 4], eax
lea eax, [esp + 0x64]
mov dword [esp], eax
call sub.msvcrt.dll_rename
test eax, eax
je 0x402b00
mov eax, dword [0x40a898]
mov dword [esp], str._s:_cant_rename_file__s_to__s_n
mov dword [esp + 0xc], eax
lea eax, [esp + 0x64]
mov dword [esp + 8], eax
mov eax, dword [0x40a904]
mov dword [esp + 4], eax
call fcn.00401820
mov eax, dword [0x40a904]
mov dword [esp + 8], 0x40a8a0
mov dword [esp], str._s:_cant_open_file__s_n
mov dword [esp + 4], eax
call fcn.00401820
mov dword [esp + 8], eax
mov eax, dword [0x40a904]
mov dword [esp], str._s:_cannot_run__s_n
mov dword [esp + 4], eax
call fcn.00401820
mov eax, dword [0x40a8c0]
mov dword [esp], str._s:_cant_open_file__s_n
mov dword [esp + 8], eax
mov eax, dword [0x40a904]
mov dword [esp + 4], eax
call fcn.00401820
mov eax, dword [0x40a904]
mov dword [esp], str._s:_Out_of_memory_n
mov dword [esp + 4], eax
call fcn.00401820
mov edx, dword [0x40a048]
test edx, edx
jle 0x402f0c
jmp 0x402e90
lea eax, [esp + 0x64]
mov dword [esp], str._s:_cant_open_temporary_file__s_n
mov dword [esp + 8], eax
mov eax, dword [0x40a904]
mov dword [esp + 4], eax
call fcn.00401820
mov esi, 0x407064
jmp 0x4027cb