1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main(int argc, char **argv)
  5. {
  6. int i = 0;
  7. int32_t eax, edx, edx_tmp;
  8. int16_t ax, dx;
  9. int8_t al, dl;
  10. if (argc != 2)
  11. {
  12. printf("Specify name!\n");
  13. exit(1);
  14. }
  15. for(i=0;i<strlen(argv[1]);i++)
  16. {
  17. // printf("%x\n",argv[1][i] & 0x61);
  18. al = argv[1][i];
  19. if (i == 0)
  20. {
  21. edx = 0x4de1;
  22. edx_tmp = edx;
  23. } else {
  24. edx = ax;
  25. edx_tmp = edx;
  26. }
  27. // printf("edx == %x\n",edx);
  28. edx = (edx >> 8) & 0xff;
  29. // printf("(edx >> 2) & 0xff == %x\n",edx);
  30. // exit(1);
  31. eax = al ^ edx;
  32. printf("%0.2X",eax);
  33. eax = eax + edx_tmp;
  34. eax = eax * 0xce6d;
  35. ax = eax;
  36. ax = ax + 0x58bf;
  37. }
  38. printf("\n");
  39. }
Comments powered by Disqus