Skip to content

Instantly share code, notes, and snippets.

@guilt
Last active September 9, 2020 21:14
Show Gist options
  • Save guilt/fbb9238de5d660974b638bbb398156e2 to your computer and use it in GitHub Desktop.
Save guilt/fbb9238de5d660974b638bbb398156e2 to your computer and use it in GitHub Desktop.
FileZilla Password Decrypter
#include <stdio.h>
const char fzKey[] = "FILEZILLA1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int fzKeyLen = 45;
char *decrypt(const char *str, char *targetStr) {
int i = 0, oriLen = 0, pos;
if (!str || !targetStr) return 0;
*targetStr = 0;
for (; str[oriLen]; ++oriLen)
;
if (oriLen % 3) return 0;
oriLen /= 3;
pos = oriLen % fzKeyLen;
for (; i < oriLen; ++i) {
targetStr[i] = ((str[i * 3] - '0') * 100 + (str[(i * 3) + 1] - '0') * 10 +
(str[(i * 3) + 2] - '0')) ^
fzKey[(i + pos) % fzKeyLen];
}
targetStr[i] = 0;
return targetStr;
}
int main(int argc, char *argv[]) {
int i = 1;
if (argc <= 1) {
printf("Format is: fzDecrypt password1 password2 ...\n");
return -1;
}
for (; i < argc; ++i) {
char dbuff[256];
printf("%s -> %s\n", argv[i], decrypt(argv[i], dbuff));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment