GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — linuxKernelRoot/su/root_key_helper.h at master · bcpx/linuxKernelRoot

Expand file tree

/

root_key_helper.h

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
46 lines (40 loc) · 918 Bytes
/

root_key_helper.h

Copy path

File metadata and controls

46 lines (40 loc) · 918 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#ifndef _SOCKET_ID_HELPER_H_
#define _SOCKET_ID_HELPER_H_
#include <unistd.h>
#include <string.h>
#include <sstream>
#include "base64.h"
static inline unsigned int get_tmp_root_key(const char* myself_path) {
//1.取路径尾巴
unsigned int key = 0;
char *pstart = strrchr((char*)myself_path, '_');
if (!pstart) {
return 0;
}
pstart ++;
size_t copy_len;
char *pend = strstr(pstart, "/");
if (pend) {
copy_len = pend - pstart;
}
else {
copy_len = strlen(pstart);
}
char buf[256] = { 0 };
memcpy(buf, pstart, copy_len);
buf[sizeof(buf) - 1] = '\0';
//2.base64解密
std::string base64 = base64_decode(buf);
//3.截止A字母
size_t n = base64.find("A");
if (n == -1) {
return 0;
}
base64 = base64.substr(0, n);
//4.取出KEY
std::stringstream sstrConvert;
sstrConvert << base64;
sstrConvert >> key;
return key;
}
#endif /* _SOCKET_ID_HELPER_H_ */
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.