Advertisement
Guest User

Untitled

a guest
May 29th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. void seed_rng();
  2. void *gen_rand_str(unsigned int param1);
  3.  
  4. // address: 0x80486a5
  5. int main(int argc, char *argv[], char *envp[]) {
  6. __size32 eax; // r24
  7. int eax_2; // r24{45}
  8. __size32 edx; // r26
  9.  
  10. seed_rng();
  11. rand();
  12. edx = (unsigned int) (unsigned int)(eax * 0x66666667) >> 32;
  13. edx = (edx >> 2) - (eax >> 31);
  14. eax_2 = edx * 5 + edx * 5;
  15. puts("Generating the 2nd flag");
  16. eax = gen_rand_str(eax - eax_2 + 5);
  17. write(42, eax, eax - eax_2 + 6);
  18. puts("Generated! Can you guess it this time?");
  19. getline();
  20. if (eax - 1 == eax - eax_2 + 5) {
  21. memcmp();
  22. if (eax == 0) {
  23. puts("L33t $killz bro!");
  24. } else {
  25. puts("Nope");
  26. }
  27. } else {
  28. puts("Seriously?");
  29. }
  30. free(eax);
  31. free(0);
  32. return 0;
  33. }
  34.  
  35. // address: 0x804860c
  36. void seed_rng() {
  37. gettimeofday();
  38. srand();
  39. return;
  40. }
  41.  
  42. // address: 0x8048632
  43. void *gen_rand_str(unsigned int param1) {
  44. void *eax; // r24
  45. unsigned int eax_1; // r24
  46. void *eax_2; // r24{41}
  47. unsigned int local1; // m[esp - 16]
  48.  
  49. malloc(param1 + 2);
  50. local1 = 0;
  51. while (local1 < param1) {
  52. rand();
  53. eax_2 = (eax_1) % 58 + 65;
  54. *(__size8*)(eax + local1) = (unsigned char) eax_2;
  55. local1++;
  56. }
  57. *(__size8*)(param1 + eax) = 10;
  58. *(__size8*)(eax + param1 + 1) = 0;
  59. return eax;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement