below is the Iron Python script for vc.
#-------------------------------------------------------------------------------
# Name: VC MPC Payload Xml Generator
# Purpose: I need it
#
# Author: xtermin8r
#
# Created: 18/05/2014
# Copyright: (c) xtermin8r 2014
# Licence: 111000111010
#-------------------------------------------------------------------------------
import urllib, urllib2
import re
import os
from re import findall
from xml.etree import ElementTree as ET
#function get rid of unwanted characters
def cfix(zx):
global x
f2 = re.sub( '\s+', ' ', zx).strip()
f2 = f2.replace(" -", "")
f2 = f2.replace("-", "")
f2 = f2.replace(":", ".")
f2 = re.sub( '\s+', ' ', f2).strip()
x = f2
# print(x)
return x
# http request
url = "http://localhost:13579/browser.html?path=E:\Videos\Music%20Vids"
response = urllib.urlopen(url)
html = response.read()
htmlStr = str(html)
# close it
response.close()
#print(htmlStr)
#<a href="/browser.html?path=E:\Videos\Music%20Vids\Snap%20-%20The%20Power%20(HQ).mp4">Snap - The Power (HQ).mp4</a></td>
adata = findall('path=(.*?)">(.*?)\<', htmlStr)
#print(adata)
#Create Music Videos Phrases txt File
tf = open("music_videos.txt", "wb")
for value,phrase in adata:
print(phrase)
tf.write((str(phrase) + "\n"))
tf.close()
#create the root </PayloadsRoot> <PayloadsRoot>
root_element = ET.Element("PayloadsRoot")
for value,phrase in adata:
#print(k,v)
#create the first subelemet <payload> </payload>
pay_element = ET.SubElement(root_element, "payload")
#create the first child <value> </value>
child = ET.SubElement(pay_element, "value")
child.text = value
#create the second child <phrase> </phrase>
child = ET.Element("phrase")
#get the filename without the extension
fileName = (os.path.splitext(phrase)[0])
#get rid of unwanted characters
cfix(fileName)
fileName = x
child.text = fileName
#now append
pay_element.append(child)
#Let's see the results
a = ET.tostring(root_element)
#print a
def indent(elem, level=0):
i = "\n" + level*'\t'
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + '\t'
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
indent(elem, level+1)
if not elem.tail or not elem.tail.strip():
elem.tail = i
else:
if level and (not elem.tail or not elem.tail.strip()):
elem.tail = i
indent(root_element)
#print ( ET.tostring(root_element) )
output_file = open( 'E:\Appz\Vox\VC_187_Eden\payloads\musicvideos.xml', 'w' )
output_file.write( '<?xml version="1.0" encoding="utf-8"?>'+'\n' )
output_file.write( '<!--A VoxCommando Payload file-->' +'\n' )
output_file.write( ET.tostring(root_element) )
output_file.close()
Enjoy.
I'll be uploading a video soon, stay tuned.