Advertisement
Rapptz

Untitled

Jan 21st, 2013
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Sample code used:
  2.  
  3. #include <algorithm>
  4. #include <cstring>
  5.  
  6. int main() {
  7.   char array[80];
  8.   memset(array,'r',80);
  9. }
  10.  
  11. #include <algorithm>
  12. #include <cstring>
  13.  
  14. int main() {
  15.   char array[80];
  16.   std::fill(array,array+80,'r');
  17. }
  18.  
  19. //std::fill
  20. main:
  21.     movabs  rdx, 8246779703540740722
  22.     sub rsp, 104
  23.     movabs  rcx, 8246779703540740722
  24.     mov rax, QWORD PTR fs:40
  25.     mov QWORD PTR [rsp+88], rax
  26.     xor eax, eax
  27.     mov QWORD PTR [rsp], rdx
  28.     movabs  rdx, 8246779703540740722
  29.     movabs  rsi, 8246779703540740722
  30.     mov QWORD PTR [rsp+64], rdx
  31.     movabs  rdi, 8246779703540740722
  32.     movabs  r8, 8246779703540740722
  33.     mov QWORD PTR [rsp+8], rcx
  34.     movabs  r9, 8246779703540740722
  35.     movabs  r10, 8246779703540740722
  36.     mov QWORD PTR [rsp+16], rsi
  37.     movabs  r11, 8246779703540740722
  38.     movabs  rcx, 8246779703540740722
  39.     mov QWORD PTR [rsp+24], rdi
  40.     mov QWORD PTR [rsp+32], r8
  41.     mov rdx, QWORD PTR [rsp+88]
  42.     xor rdx, QWORD PTR fs:40
  43.     mov QWORD PTR [rsp+40], r9
  44.     mov QWORD PTR [rsp+48], r10
  45.     mov QWORD PTR [rsp+56], r11
  46.     mov QWORD PTR [rsp+72], rcx
  47.     jne .L5
  48.     add rsp, 104
  49.     ret
  50. .L5:
  51.     call    __stack_chk_fail
  52.  
  53. //memset
  54. main:
  55.     movabs  rdx, 8246779703540740722
  56.     sub rsp, 104
  57.     movabs  rcx, 8246779703540740722
  58.     mov rax, QWORD PTR fs:40
  59.     mov QWORD PTR [rsp+88], rax
  60.     xor eax, eax
  61.     mov QWORD PTR [rsp], rdx
  62.     movabs  rdx, 8246779703540740722
  63.     movabs  rsi, 8246779703540740722
  64.     mov QWORD PTR [rsp+64], rdx
  65.     movabs  rdi, 8246779703540740722
  66.     movabs  r8, 8246779703540740722
  67.     mov QWORD PTR [rsp+8], rcx
  68.     movabs  r9, 8246779703540740722
  69.     movabs  r10, 8246779703540740722
  70.     mov QWORD PTR [rsp+16], rsi
  71.     movabs  r11, 8246779703540740722
  72.     movabs  rcx, 8246779703540740722
  73.     mov QWORD PTR [rsp+24], rdi
  74.     mov QWORD PTR [rsp+32], r8
  75.     mov rdx, QWORD PTR [rsp+88]
  76.     xor rdx, QWORD PTR fs:40
  77.     mov QWORD PTR [rsp+40], r9
  78.     mov QWORD PTR [rsp+48], r10
  79.     mov QWORD PTR [rsp+56], r11
  80.     mov QWORD PTR [rsp+72], rcx
  81.     jne .L5
  82.     add rsp, 104
  83.     ret
  84. .L5:
  85.     call    __stack_chk_fail
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement