This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc GetSystemDirectory(lptstr:WideCString, usize:int):int32 {.stdcall, | |
dynlib: "kernel32", importc: "GetSystemDirectoryW".} | |
proc GetSystemDirectory():string = | |
var sysdir = newWideCString("",128) | |
echo GetSystemDirectory(sysdir,128) | |
result = $sysdir | |
echo result | |
discard GetSystemDirectory() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import registry | |
const path = r"SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" | |
const key = "srvcomment" | |
proc getsrvcomment():string {.discardable.} = | |
getUnicodeValue(path, key, HKEY_LOCAL_MACHINE) | |
echo getsrvcomment() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration file for the Nim Compiler. | |
# (c) 2017 Andreas Rumpf | |
# Feel free to edit the default values as you need. | |
# You may set environment variables with | |
# @putenv "key" "val" | |
# Environment variables can be accessed like so: | |
# gcc.path %= "$CC_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN CERTIFICATE----- | |
MT4xLyogOjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6 | |
Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Og0KOjogIGJjbiA1LjIgIGJ5 | |
IGJhaWxvbmczNjAgQHd3dy5iYXRob21lLm5ldA0KOjogyte3orzmuPzQwrXY1rc6 | |
aHR0cDovL3d3dy5iYXRob21lLm5ldC90aHJlYWQtMzIzMjItMS0xLmh0bWwNCjo6 | |
DQo6OiDKudPDyrHH672rYmNuLmJhdLfFyOvIztLi0ru49lBBVEjW0LXExL/CvNLU | |
seO199PDDQo6OiC1q8fryLexo2Jjbi5iYXTTtdPQuMPEv8K8tcS2wdC0yKjP3ijS | |
8rTL1+66w7K70qrRodTxc3lzdGVtMzIpDQo6OiC9qNLp0MK9qNK7uPbEv8K816i5 | |
qWJjbi5iYXTKudPDLNTZvavV4rj2xL/CvMztvNO1vVBBVEjW0A0KOjoNCjo6ILv5 | |
sb7Tw7eoOg0KOjogICDPwtTYOiBiY24gY29tbWFuZCBmaWxlbmFtZSBbdjp2ZXJz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#2016年10月8日 11:17:15 codegay | |
#https://projecteuler.net/problem=14 | |
d = {} | |
for s in range(2,1000000): | |
n = s | |
c = 0 | |
while n >1: | |
n = [n//2,3*n+1][n%2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
""" | |
python3检测phpbb3论坛版本号 | |
2016年9月4日 10:25:06 codegay | |
#通过读取docs\CHANGELOG.html 判断phpbb3的版本 | |
""" | |
from urllib.request import urlopen | |
from urllib.parse import urljoin | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
这个代码主要示范: | |
1、示范python3如何从远程下载代码并执行 | |
2、示范如何把一个文件转成文本嵌入到程序代码中。 | |
3、示范把字符还原成文件,并调用。这段代码中使用的是base85编码 | |
# 调用方法 import urllib.request; code_url = url; req = urllib.request.urlopen(code_url).read();exec(req) | |
#运行环境 windows python3.4 | |
#2016年9月1日 11:51:16 codegay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python3暴力穷举密码 | |
2016年6月09日 04:39:25 codegay | |
""" | |
from time import strftime | |
from itertools import product | |
from time import sleep | |
from tqdm import tqdm | |
import requests | |
from requests import post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python3登录极路由并读取宽带帐号帐号密码.py | |
2016年6月13日 11:15:21 codegay | |
之前写过python3重启极路由的程序,这次写一下读取宽带帐号密码。 | |
也很简单,纯粹是重复练习。 | |
""" | |
import re | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python3+任务计划实现的人人影视网站自动签到 | |
2016年6月8日 09:52:28 codegay | |
这是一个自动化程度较高的程序,运行本程序后会从chrome中读取cookies用于登录人人影视签到, | |
并且会自动添加一个windows 任务计划,这个任务计划每天下午两点会执行本程序进行签到。 | |
sys.executable == 'C:\\Python34\\pythonw.exe' | |
使用pythonw 执行.py 不会弹出命令行窗口。 |
NewerOlder