MCPcopy Create free account
hub / github.com/Yeuoly/0xUBypass / DecryptShell

Method DecryptShell

WindowsShellcodeInjector/RSA.cpp:289–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void std::DecryptShell(uint8_t *src, size_t srclen, uint8_t *dst, size_t dstlen, string private_key) {
290 BigUint d = 0, N = 0;
291 Printable2Number(private_key, d, N);
292
293 //convert char[] to BigUint[]
294 BigUint tmp_size = CEIL(srclen, (ENCRYPT_DST_SIZE / 8));
295 BigUint *tmp = new BigUint[tmp_size.get_ui()];
296
297 for (BigUint i = 0; i < tmp_size; i++) {
298 tmp[i.get_ui()] = 0;
299 U(src + (ENCRYPT_DST_SIZE / 8) * i.get_ui(), ENCRYPT_DST_SIZE, tmp[i.get_ui()]);
300 }
301
302 //encrypt
303 for (BigUint i = 0; i < tmp_size; i++) {
304 tmp[i.get_ui()] = rsa::Decrypt(tmp[i.get_ui()], d, N);
305 }
306
307 //convert BigUint[] to char[]
308 for (BigUint i = 0; i < tmp_size; i++) {
309 P(tmp[i.get_ui()], ENCRYPT_BLOCK_SIZE, dst + (ENCRYPT_BLOCK_SIZE / 8) * i.get_ui());
310 }
311
312 delete[tmp_size.get_ui()]tmp;
313}

Callers

nothing calls this directly

Calls 2

UFunction · 0.85
PFunction · 0.85

Tested by

no test coverage detected