Generation of Secure Runtime Environments for Untrusted Applications Through Machine Code Analysis