技术存档笔记咯

人生很南,也很靠北,所以才会想东想西...

Standard Search Order for Desktop Applications

If SafeDllSearchMode is enabled, the search order is as follows:

  1. The directory from which the application loaded.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

If SafeDllSearchMode is disabled, the search order is as follows:

  1. The directory from which the application loaded.
  2. The current directory.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
阅读全文 »

题目要求,用户输入二进制、十进制、十六进制中的任意一种,程序输出另外两种结果
有三种格式

  1. 12345….纯数字,10进制
  2. 0x12345….,以0x/0X开头,16进制
  3. 1010….b,以b/B结尾,2进制
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <stdio.h>
#include <string.h> //strlen函数需要

#define MaxChar 100 //最大字符

//平方运算
int PF(int k,int i){
int temp=1;
if (i==0)return 1;
while(i>0){
temp*=k;--i;
}
return temp;
}

//输入数据进制判断
int type_judge(char * str){
if ((str[strlen(str)-1]=='b')||(str[strlen(str)-1]=='B'))return 2;
else if (((str[0]=='0')&&(str[1]=='x'))||((str[0]=='0')&&(str[1]=='X')))return 16;
else return 10;
}

//二进制转整型
int b2D(char * str){
int temp=0;
for (int i = 0; i < strlen(str)-1; ++i) {
temp+=(str[i]-'0')*PF(2,strlen(str)-2-i);
}
return temp;
}

//十进制转整型
int d2D(char * str){
int temp=0;
for (int i = 0; i < strlen(str); ++i) {
temp+=(str[i]-'0')*PF(10,strlen(str)-1-i);
}
return temp;
}

//十六进制转整型
int x2D(char * str){
int temp=0;
for (int i = 2; i < strlen(str); ++i) {
if (str[i]<='9'&&str[i]>='0')temp+=(str[i]-'0')*PF(16,strlen(str)-1-i);
if (str[i]>='a'&&str[i]<='f')temp+=(str[i]-87)*PF(16,strlen(str)-1-i);
if (str[i]>='A'&&str[i]<='F')temp+=(str[i]-55)*PF(16,strlen(str)-1-i);
}
return temp;
}

//二进制格式输出
void binprintf(int data){
int i,k=0;
char bindata[MaxChar];
for(i=data;i>=2;){
bindata[k]=i%2+48;
i=(i-(i%2))/2;
k++;
if (i==1) {
bindata[k] = 49;
bindata[k+1] = '\0';
}
}
bindata[k+1] = '\0';
for (int j = 0; j < strlen(bindata); ++j) {
printf("%c",bindata[strlen(bindata)-1-j]);
}
printf("B");
}

void main() {
char userdata[MaxChar];
char bindata[MaxChar];
int inputtype;
int outputdata;
scanf("%s",userdata);
printf("您的输入是: ");
printf("%s\n",userdata);
printf("进制类型是: %d进制\n",type_judge(userdata));
printf("--------------------------------\n");
inputtype=type_judge(userdata);
if (inputtype==2){
outputdata=b2D(userdata);
printf("转化为十进制为: %d\n",outputdata);
printf("转化为十六进制为: 0x%x",outputdata);
}
if (inputtype==10){
outputdata=d2D(userdata);
printf("转化为十六进制为: 0x%x\n",outputdata);
printf("转化为二进制为: ");
binprintf(outputdata);
}
if (inputtype==16){
outputdata=x2D(userdata);
printf("转化为十进制为: %d\n",outputdata);
printf("转化为二进制为: ");
binprintf(outputdata);
}
}

0x01 安装docker

如果安装 Docker ce 需要 16.04 及以上版本,Docker 要求 Ubuntu 系统的内核版本高于 3.10,使用以下命令检查

1
uname -r
使用脚本安装 Docker
1
wget -qO- https://get.docker.com/ | sh
阅读全文 »

0x01在宿主机安装debootstrap及挂在磁盘

安装程序

1
sudo apt-get install debootstrap

使用cfdisk新建磁盘并标记为可启动

在分区上创建文件系统。例如,在 /dev/sda6 分区(以后的例子中,将把它作为 root 分区)建立一个 ext3 格式的文件系统:

阅读全文 »

1.打开 Fiddler,选择菜单栏 > Tools > Fiddler Options,在 HTTPS 选项中选择 Decrypt HTTPS traffic,并重新启动Fiddler。

img

2.在打开fiddler的情况下,打开itunes软件,并在itunes store中搜索你想要的app名称。在fiddler 中设置一个断点:

在fiddler左下角的黑框输入bpu MZBuy.woa 后敲回车,回车后看到右下角的提示就代表断点设置成功

img

阅读全文 »

MATLAB的界面颜色主题只有系统默认的一套白色背景的主题,如果想更改代码颜色、背景颜色或字体,不借助外部工具的话只能手动一个一个去试颜色搭配和字体搭配。

不过有需求就有解决需求的,这不,有大神制作了辅助工具:“MATLAB Schemer”

只需运行在Matlab终端输入schemer_import,即运行该m文件,即可从几个以.prf结尾的主题包中选择自己喜欢的主题。目前自带的主题有Cobalt、Monokai、Solarised Dark、Solarised Light等,当然也包括了Matlab的原版主题(用来恢复到原版)


Learn Regex


什么是正则表达式 ?

正则表达式是一种被用于从文本中检索符合某些特定模式的文本。

阅读全文 »

1. 安装依赖

1
sudo apt-get install automake  autotools-dev binutils bzip2 elfutils expat gawk gcc gcc-multilib g++-multilib lib32ncurses5 lib32z1 ksh less libmotif-dev lib32z1 libaio1 libaio-dev libc6-dev libc6-dev-i386 libc6-i386  libelf-dev libltdl-dev libxm4:i386 libuil4:i386 libmrm4:i386 libxm4 libuil4 libmrm4 libmotif-common libodbcinstq4-1 libodbcinstq4-1:i386 libpth-dev  libpthread-stubs0-dev libstdc++5 lsb lsb-core make openssh-server  mksh rlwrap rpm sysstat unixodbc unixodbc-dev unzip x11-utils zlibc

手动安装以下安装包:

lesstif2 暂时忽略

对于 libpthread-stubs0

阅读全文 »
0%