Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. .686
  2. .model flat
  3.  
  4. extern _MessageBoxW@16 : PROC
  5. extern _ExitProcess@4 : PROC
  6.  
  7. public _main
  8.  
  9. .data
  10. tytul dw 't','y','t','u','l',0
  11. utf8_char db 11000100b,10000101b
  12. char_end db ?
  13. utf16_char dw ?
  14. if_long dw 1101100000000000b,1101110000000000b,0
  15. .code
  16.  
  17. _main PROC
  18.  
  19. mov ecx,char_end - utf8_char
  20.  
  21. cmp ecx,1
  22. je byte_1
  23.  
  24. cmp ecx,2
  25. je byte_2
  26.  
  27. cmp ecx,3
  28. je byte_3
  29.  
  30. cmp ecx,4
  31. je byte_4
  32.  
  33. byte_1:
  34.  
  35. jmp write
  36.  
  37. byte_2:
  38.  
  39. mov ebx,0
  40. mov edx,0
  41. mov dl, utf8_char[0];
  42. shl edx,27
  43. shr edx,21
  44. add ebx,edx
  45.  
  46. mov edx,0
  47. mov dl,utf8_char[1];
  48. shl edx,26
  49. shr edx,26
  50. add ebx,edx
  51.  
  52. mov utf16_char,bx
  53. mov utf16_char+2,0
  54.  
  55. jmp write
  56.  
  57. byte_3:
  58.  
  59. jmp write
  60.  
  61. byte_4:
  62.  
  63. jmp write
  64.  
  65. write:
  66.  
  67. push 0
  68. push offset tytul
  69. push offset utf16_char
  70. push 0
  71.  
  72. call _MessageBoxW@16
  73.  
  74. sub esp,16
  75.  
  76. push 0
  77. call _ExitProcess@4
  78.  
  79. _main ENDP
  80.  
  81. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement