spacepaste

  1.  
  2. pwndbg>
  3. Continuing.
  4. c = 85
  5. zrule_name = @����
  6. zkey = H�E���UH��ATSH��@H�}�dH�%(
  7. insert(@����0, "H�E���UH��ATSH��@H�}�dH�%(", 1, rule_4);
  8. Hardware watchpoint 1: trie_trie->rear->rule_name
  9. Old value = 0x555555555a76 "rule_"
  10. New value = 0x7fffffffdbd0 "@\334\377\377\377\177"
  11. Hardware watchpoint 2: trie_trie->rear->key
  12. Old value = 0x555555758830 "5"
  13. New value = 0x555555758890 "H\213E\370\311\303UH\211\345ATSH\203"...
  14. trie_store_asm3 (q=0x555555758690, rule_name=0x7fffffffdbd0 "@\334\377\377\377\177", rule_name_index=0, key=0x555555758890 "H\213E\370\311\303UH\211\345ATSH\203"..., index=1, rule_next=0x555555555a76 "rule_", rule_next_index=4) at trie.c:110
  15. 110 }
  16. LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA
  17. ────────────────────────────[ REGISTERS ]─────────────────────────────
  18. RAX 0x555555758690 —▸ 0x5555557586b0 —▸ 0x555555555a6d ◂— jae 0x555555555ae4 /* 'sub_root' */
  19. RBX 0x555555555a76 ◂— jb 0x555555555aed /* 'rule_' */
  20. RCX 0x5555557588c0 —▸ 0x7fffffffdbd0 —▸ 0x7fffffffdc40 —▸ 0x5555555559e0 (__libc_csu_init) ◂— push r15
  21. RDX 0x5555557588c0 —▸ 0x7fffffffdbd0 —▸ 0x7fffffffdc40 —▸ 0x5555555559e0 (__libc_csu_init) ◂— push r15
  22. RDI 0x5555557588f0 ◂— 0x0
  23. RSI 0x0
  24. R8 0x555555555a76 ◂— jb 0x555555555aed /* 'rule_' */
  25. R9 0x0
  26. R10 0x555555758010 ◂— 0x0
  27. R11 0x0
  28. R12 0x4
  29. R13 0x555555555a76 ◂— jb 0x555555555aed /* 'rule_' */
  30. R14 0x0
  31. R15 0x0
  32. RBP 0x7fffffffdb10 —▸ 0x7fffffffdb60 —▸ 0x7fffffffdbd0 —▸ 0x7fffffffdc40 —▸ 0x5555555559e0 (__libc_csu_init) ◂— ...
  33. RSP 0x7fffffffdad0 ◂— 0x0
  34. RIP 0x555555554b53 (trie_store_asm3+138) ◂— leave
  35. ──────────────────────────────[ DISASM ]──────────────────────────────
  36. ► 0x555555554b53 <trie_store_asm3+138> leave
  37. 0x555555554b54 <trie_store_asm3+139> ret
  38. 0x555555554d2f <trie_queue_add3+105> add rsp, 0x10
  39. 0x555555554d33 <trie_queue_add3+109> mov eax, 0
  40. 0x555555554d38 <trie_queue_add3+114> leave
  41. 0x555555554d39 <trie_queue_add3+115> ret
  42. 0x555555554fbb <parse_branch+420> add rsp, 0x10
  43. 0x555555554fbf <parse_branch+424> mov dword ptr [rbp - 0x34], 0
  44. 0x555555554fc6 <parse_branch+431> jmp parse_branch+987 <0x5555555551f2>
  45. 0x5555555551f2 <parse_branch+987> mov eax, dword ptr [rbp - 0x34]
  46. 0x5555555551f5 <parse_branch+990> movsxd rdx, eax
  47. ──────────────────────────[ SOURCE (CODE) ]───────────────────────────
  48. 105 }
  49. 106
  50. 107 // Add the new node at the end of queue and change rear
  51. 108 q->rear->next = temp;
  52. 109 q->rear = temp;
  53. ► 110 }
  54. 111
  55. 112 struct trie_QNode * trie_load_asm(struct trie_Queue **q)
  56. 113 {
  57. 114 // If queue is empty, return NULL.
  58. 115 if ((q) == NULL) return NULL;
  59. ──────────────────────────────[ STACK ]───────────────────────────────
  60. 00:0000│ rsp 0x7fffffffdad0 ◂— 0x0
  61. 01:0008│ 0x7fffffffdad8 —▸ 0x555555555a76 ◂— jb 0x555555555aed /* 'rule_' */
  62. 02:0010│ 0x7fffffffdae0 —▸ 0x555555758890 ◂— 0x4855c3c9f8458b48
  63. 03:0018│ 0x7fffffffdae8 ◂— 0x1
  64. 04:0020│ 0x7fffffffdaf0 —▸ 0x7fffffffdbd0 —▸ 0x7fffffffdc40 —▸ 0x5555555559e0 (__libc_csu_init) ◂— push r15
  65. 05:0028│ 0x7fffffffdaf8 —▸ 0x555555758690 —▸ 0x5555557586b0 —▸ 0x555555555a6d ◂— jae 0x555555555ae4 /* 'sub_root' */
  66. 06:0030│ 0x7fffffffdb00 ◂— 0xffffffffffffffb0
  67. 07:0038│ 0x7fffffffdb08 —▸ 0x5555557588c0 —▸ 0x7fffffffdbd0 —▸ 0x7fffffffdc40 —▸ 0x5555555559e0 (__libc_csu_init) ◂— ...
  68. ────────────────────────────[ BACKTRACE ]─────────────────────────────
  69. ► f 0 555555554b53 trie_store_asm3+138
  70. f 1 555555554d2f trie_queue_add3+105
  71. f 2 555555554fbb parse_branch+420
  72. f 3 5555555552ca main+162
  73. f 4 7ffff77feb97 __libc_start_main+231
  74. Breakpoint None
  75. Breakpoint None
  76. pwndbg> bt
  77. #0 trie_store_asm3 (q=0x555555758690, rule_name=0x7fffffffdbd0 "@\334\377\377\377\177", rule_name_index=0, key=0x555555758890 "H\213E\370\311\303UH\211\345ATSH\203"..., index=1, rule_next=0x555555555a76 "rule_", rule_next_index=4) at trie.c:110
  78. #1 0x0000555555554d2f in trie_queue_add3 (q=0x555555757038 <trie_trie>, rule_name=0x7fffffffdbd0 "@\334\377\377\377\177", rule_name_index=0, key=0x555555758890 "H\213E\370\311\303UH\211\345ATSH\203"..., index=1, rule_next=0x555555555a76 "rule_", rule_next_index=4) at trie.c:145
  79. #2 0x0000555555554fbb in parse_branch (co=0x555555758750 "85") at trie.c:210
  80. #3 0x00005555555552ca in main (argc=1, argv=0x7fffffffdd28) at trie.c:266
  81. #4 0x00007ffff77feb97 in __libc_start_main (main=0x555555555228 <main>, argc=1, argv=0x7fffffffdd28, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffdd18) at ../csu/libc-start.c:310
  82. #5 0x000055555555477a in _start ()
  83. pwndbg> l trie.c:210
  84. 205 else if (itterations == 2) rule_index_tmp++;
  85. 206 actual_index_tmp = actual_index+1;
  86. 207 printf("zrule_name = %s\n", zrule_name);
  87. 208 printf("zkey = %s\n", zkey);
  88. 209 printf("insert(%s%d, \"%s\", %d, %s%d);\n", zrule_name, zrule_name_index, zkey, zindex, trie_rule_prefix, rule_index_tmp-(itterations==1?0:1));
  89. 210 trie_queue_add3(&trie_trie, zrule_name, zrule_name_index, strdup(zkey), zindex, trie_rule_prefix, rule_index_tmp-(itterations==1?0:1));
  90. 211 for (int level = 0; co[level]; level++) {
  91. 212 char tmp[2];
  92. 213 tmp[0] = co[level];
  93. 214 tmp[1] = '\0';
  94. pwndbg> l --
  95. Function "--" not defined.
  96. pwndbg> l -
  97. 195 char * zkey;
  98. 196 int zindex;
  99. 197 if (itterations == 1) {
  100. 198 zrule_name = trie_trie->rear->rule_name;
  101. 199 zrule_name_index = trie_trie->rear->rule_name_index;
  102. 200 zkey = trie_trie->rear->key;
  103. 201 zindex = trie_trie->rear->index;
  104. 202 rule_index_tmp = rule_index+1;
  105. 203 final_rule = rule_index_tmp;
  106. 204 }
  107.