当前位置: 编程技术>综合
本页文章导读:
▪Python3与Python2中print的用法改变与Class获取属性学习 Reference: http://planet.python.org/
python2中 print 'hello world'
python3中 print ('hello world')
获取属性的方法使用__dict__
import inspect
class Test:
""""""
#--------------------------.........
▪Jquery中LigerUi的弹出编辑框方法! 一、载入
<link href=/blog_article/"/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<script src=/blog_article/"/lib/jquery/jquery-1.5.2.min.js" type="text/javascript"><.........
▪VC++实现伪装进程路径 我们经常需要进行伪装进程路径,以保护相关重要进程。 #include <windows.h>
#include <stdio.h>
#include <tchar.h>
// 结构定义
typedef struct _PROCESS_BASIC_INFORMATION {
DWORD ExitStatus;
ULONG P.........
[1]Python3与Python2中print的用法改变与Class获取属性学习
来源: 互联网 发布时间: 2013-11-10
Reference: http://planet.python.org/
python2中 print 'hello world'
python3中 print ('hello world')
获取属性的方法使用__dict__
import inspect class Test: """""" #-------------------------------------------- def __init__(self): self.varOne = "" self.varTwo = "" self.varThree = "" #-------------------------------------------- def methodOne(self): """""" # print "You just called methodOne!" print ("You just called methodOne!") #---------------------------------------------------- if __name__ == "__main__": t = Test() variables = [i for i in t.__dict__ if not inspect.ismethod(i)] print (variables) print ('End of File')以下两种方法也可以,并且第二种不需要import inspect.
variables = [i for i in t.__dict__ if not callable(i)]
variables = t.__dict__.keys()
作者:qianguozheng 发表于2013-1-12 12:00:54 原文链接
阅读:52 评论:0 查看评论
[2]Jquery中LigerUi的弹出编辑框方法!
来源: 互联网 发布时间: 2013-11-10
一、载入
<link href=/blog_article/"/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" /> <script src=/blog_article/"/lib/jquery/jquery-1.5.2.min.js" type="text/javascript"></script> <script src=/blog_article/"/lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script> <script src=/blog_article/"/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script> <script src=/blog_article/"/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script> <link href=/blog_article/"/lib/css/common.css" rel="stylesheet" type="text/css" /> <script src=/blog_article/"/lib/js/common.js" type="text/javascript"></script> <script src=/blog_article/"/lib/js/LG.js" type="text/javascript"></script> <script src=/blog_article/"/lib/jquery-validation/jquery.validate.min.js" type="text/javascript"></script> <script src=/blog_article/"/lib/jquery-validation/jquery.metadata.js" type="text/javascript"></script> <script src=/blog_article/"/lib/jquery-validation/messages_cn.js" type="text/javascript"></script> <script src=/blog_article/"/lib/js/ligerui.expand.js" type="text/javascript"></script> <script src=/blog_article/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>二、Html
<div id="detail" style="display:none;"><form id="mainform" method="post"></form> </div> <%--弹出编辑框DIV--%>
三、
var mainform = $("#mainform"); mainform.ligerForm({ inputWidth: 150, fields: [ { name: "ProId1", type: "hidden" }, // 隐藏字段,为弹出选择编号保存值 { display: "仓库", name: "Daihao1", newline: true, labelWidth: 100, width: 150, space: 30, type: "text", validate: { required: true, digits: true} }, { display: "商品名称", name: "ProId", comboboxName: "ProId2", newline: false, labelWidth: 100, width: 150, space: 30, type: "select", option: {} }, // 弹出选择框 { display: "单位", name: "DegreeId", comboboxName: "DegreeId2", newline: false, labelWidth: 100, width: 150, space: 30, type: "select", options: { valueFieldID: "DegreeId1", treeLeafOnly: false, tree: { url: "../handle/se1.ashx?ajaxaction=Getgree", checkbox: false}} }, { display: "生产日期", name: "MadeDate1", newline: true, labelWidth: 100, width: 150, space: 30, type: "date", validate: { required: true} }, { display: "备注", name: "mark", newline: false, labelWidth: 100, width: 150, space: 30, type: "text", validate: { required: true, digits: true} } ], toJSON: JSON2.stringify }); $.metadata.setType("attr", "validate"); LG.validate(mainform, { debug: true }); $("#HandDate").val(currentdate); $("#BoNum").val("0"); $.ligerui.get("ProId2").set('onBeforeOpen', f_selectCoct) $.ligerui.get("Faory2").set('onBeforeOpen', f_selectFary_1) $.ligerui.get("Buyany2").set('onBeforeOpen', f_selectFary_2) $.ligerui.get("Froce2").set('onBeforeOpen', f_selectFroace) detailWin = $.ligerDialog.open({ target: $("#detail"), width: 595, height: 460, top: 80, title: t, //240 buttons: [ { text: '保存', onclick: function () { save(); } }, { text: '取消', onclick: function () { detailWin.hide(); } } ] });
作者:dxnn520 发表于2013-1-12 12:42:08 原文链接
阅读:0 评论:0 查看评论
[3]VC++实现伪装进程路径
来源: 互联网 发布时间: 2013-11-10
我们经常需要进行伪装进程路径,以保护相关重要进程。
#include <windows.h> #include <stdio.h> #include <tchar.h> // 结构定义 typedef struct _PROCESS_BASIC_INFORMATION { DWORD ExitStatus; ULONG PebBaseAddress; ULONG AffinityMask; LONG BasePriority; ULONG UniqueProcessId; ULONG InheritedFromUniqueProcessId; } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; // API声明 typedef LONG (__stdcall *PZWQUERYINFORMATIONPROCESS) ( HANDLE ProcessHandle, ULONG ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength); /********************************************************/ /* 函数:FxReplaceProcessPath 功能:伪装进程路径 参数:1-目标进程句柄 2-假路径的字符串(UNICODE) 返回值:TRUE-成功 FALSE-失败*/ BOOL FxReplaceProcessPath(HANDLE hProcess, TCHAR *szNewPath) { // 获取NTDLL.DLL的基址 HMODULE hModule = GetModuleHandle(TEXT("NTDLL.DLL")); if (hModule == NULL) return FALSE; // 获取ZwQueryInformationProcess函数的指针 PZWQUERYINFORMATIONPROCESS pZwQueryInformationProcess = (PZWQUERYINFORMATIONPROCESS)GetProcAddress(hModule, "ZwQueryInformationProcess"); // 查询进程基本信息(包含PEB地址) PROCESS_BASIC_INFORMATION pbi = {NULL}; if(pZwQueryInformationProcess(hProcess, 0, (LPVOID)&pbi, sizeof(pbi), NULL) < 0) return FALSE; // 获取PEB+0X10处的_RTL_USER_PROCESS_PARAMETERS结构指针 ULONG lpRUPP = NULL; ReadProcessMemory(hProcess, (LPVOID)(pbi.PebBaseAddress + 0x10), &lpRUPP, 4, NULL); // 修改进程路径 ULONG lpOldPath = NULL; ReadProcessMemory(hProcess, (LPVOID)(lpRUPP + 0x3C), &lpOldPath, 4, NULL); WriteProcessMemory(hProcess, (LPVOID)lpOldPath, szNewPath, MAX_PATH, NULL); // 修改命令行为空 ULONG lpOldCommand = NULL; ReadProcessMemory(hProcess, (LPVOID)(lpRUPP + 0x44), &lpOldCommand, 4, NULL); WriteProcessMemory(hProcess, (LPVOID)lpOldCommand, TEXT(""), MAX_PATH, NULL); return TRUE; } //入口函数 int main(int argc, char* argv[]) { FxReplaceProcessPath(GetCurrentProcess(), TEXT("C:\\WINDOWS\\system32\\svchost.exe")); printf("Goodbye World!\n"); system("pause"); return 0; }
作者:yincheng01 发表于2013-1-12 13:14:26 原文链接
阅读:0 评论:0 查看评论
最新技术文章: