Found something that bears some resemblance with my half-trusted execution environment, so i'll list it here maybe others will find it useful: http://www.google.com/search?q=%22Exploiting+Code+Mobility+for+Dynamic+Binary+Obfuscation%22+pdf