Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void seed_rng();
- void *gen_rand_str(unsigned int param1);
- // address: 0x80486a5
- int main(int argc, char *argv[], char *envp[]) {
- __size32 eax; // r24
- int eax_2; // r24{45}
- __size32 edx; // r26
- seed_rng();
- rand();
- edx = (unsigned int) (unsigned int)(eax * 0x66666667) >> 32;
- edx = (edx >> 2) - (eax >> 31);
- eax_2 = edx * 5 + edx * 5;
- puts("Generating the 2nd flag");
- eax = gen_rand_str(eax - eax_2 + 5);
- write(42, eax, eax - eax_2 + 6);
- puts("Generated! Can you guess it this time?");
- getline();
- if (eax - 1 == eax - eax_2 + 5) {
- memcmp();
- if (eax == 0) {
- puts("L33t $killz bro!");
- } else {
- puts("Nope");
- }
- } else {
- puts("Seriously?");
- }
- free(eax);
- free(0);
- return 0;
- }
- // address: 0x804860c
- void seed_rng() {
- gettimeofday();
- srand();
- return;
- }
- // address: 0x8048632
- void *gen_rand_str(unsigned int param1) {
- void *eax; // r24
- unsigned int eax_1; // r24
- void *eax_2; // r24{41}
- unsigned int local1; // m[esp - 16]
- malloc(param1 + 2);
- local1 = 0;
- while (local1 < param1) {
- rand();
- eax_2 = (eax_1) % 58 + 65;
- *(__size8*)(eax + local1) = (unsigned char) eax_2;
- local1++;
- }
- *(__size8*)(param1 + eax) = 10;
- *(__size8*)(eax + param1 + 1) = 0;
- return eax;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement