Commits

ZoomQuiet committed 9a005cf

Comments (0)

Files changed (53)

Sprint1DemoV1.0/Readme.txt

+sample.txt ������������
+config.txt �ֶ�������,ð��:���Ϊ���������������ܳ��ֵĹؼ���,�ұ�Ϊ���ݿ��           �е��ֶ���,�ֶ��������Ⱥ�˳��
+hello.py δ����ģ��, ��sample.txt�е���Ϣ���뵽virus����
+         ʵ��(1)��sample.txt�з����ֶ�����ֵ�������ֵ�,�õ���������	                HasKey(s,dk),Token(s,dk)
+	     (2)ƴ��sql��
+             (3)�������ݿⲢ��ѯ
+
+
+		 
+
+

Sprint1DemoV1.0/config.txt

+����Ӣ������:field_enname_value
+��������:
+�����:field_level_value
+�ؼ���:
+Ӱ��ϵͳ:
+��������:field_category_value
+��Ⱦ;��:
+�������:
+������:field_remark_value
+

Sprint1DemoV1.0/hello.py

+#�жϴ�s���Ƿ����ֵ�dk�е�key��ͷ
+def HasKey(s, dk):
+    for kk in dk:
+        if s.startswith(kk):
+            return True
+    return False
+
+#������s�е��ֶ�����ֵ�������ֵ�dk��
+def Token(s,dk):
+    a=s.split(':',1)
+    if a[0] in dk:
+        dk[a[0]]=a[1].strip()
+
+#������ϢӦ���ļ���ȡ
+conf={'����Ӣ������':'field_enname_value','��������':'','��в����':'field_level_value',\
+      '�ؼ���':'','Ӱ��ϵͳ':'',\
+      '��������':'field_category_value','��Ⱦ;��':'','�������':'',\
+      '������':'field_remark_value'}
+
+#for k,v in conf.items():
+#    print k,v
+k=conf.keys()
+#kkk=['����Ӣ������','��������','��в����','�ؼ���','Ӱ��ϵͳ',\
+#  '��������','��Ⱦ;��','�������','��Ϊ����']
+d={}#����
+for ki in k:
+    d[ki]=''
+print len(k)
+f = open("sample.txt","r")     #�ļ�����
+lines = f.readlines()
+sum = len(lines)
+temp=''
+for i in range(sum):
+    temp+=lines[i]
+    if i+1<sum and HasKey(lines[i+1],d):
+        Token(temp,d)
+        temp=''
+print temp
+temp+=lines[sum-1]
+Token(temp,d)
+
+f.close()
+
+#�����¼SQL��
+#insert into virus1 (field_enname_value ,field_level_value,\
+#field_category_value,field_remark_value)values('name','***','class','test');
+
+#ƴ��SQL��
+sk="("#field_enname_value
+sv="("#name
+for i in k :
+    if conf[i]!="":
+        sk+=conf[i]
+        sk+=" ,"
+        
+        sv+="'"
+        sv+=d[i]
+        sv+="'"
+        sv+=","
+sk=sk[0:len(sk)-1]
+sv=sv[0:len(sv)-1]
+sk+=")"
+sv+=")"
+print '*************'
+print sk
+print sv
+#insert into virus1 (field_enname_value ,field_level_value,\
+#field_category_value,field_remark_value)values('name','***','class','test');
+strsql="insert into virus1 "
+strsql+=sk
+strsql+="values"
+strsql+=sv
+
+print "---------------------SQL��---------------------"
+print strsql
+print "---------------------SQL��---------------------"
+
+#�������ݿ�
+import MySQLdb
+try:
+   conn = MySQLdb.connect(user="ivirus",passwd="ivirus",host="kcpy.kc.kingsoft.net",db="ivirus")
+except:
+   print "Could not connect to MySQL server."
+cursor = conn.cursor()
+#�����¼
+cursor.execute(strsql)
+#��ѯ��
+strsql = "select * from virus1"
+cursor.execute(strsql)
+
+for row in cursor.fetchall():
+    print "\n----------------------record:", row[0],"--------------------------"
+    print row[4],'\t|',row[1],'\t|',row[2] 
+    print row[3],
+    print "\n______________________record:", row[0],"_____________________________"
+   

Sprint1DemoV1.0/sample.txt

+����Ӣ������: Win32.Troj.Dluca.cb.39424
+��������: 39424
+�����: ��
+�ؼ���: delwbi.tmp,ľ��,vmx38Fg45
+Ӱ��ϵͳ:win9x/winMe/winNT/win2000/winXP/win2003
+��������: ľ�����
+��Ⱦ;��: 
+
+�������:
+
+����һ��ľ����򡣻��ڴ������ͷų��ļ������޸�ע��
+
+������:
+
+�ڴ������ͷų������ļ�:
+windows
+
+�ڴ�����ɾ���������ļ�:
+C:\WINDOWS\TEMP\delwbi.tmp
+
+��ע����д�����������Ϣ:
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F7EE4E3689C2DCF4A531C20954D158C1936D9A3C"
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\1567DAAB1377FE3552D2F6F2A2FA80200135EDA5"
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F705E9D8DAA72DF53D068BF60B551EA3103D51D7"
+"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\sncntr"
+"HKCU\Software\sncntr"
+
+��ע�����������������Ϣ:
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F7EE4E3689C2DCF4A531C20954D158C1936D9A3C"	"Blob"	""
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\1567DAAB1377FE3552D2F6F2A2FA80200135EDA5"	"Blob"	""
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F705E9D8DAA72DF53D068BF60B551EA3103D51D7"	"Blob"	""
+
+�������ע����ж�ȡ��Ϣ:
+"HKCU\Software\Microsoft\VisualStudio\6.0\Debugger"
+"HKCU\Software\Microsoft\VisualStudio\7.0\Debugger"
+"HKCU\Software\Microsoft\Win32SDK"
+"HKCU\Software\Microsoft\Sourcesafe"
+"HKCU\Software\Microsoft\PlatformSDK"
+"HKLM\Software\_GMC_ODLUP"
+"HKLM\Software\Microsoft\VisualStudio\6.0\Debugger"
+"HKLM\Software\Microsoft\VisualStudio\7.0\Debugger"
+"HKLM\Software\Microsoft\Win32SDK"
+"HKLM\Software\Microsoft\Sourcesafe"
+"HKLM\Software\Microsoft\PlatformSDK"
+
+��ϵͳ�д��������½���:
+�����ᴴ����һ�������� vmx38Fg45 ����ֹ�ظ�����
+
+������ͨ������;������:
+������������������
+

kcver1.1/VirusInfo.py

+# -*- coding: cp936 -*-
+from env import *
+import sql
+import os.path
+import re
+def reTest(s):
+    print '-'*60
+    url = re.compile(r'http://\w*')
+    print url.match(s)
+    print '-'*60
+    
+def GetInfo(path):
+    k=g_dtxt.keys()
+    d={}#����
+    for ki in k:
+        d[ki]=''
+    #print len(k)
+#    path = raw_input('file name:')
+
+    bfile = os.path.isfile(path)
+    if not bfile:
+        print 'not file or not exist'
+        return False,d
+    bfile = os.path.splitext(path)
+    if bfile[1] != '.txt':
+        print 'not text file'
+        return False,d
+    f = open(path,"r")     #�ļ�����
+    lines = f.readlines()
+    sum = len(lines)
+    if sum < 1:
+        return False ,d
+    if not lines[0].startswith('����Ӣ������'):
+        print lines[0]
+        print 'not starts with'
+        return False ,d
+    temp=''
+    for i in range(sum):
+        temp+=lines[i]
+        if i+1<sum and HasKey(lines[i+1],d):
+            Token(temp,d)
+            temp=''
+    #print temp
+    temp+=lines[sum-1]
+    Token(temp,d)
+    f.close()
+    return (True,d)
+if __name__ == '__main__':
+    ReadCfg('cfg.txt')
+    #path = raw_input('file name:')
+    path = 'sample.txt'
+    (b,d1)=GetInfo(path)
+    if b:   
+        print '___________'
+        for ki in g_dtxt.keys():
+            print (ki+':'+d1[ki]+'\n')
+            #reTest(d1[ki])
+        print '*'*50
+
+        sret = sql.AddNodeSql(6000,6000,25,0,d1,'')
+        print sret
+    else:
+        print 'error'
+    
+
+
+

kcver1.1/VirusInfo.pyc

Binary file added.
+[dbcon]
+db=ivirus
+host=121.14.11.187
+port=3306
+user=kduba
+passwd=KDUBA5053
+charset=utf8
+[txt_field]
+����Ӣ������=
+��������=
+�����=
+�ؼ���=
+Ӱ��ϵͳ=
+��������=
+��Ⱦ;��=
+�������=
+������=
+��������=
+������������=
+�ڲ���Ϣ=
+[db_field]
+var_title=����Ӣ������
+var_field_alias_value=��������
+var_field_length_value=��������
+var_field_category_value=��������
+var_field_brief_value=�������
+var_field_level_value=�����
+var_field_platform_value=Ӱ��ϵͳ
+var_field_cnname_value=������������
+var_body=������
+var_teaser=�������
+var_term=�ؼ���
+var_field_remark_value=�ڲ���Ϣ
+#-*- coding: utf-8 -*-
+#coding = utf-8
+dfield={}#字段字典
+dsql={}#sql
+ddb={}#dbconf
+f = open ('config.txt')
+i =0
+for line in f.readlines():
+    line=line.strip()
+    i+=1
+#   l =len(line)
+    if ':' in line :
+        s=line.split(':')
+        dsql[s[0]]=s[1]
+    elif '=' in line:
+        s=line.split('=')
+        ddb[s[0]]=s[1]
+#   print i,line.strip(),(s[1]=='')
+#    dfield[s[0]]=''
+    
+
+if 1:
+    for k,v in dsql.items():
+        print k,v
+    print '------'
+    for k,v in ddb.items():
+        print k,v
+f.close()
+f=open('env.py')
+lines = f.readlines()
+for i in range(len(lines)):
+    if lines[i].startswith('conf ='):
+        print lines[i]
+        lines[i] ='conf ='+`dsql`+'\n'
+        sss=''+repr(dsql)
+        print sss
+        print lines[i]
+    elif lines[i].startswith('dbcon ='):
+        lines[i] ='dbcon ='+`ddb`+'\n'
+for line in lines:
+    print line
+f.close()
+f1 = open ('env.py','w')
+for i in range (len(lines)):
+    f1.write (lines[i])
+f1.close()
+
+# -*- coding: cp936 -*-
+import string, sys, pickle, cmd,post2db,env,getpass
+import os.path,os
+import wx
+from wx import xrc
+#import login
+#import dlg
+ACCT = u'�ʺ�'
+PWD = u'����password'
+LOGIN =u'��¼'
+LOGOUT = u'ע��'
+import threading
+import random
+class MyApp(wx.App):
+
+    def OnInit(self):
+        self.res = xrc.XmlResource('demo.xrc')
+        assert self.res
+        self.init_dialog()
+        self.lifile=[]
+        self.workth=None
+        return True
+    
+    def init_dialog(self):
+        self.dlg = self.res.LoadFrame(None, 'ID_DLG')
+        assert self.dlg
+        self.panel = xrc.XRCCTRL(self.dlg, 'ID_PANEL')
+
+        #login
+        self.acct = xrc.XRCCTRL(self.panel, 'ID_ACCT')
+        self.pwd = xrc.XRCCTRL(self.panel, 'ID_PWD')
+        self.pwd.SetValue(PWD)
+        self.login =xrc.XRCCTRL(self.panel, 'ID_LOGIN')
+        
+        self.btn_dir = xrc.XRCCTRL(self.panel, 'ID_DIR')
+        self.btn_file = xrc.XRCCTRL(self.panel, 'ID_FILE')
+        self.btn_submit = xrc.XRCCTRL(self.panel, 'ID_SUBMIT')
+        
+        #output
+        self.succ = xrc.XRCCTRL(self.panel, 'ID_SUCC')
+        self.process = xrc.XRCCTRL(self.panel, 'ID_PROCESS')
+        self.process.SetLabel('hello,world')
+        self.fail =xrc.XRCCTRL(self.panel, 'ID_FAIL')
+
+        #ID_PROCTXT
+        self.labproc = xrc.XRCCTRL(self.panel,'ID_PROCTXT')
+        #event band
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnLogin, id=xrc.XRCID('ID_LOGIN'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnFile, id=xrc.XRCID('ID_FILE'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnDir, id = xrc.XRCID('ID_DIR'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnSubmit, id = xrc.XRCID('ID_SUBMIT'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnEmpty, id = xrc.XRCID('ID_EMPTY'))
+        
+        #show dialog
+        self.panel.Bind(wx.EVT_LEFT_DOWN,self.OnClickPanel,id=xrc.XRCID('ID_PANEL'))
+        self.acct.Bind(wx.EVT_LEFT_UP,self.OnClickAcct,id = xrc.XRCID('ID_ACCT'))
+        self.acct.Bind(wx.EVT_SET_FOCUS,self.OnSetAcct , id = xrc.XRCID('ID_ACCT'))
+        self.acct.Bind(wx.EVT_KILL_FOCUS,self.OnLostAcct , id = xrc.XRCID('ID_ACCT'))
+
+        self.pwd.Bind(wx.EVT_LEFT_UP,self.OnClickPwd,id = xrc.XRCID('ID_PWD'))
+        self.pwd.Bind(wx.EVT_SET_FOCUS,self.OnSetPwd , id = xrc.XRCID('ID_PWD'))
+        self.pwd.Bind(wx.EVT_KILL_FOCUS,self.OnLostPwd , id = xrc.XRCID('ID_PWD'))
+        
+        self.acct.SelectAll()
+        self.dlg.Show()
+
+    def OnEmpty(self,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+        self.lifile = []
+        self.succ.AppendText(u'�ļ��б������\n')
+        self.labproc.SetLabel('')
+        self.process.SetValue(0)
+        pass
+    def OnClickPanel(self,evt):
+        self.process.SetFocus()
+    def OnClickPwd(self, evt):
+        self.pwd.SelectAll()
+        evt.Skip()    
+    def OnClickAcct(self, evt):
+        self.acct.SelectAll()
+        evt.Skip()
+    def OnSetAcct(self, evt):
+        if self.acct.GetValue() == ACCT:
+            self.acct.SetValue('')
+        else:
+            self.acct.SelectAll()
+    def OnLostAcct(self ,evt):
+        if self.acct.GetValue()=='':
+            self.acct.SetValue(ACCT)
+    def OnSetPwd(self, evt):
+        if self.pwd.GetValue() == PWD:
+            self.pwd.SetValue('')
+    def OnLostPwd(self ,evt):
+         if self.pwd.GetValue()=='':
+            self.pwd.SetValue(PWD)
+    def OnLogin(self, evt):
+        if env.g_uid == -1:
+            user = self.acct.GetValue()
+            pwd = self.pwd.GetValue()
+            r = post2db.CheckUser(user,pwd)
+            if r>-1 :
+                self.prompt='['+user+']>'
+                env.g_uid=r
+                env.g_user=user
+                self.login.SetLabel(LOGOUT)
+                self.acct.SetEditable(0)
+                self.pwd.SetEditable(0)
+                self.succ.AppendText(u'%s �ɹ���¼\n'%(user))
+            else :
+                self.fail.AppendText(u'�û��������벻ƥ��,��¼ʧ��\n')
+        else:
+           self.fail.AppendText(u'%s ��ע��\n'%(env.g_user))
+           env.g_uid =-1
+           env.g_user = ''
+           self.login.SetLabel(LOGIN)
+           self.acct.SetEditable(1)
+           self.pwd.SetEditable(1)
+           self.acct.SetValue(ACCT)
+           self.pwd.SetValue(PWD)
+           
+    def OnDir(self ,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+            pass
+        if self.workth != None:
+            self.fail.AppendText('¼��������...')
+            return
+        self.process.SetValue(0)
+        dirdlg = wx.DirDialog(None,'Choose dir',
+                style = wx.DD_DEFAULT_STYLE)
+        r = dirdlg.ShowModal()
+        if r == wx.ID_OK:
+            strPath = dirdlg.GetPath()
+            strpath=strPath.encode('cp936')
+            li=os.listdir(strPath)
+            files=[os.path.join(strPath, l) for l in li]
+            self.lifile = list(set(self.lifile + files))
+            self.succ.AppendText(u'������� %d ���ļ�\n'%(len(self.lifile)))
+        else:
+            dirdlg.Destroy()
+            
+    def OnFile(self ,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+            pass
+        if self.workth != None:
+            self.fail.AppendText('¼��������...')
+            return
+        dlg = wx.FileDialog(None, message=u'����ļ���', defaultDir="",
+        defaultFile="", wildcard="*.*", style=wx.MULTIPLE,
+        pos=wx.DefaultPosition)
+        r = dlg.ShowModal()
+        if r == wx.ID_OK:
+            li = dlg.GetPaths()
+            self.lifile = list(set(self.lifile + li))
+            self.succ.AppendText(u'������� %d ���ļ�\n'%(len(self.lifile)))
+        else:
+            dlg.Destroy()
+        pass
+    def OnSubmit(self,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+            pass
+        #post2db.PostList(self.lifile,env.g_uid,self)
+        #self.lifile = []
+        if self.workth == None:
+            self.workth = WorkerThread(self,self.lifile,env.g_uid)
+            self.workth.start()
+            self.lifile=[]
+            pass
+        else:
+            self.fail.AppendText('¼��������...\n')
+    def PostAll(self,msg):
+        self.workth=None
+        pass
+    def showmsg(self,m1,m2):
+        self.succ.AppendText(m1)
+        self.fail.AppendText(m2)
+    def SetRange(self,var):
+        self.process.SetRange(var)
+        pass
+    def SetValue(self,var):
+        self.process.SetValue(var)
+    def SetLabel(self,var):
+        self.labproc.SetLabel(var)
+    def AppendText(self,bsucc,txt):
+        if bsucc:
+            self.succ.AppendText(txt)
+        else:
+            self.fail.AppendText(txt)
+    def SetText(self,bsucc,txt):
+        if bsucc:
+            self.succ.SetValue(txt)
+        else:
+            self.fail.SetValue(txt)
+
+class WorkerThread(threading.Thread):
+    def __init__(self,app,lifile,gid):
+        threading.Thread.__init__(self)
+        self.app = app
+        self.li=lifile
+        self.gid=gid
+        self.timeToQuit = threading.Event()
+        self.timeToQuit.clear()
+
+    def run(self):
+        post2db.PostList(self.li,self.gid,self.app,self.timeToQuit)
+        self.timeToQuit.set()
+        wx.CallAfter(self.app.PostAll,'all done')
+    
+if __name__ == '__main__':
+    env.ReadCfg('cfg.txt')
+    app = MyApp(0)
+    app.MainLoop()

kcver1.1/demo.xrc

+<?xml version="1.0" encoding="UTF-8"?>
+<resource class="wxFrame">
+  <object class="wxFrame" name="ID_DLG">
+    <object class="wxPanel" name="ID_PANEL">
+      <object class="wxFlexGridSizer">
+        <object class="sizeritem">
+          <object class="wxFlexGridSizer">
+            <object class="sizeritem">
+              <object class="wxTextCtrl" name="ID_SUCC">
+                <size>360,150</size>
+                <style>wxTE_AUTO_SCROLL|wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxTE_READONLY</style>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxGauge" name="ID_PROCESS">
+                <pos>0,160</pos>
+                <size>360,18</size>
+                <range>10000</range>
+                <value>0</value>
+                <bezel>0</bezel>
+                <fg>#00FF00</fg>
+                <bg>#C5FFC1</bg>
+                <style>wxSUNKEN_BORDER|wxGA_SMOOTH</style>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxStaticText" name="ID_PROCTXT">
+                <pos>0,160</pos>
+                <size>360,18</size>
+                <style>wxTRANSPARENT_WINDOW|wxNO_FULL_REPAINT_ON_RESIZE|wxALIGN_CENTRE|wxST_NO_AUTORESIZE</style>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxTextCtrl" name="ID_FAIL">
+                <size>360,150</size>
+                <style>wxTE_AUTO_SCROLL|wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxTE_READONLY</style>
+              </object>
+            </object>
+            <object class="spacer">
+              <size>10</size>
+            </object>
+            <object class="sizeritem">
+              <object class="wxStaticText">
+                <size>360,-1</size>
+                <label>Kingsoft  软件事业部技术支持中心与蟒营 联合出品</label>
+                <style>wxALIGN_CENTRE</style>
+              </object>
+            </object>
+            <cols>1</cols>
+            <vgap>10</vgap>
+          </object>
+          <flag>wxLEFT</flag>
+        </object>
+        <cols>3</cols>
+        <rows>1</rows>
+        <object class="spacer">
+          <size>30</size>
+        </object>
+        <object class="sizeritem">
+          <object class="wxFlexGridSizer">
+            <cols>1</cols>
+            <rows>3</rows>
+            <vgap>20</vgap>
+            <object class="spacer">
+              <size>3</size>
+            </object>
+            <object class="sizeritem">
+              <object class="wxBoxSizer">
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="ID_ACCT">
+                    <size>100,-1</size>
+                    <value>帐号</value>
+                    <style>wxSTATIC_BORDER|wxTE_NOHIDESEL|wxTE_CENTRE</style>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>20</size>
+                  <border>20</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="ID_PWD">
+                    <size>100,-1</size>
+                    <value>密码</value>
+                    <style>wxSTATIC_BORDER|wxTE_PASSWORD|wxTE_NOHIDESEL|wxTE_CENTRE</style>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>20</size>
+                  <border>20</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxButton" name="ID_LOGIN">
+                    <size>100,-1</size>
+                    <label>登录</label>
+                    <bg>#ffffff</bg>
+                    <style>wxSTATIC_BORDER</style>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>50</size>
+                  <border>20</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxButton" name="ID_EMPTY">
+                    <size>100,-1</size>
+                    <label>清空列表</label>
+                    <bg>#808080</bg>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>20</size>
+                  <border>20</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxButton" name="ID_DIR">
+                    <size>100,-1</size>
+                    <label>添加目录</label>
+                    <bg>#808080</bg>
+                    <style>wxSTATIC_BORDER</style>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>20</size>
+                  <border>20</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxButton" name="ID_FILE">
+                    <size>100,-1</size>
+                    <label>添加文件</label>
+                    <bg>#808080</bg>
+                    <style>wxSTATIC_BORDER</style>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>20</size>
+                  <border>20</border>
+                </object>
+                <object class="sizeritem">
+                  <object class="wxButton" name="ID_SUBMIT">
+                    <size>100,-1</size>
+                    <label>确定录入</label>
+                    <bg>#808080</bg>
+                    <style>wxSTATIC_BORDER</style>
+                  </object>
+                </object>
+                <object class="spacer">
+                  <size>10</size>
+                </object>
+                <orient>wxVERTICAL</orient>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxBoxSizer">
+                <object class="sizeritem">
+                  <object class="wxStaticText">
+                    <size>160,120</size>
+                    <label>金山毒霸 病毒大百科
+vi.duba.net
+分析报告批量自动录入工具
+需求设计:禹林
+制作:张山山
+版本号:V1.0</label>
+                    <style>wxALIGN_LEFT</style>
+                  </object>
+                </object>
+                <orient>wxHORIZONTAL</orient>
+              </object>
+            </object>
+            <hgap>20</hgap>
+          </object>
+        </object>
+        <vgap>5</vgap>
+        <hgap>5</hgap>
+      </object>
+      <bg>#C0C0C0</bg>
+      <focused>1</focused>
+    </object>
+    <pos>0,0</pos>
+    <size>600,500</size>
+    <title>病毒分析报告批量录入</title>
+  </object>
+</resource>
+# -*- coding: cp936 -*-
+
+import ConfigParser
+#ģ�鹦��:���ļ��н���������Ϣ,���浽�ֵ�
+#conf--
+#conf ={'\xb2\xa1\xb6\xbe\xc0\xe0\xd0\xcd': 'field_category_value', '\xb2\xa1\xb6\xbe\xd3\xa2\xce\xc4\xc3\xfb\xb3\xc6': 'field_enname_value', '\xd3\xb0\xcf\xec\xcf\xb5\xcd\xb3': '', '\xb2\xa1\xb6\xbe\xd6\xd0\xce\xc4\xc3\xfb\xb3\xc6': '', '\xcd\xfe\xd0\xb2\xbc\xb6\xb1\xf0': 'field_level_value', '\xb9\xd8\xbc\xfc\xb4\xca': '', '\xb2\xa1\xb6\xbe\xbc\xf2\xbd\xe9': '', '\xb8\xd0\xc8\xbe\xcd\xbe\xbe\xb6': '', '\xb2\xa1\xb6\xbe\xb1\xf0\xc3\xfb': '', '\xd0\xd0\xce\xaa\xb7\xd6\xce\xf6': 'field_remark_value', '\xb2\xa1\xb6\xbe\xb3\xa4\xb6\xc8': ''}
+#dbcon ={'passwd': '123456', 'host': 'localhost', 'db': 'test1', 'user': 'root'}
+#--conf
+#�жϴ�s���Ƿ����ֵ�dk�е�key��ͷ
+def HasKey(s, dk):
+    for kk in dk:
+        if s.startswith(kk):
+            return True
+    return False
+
+#������s�е��ֶ�����ֵ�������ֵ�dk��
+def Token(s,dk):
+    a=s.split(':',1)
+    if a[0] in dk:
+        dk[a[0]]=a[1].strip()
+g_ddb={}#���ݿ����Ӳ���
+g_dtxt={}#�ļ��ֶ���ȡ
+g_dsql={}#���ݿ���ֶ�
+g_uid=-1
+g_user=''
+#�������ļ�     
+def ReadCfg(path):
+    global g_ddb,g_dtxt,g_dsql
+    cfg = ConfigParser.ConfigParser()
+    cfg.read(path)
+    s=cfg.sections()
+    v=cfg.items('txt_field')
+    for vi in v:
+        g_dtxt[vi[0]]=vi[1]
+    v=cfg.items('db_field')
+    for vi in v:
+        g_dsql[vi[0]]=vi[1]
+    v=cfg.items('dbcon')
+    for vi in v:
+        g_ddb[vi[0]]=vi[1]
+    for k,v in g_ddb.items():
+        #print k,v
+        pass
+if __name__ == '__main__':
+    pass

kcver1.1/env.pyc

Binary file added.

kcver1.1/how to setup.txt

+py2exeʹ�÷��� 
+py2exe
+
+һ�����
+
+py2exe��һ����python�ű�ת����windows�ϵĿɶ���ִ�еĿ�ִ�г���(*.exe)�Ĺ��ߣ���������Ϳ��Բ���װpython����windowsϵͳ�����������ִ�г���
+
+py2exe�Ѿ������ڴ���wxPython,Tkinter,Pmw,PyGTK,pygame,win32com client��server,�������Ķ�������py2exe�Ƿ����ڿ�Դ���֤�µġ�
+
+������װpy2exe
+
+��http://prdownloads.sourceforge.net/py2exe���ز�������������װ��Python��Ӧ��py2exe�汾��installer���⽫��װpy2exe����Ӧ�����ӣ���Щ���ӱ���װ��lib\site-packages\py2exe\samplesĿ¼�¡�
+
+����py2exe���÷�
+
+�������һ����Ϊhelloworld.py��python�ű����������ת��Ϊ������windows�ϵĿ�ִ�г��򣬲�������û�а�װpython��windowsϵͳ�ϣ���ô������Ӧдһ�����ڷ�����������ýű�����mysetup.py�������е�setup����ǰ�������import py2exe ��
+mysetup.pyʾ������:
+# mysetup.py
+from distutils.core import setup
+import py2exe
+
+setup(console=["helloworld.py"])
+Ȼ������ķ�������mysetup.py:
+python mysetup.py py2exe
+���������ִ�к󽫲���һ����Ϊdist����Ŀ¼�����а�����helloworld.exe,python24.dll,library.zip��Щ�ļ���
+������helloworld.py�ű��������ѱ����C��չģ�飬��ô��Щģ��Ҳ�ᱻ�����ڸ���Ŀ¼�У�ͬ�������е�dll�ļ�������ʱ������Ҫ�ģ�����ϵͳ��dll�ļ���
+dist��Ŀ¼�е��ļ���������ij���������Ķ�������Ӧ�������Ŀ¼�е���������һ�𷢲���
+
+Ĭ������£�py2exe��Ŀ¼dist�´���������Щ������ļ���
+1��һ������exe�ļ���
+2��python##.dll�� 
+3������.pyd�ļ����������ѱ������չ����������exe�ļ�����Ҫ�ģ�����������.dll�ļ�����Щ.dll��.pyd����Ҫ�ġ�
+4��һ��library.zip�ļ������������ѱ���Ĵ���pythonģ����.pyc��.pyo
+�����mysetup.py������һ������̨��helloword.exe���������Ҫ����һ��ͼ���û���ij�����ô��ֻ��Ҫ��mysetup.py�е�console=["helloworld.py"]�滻Ϊwindows=["myscript.py"]�ȿɡ�
+
+py2exeһ���ܹ��������exe�ļ�������Ҫ����Щ�ű��ļ����б�ݸ�console��windows�Ĺؼ��ֲ�����������м���������Ľű�����ô���Ǻ����õġ�
+����������������ʾpy2exe��������������б�ǡ�
+python mysetup.py py2exe --help
+
+�ġ�ָ��������ļ�
+һЩӦ�ó���������ʱ��Ҫ������ļ������������ļ������塢λͼ��
+����ڰ�װ�ű�����data_files��ѡ��ָ������Щ������ļ�����ôpy2exe�ܽ���Щ�ļ�������dist��Ŀ¼�С�data_filesӦ����һ��Ԫ��(target-dir, files)�б���е�files����Щ������ļ����б
+ʾ�����£�
+# mysetup.py
+from distutils.core import setup
+import glob
+import py2exe
+
+setup(console=["helloworld.py"],
+      data_files=[("bitmaps",
+                   ["bm/large.gif", "bm/small.gif"]),
+                  ("fonts",
+                   glob.glob("fonts\\*.fnt"))],
+)
+˵����data_filesѡ�����һ����Ŀ¼dist\bitmaps�����а�������.gif�ļ���һ����Ŀ¼dist\fonts�����а��������е�.fnt�ļ���
+
+�塢Windows NT services
+
+�����ͨ������һ��service�ؼ��ֲ�����setup����������Windows NT services
+,���service������ֵ������һ��Pythonģ����(����һservice��)���б
+ʾ�����£�
+# mysetup.py
+from distutils.core import setup
+import py2exe
+
+setup(service=["MyService"])
+������Ŀ�ִ�е�service�ǿ���ͨ��������һ���������в�����������а�װ��ж�صġ������ͨ���������ִ�е�service(exe)���һ-help�������õ�����İ�����
+����COM servers
+
+�����ͨ������һ��com_server �ؼ��ֲ�����setup����������Windows NT services
+,���service������ֵ������һ��Pythonģ����(����һ������COM server ��)���б
+ʾ�����£�
+# mysetup.py
+from distutils.core import setup
+import py2exe

kcver1.1/how to use.txt

+			����������������¼�빤��ʹ��˵��
+1.�����ļ�
+	1.1 ���ļ�����Ҫ,�޸�ǰ,�����ñ���
+	1.2 [dbcon]��������ٿ����ݿ������Ϣ,�ɴ�ٿƵ���Ӫ�ṩ
+		db:���ݿ�����
+		host:���ݿ�URL,��192.168.9.51
+		port:���ݿ�˿�,��3306
+		user:���ݿ��ʺ�
+		passwd:���ݿ�����
+		charset:���ݿ��ַ�����,��ֵ�����޸�
+	1.3 [txt_field]�ζ�Ӧ�������������ļ��е�С����:�粡�����,������Ϊ����
+ 	1.4 [db_field]���������ݿ���е�ʵ���ֶ��벡�����������е�С�������ϵ,����			�����������ʽ�޶�����޸�=�ұߵ�ֵ,
+			����������и�ʽ�е�'�ؼ���'�����Ϊ��'�ؼ���',
+			��Ӧ�����޸�:var_term=�ؼ���,ע��ֻ�ܸ�=�ұߵ�ֵ,��������
+			
+2.���湦��
+	2.1 ��¼/ע�� ��Ҫʹ�ô�ٿƹ���Ա�ʺź������¼���ܲ���
+	2.2 ����ļ�/Ŀ¼ ѡ���¼��ķ�������
+	2.3 ����б� ѡ���ļ���������б�,�������
+	2.4 ¼������ ����¼�������в���������ļ�,¼������,��һ��ֻ�ܴ���һ���ļ�
+
+3.ʹ��ʱ����ȷ�ϴ˳����Ƿ񱻷���ǽ���ɽ��������

kcver1.1/mysetup.py

+# mysetup.py
+from distutils.core import setup
+import py2exe
+setup(windows=["demo.py"])
+

kcver1.1/post2db.py

+# -*- coding: cp936 -*-
+import wx
+import MySQLdb
+import sql
+import VirusInfo
+import md5
+from env import *
+import time
+import os.path
+import tword
+def test(myapp):
+    myapp.load.SetLabel('hahahha')
+    pass
+    
+
+def CheckUser(user,pwd):
+    #for k,v in g_ddb.items():
+    #    print k+':'+v
+    try:
+        #conn = MySQLdb.connect(user="ivirus",passwd="ivirus",host="192.168.1.51",db="ivirus",charset="utf8")
+        #conn = MySQLdb.connect(user="ivirus",passwd="ivirus",host="kcpy.kc.kingsoft.net",db="ivirus",charset="utf8")
+        #conn = MySQLdb.connect(user="root",passwd="123456",host="localhost",db="test1",charset="utf8")
+        conn = MySQLdb.connect(user=g_ddb['user'],passwd=g_ddb['passwd'],host=g_ddb['host'],db=g_ddb['db'],charset="utf8")
+    except:
+        print "Could not connect to MySQL server."
+    cursor = conn.cursor()
+    q="select `uid`,`pass` from `users` where `name`='%s'"%(user)
+    cursor.execute(q)
+    row = cursor.fetchone()
+    if row == None:
+        return -1
+    if md5.md5(pwd).hexdigest() == row[1]:
+        return row[0]
+    else:
+        return -1
+    conn.close();
+    
+def TokenTerms(word):
+    sword = word.strip()
+    if sword == '':
+        return []
+    li=sword.split(',')
+    li=list(set(li))
+    return li
+#���� id
+def QueryTerm(term,cursor):
+    q='select tid from term_data where name = %s'
+    #q = unicode(q,'cp936')
+    term = unicode(term ,'cp936')
+    cursor.execute(q,term)
+    row = cursor.fetchone()
+    if row == None:
+        return None
+    return row[0]
+def QueryTitle(title,cursor):
+    q='select nid from node where title = %s'
+    #title = unicode(title ,'cp936')
+    cursor.execute(q,title)
+    row = cursor.fetchone()
+    if row == None:
+        return None
+    return row[0]
+def QueryField(cursor,table,obj,name,index):
+    q="select `%s` from `%s` where `%s` = '%s'" %(obj,table,name,index)
+    cursor.execute(q)
+    row = cursor.fetchone()
+    if row == None:
+        return None
+    return row[0]
+    pass
+
+def PostList(li,uid,myapp,time2quit):
+    try:
+        conn = MySQLdb.connect(user=g_ddb['user'],passwd=g_ddb['passwd'],host=g_ddb['host'],db=g_ddb['db'],charset="utf8")
+    except:
+        myapp.fail.AppendText('Could not connect to MySQL server.')
+    cursor = conn.cursor()
+    
+    sumli = len(li)
+    sumfail = 0
+    #init
+    #myapp.process.SetRange(sumli)
+    #myapp.process.SetValue(0)
+    #myapp.labproc.SetLabel('0 / %d'%(sumli))
+    #myapp.succ.SetValue('')
+    #myapp.fail.SetValue('')
+    #init
+
+    wx.CallAfter(myapp.SetRange,sumli)
+    wx.CallAfter(myapp.SetValue,0)
+    wx.CallAfter(myapp.SetLabel,'0 / %d'%(sumli))
+    wx.CallAfter(myapp.SetText,True,'')
+    wx.CallAfter(myapp.SetText,False,'')
+    
+    for item in li:
+        #
+        #myapp.labproc.SetLabel('%d / %d %s'%(li.index(item)+1,len(li),os.path.basename(item)))
+        #
+        sl=('%d / %d %s'%(li.index(item)+1,len(li),os.path.basename(item)))
+        wx.CallAfter(myapp.SetLabel,sl)
+        time2quit.wait(0.01)
+        s=PostFile(item,cursor,uid)
+        #
+        #myapp.process.SetValue(li.index(item)+1)
+        #
+        wx.CallAfter(myapp.SetValue,li.index(item)+1)
+        s1=unicode(s,'cp936')
+        if '¼��ʧ��'in s:
+            #
+            #myapp.fail.AppendText(item + ':'+s1+'\n')
+            #
+            wx.CallAfter(myapp.AppendText,False,(item + ':'+s1+'\n'))
+            sumfail +=1
+        else:
+            #
+            #myapp.succ.AppendText(item + ':'+s1+ '\n')
+            #
+            wx.CallAfter(myapp.AppendText,True,(item + ':'+s1+'\n'))
+    #
+    #myapp.succ.AppendText('*******************\n�ɹ�¼��: %d / %d\n'%(sumli - sumfail , sumli))
+    #myapp.fail.AppendText('*******************\n¼��ʧ��: %d / %d\n'%(sumfail , sumli))
+    wx.CallAfter(myapp.AppendText,True,('*******************\n�ɹ�¼��: %d / %d\n'%(sumli - sumfail , sumli)))
+    wx.CallAfter(myapp.AppendText,False,('*******************\n¼��ʧ��: %d / %d\n'%(sumfail , sumli)))
+
+    conn.close();
+    pass
+def UpdateNode(uid,dinfo,cursor):
+    #var_nid,var_vid,var_uid,var_time,dinfo,platformtxt
+    var_uid = int(uid)
+    var_nid=QueryField(cursor,'sequences','id','name','node_nid')
+    var_vid=QueryField(cursor,'sequences','id','name','node_revisions_vid')
+    var_nid=int(var_nid)+1
+    var_vid=int(var_vid)+1
+    #print 'vid=' , var_vid
+    #print 'nid=' , var_nid
+    platformtxt = QueryField(cursor,'node_field','global_settings','field_name','field_platform')
+    platformtxt = platformtxt.encode('cp936')
+    #"""SELECT `global_settings` FROM `node_field` WHERE `field_name` = 'field_platform'"""
+    var_time=int(time.time())
+    q=sql.AddNodeSql(var_nid,var_vid,var_uid,var_time,dinfo,platformtxt)
+    q = unicode(q,'cp936')
+    li =q.split(';')
+    for query in li:
+        pass
+        #print '[ node ',li.index(query),']',query
+        cursor.execute(query)#encode
+
+        #print query
+        pass
+    #print '*'*30,'node','*'*30
+    return var_nid
+    pass
+
+def UpdateTerm(keywords,nid,cursor):
+    tid0=int(QueryField(cursor,'sequences','id','name','term_data_tid'))
+    tid=tid0
+    lisql=[]
+    #print 'term keywords len = ', len(keywords)
+    for word in keywords:
+        r=QueryTerm(word,cursor)
+        if r == None:
+            tid+=1
+            lisql.append("INSERT INTO `term_data` (`tid`,`vid`,`name`,`weight`) VALUES ('%s','1','%s','0')"%(tid,word))
+            lisql.append("insert into `url_alias` (`src`,`dst`) values ('taxonomy/term/%s','%s%s.html')"%(tid,tword.Word2URL(word),tid))
+            r=tid
+        lisql.append("INSERT INTO `term_node` (`nid`,`tid`) VALUES ('%s','%s')"%(nid,r))
+    if tid !=tid0:
+        lisql.append("UPDATE `sequences` SET `id`='%s' WHERE `name`='term_data_tid'"%(tid))
+    i =0;
+    for q in lisql:
+        q1 = unicode(q,'cp936')
+        i+=1
+        #print '[term ',i,']:',q1
+        cursor.execute(q1)
+        #print '[term ',lisql.index(q),']:',q1
+    #print '$'*30,'term','$'*30
+    pass
+def PostFile(path,cursor,uid):
+    #getinfo
+    #0:query title
+    #sql two part(1)node(2)term
+    #0ֱ�����ļ�����ȡ,1.��dtxt�Ľ��
+    bret , dtxt=VirusInfo.GetInfo(path)
+    if not bret:
+        return '¼��ʧ��,�ļ���ʽ����'
+    title=dtxt[g_dsql['var_title']]
+    r=QueryTitle(title,cursor)
+    if r!= None:
+        return '¼��ʧ��,���������Ѵ���'
+    nid=UpdateNode(uid,dtxt,cursor)
+    keywords=TokenTerms(dtxt[g_dsql['var_term']])
+    #print 'key[0]=['+keywords[0]+']'
+    UpdateTerm(keywords,nid,cursor)
+    return ('�ɹ�¼��,nid=%d'%(nid))
+    #return nid
+def PostTxt(path):
+    try:
+        #conn = MySQLdb.connect(user="ivirus",passwd="ivirus",host="192.168.1.51",db="ivirus",charset="utf8")
+        #conn = MySQLdb.connect(user="ivirus",passwd="ivirus",host="kcpy.kc.kingsoft.net",db="ivirus",charset="utf8")
+        #conn = MySQLdb.connect(user="root",passwd="123456",host="localhost",db="test1",charset="utf8")
+        conn = MySQLdb.connect(user=dbcon['user'],passwd=dbcon['passwd'],host=dbcon['host'],db=dbcon['db'],charset="utf8")
+    except:
+        print "Could not connect to MySQL server."
+    cursor = conn.cursor()
+    
+    query="select id from sequences  where `name` ='node_nid'"
+    cursor.execute(query)
+    for row in cursor.fetchall():
+        pass
+        #print row[0]
+    nid=int(row[0])
+    query="select id from sequences  where `name` ='node_revisions_vid'"
+    cursor.execute(query)
+    for row in cursor.fetchall():
+        pass
+        #print row[0]
+    vid=int(row[0])
+    query="select id from sequences  where `name` ='term_data_tid'"
+    cursor.execute(query)
+    for row in cursor.fetchall():
+        pass
+        #print row[0]
+    tid=int(row[0])
+#    print nid,tid,vid
+
+    for p in path:
+        nid +=1
+        tid +=1
+        vid +=1
+        d=VirusInfo.GetInfo(p)
+        query = sql.MakeSql(nid,vid,tid,d)
+        query = unicode(query,'cp936')
+        qli = query.split(';')
+        #print '--------------'
+        #print query
+        #print '--------------'
+        #conn.begin()
+        for q in qli:
+            try:
+                cursor.execute(q)
+            except Exception, e:
+                print 'error:',e
+        print 'done: ',p,'\t',path.index(p)+1,'/',len(path)
+    conn.close()

kcver1.1/post2db.pyc

Binary file added.

kcver1.1/readme.txt

+�ļ��б�
+
+�ĵ�
+how to setup.txt	˵���������exe
+how to use.txt		ʹ��˵��
+
+����
+demo.py			������
+conf.py			��������ģ��
+env.py			�����õ���ȫ�ֳ�Ա
+VirusInfo.py		���������ļ�ģ��
+tword.py		�ɹؼ��ֹ���URL����
+post2db.py		�������ݿ�ģ��
+sql.py			����URLģ��
+demo.xrc		��������Դ�ļ�
+mysetup.py		����EXE�ű�
+
+
+

kcver1.1/sample.txt

+����Ӣ������: Win32.Adware.Agent.el.155648
+��������: 49664
+�����: ��
+�ؼ���: 
+Ӱ��ϵͳ:win9x/winMe/winNT/win2000/winXP/win2003
+��������: ������
+��Ⱦ;��: 
+
+�������:
+
+����һ�������������޸�ע����й�������������ݣ�������������ָ���Ĺ��ҳ�棬�����û����������������IJ��ֱ��ֿ���ӵ��Զ�̿��ƻ��������Ĺ��ܡ�
+
+������:
+
+�ڴ������ͷų������ļ�:
+C:\Program Files\Common Files\Microsoft Shared\MSINFO\FieleWay.txt
+
+�������ע����ж�ȡ��Ϣ:
+"HKCU\Software\Borland\Locales"
+"HKLM\Software\Borland\Locales"
+"HKCU\Software\Borland\Delphi\Locales"
+
+��������������ָ������ַ:
+������� http://dd4.tesekl.info/not.exe �����ļ������ؼ���� c:\not.exe
+����:"dd4.tesekl.info" �˿�:80 (TCP)
+dd4.tesekl.info/not.exe
+
+��ϵͳ�д��������½���:
+"IEXPLORE.EXE""
+������ע�� IEXPLORE.EXE" ����
+
+������ͨ������;������:
+������������������
+
+��������������ָ������ַ:
+http://cs.993311.com/anc.jpg
+����:"cs.993311.com" �˿�:80 (TCP)
+cs.993311.com/anc.jpg
+
+
+�ڲ���Ϣ:�Զ�����

kcver1.1/sample0.txt

+����Ӣ������: Win32.Troj.Dluca.cb.39424
+��������: 39424
+�����: ��
+�ؼ���: delwbi.tmp,ľ��,vmx38Fg45
+Ӱ��ϵͳ:win9x/winMe/winNT/win2000/winXP/win2003
+��������: ľ�����
+��Ⱦ;��: 
+
+�������:
+
+����һ��ľ����򡣻��ڴ������ͷų��ļ������޸�ע��
+
+������:
+
+�ڴ������ͷų������ļ�:
+windows
+
+�ڴ�����ɾ���������ļ�:
+C:\WINDOWS\TEMP\delwbi.tmp
+c:\a\b\c
+a\b\c\d
+��ע����д�����������Ϣ:
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F7EE4E3689C2DCF4A531C20954D158C1936D9A3C"
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\1567DAAB1377FE3552D2F6F2A2FA80200135EDA5"
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F705E9D8DAA72DF53D068BF60B551EA3103D51D7"
+"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\sncntr"
+"HKCU\Software\sncntr"
+
+��ע�����������������Ϣ:
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F7EE4E3689C2DCF4A531C20954D158C1936D9A3C"	"Blob"	""
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\1567DAAB1377FE3552D2F6F2A2FA80200135EDA5"	"Blob"	""
+"HKCU\Software\Microsoft\SystemCertificates\TrustedPublisher\Certificates\F705E9D8DAA72DF53D068BF60B551EA3103D51D7"	"Blob"	""
+
+�������ע����ж�ȡ��Ϣ:
+"HKCU\Software\Microsoft\VisualStudio\6.0\Debugger"
+"HKCU\Software\Microsoft\VisualStudio\7.0\Debugger"
+"HKCU\Software\Microsoft\Win32SDK"
+"HKCU\Software\Microsoft\Sourcesafe"
+"HKCU\Software\Microsoft\PlatformSDK"
+"HKLM\Software\_GMC_ODLUP"
+"HKLM\Software\Microsoft\VisualStudio\6.0\Debugger"
+"HKLM\Software\Microsoft\VisualStudio\7.0\Debugger"
+"HKLM\Software\Microsoft\Win32SDK"
+"HKLM\Software\Microsoft\Sourcesafe"
+"HKLM\Software\Microsoft\PlatformSDK"
+
+��ϵͳ�д��������½���:
+�����ᴴ����һ�������� vmx38Fg45 ����ֹ�ظ�����
+
+������ͨ������;������:
+������������������
+
+# -*- coding: cp936 -*-
+import time
+import env
+import re #add
+import random
+StrSqlOrg="""INSERT INTO `node` (`nid`,`vid`,`type`,`title`,`uid`,`promote`,`sticky`,`created`,`changed`)
+VALUES (id_node,id_node_ver,'virus','����Ӣ������','1','1','0',post,post);
+
+INSERT INTO `content_type_virus` (`vid`,`nid`,`field_remark_value`,`field_alias_value`,`field_length_value`,`field_category_value`,`field_brief_value`,`field_brief_format`,`field_remark_format`,`field_level_value`,`field_platform_value`)
+VALUES (id_node_ver,id_node,'��������','��������','��������','�������','1','1','��в����','Ӱ��ϵͳ');
+
+INSERT INTO `content_field_cnname` (`nid`,`vid`,`field_cnname_value`)
+ VALUES (id_node,id_node_ver,'������������');
+
+INSERT INTO `term_data` (`tid`,`vid`,`name`,`weight`)
+ VALUES (id_term,'1','','0');
+
+INSERT INTO `term_node` (`nid`,`tid`)
+VALUES (id_node,id_term);
+
+INSERT INTO `nodewords` (`type`,`id`,`name`,`content`)
+ VALUES ('node',id_node,'description','kword0');
+
+INSERT INTO `nodewords` (`type`,`id`,`name`,`content`)
+ VALUES ('node',id_node,'keywords','kword0');
+
+INSERT INTO `node_revisions` (`nid`,`vid`,`uid`,`title`,`body`,`teaser`,`log`,`format`,`timestamp`)
+ VALUES (id_node,id_node_ver,'1','����Ӣ������','��Ϊ����','teaser','log','1',post) ;
+
+UPDATE `sequences` SET `id`=id_node
+WHERE (`name`='node_nid' );
+
+UPDATE `sequences` SET `id`=id_node_ver
+ WHERE (`name`='node_revisions_vid' );
+
+UPDATE `sequences` SET `id`=id_term
+WHERE (`name`='term_data_tid' );
+
+DELETE FROM cache_page"""
+#����uid ����,����ͳһ��ǰ׺var_
+#vars:var_nid,var_vid,var_uid,var_time
+#var_teaser,var_body��Ҫ�������ļ��в���
+#var_time���ȡ������ʱ��,����SQL��ѯʱ��
+StrAddNode="""INSERT INTO `node` (`nid`,`vid`,`type`,`title`,`uid`,`promote`,`sticky`,`created`,`changed`)
+VALUES ('var_nid','var_vid','virus','var_title','var_uid','1','0','var_time','var_time');
+
+INSERT INTO `content_type_virus` (`vid`,`nid`,`field_alias_value`,`field_length_value`,`field_category_value`,
+                                `field_brief_value`,`field_brief_format`,`field_remark_format`,
+                                `field_level_value`,`field_platform_value`,`field_cnname_value`,`field_remark_value`)
+VALUES ('var_vid','var_nid','var_field_alias_value','var_field_length_value','var_field_category_value',
+'var_field_brief_value','1','1',
+'var_field_level_value','var_field_platform_value','var_field_cnname_value','var_field_remark_value');
+
+INSERT INTO `node_revisions` (`nid`,`vid`,`uid`,`title`,`body`,`teaser`,`log`,`format`,`timestamp`)
+VALUES ('var_nid','var_vid','var_uid','var_title','var_body','var_teaser','','1','var_time');
+
+UPDATE `sequences` SET `id`='var_nid' WHERE (`name`='node_nid');
+
+UPDATE `sequences` SET `id`='var_vid' WHERE (`name`='node_revisions_vid');
+
+insert into `url_alias` (`src`,`dst`) values ('node/var_nid','ivirus/var_dst-var_nid.html');
+
+DELETE FROM cache_page where cid like '%/'"""
+##DELETE FROM cache_page
+#INSERT INTO `content_field_cnname` (`nid`,`vid`,`field_cnname_value`)
+#VALUES ('var_nid','var_vid','var_field_cnname_value');
+StrAddTerm="""INSERT INTO `term_data` (`tid`,`vid`,`name`,`weight`)
+VALUES (id_term,'1','','0');
+
+INSERT INTO `term_node` (`nid`,`tid`)
+VALUES (id_node,id_term);
+
+UPDATE `sequences` SET `id`=id_term
+WHERE (`name`='term_data_tid' );"""
+
+def GetPlatform(s0 , platform):
+    sp=platform.replace('/',' ')
+    index = s0.lower().find(sp.lower())
+    return s0[index:index+len(sp)]
+def reTest(s1):
+    #print '-'*60
+    s0= """��������������ָ������ַ:
+ http://windowsupdate.microsoft.com
+����:"windowsupdate.microsoft.com" �˿�:80 (TCP)
+http://windowsupdate/microsoft.com/index.html/sth
+
+4545565465"""
+    url = re.compile(r'[hH][tT][tT][pP]://[^(\s)]*')
+    li = url.findall(s1)
+    #print li
+    for item in li:
+        url = item
+        lenUrl = len(url)
+        lenHeader= len('http://')
+        for i in range(4):
+            pos = random.randint(lenHeader, lenUrl)
+            url = url[:pos]+'*'+url[pos+1:]
+        #print 'url',url
+        #print 'item',item
+        #print s1.find(item)
+        s1=s1.replace(item,url)
+    return s1
+        #print s1
+    #print '-'*60
+    
+def AddNodeSql(var_nid,var_vid,var_uid,var_time,dinfo,platformtxt):
+    StrObj=''+StrAddNode
+    StrObj=StrObj.replace('var_nid',`var_nid`)
+    StrObj=StrObj.replace('var_vid',`var_vid`)
+    StrObj=StrObj.replace('var_uid',`var_uid`)
+    StrObj=StrObj.replace('var_time',`var_time`)
+    enname = dinfo[env.g_dsql['var_title']]
+    var_dst =enname.replace('.','-')
+    StrObj=StrObj.replace('var_dst',var_dst)
+    for k ,v in env.g_dsql.items():
+        if k == 'var_field_level_value':#Σ�ռ���
+            StrObj=StrObj.replace(k,MakeStars(dinfo[v]))
+        elif k == 'var_field_platform_value':
+            StrObj=StrObj.replace(k,GetPlatform(platformtxt,dinfo[v]))
+        elif k == 'var_body':
+            #print 'kkk == ***'*5
+            sbody = (dinfo[v]).replace("'","\\'")
+            #print sbody
+            #print 'kkk == ***'*5
+            StrObj=StrObj.replace(k,sbody)
+
+            StrObj=StrObj.replace('\\','\\\\')
+            StrObj = reTest(StrObj)
+        else:
+            StrObj=StrObj.replace(k,dinfo[v])
+    return StrObj
+
+def MakeStars(star):
+    return (star+'��'*((5*2-len(star))/2))
+def MakeSql(nid,vid,tid,dinfo):
+    id_node = nid
+    id_node_ver=vid
+    id_term=tid
+    post=int(time.time())
+    StrSqlObj= ''+StrSqlOrg
+    StrSqlObj= StrSqlObj.replace('id_node_ver',("'"+`id_node_ver`+"'"))
+    StrSqlObj= StrSqlObj.replace('id_node',("'"+`id_node`+"'"))
+    StrSqlObj= StrSqlObj.replace('id_term',("'"+`id_term`+"'"))
+    StrSqlObj= StrSqlObj.replace('post',("'"+`post`+"'"))
+    for key,value in dinfo.items():
+        if key == '�����':
+            StrSqlObj = StrSqlObj.replace(key,MakeStars(value))
+        else:
+            StrSqlObj = StrSqlObj.replace(key,value)
+    return StrSqlObj
+if 0:
+    if __name__ == '__main__':
+        print '=-----------------------'
+        print StrSqlOrg
+        print '=========================='

kcver1.1/sql.pyc

Binary file added.

kcver1.1/sql_bak.py

+# -*- coding: cp936 -*-
+import time
+import env
+StrSqlOrg="""INSERT INTO `node` (`nid`,`vid`,`type`,`title`,`uid`,`promote`,`sticky`,`created`,`changed`)
+VALUES (id_node,id_node_ver,'virus','����Ӣ������','1','1','0',post,post);
+
+INSERT INTO `content_type_virus` (`vid`,`nid`,`field_alias_value`,`field_length_value`,`field_category_value`,`field_brief_value`,`field_brief_format`,`field_remark_format`,`field_level_value`,`field_platform_value`)
+VALUES (id_node_ver,id_node,'��������','��������','��������','�������','1','1','��в����','Ӱ��ϵͳ');
+
+INSERT INTO `content_field_cnname` (`nid`,`vid`,`field_cnname_value`)
+ VALUES (id_node,id_node_ver,'������������');
+
+INSERT INTO `term_data` (`tid`,`vid`,`name`,`weight`)
+ VALUES (id_term,'1','','0');
+
+INSERT INTO `term_node` (`nid`,`tid`)
+VALUES (id_node,id_term);
+
+INSERT INTO `nodewords` (`type`,`id`,`name`,`content`)
+ VALUES ('node',id_node,'description','kword0');
+
+INSERT INTO `nodewords` (`type`,`id`,`name`,`content`)
+ VALUES ('node',id_node,'keywords','kword0');
+
+INSERT INTO `node_revisions` (`nid`,`vid`,`uid`,`title`,`body`,`teaser`,`log`,`format`,`timestamp`)
+ VALUES (id_node,id_node_ver,'1','����Ӣ������','��Ϊ����','teaser','log','1',post) ;
+
+UPDATE `sequences` SET `id`=id_node
+WHERE (`name`='node_nid' );
+
+UPDATE `sequences` SET `id`=id_node_ver
+ WHERE (`name`='node_revisions_vid' );
+
+UPDATE `sequences` SET `id`=id_term
+WHERE (`name`='term_data_tid' );
+
+DELETE FROM cache_page"""
+#����uid ����,����ͳһ��ǰ׺var_
+#vars:var_nid,var_vid,var_uid,var_time
+#var_teaser,var_body��Ҫ�������ļ��в���
+#var_time���ȡ������ʱ��,����SQL��ѯʱ��
+StrAddNode="""INSERT INTO `node` (`nid`,`vid`,`type`,`title`,`uid`,`promote`,`sticky`,`created`,`changed`)
+VALUES ('var_nid','var_vid','virus','var_title','var_uid','1','0','var_time','var_time');
+
+INSERT INTO `content_type_virus` (`vid`,`nid`,`field_alias_value`,`field_length_value`,`field_category_value`,
+                                `field_brief_value`,`field_brief_format`,`field_remark_format`,
+                                `field_level_value`,`field_platform_value`)
+VALUES ('var_vid','var_nid','var_field_alias_value','var_field_length_value','var_field_category_value',
+'var_field_brief_value','1','1',
+'var_field_level_value','var_field_platform_value');
+
+INSERT INTO `content_field_cnname` (`nid`,`vid`,`field_cnname_value`)
+VALUES ('var_nid','var_vid','var_field_cnname_value');
+
+INSERT INTO `node_revisions` (`nid`,`vid`,`uid`,`title`,`body`,`teaser`,`log`,`format`,`timestamp`)
+VALUES ('var_nid','var_vid','var_uid','var_title','var_body','var_teaser','','1','var_time');
+
+UPDATE `sequences` SET `id`='var_nid' WHERE (`name`='node_nid');
+
+UPDATE `sequences` SET `id`='var_vid' WHERE (`name`='node_revisions_vid');
+
+insert into `url_alias` (`src`,`dst`) values ('node/var_nid','ivirus/var_dst-var_nid.html');
+
+DELETE FROM cache_page where cid like '%/'"""
+##DELETE FROM cache_page
+
+StrAddTerm="""INSERT INTO `term_data` (`tid`,`vid`,`name`,`weight`)
+VALUES (id_term,'1','','0');
+
+INSERT INTO `term_node` (`nid`,`tid`)
+VALUES (id_node,id_term);
+
+UPDATE `sequences` SET `id`=id_term
+WHERE (`name`='term_data_tid' );"""
+
+def GetPlatform(s0 , platform):
+    sp=platform.replace('/',' ')
+    index = s0.lower().find(sp.lower())
+    return s0[index:index+len(sp)]
+
+def AddNodeSql(var_nid,var_vid,var_uid,var_time,dinfo,platformtxt):
+    StrObj=''+StrAddNode
+    StrObj=StrObj.replace('var_nid',`var_nid`)
+    StrObj=StrObj.replace('var_vid',`var_vid`)
+    StrObj=StrObj.replace('var_uid',`var_uid`)
+    StrObj=StrObj.replace('var_time',`var_time`)
+    enname = dinfo[env.g_dsql['var_title']]
+    var_dst =enname.replace('.','-')
+    StrObj=StrObj.replace('var_dst',var_dst)
+    for k ,v in env.g_dsql.items():
+        if k == 'var_field_level_value':#Σ�ռ���
+            StrObj=StrObj.replace(k,MakeStars(dinfo[v]))
+        elif k == 'var_field_platform_value':
+            StrObj=StrObj.replace(k,GetPlatform(platformtxt,dinfo[v]))
+        elif k == 'var_body':
+            #print 'kkk == ***'*5
+            sbody = (dinfo[v]).replace("'","\\'")
+            #print sbody
+            #print 'kkk == ***'*5
+            StrObj=StrObj.replace(k,sbody)
+        else:
+            StrObj=StrObj.replace(k,dinfo[v])
+    return StrObj
+
+def MakeStars(star):
+    return (star+'��'*((5*2-len(star))/2))
+def MakeSql(nid,vid,tid,dinfo):
+    id_node = nid
+    id_node_ver=vid
+    id_term=tid
+    post=int(time.time())
+    StrSqlObj= ''+StrSqlOrg
+    StrSqlObj= StrSqlObj.replace('id_node_ver',("'"+`id_node_ver`+"'"))
+    StrSqlObj= StrSqlObj.replace('id_node',("'"+`id_node`+"'"))
+    StrSqlObj= StrSqlObj.replace('id_term',("'"+`id_term`+"'"))
+    StrSqlObj= StrSqlObj.replace('post',("'"+`post`+"'"))
+    for key,value in dinfo.items():
+        if key == '�����':
+            StrSqlObj = StrSqlObj.replace(key,MakeStars(value))
+        else:
+            StrSqlObj = StrSqlObj.replace(key,value)
+    return StrSqlObj
+if 0:
+    if __name__ == '__main__':
+        print '=-----------------------'
+        print StrSqlOrg
+        print '=========================='

kcver1.1/tword.py

+# -*- coding: cp936 -*-
+def Word2URL(word):
+    bret = isinstance(word,unicode)
+    #print bret
+    #print len(word)
+    word = unicode(word,'cp936')
+    #print len(word)
+    sret =u''
+    for i in word:
+        #print i,ord(i)
+        if ord(i)<=127:
+            b1 = i.isdigit()
+            b2 = i.isalpha()
+            #print b1,b2,i,(not b1 and not b2)
+            if not b1 and not b2:
+                pass
+                if sret != u'' and sret[-1]!='-':
+                    sret +=i.replace(i,'-')
+            else:
+                #if sret != u'' and sret[-1]!='-':
+                sret +=i
+        else:
+            if sret != u'' and sret[-1]!='-':
+                sret +=i.replace(i,'-')
+                pass
+    #print sret
+    sret=sret.lower()
+    sret = u'tag/'+sret
+    if not sret.endswith('-'):
+        sret+=u'-'
+    bret = isinstance(sret,unicode)
+    #print bret ,len(sret),sret
+    sret1 = sret.encode('cp936')
+    bret = isinstance(sret1,unicode)
+    #print bret,len(sret1),sret1,sret1==sret
+    return sret1
+    pass
+
+if __name__ == '__main__':
+    #Word2URL('hao��123��')
+    path = 'tag.txt'
+    f = open(path,'r')
+    lines = f.readlines()
+    print len(lines)
+    lisql=[]
+    tid = 20009
+    
+    for i in lines:
+        pos = i.find('\t')
+        s1=i[0:pos].strip()
+        s2=i[pos:-1].strip()
+        sret=Word2URL(s1)
+        print '[',s1,':',s2,']'
+        print sret,s2.startswith(sret)
+        
+        lisql.append("insert into `url_alias` (`src`,`dst`) values ('%s','%s%s.html')"%(tid,sret,tid))
+        q=lisql[lines.index(i)]
+        q4=unicode(q,'cp932')
+        print q
+        print q4
+        q0='python����'
+        b1=isinstance(q0,unicode)
+        q1=unicode(q0,'cp936')
+        b2=isinstance(q1,unicode)
+        b3=isinstance(q,unicode)
+        print b1,b2,b3
+        print q1
+        print '*'*40
+        
+    
+    
+    

kcver1.1/tword.pyc

Binary file added.

kcver1.1/zss_test0.txt

+����Ӣ������: Win32.Adware.Agent.el.155648
+��������: 49664
+�����: ��
+�ؼ���: 
+Ӱ��ϵͳ:win9x/winMe/winNT/win2000/winXP/win2003
+��������: ������
+��Ⱦ;��: 
+
+�������:
+
+����һ�������������޸�ע����й�������������ݣ�������������ָ���Ĺ��ҳ�棬�����û����������������IJ��ֱ��ֿ���ӵ��Զ�̿��ƻ��������Ĺ��ܡ�
+
+������:
+
+�ڴ������ͷų������ļ�:
+C:\Program Files\Common Files\Microsoft Shared\MSINFO\FieleWay.txt
+
+�������ע����ж�ȡ��Ϣ:
+"HKCU\Software\Borland\Locales"
+"HKLM\Software\Borland\Locales"
+"HKCU\Software\Borland\Delphi\Locales"
+
+��������������ָ������ַ:
+������� http://dd4.tesekl.info/not.exe �����ļ������ؼ���� c:\not.exe
+����:"dd4.tesekl.info" �˿�:80 (TCP)
+dd4.tesekl.info/not.exe
+
+��ϵͳ�д��������½���:
+"IEXPLORE.EXE""
+������ע�� IEXPLORE.EXE" ����
+
+������ͨ������;������:
+������������������
+
+��������������ָ������ַ:
+http://cs.993311.com/anc.jpg
+����:"cs.993311.com" �˿�:80 (TCP)
+cs.993311.com/anc.jpg
+
+
+�ڲ���Ϣ:�Զ�����

kcver_gui1.0/VirusInfo.py

+# -*- coding: cp936 -*-
+from env import *
+import sql
+import os.path
+def GetInfo(path):
+    k=g_dtxt.keys()
+    d={}#����
+    for ki in k:
+        d[ki]=''
+    #print len(k)
+#    path = raw_input('file name:')
+
+    bfile = os.path.isfile(path)
+    if not bfile:
+        print 'not file or not exist'
+        return False,d
+    bfile = os.path.splitext(path)
+    if bfile[1] != '.txt':
+        print 'not text file'
+        return False,d
+    f = open(path,"r")     #�ļ�����
+    lines = f.readlines()
+    sum = len(lines)
+    if sum < 1:
+        return False ,d
+    if not lines[0].startswith('����Ӣ������'):
+        print lines[0]
+        print 'not starts with'
+        return False ,d
+    temp=''
+    for i in range(sum):
+        temp+=lines[i]
+        if i+1<sum and HasKey(lines[i+1],d):
+            Token(temp,d)
+            temp=''
+    #print temp
+    temp+=lines[sum-1]
+    Token(temp,d)
+    f.close()
+    return (True,d)
+if __name__ == '__main__':
+    ReadCfg('cfg.txt')
+    #path = raw_input('file name:')
+    path = 'sample.txt'
+    (b,d1)=GetInfo(path)
+    if b:   
+        print '___________'
+        for ki in g_dtxt.keys():
+            print (ki+':'+d1[ki]+'\n')
+        print '*'*50
+
+        sret = sql.AddNodeSql(6000,6000,25,0,d1,'')
+        print sret
+    else:
+        print 'error'
+    
+
+
+

kcver_gui1.0/cfg.txt

+[dbcon]
+db=ivirus
+host=kcpy.kc.kingsoft.net
+port=3306
+user=ivirus
+passwd=ivirus
+charset=utf8
+[txt_field]
+����Ӣ������=
+��������=
+�����=
+�ؼ���=
+Ӱ��ϵͳ=
+��������=
+��Ⱦ;��=
+�������=
+������=
+��������=
+������������=
+[db_field]
+var_title=����Ӣ������
+var_field_alias_value=��������
+var_field_length_value=��������
+var_field_category_value=��������
+var_field_brief_value=�������
+var_field_level_value=�����
+var_field_platform_value=Ӱ��ϵͳ
+var_field_cnname_value=������������
+var_body=������
+var_teaser=�������
+var_term=�ؼ���

kcver_gui1.0/conf.py

+#-*- coding: utf-8 -*-
+#coding = utf-8
+dfield={}#字段字典
+dsql={}#sql
+ddb={}#dbconf
+f = open ('config.txt')
+i =0
+for line in f.readlines():
+    line=line.strip()
+    i+=1
+#   l =len(line)
+    if ':' in line :
+        s=line.split(':')
+        dsql[s[0]]=s[1]
+    elif '=' in line:
+        s=line.split('=')
+        ddb[s[0]]=s[1]
+#   print i,line.strip(),(s[1]=='')
+#    dfield[s[0]]=''
+    
+
+if 1:
+    for k,v in dsql.items():
+        print k,v
+    print '------'
+    for k,v in ddb.items():
+        print k,v
+f.close()
+f=open('env.py')
+lines = f.readlines()
+for i in range(len(lines)):
+    if lines[i].startswith('conf ='):
+        print lines[i]
+        lines[i] ='conf ='+`dsql`+'\n'
+        sss=''+repr(dsql)
+        print sss
+        print lines[i]
+    elif lines[i].startswith('dbcon ='):
+        lines[i] ='dbcon ='+`ddb`+'\n'
+for line in lines:
+    print line
+f.close()
+f1 = open ('env.py','w')
+for i in range (len(lines)):
+    f1.write (lines[i])
+f1.close()
+

kcver_gui1.0/demo.py

+# -*- coding: cp936 -*-
+import string, sys, pickle, cmd,post2db,env,getpass
+import os.path,os
+import wx
+from wx import xrc
+#import login
+#import dlg
+ACCT = u'�ʺ�'
+PWD = u'����password'
+LOGIN =u'��¼'
+LOGOUT = u'ע��'
+import threading
+import random
+class MyApp(wx.App):
+
+    def OnInit(self):
+        self.res = xrc.XmlResource('demo.xrc')
+        assert self.res
+        self.init_dialog()
+        self.lifile=[]
+        self.workth=None
+        return True
+    
+    def init_dialog(self):
+        self.dlg = self.res.LoadFrame(None, 'ID_DLG')
+        assert self.dlg
+        self.panel = xrc.XRCCTRL(self.dlg, 'ID_PANEL')
+
+        #login
+        self.acct = xrc.XRCCTRL(self.panel, 'ID_ACCT')
+        self.pwd = xrc.XRCCTRL(self.panel, 'ID_PWD')
+        self.pwd.SetValue(PWD)
+        self.login =xrc.XRCCTRL(self.panel, 'ID_LOGIN')
+        
+        self.btn_dir = xrc.XRCCTRL(self.panel, 'ID_DIR')
+        self.btn_file = xrc.XRCCTRL(self.panel, 'ID_FILE')
+        self.btn_submit = xrc.XRCCTRL(self.panel, 'ID_SUBMIT')
+        
+        #output
+        self.succ = xrc.XRCCTRL(self.panel, 'ID_SUCC')
+        self.process = xrc.XRCCTRL(self.panel, 'ID_PROCESS')
+        self.process.SetLabel('hello,world')
+        self.fail =xrc.XRCCTRL(self.panel, 'ID_FAIL')
+
+        #ID_PROCTXT
+        self.labproc = xrc.XRCCTRL(self.panel,'ID_PROCTXT')
+        #event band
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnLogin, id=xrc.XRCID('ID_LOGIN'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnFile, id=xrc.XRCID('ID_FILE'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnDir, id = xrc.XRCID('ID_DIR'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnSubmit, id = xrc.XRCID('ID_SUBMIT'))
+        self.dlg.Bind(wx.EVT_BUTTON, self.OnEmpty, id = xrc.XRCID('ID_EMPTY'))
+        
+        #show dialog
+        self.panel.Bind(wx.EVT_LEFT_DOWN,self.OnClickPanel,id=xrc.XRCID('ID_PANEL'))
+        self.acct.Bind(wx.EVT_LEFT_UP,self.OnClickAcct,id = xrc.XRCID('ID_ACCT'))
+        self.acct.Bind(wx.EVT_SET_FOCUS,self.OnSetAcct , id = xrc.XRCID('ID_ACCT'))
+        self.acct.Bind(wx.EVT_KILL_FOCUS,self.OnLostAcct , id = xrc.XRCID('ID_ACCT'))
+
+        self.pwd.Bind(wx.EVT_LEFT_UP,self.OnClickPwd,id = xrc.XRCID('ID_PWD'))
+        self.pwd.Bind(wx.EVT_SET_FOCUS,self.OnSetPwd , id = xrc.XRCID('ID_PWD'))
+        self.pwd.Bind(wx.EVT_KILL_FOCUS,self.OnLostPwd , id = xrc.XRCID('ID_PWD'))
+        
+        self.acct.SelectAll()
+        self.dlg.Show()
+
+    def OnEmpty(self,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+        self.lifile = []
+        self.succ.AppendText(u'�ļ��б������\n')
+        self.labproc.SetLabel('')
+        self.process.SetValue(0)
+        pass
+    def OnClickPanel(self,evt):
+        self.process.SetFocus()
+    def OnClickPwd(self, evt):
+        self.pwd.SelectAll()
+        evt.Skip()    
+    def OnClickAcct(self, evt):
+        self.acct.SelectAll()
+        evt.Skip()
+    def OnSetAcct(self, evt):
+        if self.acct.GetValue() == ACCT:
+            self.acct.SetValue('')
+        else:
+            self.acct.SelectAll()
+    def OnLostAcct(self ,evt):
+        if self.acct.GetValue()=='':
+            self.acct.SetValue(ACCT)
+    def OnSetPwd(self, evt):
+        if self.pwd.GetValue() == PWD:
+            self.pwd.SetValue('')
+    def OnLostPwd(self ,evt):
+         if self.pwd.GetValue()=='':
+            self.pwd.SetValue(PWD)
+    def OnLogin(self, evt):
+        if env.g_uid == -1:
+            user = self.acct.GetValue()
+            pwd = self.pwd.GetValue()
+            r = post2db.CheckUser(user,pwd)
+            if r>-1 :
+                self.prompt='['+user+']>'
+                env.g_uid=r
+                env.g_user=user
+                self.login.SetLabel(LOGOUT)
+                self.acct.SetEditable(0)
+                self.pwd.SetEditable(0)
+                self.succ.AppendText(u'%s �ɹ���¼\n'%(user))
+            else :
+                self.fail.AppendText(u'�û��������벻ƥ��,��¼ʧ��\n')
+        else:
+           self.fail.AppendText(u'%s ��ע��\n'%(env.g_user))
+           env.g_uid =-1
+           env.g_user = ''
+           self.login.SetLabel(LOGIN)
+           self.acct.SetEditable(1)
+           self.pwd.SetEditable(1)
+           self.acct.SetValue(ACCT)
+           self.pwd.SetValue(PWD)
+           
+    def OnDir(self ,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+            pass
+        if self.workth != None:
+            self.fail.AppendText('¼��������...')
+            return
+        self.process.SetValue(0)
+        dirdlg = wx.DirDialog(None,'Choose dir',
+                style = wx.DD_DEFAULT_STYLE)
+        r = dirdlg.ShowModal()
+        if r == wx.ID_OK:
+            strPath = dirdlg.GetPath()
+            strpath=strPath.encode('cp936')
+            li=os.listdir(strPath)
+            files=[os.path.join(strPath, l) for l in li]
+            self.lifile = list(set(self.lifile + files))
+            self.succ.AppendText(u'������� %d ���ļ�\n'%(len(self.lifile)))
+        else:
+            dirdlg.Destroy()
+            
+    def OnFile(self ,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+            pass
+        if self.workth != None:
+            self.fail.AppendText('¼��������...')
+            return
+        dlg = wx.FileDialog(None, message=u'����ļ���', defaultDir="",
+        defaultFile="", wildcard="*.*", style=wx.MULTIPLE,
+        pos=wx.DefaultPosition)
+        r = dlg.ShowModal()
+        if r == wx.ID_OK:
+            li = dlg.GetPaths()
+            self.lifile = list(set(self.lifile + li))
+            self.succ.AppendText(u'������� %d ���ļ�\n'%(len(self.lifile)))
+        else:
+            dlg.Destroy()
+        pass
+    def OnSubmit(self,evt):
+        if env.g_uid == -1:
+            self.fail.AppendText(u'���ȵ�¼\n')
+            return
+            pass
+        #post2db.PostList(self.lifile,env.g_uid,self)
+        #self.lifile = []
+        if self.workth == None:
+            self.workth = WorkerThread(self,self.lifile,env.g_uid)
+            self.workth.start()
+            self.lifile=[]
+            pass
+        else:
+            self.fail.AppendText('¼��������...\n')
+    def PostAll(self,msg):
+        self.workth=None
+        pass
+    def showmsg(self,m1,m2):
+        self.succ.AppendText(m1)
+        self.fail.AppendText(m2)
+    def SetRange(self,var):
+        self.process.SetRange(var)
+        pass
+    def SetValue(self,var):
+        self.process.SetValue(var)
+    def SetLabel(self,var):
+        self.labproc.SetLabel(var)
+    def AppendText(self,bsucc,txt):
+        if bsucc:
+            self.succ.AppendText(txt)
+        else:
+            self.fail.AppendText(txt)
+    def SetText(self,bsucc,txt):
+        if bsucc:
+            self.succ.SetValue(txt)
+        else:
+            self.fail.SetValue(txt)
+
+class WorkerThread(threading.Thread):
+    def __init__(self,app,lifile,gid):
+        threading.Thread.__init__(self)
+        self.app = app
+        self.li=lifile
+        self.gid=gid
+        self.timeToQuit = threading.Event()
+        self.timeToQuit.clear()
+
+    def run(self):
+        post2db.PostList(self.li,self.gid,self.app,self.timeToQuit)
+        self.timeToQuit.set()
+        wx.CallAfter(self.app.PostAll,'all done')
+    
+if __name__ == '__main__':
+    env.ReadCfg('cfg.txt')
+    app = MyApp(0)
+    app.MainLoop()

kcver_gui1.0/demo.xrc

+<?xml version="1.0" encoding="UTF-8"?>
+<resource class="wxFrame">
+  <object class="wxFrame" name="ID_DLG">
+    <object class="wxPanel" name="ID_PANEL">
+      <object class="wxFlexGridSizer">
+        <object class="sizeritem">
+          <object class="wxFlexGridSizer">
+            <object class="sizeritem">
+              <object class="wxTextCtrl" name="ID_SUCC">
+                <size>360,150</size>
+                <style>wxTE_AUTO_SCROLL|wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxTE_READONLY</style>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxGauge" name="ID_PROCESS">
+                <pos>0,160</pos>
+                <size>360,18</size>
+                <range>10000</range>
+                <value>0</value>
+                <bezel>0</bezel>
+                <fg>#00FF00</fg>
+                <bg>#C5FFC1</bg>
+                <style>wxSUNKEN_BORDER|wxGA_SMOOTH</style>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxStaticText" name="ID_PROCTXT">
+                <pos>0,160</pos>
+                <size>360,18</size>
+                <style>wxTRANSPARENT_WINDOW|wxNO_FULL_REPAINT_ON_RESIZE|wxALIGN_CENTRE|wxST_NO_AUTORESIZE</style>
+              </object>
+            </object>
+            <object class="sizeritem">
+              <object class="wxTextCtrl" name="ID_FAIL">
+                <size>360,150</size>
+                <style>wxTE_AUTO_SCROLL|wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxTE_READONLY</style>
+              </object>
+            </object>
+            <object class="spacer">
+              <size>10</size>
+            </object>
+            <object class="sizeritem">
+              <object class="wxStaticText">
+                <size>360,-1</size>
+                <label>Kingsoft  软件事业部技术支持中心与蟒营 联合出品</label>
+                <style>wxALIGN_CENTRE</style>
+              </object>
+            </object>
+            <cols>1</cols>
+            <vgap>10</vgap>
+          </object>
+          <flag>wxLEFT</flag>
+        </object>
+        <cols>3</cols>
+        <rows>1</rows>
+        <object class="spacer">
+          <size>30</size>
+        </object>
+        <object class="sizeritem">
+          <object class="wxFlexGridSizer">
+            <cols>1</cols>
+            <rows>3</rows>
+            <vgap>20</vgap>
+            <object class="spacer">
+              <size>3</size>
+            </object>
+            <object class="sizeritem">
+              <object class="wxBoxSizer">
+                <object class="sizeritem">
+                  <object class="wxTextCtrl" name="ID_ACCT">