|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
|
2006-10-19 21:24 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 32 楼』:
提供关于BASE64编码的资料
使用 LLM 解释/回答一下
算出了base64转换后的编码之后,还要与相关的字符对应:
A ----------- 0
B ----------- 1
C ----------- 2
D ----------- 3
E ----------- 4
F ----------- 5
G ----------- 6
H ----------- 7
I ----------- 8
J ----------- 9
K ----------- 10
L ----------- 11
M ----------- 12
N ----------- 13
O ----------- 14
P ----------- 15
Q ----------- 16
R ----------- 17
S ----------- 18
T ----------- 19
U ----------- 20
V ----------- 21
W ----------- 22
X ----------- 23
Y ----------- 24
Z ----------- 25
a ----------- 26
b ----------- 27
c ----------- 28
d ----------- 29
e ----------- 30
f ----------- 31
g ----------- 32
h ----------- 33
i ----------- 34
j ----------- 35
k ----------- 36
l ----------- 37
m ----------- 38
n ----------- 39
o ----------- 40
p ----------- 41
q ----------- 42
r ----------- 43
s ----------- 44
t ----------- 45
u ----------- 46
v ----------- 47
w ----------- 48
x ----------- 49
y ----------- 50
z ----------- 51
0 ----------- 52
1 ----------- 53
2 ----------- 54
3 ----------- 55
4 ----------- 56
5 ----------- 57
6 ----------- 58
7 ----------- 59
8 ----------- 60
9 ----------- 61
+ ----------- 62
/ ----------- 63
After calculating the encoded result after base64 conversion, it is also necessary to correspond to the relevant characters:
A ----------- 0
B ----------- 1
C ----------- 2
D ----------- 3
E ----------- 4
F ----------- 5
G ----------- 6
H ----------- 7
I ----------- 8
J ----------- 9
K ----------- 10
L ----------- 11
M ----------- 12
N ----------- 13
O ----------- 14
P ----------- 15
Q ----------- 16
R ----------- 17
S ----------- 18
T ----------- 19
U ----------- 20
V ----------- 21
W ----------- 22
X ----------- 23
Y ----------- 24
Z ----------- 25
a ----------- 26
b ----------- 27
c ----------- 28
d ----------- 29
e ----------- 30
f ----------- 31
g ----------- 32
h ----------- 33
i ----------- 34
j ----------- 35
k ----------- 36
l ----------- 37
m ----------- 38
n ----------- 39
o ----------- 40
p ----------- 41
q ----------- 42
r ----------- 43
s ----------- 44
t ----------- 45
u ----------- 46
v ----------- 47
w ----------- 48
x ----------- 49
y ----------- 50
z ----------- 51
0 ----------- 52
1 ----------- 53
2 ----------- 54
3 ----------- 55
4 ----------- 56
5 ----------- 57
6 ----------- 58
7 ----------- 59
8 ----------- 60
9 ----------- 61
+ ----------- 62
/ ----------- 63
|
|
2006-10-20 00:18 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 33 楼』:
使用 LLM 解释/回答一下
各路高手亮本事的时候到了
base64编码用处还是蛮多的,比如说eml文件、批处理内嵌bin等
Last edited by electronixtar on 2006-10-20 at 01:08 ]
The time for all experts to show their skills has come.
Base64 encoding is quite useful, for example, in eml files, embedding bin in batch scripts, etc.
Last edited by electronixtar on 2006-10-20 at 01:08 ]
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-20 00:55 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-10-20 07:19 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 35 楼』:
使用 LLM 解释/回答一下
Originally posted by lxmxn at 2006-10-19 07:04:
多谢est兄写了关于位运算的帖子。
但是没有写出这位运算到底有哪些方面的应用,提不起大家对位运算的兴趣。大家只知遠...
这个主意好~:)
写些能让大家感兴趣又实用的位运算的例子来~:)
又聚人气又为开发打基础又增加了知识范围~:)
Originally posted by lxmxn at 2006-10-19 07:04:
Thanks to brother est for writing the post about bit operations.
But it didn't write out in which aspects these bit operations are applied, which can't arouse everyone's interest in bit operations. Everyone only knows vaguely...
This idea is good~ : )
Write some examples of bit operations that can arouse everyone's interest and are practical~ : )
It can both gather popularity, lay the foundation for development, and expand the knowledge scope~ : )
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-10-20 10:32 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 36 楼』:
使用 LLM 解释/回答一下
说实话,我是直接把其他语言里的位运算照搬过来改成 set /a 的。真的没什么写头。
To be honest, I just copied the bitwise operations from other languages and changed them to set /a. There's really nothing to write about.
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-20 21:57 |
|
|
smlz1213
初级用户
 
积分 25
发帖 19
注册 2007-3-7
状态 离线
|
|
2007-8-19 11:53 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 38 楼』:
使用 LLM 解释/回答一下
//////
写,我们期待着。
//////
We are looking forward to it.
|
|
2007-8-19 12:14 |
|
|
solomon9813
新手上路

积分 7
发帖 3
注册 2005-12-2
状态 离线
|
『第 39 楼』:
使用 LLM 解释/回答一下
hehe ,说道心里去了
Hehe, that really hits the nail on the head
|
|
2007-8-22 23:30 |
|
|
plp626
银牌会员
     钻石会员
积分 2278
发帖 1020
注册 2007-11-19
状态 离线
|
|
2008-3-2 23:33 |
|
|
pooronce
中级用户
  
积分 484
发帖 250
注册 2007-6-5
状态 离线
|
『第 41 楼』:
使用 LLM 解释/回答一下
楼主啊,你得先弄懂10进制2进制转化啥的啊
我举几个简单例子说明CMD下的位操作吧
set /a 13^<^<1
结果是26,因为13的二进制是1101,左移1位就相当于在二进制末尾加一个0,就是11010,也就是26了。
set /a 13^>^>1
结果是6,1101去掉末位1后,为110,也就是10进制6了
同样
set /a 13^<^<2为52
set /a 13^>^>2为3
再说按位与&
按位与的意思是转化成二进制后,位对应进行逻辑与操作的结果,与操作的算法是全1则1,否则0.
set /a 13^&11
结果是9
因为1101&1011,中间两位各有一0,只有首尾两位都是1,所以是1001了,也就是10进制9了
明白位操作是位对应操作了,就不用再赘述异和或了,只说下异及或的算法
异又称异或(对应的有同或),算法是相同的两数操作得0,不同得1,也就是0^1=1,1^1=0,0^0=0。
而或操作呢,是全0则0,也就是0|1=1,1|1=1, 0|0=0了
LZ, you need to first understand the conversion between decimal and binary, etc.
I'll give a few simple examples to explain bit operations under CMD:
set /a 13^<^<1
The result is 26, because the binary of 13 is 1101. Shifting left by 1 bit is equivalent to adding a 0 at the end of the binary, which is 11010, that is 26.
set /a 13^>^>1
The result is 6. Removing the last bit 1 from 1101 gives 110, which is 10 in decimal 6.
Similarly
set /a 13^<^<2 is 52
set /a 13^>^>2 is 3
Then talk about bitwise AND &
The meaning of bitwise AND is that after converting to binary, the bits are operated logically AND. The algorithm of AND operation is that it's 1 only if all are 1, otherwise 0.
set /a 13^&11
The result is 9
Because 1101&1011, there are 0s in the middle two bits. Only the first and last bits are both 1, so it's 1001, that is 10 in decimal 9.
After understanding that bit operations are bit-corresponding operations, there's no need to go into details about XOR and OR. Just say the algorithms of XOR and OR.
XOR is also called exclusive OR (there is also equivalence). The algorithm is that the result is 0 if two numbers are the same, and 1 if different, that is 0^1=1, 1^1=0, 0^0=0.
And the OR operation is that it's 0 only if all are 0, that is 0|1=1, 1|1=1, 0|0=0.
|
|
2008-3-3 10:53 |
|
|
jha334201553
初级用户
 
积分 20
发帖 18
注册 2008-12-7 来自 浙江永康
状态 离线
|
『第 42 楼』:
使用 LLM 解释/回答一下
@echo off
set b=0
for /l %%a in (1,1,100) do set /a b=b+%%a>>nul
echo 一加到一百等于:%b%
pause>nul
高手们:
set /a a=00000010 "<<" 2 是什么意思啊?
@echo off
set b=0
for /l %%a in (1,1,100) do set /a b=b+%%a>>nul
echo The sum from 1 to 100 is: %b%
pause>nul
Experts:
What does "set /a a=00000010 << 2" mean?
|
|
2009-4-23 12:42 |
|
|
Lying
新手上路

积分 19
发帖 20
注册 2010-5-9
状态 离线
|
|
2010-6-26 10:34 |
|