I should mention that without loadvm option everything work but when I add it got fatal error..
# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE, STDOUT
# pass initial command as list of individual args
p = Popen([r"/home/bitblaze/temu-1.0/tracecap/temu","-monitor","stdio","-m","1024", "-loadvm", "vmsnapshot", "/home/hossein/windowsxp.qcow"],stdout=PIPE, stdin=PIPE)
#p = Popen(["qemu-system-i386","-monitor","stdio","-m","512","-netdev","user,id=mynet", "-device", "rtl8139,netdev=mynet" ,"-loadvm", "decafvm", "/home/hossein/windowsxp.qcow"],stdout=PIPE, stdin=PIPE)
# store all the next arguments to pass
args = iter(["enable_emulation","tracebyname foo.exe /home/hossein/traceexample/foopython.trace","stop_emulation"])
# iterate over stdout so we can check where we are
for line in iter(p.stdout.readline,""):
# if (qemu) is at the prompt, enter a command
if line.startswith("(qemu)"):
arg = next(args,"")
# if we have used all args break
if not arg:
break
# else we write the arg with a newline
p.stdin.write(arg+"\n")
print(line)# just use to see the output
And this is the exception that I got:
qemu: warning: error while loading state for instance 0x0 of device 'ram'
qemu: warning: instance 0x0 of device 'funmap' not present in current VM
qemu: warning: instance 0x0 of device 'hookapi' not present in current VM
qemu: warning: instance 0x0 of device 'procmod' not present in current VM
qemu: warning: instance 0x0 of device 'taintcheck' not present in current VM
qemu: fatal: triple fault
EAX=00000000 EBX=015af758 ECX=015af99c EDX=015af78a
ESI=015af758 EDI=015af99c EBP=015af720 ESP=015af500
EIP=77f679fe EFL=00000202 [-------] CPL=3 II=0 A20=1 SMM=0 HLT=0
ES =0023 00000000 ffffffff 00cff300
CS =001b 00000000 ffffffff 00c0fb00
SS =0023 00000000 ffffffff 00c0f300
DS =0023 00000000 ffffffff 00cff300
FS =003b 7ffaf000 00000fff 7f40f3fa
GS =0000 00000000 00000000 00000000
LDT=0000 00000000 00000000 00008000
TR =0028 80042000 000020ab 00008900
GDT= 8003f000 000003ff
IDT= 8003f400 000007ff
CR0=e001003b CR2=8003f440 CR3=0b7f9000 CR4=00000698
CCS=00000000 CCD=00001ec0 CCO=EFLAGS
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=8a885d0400000000 0048
FPR2=0000000277de612a 6148 FPR3=0000000000000000 6134
FPR4=0000000000000000 0000 FPR5=0000000800000000 0000
FPR6=a219166666666787 401d FPR7=a880000000000000 400a
XMM00=7db51942000002000007fa740007fa74 XMM01=00000002000000010007fa3800000000
XMM02=000000000007fb04000000000007fa2c XMM03=000000000007fac8000efc687c809668
XMM04=0007fad000000000000efc6800001001 XMM05=0007fb9c000ee4380235000000000000
XMM06=7c91009800000000000901787c910021 XMM07=000f27707c9100210000000000360178
It seems I got fatal error but I do not know why? Could you please help me what is the problem?