Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Flare On 2019 - task 9 - reloadered
#include <stdio.h>
#include <windows.h>
#include <peconv.h>
unsigned char encoded_val[0x34] = {
0x44, 0x29, 0x36, 0x0A, 0x29, 0x0F, 0x05, 0x1B, 0x65, 0x26, 0x10, 0x04,
0x2B, 0x68, 0x30, 0x2F, 0x00, 0x33, 0x2F, 0x05, 0x1A, 0x1F, 0x0F, 0x38,
0x02, 0x18, 0x42, 0x02, 0x33, 0x1A, 0x28, 0x04, 0x2A, 0x47, 0x3F, 0x04,
0x26, 0x64, 0x66, 0x4D, 0x10, 0x37, 0x3E, 0x28, 0x3E, 0x77, 0x1C, 0x3F,
0x7E, 0x36, 0x34, 0x2A
};
void preprocess_buf()
{
size_t eIndx;
size_t v33 = 0;
do
{
eIndx = 0;
do
{
if (!(v33 % 3) || !(v33 % 7))
encoded_val[eIndx] ^= v33;
++eIndx;
} while (eIndx < 0x34);
++v33;
} while (v33 < 0x539);
}
int main(int argc, char *argv[])
{
preprocess_buf();
FILE *fp;
fopen_s(&fp,"xor_buffer1.bin", "wb");
if (!fp) {
return -1;
}
fwrite(encoded_val, 1, sizeof(encoded_val), fp);
fclose(fp);
std::cout << "Dumped!\n";
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment