📄 addsub.cpp
字号:
// Created:12-14-98
// By Jeff Connelly
// ADD/SUB encryption
// Adds or subtracts the password with the data, developed by me
#include "stdafx.h"
#define EXPORTING
#include "comprlib.h"
#include "addsub.h"
// Encrypt using ADD/SUB
void EXPORT addsub_encode(char* pw)
{
register char c;
register int i = 0;
register int pwlen = strlen(pw);
while (!end_of_data())
{
c = read_byte();
// Note: 'c' might wrap around, this is not a bug
write_byte(c + pw[i % pwlen]);
++i;
}
}
// Decode using ADD/SUB
void EXPORT addsub_decode(char* pw)
{
register char c;
register int i = 0;
register int pwlen = strlen(pw);
while (!end_of_data())
{
c = read_byte();
write_byte(c - pw[i % pwlen]);
++i;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -