Advertisement
cotaoctavian

Untitled

Jan 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. // cifsilit.cpp : Defines the entry point for the console application.
  2. //
  3. #include "stdafx.h"
  4.  
  5. struct MyStruct {
  6. int x;
  7. int z;
  8. char y;
  9. short t;
  10. };
  11.  
  12. int nr(MyStruct *, const char *) {
  13. _asm {
  14. mov ebx, [ebp + 8]
  15. mov edx, [ebp + 12]
  16. mov eax, 0
  17. mov esi, 0
  18. mov dword ptr[ebx], 0
  19. mov dword ptr[ebx + 4], 0
  20. mov byte ptr[ebx + 8], 0
  21. mov word ptr[ebx + 10], 0
  22. while1: mov cl, [edx + esi]
  23. cmp cl, '\0'
  24. je stopwhile
  25. cmp cl, 'x'
  26. je amgasitx
  27. cmp cl, 'y'
  28. je amgasity
  29. cmp cl, 'z'
  30. je amgasitz
  31. cmp cl, 't'
  32. je amgasitt
  33. cmp cl, '0'
  34. jl nexti
  35. cmp cl, '9'
  36. jg nexti
  37. inc eax
  38. nexti : inc esi
  39. jmp while1
  40. amgasitx : inc dword ptr[ebx]
  41. jmp nexti
  42. amgasity : inc byte ptr[ebx + 8]
  43. jmp nexti
  44. amgasitz : inc dword ptr[ebx + 4]
  45. jmp nexti
  46. amgasitt : inc word ptr[ebx + 10]
  47. jmp nexti
  48.  
  49. stopwhile :
  50. }
  51. }
  52.  
  53. int main() {
  54. MyStruct L;
  55. char *c = "xxxyyyyzt3213210";
  56. int alfa = nr(&L, c);
  57. printf("%d\n", alfa);
  58. printf("%d\n", L.y);
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement