From 32f7d742b3fb09877b4ffbcec374942b165cc02f Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 26 Oct 2009 17:44:43 +0000 Subject: [PATCH] Fixes #328. Crafty little bug -- if asm was "" vs nil, the stage would try to compile as metasm instead of using the raw payload. git-svn-id: file:///home/svn/framework3/trunk@7278 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/payload.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/payload.rb b/lib/msf/core/payload.rb index d57d97c238..c86bcbbd58 100644 --- a/lib/msf/core/payload.rb +++ b/lib/msf/core/payload.rb @@ -487,10 +487,12 @@ protected # is used to localize the way the generated payload is cached (whether the # blob is part of a single, stager, or stage, for example). # - def build(p, asm, off, suffix = '') + def build(x, asm, off, suffix = '') # If there is no assembly to be compiled, then we return a duplicated # copy of the raw payload blob - return p.dup if asm.nil? + if(asm.nil? or asm.empty?) + return x.dup + end cache_key = refname + suffix cache_entry = framework.payloads.check_blob_cache(cache_key)