function_name
stringlengths
3
34
binary_name
stringlengths
64
64
author_name
stringlengths
2
36
project_name
stringlengths
2
48
opt
stringclasses
1 value
src
stringlengths
82
18.8k
dbg
stringclasses
1 value
codeart
stringlengths
461
87.8k
lmpa
stringlengths
492
9.74k
retrieved_index
sequencelengths
2
2
hsort
dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b
lavabit
pahoehoe
NA
void hsort(void *base, size_t n, size_t size, hsort_cmp_t *cmp) { register char *p, *q, *base0, *hi; register unsigned int gap, g; if (n < 2) return; base0 = (char *)base - size; /* set up address of h[0] */ /* * The gap is the distance, in bytes, between h[0] and h[i], * for some i. It is also the distance between h[i] and h[2*i]; * that is, the distance between a node and its left child. * The initial node of interest is h[n/2] (the rightmost * interior node), so gap is set accordingly. The following is * the only multiplication needed. */ gap = (n >> 1) * size; /* initial gap is n/2*size */ hi = base0 + gap + gap; /* calculate address of h[n] */ if (n & 1) hi += size; /* watch out for odd arrays */ /* * Phase 1: Construct heap from random data. * * For i = n/2 downto 2, ensure h[i] is greater than its * children h[2*i] and h[2*i+1]. By decreasing 'gap' at each * iteration, we move down the heap towards h[2]. The final step * of making h[1] the maximum value is done in the next phase. */ for ( ; gap != size; gap -= size) { /* fixheap(base0, size, cmp, gap, hi) */ for (p = base0 + (g = gap); (q = p + g) <= hi; p = q) { g += g; /* double gap for next level */ /* * Find greater of left and right children. */ if (q != hi && (*cmp)(q + size, q) > 0) { q += size; /* choose right child */ g += size; /* follow right subtree */ } /* * Compare with parent. */ if ((*cmp)(p, q) >= 0) break; /* order is correct */ swap(p, q, size); /* swap parent and child */ } } /* * Phase 2: Each iteration makes the first item in the * array the maximum, then swaps it with the last item, which * is its correct position. The size of the heap is decreased * each iteration. The gap is always "size", as we are interested * in the heap starting at h[1]. */ for ( ; hi != base; hi -= size) { /* fixheap(base0, size, cmp, gap (== size), hi) */ p = (char *)base; /* == base0 + size */ for (g = size; (q = p + g) <= hi; p = q) { g += g; if (q != hi && (*cmp)(q + size, q) > 0) { q += size; g += size; } if ((*cmp)(p, q) >= 0) break; swap(p, q, size); } swap((char *)base, hi, size); /* move largest item to end */ } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_423920", "function_addr": 4340000, "binary_name": "dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r15"], [3, "push r14"], [4, "push r13"], [5, "push r12"], [6, "push rbx"], [7, "sub rsp, 38h"], [8, "mov [rbp+var_38], rdi"], [9, "mov [rbp+var_40], rsi"], [10, "mov [rbp+var_48], rdx"], [11, "mov [rbp+var_50], rcx"], [12, "cmp [rbp+var_40], 1"], [13, "jbe loc_423AC6"], [14, "mov rax, [rbp+var_48]"], [15, "neg rax"], [16, "mov rdx, rax"], [17, "mov rax, [rbp+var_38]"], [18, "lea rcx, [rdx+rax]"], [19, "mov [rbp+var_58], rcx"], [20, "mov rax, [rbp+var_40]"], [21, "shr rax, 1"], [22, "mov edx, eax"], [23, "mov rax, [rbp+var_48]"], [24, "imul edx, eax"], [25, "mov r15d, edx"], [26, "mov eax, r15d"], [27, "add rax, rax"], [28, "lea r12, [rcx+rax]"], [29, "mov rax, [rbp+var_40]"], [30, "and eax, 1"], [31, "test rax, rax"], [32, "jz loc_423A18"], [33, "mov rax, [rbp+var_48]"], [34, "add rax, r12"], [35, "mov r12, rax"], [36, "jmp short loc_423A18"], [37, "mov r14d, r15d"], [38, "mov eax, r14d"], [39, "mov rcx, [rbp+var_58]"], [40, "lea r13, [rcx+rax]"], [41, "jmp short loc_423A01"], [42, "add r14d, r14d"], [43, "cmp rbx, r12"], [44, "jz short loc_4239DC"], [45, "mov rax, [rbp+var_48]"], [46, "lea rdx, [rbx+rax]"], [47, "mov rax, [rbp+var_50]"], [48, "mov rsi, rbx"], [49, "mov rdi, rdx"], [50, "call rax"], [51, "test eax, eax"], [52, "jle short loc_4239DC"], [53, "mov rax, [rbp+var_48]"], [54, "add rax, rbx"], [55, "mov rbx, rax"], [56, "mov rax, [rbp+var_48]"], [57, "add r14d, eax"], [58, "mov rax, [rbp+var_50]"], [59, "mov rsi, rbx"], [60, "mov rdi, r13"], [61, "call rax"], [62, "test eax, eax"], [63, "jns short loc_423A10"], [64, "mov rax, [rbp+var_48]"], [65, "mov rdx, rax"], [66, "mov rsi, rbx"], [67, "mov rdi, r13"], [68, "call sub_4238E6"], [69, "mov r13, rbx"], [70, "mov eax, r14d"], [71, "lea rbx, [r13+rax+0]"], [72, "cmp rbx, r12"], [73, "jbe short loc_4239AB"], [74, "jmp short loc_423A11"], [75, "nop"], [76, "mov rax, [rbp+var_48]"], [77, "sub r15d, eax"], [78, "mov eax, r15d"], [79, "cmp [rbp+var_48], rax"], [80, "jnz loc_42399B"], [81, "jmp loc_423ABA"], [82, "mov r13, [rbp+var_38]"], [83, "mov rax, [rbp+var_48]"], [84, "mov r14d, eax"], [85, "jmp short loc_423A8D"], [86, "add r14d, r14d"], [87, "cmp rbx, r12"], [88, "jz short loc_423A68"], [89, "mov rax, [rbp+var_48]"], [90, "lea rdx, [rbx+rax]"], [91, "mov rax, [rbp+var_50]"], [92, "mov rsi, rbx"], [93, "mov rdi, rdx"], [94, "call rax"], [95, "test eax, eax"], [96, "jle short loc_423A68"], [97, "mov rax, [rbp+var_48]"], [98, "add rax, rbx"], [99, "mov rbx, rax"], [100, "mov rax, [rbp+var_48]"], [101, "add r14d, eax"], [102, "mov rax, [rbp+var_50]"], [103, "mov rsi, rbx"], [104, "mov rdi, r13"], [105, "call rax"], [106, "test eax, eax"], [107, "jns short loc_423A9C"], [108, "mov rax, [rbp+var_48]"], [109, "mov rdx, rax"], [110, "mov rsi, rbx"], [111, "mov rdi, r13"], [112, "call sub_4238E6"], [113, "mov r13, rbx"], [114, "mov eax, r14d"], [115, "lea rbx, [r13+rax+0]"], [116, "cmp rbx, r12"], [117, "jbe short loc_423A37"], [118, "jmp short loc_423A9D"], [119, "nop"], [120, "mov rdx, [rbp+var_48]"], [121, "mov rax, [rbp+var_38]"], [122, "mov rsi, r12"], [123, "mov rdi, rax"], [124, "call sub_4238E6"], [125, "mov rax, [rbp+var_48]"], [126, "neg rax"], [127, "add r12, rax"], [128, "cmp r12, [rbp+var_38]"], [129, "jnz loc_423A2A"], [130, "jmp short loc_423AC7"], [131, "nop"], [132, "add rsp, 38h"], [133, "pop rbx"], [134, "pop r12"], [135, "pop r13"], [136, "pop r14"], [137, "pop r15"], [138, "pop rbp"], [139, "retn"]], "data_dep": [[12, 9], [13, 12], [14, 10], [15, 14], [16, 15], [17, 8], [18, 17], [19, 18], [20, 9], [21, 20], [22, 21], [23, 10], [24, 23], [24, 22], [25, 24], [26, 25], [27, 26], [28, 27], [29, 9], [30, 29], [31, 30], [32, 31], [33, 10], [34, 28], [34, 33], [35, 34], [37, 25], [37, 77], [38, 37], [39, 19], [40, 38], [40, 40], [40, 69], [42, 57], [42, 42], [42, 37], [43, 71], [43, 35], [43, 28], [44, 43], [45, 10], [46, 45], [46, 65], [46, 24], [46, 46], [47, 11], [48, 71], [49, 46], [50, 47], [51, 50], [52, 51], [53, 10], [54, 53], [54, 71], [55, 54], [56, 10], [57, 56], [57, 42], [58, 11], [59, 55], [59, 71], [60, 69], [60, 40], [61, 58], [62, 61], [63, 62], [64, 10], [65, 64], [66, 71], [66, 55], [67, 40], [67, 69], [69, 71], [69, 55], [70, 57], [70, 42], [70, 37], [71, 71], [71, 55], [71, 70], [72, 35], [72, 28], [72, 71], [73, 72], [76, 10], [77, 76], [77, 25], [77, 77], [78, 77], [78, 25], [79, 10], [79, 78], [80, 79], [82, 8], [83, 10], [84, 83], [86, 101], [86, 84], [86, 86], [87, 127], [87, 115], [87, 35], [87, 28], [88, 87], [89, 10], [90, 24], [90, 46], [90, 89], [90, 109], [90, 120], [90, 65], [91, 11], [92, 115], [93, 90], [94, 91], [95, 94], [96, 95], [97, 10], [98, 97], [98, 115], [99, 98], [100, 10], [101, 86], [101, 100], [102, 11], [103, 115], [103, 99], [104, 82], [104, 113], [105, 102], [106, 105], [107, 106], [108, 10], [109, 108], [110, 115], [110, 99], [111, 82], [111, 113], [113, 99], [113, 115], [114, 101], [114, 84], [114, 86], [115, 71], [115, 55], [115, 114], [115, 115], [115, 99], [116, 127], [116, 115], [116, 35], [116, 28], [117, 116], [120, 10], [121, 8], [122, 35], [122, 28], [122, 127], [123, 121], [125, 10], [126, 125], [127, 127], [127, 35], [127, 126], [127, 28], [128, 35], [128, 28], [128, 8], [128, 127], [129, 128], [132, 7], [133, 6], [134, 5], [135, 4], [136, 3], [137, 2], [138, 0], [139, 126], [139, 78]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b_dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.jsonl.gz", "strip_func_name": "sub_423920", "query": "\n\n\nvoid __fastcall sub_423920(char *a1, unsigned __int64 a2, __int64 a3, int (__fastcall *a4)(char *, char *))\n{\nunsigned int v4; // er15\nchar *v5; // r12\nunsigned int v6; // er14\nchar *i; // r13\nchar *v8; // rbx\nchar *v9; // r13\nint v10; // er14\nchar *v11; // rbx\n\nif ( a2 > 1 )\n{\nv4 = a3 * (a2 >> 1);\nv5 = &a1[2 * v4 - a3];\nif ( (a2 & 1) != 0 )\nv5 = &a1[2 * (unsigned int)a3 * (unsigned int)(a2 >> 1)];\nwhile ( a3 != v4 )\n{\nv6 = v4;\nfor ( i = &a1[v4 - a3]; ; i = v8 )\n{\nv8 = &i[v6];\nif ( v8 > v5 )\nbreak;\nv6 *= 2;\nif ( v8 != v5 && a4(&v8[a3], v8) > 0 )\n{\nv8 += a3;\nv6 += a3;\n}\nif ( a4(i, v8) >= 0 )\nbreak;\nsub_4238E6(i, v8, a3);\n}\nv4 -= a3;\n}\nwhile ( v5 != a1 )\n{\nv9 = a1;\nv10 = a3;\nwhile ( 1 )\n{\nv11 = &v9[v10];\nif ( v11 > v5 )\nbreak;\nv10 *= 2;\nif ( v11 != v5 && a4(&v11[a3], v11) > 0 )\n{\nv11 += a3;\nv10 += a3;\n}\nif ( a4(v9, v11) >= 0 )\nbreak;\nsub_4238E6(v9, v11, a3);\nv9 = v11;\n}\nsub_4238E6(a1, v5, a3);\nv5 -= a3;\n}\n}\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_423920,sub_4238E6,]", "hints": "[]", "response": "{'a3': 'size', 'a4': 'cmp', 'a1': 'base', 'a2': 'n', 'sub_423920': 'hsort', 'sub_4238E6': 'swap'}"}
[ [ 0.7695409059524536, 0.7328778505325317, 0.7212467193603516, 0.7166948318481445, 0.7110140323638916, 0.6900853514671326, 0.6882831454277039, 0.6878212690353394, 0.6870876550674438, 0.6858653426170349, 0.6833648085594177, 0.6806107759475708, 0.6794067621231079, 0.673912525177002, 0.6726387143135071, 0.6709787845611572, 0.6688427329063416, 0.6651244163513184, 0.6637542843818665, 0.6623186469078064 ], [ 14807, 3764, 92020, 101461, 184336, 39116, 242026, 42984, 49998, 21636, 209787, 233099, 100003, 182485, 113981, 159170, 138235, 129825, 218562, 241629 ] ]
unzReadCurrentFile
3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f
yquake2
yquake2
NA
extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len) { int err=UNZ_OK; uInt iRead = 0; unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file==NULL) return UNZ_PARAMERROR; s=(unz64_s*)file; pfile_in_zip_read_info=s->pfile_in_zip_read; if (pfile_in_zip_read_info==NULL) return UNZ_PARAMERROR; if (pfile_in_zip_read_info->read_buffer == NULL) return UNZ_END_OF_LIST_OF_FILE; if (len==0) return 0; pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; pfile_in_zip_read_info->stream.avail_out = (uInt)len; if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && (!(pfile_in_zip_read_info->raw))) pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_uncompressed; if ((len>pfile_in_zip_read_info->rest_read_compressed+ pfile_in_zip_read_info->stream.avail_in) && (pfile_in_zip_read_info->raw)) pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_compressed+ pfile_in_zip_read_info->stream.avail_in; while (pfile_in_zip_read_info->stream.avail_out>0) { if ((pfile_in_zip_read_info->stream.avail_in==0) && (pfile_in_zip_read_info->rest_read_compressed>0)) { uInt uReadThis = UNZ_BUFSIZE; if (pfile_in_zip_read_info->rest_read_compressed<uReadThis) uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed; if (uReadThis == 0) return UNZ_EOF; if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, pfile_in_zip_read_info->pos_in_zipfile + pfile_in_zip_read_info->byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET)!=0) return UNZ_ERRNO; if (ZREAD64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, pfile_in_zip_read_info->read_buffer, uReadThis)!=uReadThis) return UNZ_ERRNO; # ifndef NOUNCRYPT if(s->encrypted) { uInt i; for(i=0;i<uReadThis;i++) pfile_in_zip_read_info->read_buffer[i] = zdecode(s->keys,s->pcrc_32_tab, pfile_in_zip_read_info->read_buffer[i]); } # endif pfile_in_zip_read_info->pos_in_zipfile += uReadThis; pfile_in_zip_read_info->rest_read_compressed-=uReadThis; pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->read_buffer; pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; } if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) { uInt uDoCopy,i ; if ((pfile_in_zip_read_info->stream.avail_in == 0) && (pfile_in_zip_read_info->rest_read_compressed == 0)) return (iRead==0) ? UNZ_EOF : (int)iRead; if (pfile_in_zip_read_info->stream.avail_out < pfile_in_zip_read_info->stream.avail_in) uDoCopy = pfile_in_zip_read_info->stream.avail_out ; else uDoCopy = pfile_in_zip_read_info->stream.avail_in ; for (i=0;i<uDoCopy;i++) *(pfile_in_zip_read_info->stream.next_out+i) = *(pfile_in_zip_read_info->stream.next_in+i); pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, pfile_in_zip_read_info->stream.next_out, uDoCopy); pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; pfile_in_zip_read_info->stream.avail_in -= uDoCopy; pfile_in_zip_read_info->stream.avail_out -= uDoCopy; pfile_in_zip_read_info->stream.next_out += uDoCopy; pfile_in_zip_read_info->stream.next_in += uDoCopy; pfile_in_zip_read_info->stream.total_out += uDoCopy; iRead += uDoCopy; } else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) { #ifdef HAVE_BZIP2 uLong uTotalOutBefore,uTotalOutAfter; const Bytef *bufBefore; uLong uOutThis; pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; pfile_in_zip_read_info->bstream.total_in_hi32 = 0; pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; pfile_in_zip_read_info->bstream.total_out_hi32 = 0; uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; uOutThis = uTotalOutAfter-uTotalOutBefore; pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; if (err==BZ_STREAM_END) return (iRead==0) ? UNZ_EOF : iRead; if (err!=BZ_OK) break; #endif } // end Z_BZIP2ED else { ZPOS64_T uTotalOutBefore,uTotalOutAfter; const Bytef *bufBefore; ZPOS64_T uOutThis; int flush=Z_SYNC_FLUSH; uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; bufBefore = pfile_in_zip_read_info->stream.next_out; /* if ((pfile_in_zip_read_info->rest_read_uncompressed == pfile_in_zip_read_info->stream.avail_out) && (pfile_in_zip_read_info->rest_read_compressed == 0)) flush = Z_FINISH; */ err=inflate(&pfile_in_zip_read_info->stream,flush); if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) err = Z_DATA_ERROR; uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; /* Detect overflow, because z_stream.total_out is uLong (32 bits) */ if (uTotalOutAfter<uTotalOutBefore) uTotalOutAfter += 1LL << 32; /* Add maximum value of uLong + 1 */ uOutThis = uTotalOutAfter-uTotalOutBefore; pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); if (err==Z_STREAM_END) return (iRead==0) ? UNZ_EOF : (int)iRead; if (err!=Z_OK) break; } } if (err==Z_OK) return (int)iRead; return err; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_49D12F", "function_addr": 4837679, "binary_name": "3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.elf_extract.pkl\n"}, "code": [[0, "sub rsp, 78h"], [1, "mov [rsp+78h+var_60], rdi"], [2, "mov [rsp+78h+var_68], rsi"], [3, "mov [rsp+78h+var_6C], edx"], [4, "mov [rsp+78h+var_C], 0"], [5, "mov [rsp+78h+var_10], 0"], [6, "cmp [rsp+78h+var_60], 0"], [7, "jnz short loc_49D163"], [8, "mov eax, 0FFFFFF9Ah"], [9, "jmp loc_49D6B2"], [10, "mov rax, [rsp+78h+var_60]"], [11, "mov [rsp+78h+var_28], rax"], [12, "mov rax, [rsp+78h+var_28]"], [13, "mov rax, [rax+140h]"], [14, "mov [rsp+78h+var_30], rax"], [15, "cmp [rsp+78h+var_30], 0"], [16, "jnz short loc_49D190"], [17, "mov eax, 0FFFFFF9Ah"], [18, "jmp loc_49D6B2"], [19, "mov rax, [rsp+78h+var_30]"], [20, "mov rax, [rax]"], [21, "test rax, rax"], [22, "jnz short loc_49D1A7"], [23, "mov eax, 0FFFFFF9Ch"], [24, "jmp loc_49D6B2"], [25, "cmp [rsp+78h+var_6C], 0"], [26, "jnz short loc_49D1B8"], [27, "mov eax, 0"], [28, "jmp loc_49D6B2"], [29, "mov rax, [rsp+78h+var_30]"], [30, "mov rdx, [rsp+78h+var_68]"], [31, "mov [rax+20h], rdx"], [32, "mov rax, [rsp+78h+var_30]"], [33, "mov edx, [rsp+78h+var_6C]"], [34, "mov [rax+28h], edx"], [35, "mov edx, [rsp+78h+var_6C]"], [36, "mov rax, [rsp+78h+var_30]"], [37, "mov rax, [rax+0C0h]"], [38, "cmp rdx, rax"], [39, "jbe short loc_49D20C"], [40, "mov rax, [rsp+78h+var_30]"], [41, "mov eax, [rax+138h]"], [42, "test eax, eax"], [43, "jnz short loc_49D20C"], [44, "mov rax, [rsp+78h+var_30]"], [45, "mov rax, [rax+0C0h]"], [46, "mov edx, eax"], [47, "mov rax, [rsp+78h+var_30]"], [48, "mov [rax+28h], edx"], [49, "mov edx, [rsp+78h+var_6C]"], [50, "mov rax, [rsp+78h+var_30]"], [51, "mov rcx, [rax+0B8h]"], [52, "mov rax, [rsp+78h+var_30]"], [53, "mov eax, [rax+10h]"], [54, "mov eax, eax"], [55, "add rax, rcx"], [56, "cmp rdx, rax"], [57, "jbe loc_49D68E"], [58, "mov rax, [rsp+78h+var_30]"], [59, "mov eax, [rax+138h]"], [60, "test eax, eax"], [61, "jz loc_49D68E"], [62, "mov rax, [rsp+78h+var_30]"], [63, "mov rax, [rax+0B8h]"], [64, "mov edx, eax"], [65, "mov rax, [rsp+78h+var_30]"], [66, "mov eax, [rax+10h]"], [67, "add edx, eax"], [68, "mov rax, [rsp+78h+var_30]"], [69, "mov [rax+28h], edx"], [70, "jmp loc_49D68E"], [71, "mov rax, [rsp+78h+var_30]"], [72, "mov eax, [rax+10h]"], [73, "test eax, eax"], [74, "jnz loc_49D3BA"], [75, "mov rax, [rsp+78h+var_30]"], [76, "mov rax, [rax+0B8h]"], [77, "test rax, rax"], [78, "jz loc_49D3BA"], [79, "mov [rsp+78h+var_14], 4000h"], [80, "mov rax, [rsp+78h+var_30]"], [81, "mov rdx, [rax+0B8h]"], [82, "mov eax, [rsp+78h+var_14]"], [83, "cmp rdx, rax"], [84, "jnb short loc_49D2BC"], [85, "mov rax, [rsp+78h+var_30]"], [86, "mov rax, [rax+0B8h]"], [87, "mov [rsp+78h+var_14], eax"], [88, "cmp [rsp+78h+var_14], 0"], [89, "jnz short loc_49D2CD"], [90, "mov eax, 0"], [91, "jmp loc_49D6B2"], [92, "mov rax, [rsp+78h+var_30]"], [93, "mov rdx, [rax+78h]"], [94, "mov rax, [rsp+78h+var_30]"], [95, "mov rax, [rax+130h]"], [96, "add rdx, rax"], [97, "mov rax, [rsp+78h+var_30]"], [98, "mov rax, [rax+120h]"], [99, "mov rcx, [rsp+78h+var_30]"], [100, "lea rdi, [rcx+0C8h]"], [101, "mov ecx, 0"], [102, "mov rsi, rax"], [103, "call sub_47AF9F"], [104, "test rax, rax"], [105, "jz short loc_49D319"], [106, "mov eax, 0FFFFFFFFh"], [107, "jmp loc_49D6B2"], [108, "mov rax, [rsp+78h+var_30]"], [109, "mov r8, [rax+0D0h]"], [110, "mov ecx, [rsp+78h+var_14]"], [111, "mov rax, [rsp+78h+var_30]"], [112, "mov rdx, [rax]"], [113, "mov rax, [rsp+78h+var_30]"], [114, "mov rsi, [rax+120h]"], [115, "mov rax, [rsp+78h+var_30]"], [116, "mov rax, [rax+100h]"], [117, "mov rdi, rax"], [118, "call r8"], [119, "mov edx, [rsp+78h+var_14]"], [120, "cmp rax, rdx"], [121, "jz short loc_49D362"], [122, "mov eax, 0FFFFFFFFh"], [123, "jmp loc_49D6B2"], [124, "mov rax, [rsp+78h+var_30]"], [125, "mov rdx, [rax+78h]"], [126, "mov eax, [rsp+78h+var_14]"], [127, "add rdx, rax"], [128, "mov rax, [rsp+78h+var_30]"], [129, "mov [rax+78h], rdx"], [130, "mov rax, [rsp+78h+var_30]"], [131, "mov rax, [rax+0B8h]"], [132, "mov ecx, [rsp+78h+var_14]"], [133, "sub rax, rcx"], [134, "mov rdx, rax"], [135, "mov rax, [rsp+78h+var_30]"], [136, "mov [rax+0B8h], rdx"], [137, "mov rax, [rsp+78h+var_30]"], [138, "mov rdx, [rax]"], [139, "mov rax, [rsp+78h+var_30]"], [140, "mov [rax+8], rdx"], [141, "mov rax, [rsp+78h+var_30]"], [142, "mov edx, [rsp+78h+var_14]"], [143, "mov [rax+10h], edx"], [144, "mov rax, [rsp+78h+var_30]"], [145, "mov rax, [rax+128h]"], [146, "test rax, rax"], [147, "jz short loc_49D3DE"], [148, "mov rax, [rsp+78h+var_30]"], [149, "mov eax, [rax+138h]"], [150, "test eax, eax"], [151, "jz loc_49D566"], [152, "mov rax, [rsp+78h+var_30]"], [153, "mov eax, [rax+10h]"], [154, "test eax, eax"], [155, "jnz short loc_49D404"], [156, "mov rax, [rsp+78h+var_30]"], [157, "mov rax, [rax+0B8h]"], [158, "test rax, rax"], [159, "jnz short loc_49D404"], [160, "mov eax, [rsp+78h+var_10]"], [161, "jmp loc_49D6B2"], [162, "mov rax, [rsp+78h+var_30]"], [163, "mov edx, [rax+28h]"], [164, "mov rax, [rsp+78h+var_30]"], [165, "mov eax, [rax+10h]"], [166, "cmp edx, eax"], [167, "jnb short loc_49D426"], [168, "mov rax, [rsp+78h+var_30]"], [169, "mov eax, [rax+28h]"], [170, "mov [rsp+78h+var_18], eax"], [171, "jmp short loc_49D432"], [172, "mov rax, [rsp+78h+var_30]"], [173, "mov eax, [rax+10h]"], [174, "mov [rsp+78h+var_18], eax"], [175, "mov [rsp+78h+var_1C], 0"], [176, "jmp short loc_49D467"], [177, "mov rax, [rsp+78h+var_30]"], [178, "mov rdx, [rax+8]"], [179, "mov eax, [rsp+78h+var_1C]"], [180, "lea rcx, [rdx+rax]"], [181, "mov rax, [rsp+78h+var_30]"], [182, "mov rdx, [rax+20h]"], [183, "mov eax, [rsp+78h+var_1C]"], [184, "add rdx, rax"], [185, "movzx eax, byte ptr [rcx]"], [186, "mov [rdx], al"], [187, "add [rsp+78h+var_1C], 1"], [188, "mov eax, [rsp+78h+var_1C]"], [189, "cmp eax, [rsp+78h+var_18]"], [190, "jb short loc_49D43C"], [191, "mov rax, [rsp+78h+var_30]"], [192, "mov rdx, [rax+0A0h]"], [193, "mov eax, [rsp+78h+var_18]"], [194, "add rdx, rax"], [195, "mov rax, [rsp+78h+var_30]"], [196, "mov [rax+0A0h], rdx"], [197, "mov edx, [rsp+78h+var_18]"], [198, "mov rax, [rsp+78h+var_30]"], [199, "mov rcx, [rax+20h]"], [200, "mov rax, [rsp+78h+var_30]"], [201, "mov rax, [rax+0A8h]"], [202, "mov rsi, rcx"], [203, "mov rdi, rax"], [204, "call sub_47B7FC"], [205, "mov rdx, [rsp+78h+var_30]"], [206, "mov [rdx+0A8h], rax"], [207, "mov rax, [rsp+78h+var_30]"], [208, "mov rax, [rax+0C0h]"], [209, "mov ecx, [rsp+78h+var_18]"], [210, "sub rax, rcx"], [211, "mov rdx, rax"], [212, "mov rax, [rsp+78h+var_30]"], [213, "mov [rax+0C0h], rdx"], [214, "mov rax, [rsp+78h+var_30]"], [215, "mov eax, [rax+10h]"], [216, "sub eax, [rsp+78h+var_18]"], [217, "mov edx, eax"], [218, "mov rax, [rsp+78h+var_30]"], [219, "mov [rax+10h], edx"], [220, "mov rax, [rsp+78h+var_30]"], [221, "mov eax, [rax+28h]"], [222, "sub eax, [rsp+78h+var_18]"], [223, "mov edx, eax"], [224, "mov rax, [rsp+78h+var_30]"], [225, "mov [rax+28h], edx"], [226, "mov rax, [rsp+78h+var_30]"], [227, "mov rdx, [rax+20h]"], [228, "mov eax, [rsp+78h+var_18]"], [229, "add rdx, rax"], [230, "mov rax, [rsp+78h+var_30]"], [231, "mov [rax+20h], rdx"], [232, "mov rax, [rsp+78h+var_30]"], [233, "mov rdx, [rax+8]"], [234, "mov eax, [rsp+78h+var_18]"], [235, "add rdx, rax"], [236, "mov rax, [rsp+78h+var_30]"], [237, "mov [rax+8], rdx"], [238, "mov rax, [rsp+78h+var_30]"], [239, "mov rdx, [rax+30h]"], [240, "mov eax, [rsp+78h+var_18]"], [241, "add rdx, rax"], [242, "mov rax, [rsp+78h+var_30]"], [243, "mov [rax+30h], rdx"], [244, "mov eax, [rsp+78h+var_18]"], [245, "add [rsp+78h+var_10], eax"], [246, "jmp loc_49D68E"], [247, "mov rax, [rsp+78h+var_30]"], [248, "mov rax, [rax+128h]"], [249, "cmp rax, 0Ch"], [250, "jz loc_49D68E"], [251, "mov [rsp+78h+var_34], 2"], [252, "mov rax, [rsp+78h+var_30]"], [253, "mov rax, [rax+30h]"], [254, "mov [rsp+78h+var_40], rax"], [255, "mov rax, [rsp+78h+var_30]"], [256, "mov rax, [rax+20h]"], [257, "mov [rsp+78h+var_48], rax"], [258, "mov rax, [rsp+78h+var_30]"], [259, "lea rdx, [rax+8]"], [260, "mov eax, [rsp+78h+var_34]"], [261, "mov esi, eax"], [262, "mov rdi, rdx"], [263, "call sub_47C25E"], [264, "mov [rsp+78h+var_C], eax"], [265, "cmp [rsp+78h+var_C], 0"], [266, "js short loc_49D5D8"], [267, "mov rax, [rsp+78h+var_30]"], [268, "mov rax, [rax+38h]"], [269, "test rax, rax"], [270, "jz short loc_49D5D8"], [271, "mov [rsp+78h+var_C], 0FFFFFFFDh"], [272, "mov rax, [rsp+78h+var_30]"], [273, "mov rax, [rax+30h]"], [274, "mov [rsp+78h+var_50], rax"], [275, "mov rax, [rsp+78h+var_50]"], [276, "sub rax, [rsp+78h+var_40]"], [277, "mov [rsp+78h+var_58], rax"], [278, "mov rax, [rsp+78h+var_30]"], [279, "mov rdx, [rax+0A0h]"], [280, "mov rax, [rsp+78h+var_58]"], [281, "add rdx, rax"], [282, "mov rax, [rsp+78h+var_30]"], [283, "mov [rax+0A0h], rdx"], [284, "mov rax, [rsp+78h+var_58]"], [285, "mov edx, eax"], [286, "mov rax, [rsp+78h+var_30]"], [287, "mov rax, [rax+0A8h]"], [288, "mov rcx, [rsp+78h+var_48]"], [289, "mov rsi, rcx"], [290, "mov rdi, rax"], [291, "call sub_47B7FC"], [292, "mov rdx, [rsp+78h+var_30]"], [293, "mov [rdx+0A8h], rax"], [294, "mov rax, [rsp+78h+var_30]"], [295, "mov rax, [rax+0C0h]"], [296, "sub rax, [rsp+78h+var_58]"], [297, "mov rdx, rax"], [298, "mov rax, [rsp+78h+var_30]"], [299, "mov [rax+0C0h], rdx"], [300, "mov rax, [rsp+78h+var_50]"], [301, "mov edx, eax"], [302, "mov rax, [rsp+78h+var_40]"], [303, "mov ecx, eax"], [304, "mov eax, edx"], [305, "sub eax, ecx"], [306, "add [rsp+78h+var_10], eax"], [307, "cmp [rsp+78h+var_C], 1"], [308, "jnz short loc_49D687"], [309, "mov eax, [rsp+78h+var_10]"], [310, "jmp short loc_49D6B2"], [311, "cmp [rsp+78h+var_C], 0"], [312, "jnz short loc_49D6A0"], [313, "mov rax, [rsp+78h+var_30]"], [314, "mov eax, [rax+28h]"], [315, "test eax, eax"], [316, "jnz loc_49D26A"], [317, "jmp short loc_49D6A1"], [318, "nop"], [319, "cmp [rsp+78h+var_C], 0"], [320, "jnz short loc_49D6AE"], [321, "mov eax, [rsp+78h+var_10]"], [322, "jmp short loc_49D6B2"], [323, "mov eax, [rsp+78h+var_C]"], [324, "add rsp, 78h"], [325, "retn"]], "data_dep": [[6, 1], [7, 6], [10, 1], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [19, 14], [20, 19], [21, 20], [22, 21], [25, 3], [26, 25], [29, 14], [30, 2], [31, 29], [31, 30], [32, 14], [33, 3], [34, 33], [34, 32], [35, 3], [36, 14], [37, 34], [37, 36], [38, 35], [38, 37], [39, 38], [40, 14], [41, 31], [41, 40], [41, 34], [42, 41], [43, 42], [44, 14], [45, 48], [45, 34], [45, 31], [45, 44], [46, 45], [47, 14], [48, 47], [48, 46], [49, 3], [50, 14], [51, 50], [51, 31], [51, 48], [51, 34], [52, 14], [53, 34], [53, 48], [53, 52], [53, 31], [54, 53], [55, 51], [55, 54], [56, 55], [56, 49], [57, 56], [58, 14], [59, 31], [59, 58], [59, 48], [59, 34], [60, 59], [61, 60], [62, 14], [63, 34], [63, 69], [63, 31], [63, 62], [63, 48], [64, 63], [65, 14], [66, 48], [66, 34], [66, 65], [66, 69], [66, 31], [67, 66], [67, 64], [68, 14], [69, 67], [69, 68], [71, 14], [72, 136], [72, 225], [72, 243], [72, 206], [72, 71], [72, 219], [72, 196], [72, 186], [72, 293], [72, 140], [72, 283], [72, 143], [72, 237], [72, 129], [72, 213], [72, 231], [72, 69], [72, 31], [72, 48], [72, 34], [72, 299], [73, 72], [74, 73], [75, 14], [76, 143], [76, 237], [76, 129], [76, 213], [76, 231], [76, 69], [76, 31], [76, 48], [76, 34], [76, 299], [76, 136], [76, 225], [76, 243], [76, 206], [76, 219], [76, 75], [76, 196], [76, 186], [76, 293], [76, 140], [76, 283], [77, 76], [78, 77], [80, 14], [81, 213], [81, 231], [81, 69], [81, 31], [81, 48], [81, 34], [81, 299], [81, 136], [81, 225], [81, 243], [81, 206], [81, 80], [81, 219], [81, 196], [81, 186], [81, 293], [81, 140], [81, 283], [81, 143], [81, 237], [81, 129], [82, 79], [83, 81], [83, 82], [84, 83], [85, 14], [86, 31], [86, 48], [86, 34], [86, 299], [86, 136], [86, 225], [86, 243], [86, 85], [86, 206], [86, 219], [86, 196], [86, 186], [86, 293], [86, 140], [86, 283], [86, 143], [86, 237], [86, 129], [86, 213], [86, 231], [86, 69], [87, 86], [88, 79], [88, 87], [89, 88], [92, 14], [93, 196], [93, 186], [93, 69], [93, 293], [93, 140], [93, 283], [93, 143], [93, 237], [93, 129], [93, 92], [93, 213], [93, 231], [93, 31], [93, 48], [93, 34], [93, 299], [93, 136], [93, 225], [93, 243], [93, 206], [93, 219], [94, 14], [95, 143], [95, 237], [95, 129], [95, 213], [95, 231], [95, 69], [95, 31], [95, 34], [95, 136], [95, 225], [95, 243], [95, 94], [95, 206], [95, 219], [95, 48], [95, 196], [95, 299], [95, 186], [95, 293], [95, 140], [95, 283], [96, 95], [96, 93], [97, 14], [98, 293], [98, 140], [98, 283], [98, 143], [98, 237], [98, 129], [98, 97], [98, 213], [98, 231], [98, 69], [98, 31], [98, 48], [98, 34], [98, 299], [98, 136], [98, 225], [98, 243], [98, 206], [98, 219], [98, 196], [98, 186], [99, 14], [100, 213], [100, 231], [100, 69], [100, 203], [100, 31], [100, 34], [100, 290], [100, 136], [100, 225], [100, 243], [100, 99], [100, 117], [100, 206], [100, 219], [100, 48], [100, 196], [100, 299], [100, 186], [100, 293], [100, 140], [100, 283], [100, 143], [100, 237], [100, 129], [102, 98], [104, 103], [105, 104], [108, 14], [109, 186], [109, 293], [109, 140], [109, 283], [109, 143], [109, 237], [109, 129], [109, 213], [109, 231], [109, 69], [109, 31], [109, 34], [109, 136], [109, 225], [109, 243], [109, 108], [109, 206], [109, 219], [109, 48], [109, 196], [109, 299], [110, 79], [110, 87], [111, 14], [112, 219], [112, 196], [112, 186], [112, 293], [112, 140], [112, 283], [112, 143], [112, 237], [112, 111], [112, 129], [112, 213], [112, 231], [112, 69], [112, 31], [112, 48], [112, 34], [112, 299], [112, 136], [112, 225], [112, 243], [112, 206], [113, 14], [114, 143], [114, 237], [114, 129], [114, 213], [114, 231], [114, 31], [114, 48], [114, 34], [114, 299], [114, 136], [114, 113], [114, 140], [114, 225], [114, 243], [114, 206], [114, 219], [114, 196], [114, 186], [114, 69], [114, 293], [114, 283], [115, 14], [116, 31], [116, 48], [116, 34], [116, 136], [116, 225], [116, 243], [116, 206], [116, 219], [116, 196], [116, 299], [116, 186], [116, 293], [116, 140], [116, 283], [116, 143], [116, 237], [116, 129], [116, 115], [116, 213], [116, 231], [116, 69], [117, 116], [118, 109], [119, 87], [119, 79], [120, 119], [120, 118], [121, 120], [124, 14], [125, 283], [125, 143], [125, 237], [125, 129], [125, 124], [125, 213], [125, 231], [125, 69], [125, 31], [125, 34], [125, 136], [125, 225], [125, 243], [125, 206], [125, 219], [125, 48], [125, 196], [125, 299], [125, 186], [125, 293], [125, 140], [126, 79], [126, 87], [127, 126], [127, 125], [128, 14], [129, 128], [129, 127], [130, 14], [131, 130], [131, 129], [131, 136], [132, 79], [132, 87], [133, 132], [133, 131], [134, 133], [135, 14], [136, 135], [136, 134], [137, 14], [138, 137], [138, 136], [139, 14], [140, 139], [140, 138], [141, 14], [142, 79], [142, 87], [143, 141], [143, 142], [144, 14], [145, 225], [145, 243], [145, 206], [145, 219], [145, 196], [145, 186], [145, 69], [145, 293], [145, 144], [145, 283], [145, 31], [145, 143], [145, 237], [145, 129], [145, 213], [145, 231], [145, 48], [145, 34], [145, 299], [145, 136], [145, 140], [146, 145], [147, 146], [148, 14], [149, 213], [149, 231], [149, 31], [149, 48], [149, 34], [149, 299], [149, 136], [149, 225], [149, 243], [149, 206], [149, 219], [149, 196], [149, 186], [149, 69], [149, 293], [149, 140], [149, 283], [149, 148], [149, 143], [149, 237], [149, 129], [150, 149], [151, 150], [152, 14], [153, 219], [153, 196], [153, 186], [153, 293], [153, 140], [153, 283], [153, 143], [153, 152], [153, 237], [153, 129], [153, 213], [153, 231], [153, 69], [153, 31], [153, 48], [153, 34], [153, 299], [153, 136], [153, 225], [153, 243], [153, 206], [154, 153], [155, 154], [156, 14], [157, 225], [157, 156], [157, 48], [157, 34], [157, 299], [157, 136], [157, 140], [157, 243], [157, 206], [157, 219], [157, 237], [157, 196], [157, 186], [157, 69], [157, 293], [157, 283], [157, 31], [157, 143], [157, 129], [157, 213], [157, 231], [158, 157], [159, 158], [160, 5], [160, 306], [160, 245], [162, 14], [163, 283], [163, 143], [163, 237], [163, 129], [163, 213], [163, 231], [163, 69], [163, 31], [163, 48], [163, 34], [163, 299], [163, 136], [163, 225], [163, 243], [163, 206], [163, 219], [163, 196], [163, 186], [163, 293], [163, 140], [163, 162], [164, 14], [165, 48], [165, 34], [165, 299], [165, 164], [165, 136], [165, 140], [165, 225], [165, 243], [165, 206], [165, 219], [165, 196], [165, 186], [165, 69], [165, 293], [165, 283], [165, 31], [165, 143], [165, 237], [165, 129], [165, 213], [165, 231], [166, 165], [166, 163], [167, 166], [168, 14], [169, 186], [169, 213], [169, 69], [169, 293], [169, 283], [169, 31], [169, 143], [169, 129], [169, 231], [169, 225], [169, 206], [169, 48], [169, 34], [169, 299], [169, 168], [169, 136], [169, 140], [169, 243], [169, 219], [169, 237], [169, 196], [170, 169], [172, 14], [173, 206], [173, 48], [173, 34], [173, 299], [173, 136], [173, 140], [173, 243], [173, 219], [173, 237], [173, 196], [173, 186], [173, 69], [173, 172], [173, 293], [173, 283], [173, 31], [173, 143], [173, 129], [173, 213], [173, 231], [173, 225], [174, 173], [177, 14], [178, 136], [178, 140], [178, 243], [178, 219], [178, 237], [178, 196], [178, 177], [178, 186], [178, 69], [178, 293], [178, 283], [178, 31], [178, 143], [178, 129], [178, 213], [178, 231], [178, 225], [178, 206], [178, 48], [178, 34], [178, 299], [179, 175], [179, 187], [180, 219], [180, 196], [180, 209], [180, 303], [180, 186], [180, 51], [180, 69], [180, 293], [180, 283], [180, 143], [180, 237], [180, 129], [180, 213], [180, 231], [180, 180], [180, 31], [180, 179], [180, 48], [180, 34], [180, 299], [180, 132], [180, 136], [180, 140], [180, 225], [180, 243], [180, 206], [181, 14], [182, 143], [182, 129], [182, 213], [182, 231], [182, 225], [182, 48], [182, 34], [182, 299], [182, 136], [182, 140], [182, 243], [182, 206], [182, 219], [182, 237], [182, 196], [182, 186], [182, 69], [182, 181], [182, 293], [182, 283], [182, 31], [183, 175], [183, 187], [184, 183], [184, 182], [185, 180], [185, 283], [185, 31], [185, 143], [185, 129], [185, 231], [185, 225], [185, 206], [185, 48], [185, 34], [185, 299], [185, 136], [185, 140], [185, 243], [185, 219], [185, 237], [185, 196], [185, 186], [185, 213], [185, 69], [185, 293], [186, 185], [186, 184], [187, 175], [187, 187], [188, 187], [188, 175], [189, 170], [189, 188], [189, 174], [190, 189], [191, 14], [192, 48], [192, 34], [192, 299], [192, 136], [192, 140], [192, 225], [192, 243], [192, 206], [192, 219], [192, 237], [192, 196], [192, 191], [192, 186], [192, 69], [192, 293], [192, 283], [192, 31], [192, 143], [192, 129], [192, 213], [192, 231], [193, 170], [193, 174], [194, 193], [194, 192], [195, 14], [196, 194], [196, 195], [197, 170], [197, 174], [198, 14], [199, 196], [199, 31], [199, 231], [199, 198], [200, 14], [201, 196], [201, 200], [202, 199], [203, 201], [205, 14], [206, 205], [206, 204], [207, 14], [208, 299], [208, 213], [208, 207], [208, 206], [209, 170], [209, 174], [210, 209], [210, 208], [211, 210], [212, 14], [213, 212], [213, 211], [214, 14], [215, 143], [215, 219], [215, 214], [215, 213], [216, 215], [216, 170], [216, 174], [217, 216], [218, 14], [219, 218], [219, 217], [220, 14], [221, 219], [221, 69], [221, 225], [221, 220], [221, 48], [221, 34], [222, 170], [222, 174], [222, 221], [223, 222], [224, 14], [225, 224], [225, 223], [226, 14], [227, 31], [227, 231], [227, 226], [227, 225], [228, 174], [228, 170], [229, 228], [229, 227], [230, 14], [231, 230], [231, 229], [232, 14], [233, 140], [233, 237], [233, 232], [233, 231], [234, 170], [234, 174], [235, 233], [235, 234], [236, 14], [237, 236], [237, 235], [238, 14], [239, 243], [239, 238], [239, 237], [240, 170], [240, 174], [241, 240], [241, 239], [242, 14], [243, 242], [243, 241], [244, 174], [244, 170], [245, 306], [245, 245], [245, 244], [245, 5], [247, 14], [248, 186], [248, 213], [248, 69], [248, 293], [248, 283], [248, 31], [248, 143], [248, 129], [248, 231], [248, 225], [248, 206], [248, 48], [248, 196], [248, 34], [248, 299], [248, 136], [248, 140], [248, 243], [248, 247], [248, 219], [248, 237], [249, 248], [250, 249], [252, 14], [253, 283], [253, 31], [253, 143], [253, 129], [253, 231], [253, 225], [253, 206], [253, 48], [253, 196], [253, 34], [253, 299], [253, 136], [253, 140], [253, 243], [253, 252], [253, 219], [253, 237], [253, 186], [253, 213], [253, 69], [253, 293], [254, 253], [255, 14], [256, 186], [256, 213], [256, 69], [256, 283], [256, 31], [256, 143], [256, 129], [256, 231], [256, 225], [256, 206], [256, 48], [256, 196], [256, 34], [256, 299], [256, 136], [256, 293], [256, 140], [256, 243], [256, 219], [256, 237], [256, 255], [257, 256], [258, 14], [259, 219], [259, 237], [259, 241], [259, 186], [259, 213], [259, 69], [259, 293], [259, 283], [259, 301], [259, 31], [259, 143], [259, 129], [259, 142], [259, 231], [259, 258], [259, 225], [259, 49], [259, 67], [259, 206], [259, 48], [259, 196], [259, 34], [259, 299], [259, 136], [259, 140], [259, 243], [260, 251], [261, 260], [262, 259], [264, 263], [265, 264], [266, 265], [267, 14], [268, 48], [268, 196], [268, 34], [268, 299], [268, 186], [268, 136], [268, 293], [268, 140], [268, 219], [268, 237], [268, 213], [268, 231], [268, 69], [268, 283], [268, 31], [268, 143], [268, 129], [268, 267], [268, 225], [268, 243], [268, 206], [269, 268], [270, 269], [272, 14], [273, 136], [273, 293], [273, 140], [273, 219], [273, 237], [273, 213], [273, 231], [273, 69], [273, 283], [273, 31], [273, 143], [273, 129], [273, 272], [273, 225], [273, 243], [273, 206], [273, 48], [273, 196], [273, 34], [273, 299], [273, 186], [274, 273], [275, 274], [276, 275], [276, 254], [277, 276], [278, 14], [279, 206], [279, 48], [279, 196], [279, 34], [279, 299], [279, 136], [279, 140], [279, 243], [279, 219], [279, 237], [279, 186], [279, 213], [279, 69], [279, 293], [279, 283], [279, 31], [279, 278], [279, 143], [279, 129], [279, 231], [279, 225], [280, 277], [281, 280], [281, 279], [282, 14], [283, 282], [283, 281], [284, 277], [285, 284], [286, 14], [287, 283], [287, 286], [288, 257], [289, 288], [290, 287], [292, 14], [293, 292], [293, 291], [294, 14], [295, 294], [295, 293], [295, 213], [295, 299], [296, 277], [296, 295], [297, 296], [298, 14], [299, 298], [299, 297], [300, 274], [301, 300], [302, 254], [303, 302], [304, 301], [305, 304], [305, 303], [306, 5], [306, 245], [306, 306], [306, 305], [307, 271], [307, 264], [308, 307], [309, 306], [311, 264], [311, 271], [312, 311], [313, 14], [314, 186], [314, 136], [314, 293], [314, 140], [314, 219], [314, 237], [314, 213], [314, 231], [314, 69], [314, 283], [314, 31], [314, 143], [314, 129], [314, 225], [314, 243], [314, 206], [314, 48], [314, 313], [314, 196], [314, 34], [314, 299], [315, 314], [316, 315], [319, 4], [319, 264], [319, 271], [320, 319], [321, 306], [321, 5], [321, 245], [323, 271], [323, 4], [323, 264], [324, 0], [325, 321], [325, 23], [325, 106], [325, 27], [325, 8], [325, 17], [325, 160], [325, 122], [325, 90], [325, 323], [325, 309]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f_3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.jsonl.gz", "strip_func_name": "sub_49D12F", "query": "\n\n\n__int64 __fastcall sub_49D12F(__int64 a1, __int64 a2, unsigned int a3)\n{\n__int64 result; // rax\n__int64 v4; // [rsp+28h] [rbp-50h]\n_BYTE *v5; // [rsp+30h] [rbp-48h]\n__int64 v6; // [rsp+38h] [rbp-40h]\n__int64 v7; // [rsp+48h] [rbp-30h]\nunsigned int i; // [rsp+5Ch] [rbp-1Ch]\nunsigned int v9; // [rsp+60h] [rbp-18h]\nunsigned int v10; // [rsp+64h] [rbp-14h]\nunsigned int v11; // [rsp+68h] [rbp-10h]\nint v12; // [rsp+6Ch] [rbp-Ch]\n\nv12 = 0;\nv11 = 0;\nif ( !a1 )\nreturn 4294967194LL;\nv7 = *(_QWORD *)(a1 + 320);\nif ( !v7 )\nreturn 4294967194LL;\nif ( !*(_QWORD *)v7 )\nreturn 4294967196LL;\nif ( !a3 )\nreturn 0LL;\n*(_QWORD *)(v7 + 32) = a2;\n*(_DWORD *)(v7 + 40) = a3;\nif ( (unsigned __int64)a3 > *(_QWORD *)(v7 + 192) && !*(_DWORD *)(v7 + 312) )\n*(_DWORD *)(v7 + 40) = *(_QWORD *)(v7 + 192);\nif ( a3 > *(_QWORD *)(v7 + 184) + (unsigned __int64)*(unsigned int *)(v7 + 16) && *(_DWORD *)(v7 + 312) )\n*(_DWORD *)(v7 + 40) = *(_DWORD *)(v7 + 16) + *(_QWORD *)(v7 + 184);\nwhile ( *(_DWORD *)(v7 + 40) )\n{\nif ( !*(_DWORD *)(v7 + 16) && *(_QWORD *)(v7 + 184) )\n{\nv10 = 0x4000;\nif ( *(_QWORD *)(v7 + 184) < 0x4000uLL )\nv10 = *(_QWORD *)(v7 + 184);\nif ( !v10 )\nreturn 0LL;\nif ( sub_47AF9F(v7 + 200, *(_QWORD *)(v7 + 288), *(_QWORD *)(v7 + 304) + *(_QWORD *)(v7 + 120), 0) )\nreturn 0xFFFFFFFFLL;\nif ( (*(__int64 (__fastcall **)(_QWORD, _QWORD, _QWORD, _QWORD))(v7 + 208))(\n*(_QWORD *)(v7 + 256),\n*(_QWORD *)(v7 + 288),\n*(_QWORD *)v7,\nv10) != v10 )\nreturn 0xFFFFFFFFLL;\n*(_QWORD *)(v7 + 120) += v10;\n*(_QWORD *)(v7 + 184) -= v10;\n*(_QWORD *)(v7 + 8) = *(_QWORD *)v7;\n*(_DWORD *)(v7 + 16) = v10;\n}\nif ( *(_QWORD *)(v7 + 296) && !*(_DWORD *)(v7 + 312) )\n{\nif ( *(_QWORD *)(v7 + 296) != 12LL )\n{\nv6 = *(_QWORD *)(v7 + 48);\nv5 = *(_BYTE **)(v7 + 32);\nv12 = sub_47C25E(v7 + 8, 2);\nif ( v12 >= 0 && *(_QWORD *)(v7 + 56) )\nv12 = -3;\nv4 = *(_QWORD *)(v7 + 48);\n*(_QWORD *)(v7 + 160) += v4 - v6;\n*(_QWORD *)(v7 + 168) = sub_47B7FC(*(_QWORD *)(v7 + 168), v5, (unsigned int)(v4 - v6));\n*(_QWORD *)(v7 + 192) -= v4 - v6;\nv11 += v4 - v6;\nif ( v12 == 1 )\nreturn v11;\nif ( v12 )\nbreak;\n}\n}\nelse\n{\nif ( !*(_DWORD *)(v7 + 16) && !*(_QWORD *)(v7 + 184) )\nreturn v11;\nif ( *(_DWORD *)(v7 + 40) >= *(_DWORD *)(v7 + 16) )\nv9 = *(_DWORD *)(v7 + 16);\nelse\nv9 = *(_DWORD *)(v7 + 40);\nfor ( i = 0; i < v9; ++i )\n*(_BYTE *)(i + *(_QWORD *)(v7 + 32)) = *(_BYTE *)(*(_QWORD *)(v7 + 8) + i);\n*(_QWORD *)(v7 + 160) += v9;\n*(_QWORD *)(v7 + 168) = sub_47B7FC(*(_QWORD *)(v7 + 168), *(_BYTE **)(v7 + 32), v9);\n*(_QWORD *)(v7 + 192) -= v9;\n*(_DWORD *)(v7 + 16) -= v9;\n*(_DWORD *)(v7 + 40) -= v9;\n*(_QWORD *)(v7 + 32) += v9;\n*(_QWORD *)(v7 + 8) += v9;\n*(_QWORD *)(v7 + 48) += v9;\nv11 += v9;\n}\n}\nif ( v12 )\nresult = (unsigned int)v12;\nelse\nresult = v11;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v4,v5,v6,v7,v9,v10,v11,v12,sub_49D12F,sub_47AF9F,sub_47C25E,sub_47B7FC,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 'file', 'a2': 'buf', 'v4': 'uTotalOutAfter', 'v5': 'bufBefore', 'v6': 'uTotalOutBefore', 'v7': 'pfile_in_zip_read_info', 'v9': 'uDoCopy', 'v10': 'uReadThis', 'v11': 'iRead', 'v12': 'err', 'sub_49D12F': 'unzReadCurrentFile', 'sub_47AF9F': 'call_zseek64', 'sub_47C25E': 'mz_inflate', 'sub_47B7FC': 'mz_crc32'}"}
[ [ 0.8184546232223511, 0.8162035346031189, 0.8158503770828247, 0.7949497103691101, 0.7706600427627563, 0.7661060690879822, 0.7657219171524048, 0.7570574879646301, 0.7558304667472839, 0.7551523447036743, 0.7531030178070068, 0.752831220626831, 0.7484961748123169, 0.7472704648971558, 0.7455307245254517, 0.742475152015686, 0.742475152015686, 0.7400825619697571, 0.7357054352760315, 0.7357054352760315 ], [ 246983, 34934, 83134, 251513, 68323, 137293, 138767, 26072, 259927, 16569, 160141, 77173, 228307, 239769, 255566, 153511, 99143, 161689, 55531, 59614 ] ]
utf8_to_utf16
f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b
0x09
hfsfuse
NA
size_t utf8_to_utf16(uint16_t *dst, size_t dst_len, const char *src, size_t src_len, int flags, int *errp) { const unsigned char *s; size_t spos, dpos; int error; uint16_t c; #define IS_CONT(c) (((c)&0xc0) == 0x80) error = 0; s = (const unsigned char *)src; spos = dpos = 0; while (spos < src_len) { if (s[spos] < 0x80) { c = s[spos++]; } else if ((flags & UNICODE_UTF8_LATIN1_FALLBACK) && (spos >= src_len || !IS_CONT(s[spos+1])) && s[spos]>=0xa0) { /* not valid UTF-8, assume ISO 8859-1 */ c = s[spos++]; } else if (s[spos] < 0xc0 || s[spos] >= 0xf5) { /* continuation byte without lead byte * or lead byte for codepoint above 0x10ffff */ error++; spos++; continue; } else if (s[spos] < 0xe0) { if (spos >= src_len || !IS_CONT(s[spos+1])) { spos++; error++; continue; } c = ((s[spos] & 0x3f) << 6) | (s[spos+1] & 0x3f); spos += 2; if (c < 0x80) { /* overlong encoding */ error++; continue; } } else if (s[spos] < 0xf0) { if (spos >= src_len-2 || !IS_CONT(s[spos+1]) || !IS_CONT(s[spos+2])) { spos++; error++; continue; } c = ((s[spos] & 0x0f) << 12) | ((s[spos+1] & 0x3f) << 6) | (s[spos+2] & 0x3f); spos += 3; if (c < 0x800 || (c & 0xdf00) == 0xd800 ) { /* overlong encoding or encoded surrogate */ error++; continue; } } else { uint32_t cc; /* UTF-16 surrogate pair */ if (spos >= src_len-3 || !IS_CONT(s[spos+1]) || !IS_CONT(s[spos+2]) || !IS_CONT(s[spos+3])) { spos++; error++; continue; } cc = ((s[spos] & 0x03) << 18) | ((s[spos+1] & 0x3f) << 12) | ((s[spos+2] & 0x3f) << 6) | (s[spos+3] & 0x3f); spos += 4; if (cc < 0x10000) { /* overlong encoding */ error++; continue; } if (dst && dpos < dst_len) dst[dpos] = (0xd800 | ((cc-0x10000)>>10)); dpos++; c = 0xdc00 | ((cc-0x10000) & 0x3ff); } if (dst && dpos < dst_len) dst[dpos] = c; dpos++; } if (errp) *errp = error; return dpos; #undef IS_CONT }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_409765", "function_addr": 4233061, "binary_name": "f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_38], rdi"], [3, "mov [rbp+var_40], rsi"], [4, "mov [rbp+var_48], rdx"], [5, "mov [rbp+var_50], rcx"], [6, "mov [rbp+var_54], r8d"], [7, "mov [rbp+var_60], r9"], [8, "mov [rbp+var_14], 0"], [9, "mov rax, [rbp+var_48]"], [10, "mov [rbp+var_20], rax"], [11, "mov [rbp+var_10], 0"], [12, "mov rax, [rbp+var_10]"], [13, "mov [rbp+var_8], rax"], [14, "jmp loc_409B84"], [15, "mov rdx, [rbp+var_20]"], [16, "mov rax, [rbp+var_8]"], [17, "add rax, rdx"], [18, "movzx eax, byte ptr [rax]"], [19, "test al, al"], [20, "js short loc_4097D9"], [21, "mov rax, [rbp+var_8]"], [22, "lea rdx, [rax+1]"], [23, "mov [rbp+var_8], rdx"], [24, "mov rdx, [rbp+var_20]"], [25, "add rax, rdx"], [26, "movzx eax, byte ptr [rax]"], [27, "movzx eax, al"], [28, "mov [rbp+var_16], ax"], [29, "jmp loc_409B58"], [30, "mov eax, [rbp+var_54]"], [31, "and eax, 3"], [32, "test eax, eax"], [33, "jz short loc_409842"], [34, "mov rax, [rbp+var_8]"], [35, "cmp rax, [rbp+var_50]"], [36, "jnb short loc_40980E"], [37, "mov rax, [rbp+var_8]"], [38, "lea rdx, [rax+1]"], [39, "mov rax, [rbp+var_20]"], [40, "add rax, rdx"], [41, "movzx eax, byte ptr [rax]"], [42, "movzx eax, al"], [43, "and eax, 0C0h"], [44, "cmp eax, 80h"], [45, "jz short loc_409842"], [46, "mov rdx, [rbp+var_20]"], [47, "mov rax, [rbp+var_8]"], [48, "add rax, rdx"], [49, "movzx eax, byte ptr [rax]"], [50, "cmp al, 9Fh"], [51, "jbe short loc_409842"], [52, "mov rax, [rbp+var_8]"], [53, "lea rdx, [rax+1]"], [54, "mov [rbp+var_8], rdx"], [55, "mov rdx, [rbp+var_20]"], [56, "add rax, rdx"], [57, "movzx eax, byte ptr [rax]"], [58, "movzx eax, al"], [59, "mov [rbp+var_16], ax"], [60, "jmp loc_409B58"], [61, "mov rdx, [rbp+var_20]"], [62, "mov rax, [rbp+var_8]"], [63, "add rax, rdx"], [64, "movzx eax, byte ptr [rax]"], [65, "cmp al, 0BFh"], [66, "jbe short loc_409866"], [67, "mov rdx, [rbp+var_20]"], [68, "mov rax, [rbp+var_8]"], [69, "add rax, rdx"], [70, "movzx eax, byte ptr [rax]"], [71, "cmp al, 0F4h"], [72, "jbe short loc_409874"], [73, "add [rbp+var_14], 1"], [74, "add [rbp+var_8], 1"], [75, "jmp loc_409B84"], [76, "mov rdx, [rbp+var_20]"], [77, "mov rax, [rbp+var_8]"], [78, "add rax, rdx"], [79, "movzx eax, byte ptr [rax]"], [80, "cmp al, 0DFh"], [81, "ja loc_409914"], [82, "mov rax, [rbp+var_8]"], [83, "cmp rax, [rbp+var_50]"], [84, "jnb short loc_4098B5"], [85, "mov rax, [rbp+var_8]"], [86, "lea rdx, [rax+1]"], [87, "mov rax, [rbp+var_20]"], [88, "add rax, rdx"], [89, "movzx eax, byte ptr [rax]"], [90, "movzx eax, al"], [91, "and eax, 0C0h"], [92, "cmp eax, 80h"], [93, "jz short loc_4098C3"], [94, "add [rbp+var_8], 1"], [95, "add [rbp+var_14], 1"], [96, "jmp loc_409B84"], [97, "mov rdx, [rbp+var_20]"], [98, "mov rax, [rbp+var_8]"], [99, "add rax, rdx"], [100, "movzx eax, byte ptr [rax]"], [101, "movzx eax, al"], [102, "shl eax, 6"], [103, "and ax, 0FC0h"], [104, "mov edx, eax"], [105, "mov rax, [rbp+var_8]"], [106, "lea rcx, [rax+1]"], [107, "mov rax, [rbp+var_20]"], [108, "add rax, rcx"], [109, "movzx eax, byte ptr [rax]"], [110, "movzx eax, al"], [111, "and eax, 3Fh"], [112, "or eax, edx"], [113, "mov [rbp+var_16], ax"], [114, "add [rbp+var_8], 2"], [115, "cmp [rbp+var_16], 7Fh"], [116, "ja loc_409B58"], [117, "add [rbp+var_14], 1"], [118, "jmp loc_409B84"], [119, "mov rdx, [rbp+var_20]"], [120, "mov rax, [rbp+var_8]"], [121, "add rax, rdx"], [122, "movzx eax, byte ptr [rax]"], [123, "cmp al, 0EFh"], [124, "ja loc_409A06"], [125, "mov rax, [rbp+var_50]"], [126, "sub rax, 2"], [127, "cmp [rbp+var_8], rax"], [128, "jnb short loc_40997A"], [129, "mov rax, [rbp+var_8]"], [130, "lea rdx, [rax+1]"], [131, "mov rax, [rbp+var_20]"], [132, "add rax, rdx"], [133, "movzx eax, byte ptr [rax]"], [134, "movzx eax, al"], [135, "and eax, 0C0h"], [136, "cmp eax, 80h"], [137, "jnz short loc_40997A"], [138, "mov rax, [rbp+var_8]"], [139, "lea rdx, [rax+2]"], [140, "mov rax, [rbp+var_20]"], [141, "add rax, rdx"], [142, "movzx eax, byte ptr [rax]"], [143, "movzx eax, al"], [144, "and eax, 0C0h"], [145, "cmp eax, 80h"], [146, "jz short loc_409988"], [147, "add [rbp+var_8], 1"], [148, "add [rbp+var_14], 1"], [149, "jmp loc_409B84"], [150, "mov rdx, [rbp+var_20]"], [151, "mov rax, [rbp+var_8]"], [152, "add rax, rdx"], [153, "movzx eax, byte ptr [rax]"], [154, "movzx eax, al"], [155, "shl eax, 0Ch"], [156, "mov ecx, eax"], [157, "mov rax, [rbp+var_8]"], [158, "lea rdx, [rax+1]"], [159, "mov rax, [rbp+var_20]"], [160, "add rax, rdx"], [161, "movzx eax, byte ptr [rax]"], [162, "movzx eax, al"], [163, "shl eax, 6"], [164, "and ax, 0FC0h"], [165, "or ecx, eax"], [166, "mov edx, ecx"], [167, "mov rax, [rbp+var_8]"], [168, "lea rcx, [rax+2]"], [169, "mov rax, [rbp+var_20]"], [170, "add rax, rcx"], [171, "movzx eax, byte ptr [rax]"], [172, "movzx eax, al"], [173, "and eax, 3Fh"], [174, "or eax, edx"], [175, "mov [rbp+var_16], ax"], [176, "add [rbp+var_8], 3"], [177, "cmp [rbp+var_16], 7FFh"], [178, "jbe short loc_4099FD"], [179, "movzx eax, [rbp+var_16]"], [180, "and eax, 0DF00h"], [181, "cmp eax, 0D800h"], [182, "jnz loc_409B58"], [183, "add [rbp+var_14], 1"], [184, "jmp loc_409B84"], [185, "mov rax, [rbp+var_50]"], [186, "sub rax, 3"], [187, "cmp [rbp+var_8], rax"], [188, "jnb short loc_409A77"], [189, "mov rax, [rbp+var_8]"], [190, "lea rdx, [rax+1]"], [191, "mov rax, [rbp+var_20]"], [192, "add rax, rdx"], [193, "movzx eax, byte ptr [rax]"], [194, "movzx eax, al"], [195, "and eax, 0C0h"], [196, "cmp eax, 80h"], [197, "jnz short loc_409A77"], [198, "mov rax, [rbp+var_8]"], [199, "lea rdx, [rax+2]"], [200, "mov rax, [rbp+var_20]"], [201, "add rax, rdx"], [202, "movzx eax, byte ptr [rax]"], [203, "movzx eax, al"], [204, "and eax, 0C0h"], [205, "cmp eax, 80h"], [206, "jnz short loc_409A77"], [207, "mov rax, [rbp+var_8]"], [208, "lea rdx, [rax+3]"], [209, "mov rax, [rbp+var_20]"], [210, "add rax, rdx"], [211, "movzx eax, byte ptr [rax]"], [212, "movzx eax, al"], [213, "and eax, 0C0h"], [214, "cmp eax, 80h"], [215, "jz short loc_409A85"], [216, "add [rbp+var_8], 1"], [217, "add [rbp+var_14], 1"], [218, "jmp loc_409B84"], [219, "mov rdx, [rbp+var_20]"], [220, "mov rax, [rbp+var_8]"], [221, "add rax, rdx"], [222, "movzx eax, byte ptr [rax]"], [223, "movzx eax, al"], [224, "shl eax, 12h"], [225, "and eax, 0C0000h"], [226, "mov edx, eax"], [227, "mov rax, [rbp+var_8]"], [228, "lea rcx, [rax+1]"], [229, "mov rax, [rbp+var_20]"], [230, "add rax, rcx"], [231, "movzx eax, byte ptr [rax]"], [232, "movzx eax, al"], [233, "shl eax, 0Ch"], [234, "and eax, 3F000h"], [235, "or edx, eax"], [236, "mov rax, [rbp+var_8]"], [237, "lea rcx, [rax+2]"], [238, "mov rax, [rbp+var_20]"], [239, "add rax, rcx"], [240, "movzx eax, byte ptr [rax]"], [241, "movzx eax, al"], [242, "shl eax, 6"], [243, "and eax, 0FC0h"], [244, "or edx, eax"], [245, "mov rax, [rbp+var_8]"], [246, "lea rcx, [rax+3]"], [247, "mov rax, [rbp+var_20]"], [248, "add rax, rcx"], [249, "movzx eax, byte ptr [rax]"], [250, "movzx eax, al"], [251, "and eax, 3Fh"], [252, "or eax, edx"], [253, "mov [rbp+var_24], eax"], [254, "add [rbp+var_8], 4"], [255, "cmp [rbp+var_24], 0FFFFh"], [256, "ja short loc_409B0F"], [257, "add [rbp+var_14], 1"], [258, "jmp short loc_409B84"], [259, "cmp [rbp+var_38], 0"], [260, "jz short loc_409B44"], [261, "mov rax, [rbp+var_10]"], [262, "cmp rax, [rbp+var_40]"], [263, "jnb short loc_409B44"], [264, "mov eax, [rbp+var_24]"], [265, "sub eax, 10000h"], [266, "shr eax, 0Ah"], [267, "mov edx, eax"], [268, "mov rax, [rbp+var_10]"], [269, "lea rcx, [rax+rax]"], [270, "mov rax, [rbp+var_38]"], [271, "add rax, rcx"], [272, "or dx, 0D800h"], [273, "mov [rax], dx"], [274, "add [rbp+var_10], 1"], [275, "mov eax, [rbp+var_24]"], [276, "and ax, 3FFh"], [277, "or ax, 0DC00h"], [278, "mov [rbp+var_16], ax"], [279, "cmp [rbp+var_38], 0"], [280, "jz short loc_409B7F"], [281, "mov rax, [rbp+var_10]"], [282, "cmp rax, [rbp+var_40]"], [283, "jnb short loc_409B7F"], [284, "mov rax, [rbp+var_10]"], [285, "lea rdx, [rax+rax]"], [286, "mov rax, [rbp+var_38]"], [287, "add rdx, rax"], [288, "movzx eax, [rbp+var_16]"], [289, "mov [rdx], ax"], [290, "add [rbp+var_10], 1"], [291, "mov rax, [rbp+var_8]"], [292, "cmp rax, [rbp+var_50]"], [293, "jb loc_4097A5"], [294, "cmp [rbp+var_60], 0"], [295, "jz short loc_409BA2"], [296, "mov rax, [rbp+var_60]"], [297, "mov edx, [rbp+var_14]"], [298, "mov [rax], edx"], [299, "mov rax, [rbp+var_10]"], [300, "pop rbp"], [301, "retn"]], "data_dep": [[9, 4], [10, 9], [12, 11], [13, 12], [15, 10], [16, 74], [16, 176], [16, 54], [16, 13], [16, 147], [16, 254], [16, 114], [16, 216], [16, 94], [16, 23], [17, 15], [17, 16], [18, 17], [18, 273], [18, 289], [19, 18], [20, 19], [21, 176], [21, 54], [21, 13], [21, 147], [21, 254], [21, 114], [21, 216], [21, 94], [21, 23], [21, 74], [22, 273], [22, 21], [22, 15], [22, 289], [23, 22], [24, 10], [25, 24], [25, 21], [26, 25], [26, 289], [26, 273], [27, 26], [28, 27], [30, 6], [31, 30], [32, 31], [33, 32], [34, 147], [34, 254], [34, 114], [34, 216], [34, 94], [34, 23], [34, 74], [34, 176], [34, 54], [34, 13], [35, 34], [35, 5], [36, 35], [37, 147], [37, 254], [37, 114], [37, 216], [37, 94], [37, 23], [37, 74], [37, 176], [37, 54], [37, 13], [38, 273], [38, 15], [38, 289], [38, 37], [39, 10], [40, 39], [40, 38], [41, 289], [41, 40], [41, 273], [42, 41], [43, 42], [44, 43], [45, 44], [46, 10], [47, 23], [47, 13], [47, 74], [47, 176], [47, 54], [47, 147], [47, 254], [47, 114], [47, 216], [47, 94], [48, 47], [48, 46], [49, 273], [49, 48], [49, 289], [50, 49], [51, 50], [52, 23], [52, 13], [52, 74], [52, 176], [52, 54], [52, 147], [52, 254], [52, 114], [52, 216], [52, 94], [53, 52], [53, 289], [53, 46], [53, 273], [54, 53], [55, 10], [56, 52], [56, 55], [57, 273], [57, 56], [57, 289], [58, 57], [59, 58], [61, 10], [62, 74], [62, 176], [62, 54], [62, 147], [62, 254], [62, 114], [62, 216], [62, 94], [62, 23], [62, 13], [63, 61], [63, 62], [64, 289], [64, 63], [64, 273], [65, 64], [66, 65], [67, 10], [68, 13], [68, 74], [68, 176], [68, 54], [68, 147], [68, 254], [68, 114], [68, 216], [68, 94], [68, 23], [69, 67], [69, 68], [70, 273], [70, 289], [70, 69], [71, 70], [72, 71], [73, 217], [73, 73], [73, 257], [73, 95], [73, 117], [73, 183], [73, 148], [73, 8], [74, 23], [74, 13], [74, 74], [74, 176], [74, 54], [74, 147], [74, 254], [74, 114], [74, 216], [74, 94], [76, 10], [77, 94], [77, 74], [77, 176], [77, 23], [77, 13], [77, 254], [77, 216], [77, 54], [77, 147], [77, 114], [78, 77], [78, 76], [79, 289], [79, 78], [79, 273], [80, 79], [81, 80], [82, 23], [82, 13], [82, 74], [82, 176], [82, 54], [82, 147], [82, 254], [82, 114], [82, 216], [82, 94], [83, 5], [83, 82], [84, 83], [85, 176], [85, 23], [85, 13], [85, 74], [85, 54], [85, 147], [85, 254], [85, 114], [85, 216], [85, 94], [86, 76], [86, 85], [86, 289], [86, 273], [87, 10], [88, 86], [88, 87], [89, 273], [89, 289], [89, 88], [90, 89], [91, 90], [92, 91], [93, 92], [94, 254], [94, 114], [94, 216], [94, 94], [94, 23], [94, 13], [94, 74], [94, 176], [94, 54], [94, 147], [95, 148], [95, 8], [95, 217], [95, 73], [95, 257], [95, 95], [95, 117], [95, 183], [97, 10], [98, 176], [98, 23], [98, 13], [98, 254], [98, 216], [98, 54], [98, 147], [98, 114], [98, 94], [98, 74], [99, 98], [99, 97], [100, 273], [100, 99], [100, 289], [101, 100], [102, 101], [103, 102], [104, 103], [105, 54], [105, 147], [105, 254], [105, 114], [105, 216], [105, 94], [105, 176], [105, 23], [105, 13], [105, 74], [106, 269], [106, 246], [106, 273], [106, 106], [106, 105], [106, 168], [106, 289], [107, 10], [108, 107], [108, 106], [109, 289], [109, 273], [109, 108], [110, 109], [111, 110], [112, 111], [112, 104], [113, 112], [114, 254], [114, 114], [114, 216], [114, 54], [114, 147], [114, 94], [114, 74], [114, 176], [114, 23], [114, 13], [115, 113], [116, 115], [117, 148], [117, 8], [117, 217], [117, 73], [117, 183], [117, 257], [117, 95], [117, 117], [119, 10], [120, 176], [120, 23], [120, 13], [120, 74], [120, 54], [120, 147], [120, 254], [120, 114], [120, 216], [120, 94], [121, 119], [121, 120], [122, 289], [122, 121], [122, 273], [123, 122], [124, 123], [125, 5], [126, 125], [127, 54], [127, 147], [127, 114], [127, 216], [127, 126], [127, 94], [127, 74], [127, 176], [127, 23], [127, 13], [127, 254], [128, 127], [129, 94], [129, 74], [129, 176], [129, 23], [129, 13], [129, 254], [129, 114], [129, 216], [129, 54], [129, 147], [130, 273], [130, 119], [130, 289], [130, 129], [131, 10], [132, 131], [132, 130], [133, 273], [133, 132], [133, 289], [134, 133], [135, 134], [136, 135], [137, 136], [138, 216], [138, 54], [138, 147], [138, 114], [138, 94], [138, 74], [138, 176], [138, 23], [138, 13], [138, 254], [139, 130], [139, 273], [139, 138], [139, 289], [140, 10], [141, 140], [141, 139], [142, 289], [142, 273], [142, 141], [143, 142], [144, 143], [145, 144], [146, 145], [147, 176], [147, 23], [147, 13], [147, 147], [147, 254], [147, 114], [147, 216], [147, 54], [147, 94], [147, 74], [148, 257], [148, 117], [148, 148], [148, 8], [148, 217], [148, 73], [148, 95], [148, 183], [150, 10], [151, 94], [151, 74], [151, 176], [151, 23], [151, 13], [151, 147], [151, 254], [151, 114], [151, 216], [151, 54], [152, 151], [152, 150], [153, 289], [153, 152], [153, 273], [154, 153], [155, 154], [156, 155], [157, 216], [157, 54], [157, 94], [157, 74], [157, 176], [157, 23], [157, 13], [157, 147], [157, 254], [157, 114], [158, 289], [158, 157], [158, 273], [158, 150], [159, 10], [160, 159], [160, 158], [161, 289], [161, 273], [161, 160], [162, 161], [163, 162], [164, 163], [165, 156], [165, 164], [166, 165], [167, 94], [167, 74], [167, 176], [167, 23], [167, 13], [167, 147], [167, 254], [167, 114], [167, 216], [167, 54], [168, 165], [168, 289], [168, 167], [168, 273], [169, 10], [170, 169], [170, 168], [171, 273], [171, 170], [171, 289], [172, 171], [173, 172], [174, 166], [174, 173], [175, 174], [176, 114], [176, 216], [176, 54], [176, 94], [176, 74], [176, 176], [176, 23], [176, 13], [176, 147], [176, 254], [177, 175], [178, 177], [179, 175], [180, 179], [181, 180], [182, 181], [183, 117], [183, 148], [183, 8], [183, 217], [183, 73], [183, 95], [183, 183], [183, 257], [185, 5], [186, 185], [187, 114], [187, 216], [187, 54], [187, 94], [187, 74], [187, 186], [187, 176], [187, 23], [187, 13], [187, 147], [187, 254], [188, 187], [189, 94], [189, 74], [189, 176], [189, 23], [189, 13], [189, 147], [189, 254], [189, 114], [189, 216], [189, 54], [190, 119], [190, 189], [190, 289], [190, 273], [191, 10], [192, 191], [192, 190], [193, 273], [193, 192], [193, 289], [194, 193], [195, 194], [196, 195], [197, 196], [198, 114], [198, 216], [198, 54], [198, 94], [198, 74], [198, 176], [198, 23], [198, 13], [198, 147], [198, 254], [199, 190], [199, 273], [199, 198], [199, 289], [200, 10], [201, 199], [201, 200], [202, 273], [202, 201], [202, 289], [203, 202], [204, 203], [205, 204], [206, 205], [207, 74], [207, 176], [207, 23], [207, 54], [207, 13], [207, 147], [207, 254], [207, 114], [207, 216], [207, 94], [208, 289], [208, 199], [208, 273], [208, 207], [209, 10], [210, 209], [210, 208], [211, 289], [211, 210], [211, 273], [212, 211], [213, 212], [214, 213], [215, 214], [216, 94], [216, 74], [216, 176], [216, 23], [216, 13], [216, 147], [216, 254], [216, 114], [216, 216], [216, 54], [217, 217], [217, 73], [217, 95], [217, 183], [217, 257], [217, 117], [217, 148], [217, 8], [219, 10], [220, 147], [220, 254], [220, 114], [220, 216], [220, 54], [220, 94], [220, 74], [220, 176], [220, 23], [220, 13], [221, 219], [221, 220], [222, 289], [222, 273], [222, 221], [223, 222], [224, 223], [225, 224], [226, 225], [227, 94], [227, 74], [227, 176], [227, 23], [227, 54], [227, 13], [227, 147], [227, 254], [227, 114], [227, 216], [228, 168], [228, 289], [228, 246], [228, 106], [228, 227], [228, 269], [228, 273], [229, 10], [230, 229], [230, 228], [231, 273], [231, 230], [231, 289], [232, 231], [233, 232], [234, 233], [235, 226], [235, 234], [236, 114], [236, 216], [236, 54], [236, 94], [236, 74], [236, 176], [236, 23], [236, 13], [236, 147], [236, 254], [237, 273], [237, 236], [237, 289], [237, 228], [238, 10], [239, 238], [239, 237], [240, 273], [240, 239], [240, 289], [241, 240], [242, 241], [243, 242], [244, 243], [244, 235], [245, 74], [245, 176], [245, 54], [245, 13], [245, 147], [245, 254], [245, 114], [245, 216], [245, 94], [245, 23], [246, 289], [246, 237], [246, 273], [246, 245], [247, 10], [248, 247], [248, 246], [249, 289], [249, 273], [249, 248], [250, 249], [251, 250], [252, 251], [252, 244], [253, 252], [254, 23], [254, 94], [254, 74], [254, 176], [254, 54], [254, 13], [254, 147], [254, 254], [254, 114], [254, 216], [255, 253], [256, 255], [257, 257], [257, 117], [257, 217], [257, 73], [257, 148], [257, 8], [257, 95], [257, 183], [259, 2], [260, 259], [261, 11], [261, 290], [262, 261], [262, 3], [263, 262], [264, 253], [265, 264], [266, 265], [267, 266], [268, 290], [268, 11], [269, 273], [269, 268], [269, 289], [269, 246], [270, 2], [271, 270], [271, 269], [272, 267], [273, 272], [273, 271], [274, 290], [274, 11], [275, 253], [276, 275], [277, 276], [278, 277], [279, 2], [280, 279], [281, 274], [281, 11], [281, 290], [282, 3], [282, 281], [283, 282], [284, 11], [284, 274], [284, 290], [285, 272], [285, 244], [285, 104], [285, 24], [285, 289], [285, 284], [285, 55], [285, 166], [285, 273], [286, 2], [287, 285], [287, 286], [288, 28], [288, 113], [288, 59], [288, 175], [288, 278], [289, 287], [289, 288], [290, 274], [290, 290], [290, 11], [291, 54], [291, 13], [291, 147], [291, 254], [291, 114], [291, 216], [291, 94], [291, 23], [291, 74], [291, 176], [292, 5], [292, 291], [293, 292], [294, 7], [295, 294], [296, 7], [297, 217], [297, 73], [297, 148], [297, 8], [297, 95], [297, 183], [297, 257], [297, 117], [298, 297], [298, 296], [299, 11], [299, 290], [300, 0], [301, 299]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b_f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.jsonl.gz", "strip_func_name": "sub_409765", "query": "\n\n\nunsigned __int64 __fastcall sub_409765(__int64 a1, unsigned __int64 a2, __int64 a3, unsigned __int64 a4, char a5, _DWORD *a6)\n{\nunsigned __int64 v6; // rax\nunsigned __int64 v7; // rax\nunsigned int v9; // [rsp+3Ch] [rbp-24h]\nunsigned __int16 v10; // [rsp+4Ah] [rbp-16h]\nint v11; // [rsp+4Ch] [rbp-14h]\nunsigned __int64 v12; // [rsp+50h] [rbp-10h]\nunsigned __int64 v13; // [rsp+58h] [rbp-8h]\n\nv11 = 0;\nv12 = 0LL;\nv13 = 0LL;\nwhile ( v13 < a4 )\n{\nif ( *(char *)(a3 + v13) >= 0 )\n{\nv6 = v13++;\nv10 = *(unsigned __int8 *)(a3 + v6);\ngoto LABEL_37;\n}\nif ( (a5 & 3) != 0 && (v13 >= a4 || (*(_BYTE *)(v13 + 1 + a3) & 0xC0) != 128) && *(_BYTE *)(a3 + v13) > 0x9Fu )\n{\nv7 = v13++;\nv10 = *(unsigned __int8 *)(a3 + v7);\ngoto LABEL_37;\n}\nif ( *(_BYTE *)(a3 + v13) > 0xBFu && *(_BYTE *)(a3 + v13) <= 0xF4u )\n{\nif ( *(_BYTE *)(a3 + v13) > 0xDFu )\n{\nif ( *(_BYTE *)(a3 + v13) > 0xEFu )\n{\nif ( v13 < a4 - 3\n&& (*(_BYTE *)(v13 + 1 + a3) & 0xC0) == 128\n&& (*(_BYTE *)(v13 + 2 + a3) & 0xC0) == 128\n&& (*(_BYTE *)(v13 + 3 + a3) & 0xC0) == 128 )\n{\nv9 = (*(unsigned __int8 *)(v13 + 2 + a3) << 6) & 0xFC0 | (*(unsigned __int8 *)(v13 + 1 + a3) << 12) & 0x3F000 | (*(unsigned __int8 *)(a3 + v13) << 18) & 0xC0000 | *(_BYTE *)(v13 + 3 + a3) & 0x3F;\nv13 += 4LL;\nif ( v9 > 0xFFFF )\n{\nif ( a1 && v12 < a2 )\n*(_WORD *)(2 * v12 + a1) = ((v9 - 0x10000) >> 10) | 0xD800;\n++v12;\nv10 = v9 & 0x3FF | 0xDC00;\nLABEL_37:\nif ( a1 && v12 < a2 )\n*(_WORD *)(a1 + 2 * v12) = v10;\n++v12;\n}\nelse\n{\n++v11;\n}\n}\nelse\n{\n++v13;\n++v11;\n}\n}\nelse if ( v13 < a4 - 2 && (*(_BYTE *)(v13 + 1 + a3) & 0xC0) == 128 && (*(_BYTE *)(v13 + 2 + a3) & 0xC0) == 128 )\n{\nv10 = (*(unsigned __int8 *)(v13 + 1 + a3) << 6) & 0xFC0 | (*(unsigned __int8 *)(a3 + v13) << 12) | *(_BYTE *)(v13 + 2 + a3) & 0x3F;\nv13 += 3LL;\nif ( v10 > 0x7FFu && (v10 & 0xDF00) != 55296 )\ngoto LABEL_37;\n++v11;\n}\nelse\n{\n++v13;\n++v11;\n}\n}\nelse if ( v13 < a4 && (*(_BYTE *)(v13 + 1 + a3) & 0xC0) == 128 )\n{\nv10 = (*(unsigned __int8 *)(a3 + v13) << 6) & 0xFC0 | *(_BYTE *)(v13 + 1 + a3) & 0x3F;\nv13 += 2LL;\nif ( v10 > 0x7Fu )\ngoto LABEL_37;\n++v11;\n}\nelse\n{\n++v13;\n++v11;\n}\n}\nelse\n{\n++v11;\n++v13;\n}\n}\nif ( a6 )\n*a6 = v11;\nreturn v12;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,v9,v10,v11,v12,v13,sub_409765,]", "hints": "[]", "response": "{'a3': 'src', 'a4': 'src_len', 'a1': 'dst', 'a2': 'dst_len', 'a5': 'flags', 'a6': 'errp', 'v9': 'cc', 'v10': 'c', 'v11': 'error', 'v12': 'dpos', 'v13': 'spos', 'sub_409765': 'utf8_to_utf16'}"}
[ [ 0.736554741859436, 0.7216984033584595, 0.7082322835922241, 0.7081046104431152, 0.7060797810554504, 0.7043324112892151, 0.7027061581611633, 0.6973254680633545, 0.6897745132446289, 0.6829317808151245, 0.6804940700531006, 0.6798242330551147, 0.6777547597885132, 0.6762441396713257, 0.676200270652771, 0.6720564365386963, 0.6677162051200867, 0.6658815145492554, 0.6648074388504028, 0.6640563011169434 ], [ 102038, 135746, 183627, 190123, 264647, 158675, 148110, 19819, 83902, 184887, 156235, 172860, 172438, 252712, 60838, 160032, 164285, 115262, 112335, 72682 ] ]
load_file
43c07aedb00eaf1f1b0c736cfcb29cace5e62b9f47e7269b70299d636b07d54f
begoon
i8080-core
NA
void load_file(const char* name, unsigned char* load_to) { FILE* f = fopen(name, "r+b"); int sz; if (!f) { fprintf(stderr, "Unable to open file \"%s\"\n", name); exit(1); } sz = 0; while (!feof(f)) { int const read = fread((void *)load_to, 1, 1024, f); if (read == 0) break; sz += read; load_to += read; } printf("\n*********************************\n"); printf("File \"%s\" loaded, size %d\n", name, sz); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40710E", "function_addr": 4223246, "binary_name": "43c07aedb00eaf1f1b0c736cfcb29cace5e62b9f47e7269b70299d636b07d54f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+filename], rdi"], [4, "mov [rbp+ptr], rsi"], [5, "mov rax, [rbp+filename]"], [6, "mov esi, offset modes"], [7, "mov rdi, rax"], [8, "call _fopen"], [9, "mov [rbp+stream], rax"], [10, "cmp [rbp+stream], 0"], [11, "jnz short loc_407161"], [12, "mov rax, cs:stderr"], [13, "mov rdx, [rbp+filename]"], [14, "mov esi, offset format"], [15, "mov rdi, rax"], [16, "mov eax, 0"], [17, "call _fprintf"], [18, "mov edi, 1"], [19, "call _exit"], [20, "mov [rbp+var_4], 0"], [21, "jmp short loc_40719F"], [22, "mov rdx, [rbp+stream]"], [23, "mov rax, [rbp+ptr]"], [24, "mov rcx, rdx"], [25, "mov edx, 400h"], [26, "mov esi, 1"], [27, "mov rdi, rax"], [28, "call _fread"], [29, "mov [rbp+var_14], eax"], [30, "cmp [rbp+var_14], 0"], [31, "jz short loc_4071B1"], [32, "mov eax, [rbp+var_14]"], [33, "add [rbp+var_4], eax"], [34, "mov eax, [rbp+var_14]"], [35, "cdqe"], [36, "add [rbp+ptr], rax"], [37, "mov rax, [rbp+stream]"], [38, "mov rdi, rax"], [39, "call _feof"], [40, "test eax, eax"], [41, "jz short loc_40716A"], [42, "jmp short loc_4071B2"], [43, "nop"], [44, "mov edi, offset s"], [45, "call _puts"], [46, "mov edx, [rbp+var_4]"], [47, "mov rax, [rbp+filename]"], [48, "mov rsi, rax"], [49, "mov edi, offset aFileSLoadedSiz"], [50, "mov eax, 0"], [51, "call _printf"], [52, "nop"], [53, "leave"], [54, "retn"]], "data_dep": [[5, 3], [7, 5], [9, 8], [10, 9], [11, 10], [13, 3], [15, 12], [22, 9], [23, 4], [23, 36], [24, 22], [27, 23], [29, 28], [30, 29], [31, 30], [32, 29], [33, 20], [33, 32], [33, 33], [34, 29], [36, 4], [36, 34], [36, 36], [37, 9], [38, 37], [40, 39], [41, 40], [46, 33], [46, 20], [47, 3], [48, 47], [54, 51]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/43c07aedb00eaf1f1b0c736cfcb29cace5e62b9f47e7269b70299d636b07d54f_43c07aedb00eaf1f1b0c736cfcb29cace5e62b9f47e7269b70299d636b07d54f.jsonl.gz", "strip_func_name": "sub_40710E", "query": "\n\n\nint __fastcall sub_40710E(const char *a1, char *a2)\n{\nint v4; // [rsp+1Ch] [rbp-14h]\nFILE *stream; // [rsp+20h] [rbp-10h]\nunsigned int v6; // [rsp+2Ch] [rbp-4h]\n\nstream = fopen(a1, \"r+b\");\nif ( !stream )\n{\nfprintf(stderr, \"Unable to open file \\\"%s\\\"\\n\", a1);\nexit(1);\n}\nv6 = 0;\nwhile ( !feof(stream) )\n{\nv4 = fread(a2, 1uLL, 0x400uLL, stream);\nif ( !v4 )\nbreak;\nv6 += v4;\na2 += v4;\n}\nputs(\"\\n*********************************\");\nreturn printf(\"File \\\"%s\\\" loaded, size %d\\n\", a1, v6);\n}\n\n\n\nQ:[a1,a2,v4,stream,v6,sub_40710E,]", "hints": "[]", "response": "{'a1': 'name', 'a2': 'load_to', 'v4': 'read', 'stream': 'f', 'v6': 'sz', 'sub_40710E': 'load_file'}"}
[ [ 0.8338678479194641, 0.7911597490310669, 0.7800928354263306, 0.7720048427581787, 0.7623245120048523, 0.762025773525238, 0.7613424062728882, 0.7611676454544067, 0.754075288772583, 0.7468896508216858, 0.7440983653068542, 0.7427850365638733, 0.7412405610084534, 0.7401643991470337, 0.7338928580284119, 0.7284931540489197, 0.7235372066497803, 0.7225151062011719, 0.7218667268753052, 0.7203863263130188 ], [ 139246, 149064, 120535, 138300, 31376, 198470, 152479, 78937, 240205, 34840, 50935, 202128, 167629, 226905, 221022, 247259, 195359, 214024, 164371, 225045 ] ]
bits_ref
db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc
thanks4opensource
regbits
NA
__attribute__((noinline)) void bits_ref( const enum SERIAL_CONFIG *bit , const uint32_t *value) { SERIAL2->config.word = 0; switch (*bit) { case MODE: SERIAL2->config.mode = *value; SERIAL2->config.mode = *value; break; case POLARITY: SERIAL2->config.polarity = *value; SERIAL2->config.polarity = *value; break; case ENDIAN: SERIAL2->config.endian = *value; SERIAL2->config.endian = *value; break; default: break; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401E22", "function_addr": 4202018, "binary_name": "db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov eax, 7002C0h"], [5, "mov dword ptr [rax+4], 0"], [6, "mov rax, [rbp+var_8]"], [7, "mov eax, [rax]"], [8, "cmp eax, 4"], [9, "jz short loc_401EA7"], [10, "cmp eax, 4"], [11, "ja loc_401F3B"], [12, "test eax, eax"], [13, "jz short loc_401E60"], [14, "cmp eax, 3"], [15, "jz loc_401EF1"], [16, "jmp loc_401F3B"], [17, "mov rax, [rbp+var_10]"], [18, "mov eax, [rax]"], [19, "mov edx, 7002C0h"], [20, "and eax, 1"], [21, "movzx eax, al"], [22, "and eax, 1"], [23, "mov ecx, eax"], [24, "mov eax, [rdx+4]"], [25, "and eax, 0FFFFFFFEh"], [26, "or eax, ecx"], [27, "mov [rdx+4], eax"], [28, "mov rax, [rbp+var_10]"], [29, "mov eax, [rax]"], [30, "mov edx, 7002C0h"], [31, "and eax, 1"], [32, "movzx eax, al"], [33, "and eax, 1"], [34, "mov ecx, eax"], [35, "mov eax, [rdx+4]"], [36, "and eax, 0FFFFFFFEh"], [37, "or eax, ecx"], [38, "mov [rdx+4], eax"], [39, "jmp loc_401F3C"], [40, "mov rax, [rbp+var_10]"], [41, "mov eax, [rax]"], [42, "mov edx, 7002C0h"], [43, "and eax, 1"], [44, "movzx eax, al"], [45, "and eax, 1"], [46, "shl eax, 6"], [47, "mov ecx, eax"], [48, "mov eax, [rdx+4]"], [49, "and eax, 0FFFFFFBFh"], [50, "or eax, ecx"], [51, "mov [rdx+4], eax"], [52, "mov rax, [rbp+var_10]"], [53, "mov eax, [rax]"], [54, "mov edx, 7002C0h"], [55, "and eax, 1"], [56, "movzx eax, al"], [57, "and eax, 1"], [58, "shl eax, 6"], [59, "mov ecx, eax"], [60, "mov eax, [rdx+4]"], [61, "and eax, 0FFFFFFBFh"], [62, "or eax, ecx"], [63, "mov [rdx+4], eax"], [64, "jmp short loc_401F3C"], [65, "mov rax, [rbp+var_10]"], [66, "mov eax, [rax]"], [67, "mov edx, 7002C0h"], [68, "and eax, 1"], [69, "movzx eax, al"], [70, "and eax, 1"], [71, "shl eax, 5"], [72, "mov ecx, eax"], [73, "mov eax, [rdx+4]"], [74, "and eax, 0FFFFFFDFh"], [75, "or eax, ecx"], [76, "mov [rdx+4], eax"], [77, "mov rax, [rbp+var_10]"], [78, "mov eax, [rax]"], [79, "mov edx, 7002C0h"], [80, "and eax, 1"], [81, "movzx eax, al"], [82, "and eax, 1"], [83, "shl eax, 5"], [84, "mov ecx, eax"], [85, "mov eax, [rdx+4]"], [86, "and eax, 0FFFFFFDFh"], [87, "or eax, ecx"], [88, "mov [rdx+4], eax"], [89, "jmp short loc_401F3C"], [90, "nop"], [91, "nop"], [92, "pop rbp"], [93, "retn"]], "data_dep": [[5, 4], [6, 2], [7, 5], [7, 6], [8, 7], [9, 8], [10, 7], [11, 10], [12, 7], [13, 12], [14, 12], [15, 14], [17, 3], [18, 17], [18, 5], [18, 27], [18, 38], [20, 18], [21, 20], [22, 21], [23, 22], [24, 19], [24, 5], [24, 27], [24, 38], [25, 24], [26, 23], [26, 25], [27, 26], [27, 19], [28, 3], [29, 27], [29, 28], [31, 29], [32, 31], [33, 32], [34, 33], [35, 30], [35, 27], [36, 35], [37, 34], [37, 36], [38, 37], [38, 30], [40, 3], [41, 40], [41, 51], [41, 5], [41, 63], [43, 41], [44, 43], [45, 44], [46, 45], [47, 46], [48, 63], [48, 42], [48, 51], [48, 5], [49, 48], [50, 47], [50, 49], [51, 50], [51, 42], [52, 3], [53, 52], [53, 51], [55, 53], [56, 55], [57, 56], [58, 57], [59, 58], [60, 54], [60, 51], [61, 60], [62, 59], [62, 61], [63, 54], [63, 62], [65, 3], [66, 5], [66, 88], [66, 65], [66, 76], [68, 66], [69, 68], [70, 69], [71, 70], [72, 71], [73, 67], [73, 76], [73, 5], [73, 88], [74, 73], [75, 72], [75, 74], [76, 67], [76, 75], [77, 3], [78, 77], [78, 76], [80, 78], [81, 80], [82, 81], [83, 82], [84, 83], [85, 79], [85, 76], [86, 85], [87, 84], [87, 86], [88, 79], [88, 87], [92, 0], [93, 62], [93, 37], [93, 12], [93, 87], [93, 7]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc_db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc.jsonl.gz", "strip_func_name": "sub_401E22", "query": "\n\n\n__int64 __fastcall sub_401E22(unsigned int *a1, _DWORD *a2)\n{\n__int64 result; // rax\nint v3; // ecx\nint v4; // ecx\nint v5; // ecx\n\nMEMORY[0x7002C4] = 0;\nresult = *a1;\nif ( (_DWORD)result == 4 )\n{\nMEMORY[0x7002C4] = ((*a2 & 1) << 6) | MEMORY[0x7002C4] & 0xFFFFFFBF;\nv4 = (*a2 & 1) << 6;\nresult = v4 | MEMORY[0x7002C4] & 0xFFFFFFBF;\nMEMORY[0x7002C4] = v4 | MEMORY[0x7002C4] & 0xFFFFFFBF;\n}\nelse if ( (unsigned int)result <= 4 )\n{\nif ( (_DWORD)result )\n{\nif ( (_DWORD)result == 3 )\n{\nMEMORY[0x7002C4] = (32 * (*a2 & 1)) | MEMORY[0x7002C4] & 0xFFFFFFDF;\nv5 = 32 * (*a2 & 1);\nresult = v5 | MEMORY[0x7002C4] & 0xFFFFFFDF;\nMEMORY[0x7002C4] = v5 | MEMORY[0x7002C4] & 0xFFFFFFDF;\n}\n}\nelse\n{\nMEMORY[0x7002C4] = *a2 & 1 | MEMORY[0x7002C4] & 0xFFFFFFFE;\nv3 = *a2 & 1;\nresult = v3 | MEMORY[0x7002C4] & 0xFFFFFFFE;\nMEMORY[0x7002C4] = v3 | MEMORY[0x7002C4] & 0xFFFFFFFE;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_401E22,]", "hints": "[]", "response": "{'a1': 'bit', 'a2': 'value', 'sub_401E22': 'bits_ref'}"}
[ [ 0.8786479830741882, 0.8339424133300781, 0.8244296312332153, 0.8223997354507446, 0.8210666179656982, 0.8198036551475525, 0.8167089223861694, 0.8134979605674744, 0.8118414282798767, 0.7951127290725708, 0.7753199338912964, 0.7513419389724731, 0.7471001148223877, 0.7394897937774658, 0.7339826226234436, 0.7307848930358887, 0.7306936979293823, 0.7302358150482178, 0.7275220155715942, 0.7270539999008179 ], [ 81495, 233797, 110923, 140283, 113048, 183825, 82522, 249384, 26766, 221567, 195244, 249857, 146422, 45963, 41791, 258436, 155598, 10799, 79424, 238206 ] ]
dial
0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6
kieselsteini
cgo
NA
int dial(const char *host, const char *port, const char *selector) { struct addrinfo hints; struct addrinfo *res, *r; int srv = -1, l; char request[512]; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if (getaddrinfo(host, port, &hints, &res) != 0) { fprintf(stderr, "error: cannot resolve hostname '%s:%s': %s\n", host, port, strerror(errno)); return -1; } for (r = res; r; r = r->ai_next) { srv = socket(r->ai_family, r->ai_socktype, r->ai_protocol); if (srv == -1) continue; if (connect(srv, r->ai_addr, r->ai_addrlen) == 0) break; close(srv); } freeaddrinfo(res); if (! r) { fprintf(stderr, "error: cannot connect to host '%s:%s'\n", host, port); return -1; } snprintf(request, sizeof(request), "%s\r\n", selector); l = strlen(request); if (write(srv, request, l) != l) { fprintf(stderr, "error: cannot complete request\n"); close(srv); return -1; } return srv; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4019F0", "function_addr": 4200944, "binary_name": "0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 270h"], [3, "mov [rbp+name], rdi"], [4, "mov [rbp+service], rsi"], [5, "mov [rbp+var_268], rdx"], [6, "mov [rbp+fd], 0FFFFFFFFh"], [7, "lea rax, [rbp+s]"], [8, "mov edx, 30h "], [9, "mov esi, 0"], [10, "mov rdi, rax"], [11, "call _memset"], [12, "mov [rbp+var_3C], 0"], [13, "mov [rbp+var_38], 1"], [14, "lea rcx, [rbp+pai]"], [15, "lea rdx, [rbp+s]"], [16, "mov rsi, [rbp+service]"], [17, "mov rax, [rbp+name]"], [18, "mov rdi, rax"], [19, "call _getaddrinfo"], [20, "test eax, eax"], [21, "jz short loc_401AA2"], [22, "call ___errno_location"], [23, "mov eax, [rax]"], [24, "mov edi, eax"], [25, "call _strerror"], [26, "mov rsi, rax"], [27, "mov rax, cs:stderr"], [28, "mov rcx, [rbp+service]"], [29, "mov rdx, [rbp+name]"], [30, "mov r8, rsi"], [31, "mov esi, offset aErrorCannotRes"], [32, "mov rdi, rax"], [33, "mov eax, 0"], [34, "call _fprintf"], [35, "mov eax, 0FFFFFFFFh"], [36, "jmp locret_401BEB"], [37, "mov rax, [rbp+pai]"], [38, "mov [rbp+var_8], rax"], [39, "jmp short loc_401B0C"], [40, "mov rax, [rbp+var_8]"], [41, "mov edx, [rax+0Ch]"], [42, "mov rax, [rbp+var_8]"], [43, "mov ecx, [rax+8]"], [44, "mov rax, [rbp+var_8]"], [45, "mov eax, [rax+4]"], [46, "mov esi, ecx"], [47, "mov edi, eax"], [48, "call _socket"], [49, "mov [rbp+fd], eax"], [50, "cmp [rbp+fd], 0FFFFFFFFh"], [51, "jz short loc_401AFF"], [52, "mov rax, [rbp+var_8]"], [53, "mov edx, [rax+10h]"], [54, "mov rax, [rbp+var_8]"], [55, "mov rcx, [rax+18h]"], [56, "mov eax, [rbp+fd]"], [57, "mov rsi, rcx"], [58, "mov edi, eax"], [59, "call _connect"], [60, "test eax, eax"], [61, "jz short loc_401B15"], [62, "mov eax, [rbp+fd]"], [63, "mov edi, eax"], [64, "call _close"], [65, "jmp short loc_401B00"], [66, "nop"], [67, "mov rax, [rbp+var_8]"], [68, "mov rax, [rax+28h]"], [69, "mov [rbp+var_8], rax"], [70, "cmp [rbp+var_8], 0"], [71, "jnz short loc_401AAC"], [72, "jmp short loc_401B16"], [73, "nop"], [74, "mov rax, [rbp+pai]"], [75, "mov rdi, rax"], [76, "call _freeaddrinfo"], [77, "cmp [rbp+var_8], 0"], [78, "jnz short loc_401B5A"], [79, "mov rax, cs:stderr"], [80, "mov rcx, [rbp+service]"], [81, "mov rdx, [rbp+name]"], [82, "mov esi, offset aErrorCannotCon"], [83, "mov rdi, rax"], [84, "mov eax, 0"], [85, "call _fprintf"], [86, "mov eax, 0FFFFFFFFh"], [87, "jmp locret_401BEB"], [88, "mov rdx, [rbp+var_268]"], [89, "lea rax, [rbp+buf]"], [90, "mov rcx, rdx"], [91, "mov edx, offset aS_0"], [92, "mov esi, 200h"], [93, "mov rdi, rax"], [94, "mov eax, 0"], [95, "call _snprintf"], [96, "lea rax, [rbp+buf]"], [97, "mov rdi, rax"], [98, "call _strlen"], [99, "mov [rbp+var_10], eax"], [100, "mov eax, [rbp+var_10]"], [101, "movsxd rdx, eax"], [102, "lea rcx, [rbp+buf]"], [103, "mov eax, [rbp+fd]"], [104, "mov rsi, rcx"], [105, "mov edi, eax"], [106, "call _write"], [107, "mov edx, [rbp+var_10]"], [108, "movsxd rdx, edx"], [109, "cmp rax, rdx"], [110, "jz short loc_401BE8"], [111, "mov rax, cs:stderr"], [112, "mov rcx, rax"], [113, "mov edx, 1Fh"], [114, "mov esi, 1"], [115, "mov edi, offset aErrorCannotCom"], [116, "call _fwrite"], [117, "mov eax, [rbp+fd]"], [118, "mov edi, eax"], [119, "call _close"], [120, "mov eax, 0FFFFFFFFh"], [121, "jmp short locret_401BEB"], [122, "mov eax, [rbp+fd]"], [123, "leave"], [124, "retn"]], "data_dep": [[10, 7], [15, 8], [16, 4], [17, 3], [18, 17], [20, 19], [21, 20], [23, 22], [24, 23], [26, 25], [28, 4], [29, 3], [30, 26], [32, 27], [38, 37], [40, 38], [40, 69], [41, 40], [42, 38], [42, 69], [43, 42], [44, 38], [44, 69], [45, 44], [46, 43], [47, 45], [49, 48], [50, 49], [51, 50], [52, 69], [52, 38], [53, 52], [54, 69], [54, 38], [55, 54], [56, 49], [57, 55], [58, 56], [60, 59], [61, 60], [62, 49], [63, 62], [67, 38], [67, 69], [68, 67], [69, 68], [70, 38], [70, 69], [71, 70], [75, 74], [77, 69], [77, 38], [78, 77], [80, 4], [81, 3], [83, 79], [88, 5], [89, 76], [90, 88], [93, 89], [96, 95], [97, 96], [99, 98], [100, 99], [101, 100], [102, 90], [103, 49], [103, 6], [104, 102], [105, 103], [107, 99], [108, 107], [109, 106], [109, 108], [110, 109], [112, 111], [117, 6], [117, 49], [118, 117], [122, 49], [122, 6], [124, 120], [124, 122], [124, 35], [124, 86]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6_0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6.jsonl.gz", "strip_func_name": "sub_4019F0", "query": "\n\n\n__int64 __fastcall sub_4019F0(const char *a1, const char *a2, const char *a3)\n{\nint *v3; // rax\nchar *v4; // rax\n__int64 result; // rax\nssize_t v6; // rax\nchar buf[520]; // [rsp+20h] [rbp-250h] BYREF\nstruct addrinfo *pai; // [rsp+228h] [rbp-48h] BYREF\nstruct addrinfo s; // [rsp+230h] [rbp-40h] BYREF\nint v11; // [rsp+260h] [rbp-10h]\nint fd; // [rsp+264h] [rbp-Ch]\nstruct addrinfo *i; // [rsp+268h] [rbp-8h]\n\nfd = -1;\nmemset(&s, 0, sizeof(s));\ns.ai_family = 0;\ns.ai_socktype = 1;\nif ( getaddrinfo(a1, a2, &s, &pai) )\n{\nv3 = __errno_location();\nv4 = strerror(*v3);\nfprintf(stderr, \"error: cannot resolve hostname '%s:%s': %s\\n\", a1, a2, v4);\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nfor ( i = pai; i; i = i->ai_next )\n{\nfd = socket(i->ai_family, i->ai_socktype, i->ai_protocol);\nif ( fd != -1 )\n{\nif ( !connect(fd, i->ai_addr, i->ai_addrlen) )\nbreak;\nclose(fd);\n}\n}\nfreeaddrinfo(pai);\nif ( i )\n{\nsnprintf(buf, 0x200uLL, \"%s\\r\\n\", a3);\nv11 = strlen(buf);\nv6 = write(fd, buf, v11);\nif ( v6 == v11 )\n{\nresult = (unsigned int)fd;\n}\nelse\n{\nfwrite(\"error: cannot complete request\\n\", 1uLL, 0x1FuLL, stderr);\nclose(fd);\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nfprintf(stderr, \"error: cannot connect to host '%s:%s'\\n\", a1, a2);\nresult = 0xFFFFFFFFLL;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,buf,pai,s,v11,fd,i,sub_4019F0,]", "hints": "[]", "response": "{'a3': 'selector', 'a1': 'host', 'a2': 'port', 'buf': 'request', 'pai': 'res', 's': 'hints', 'v11': 'l', 'fd': 'srv', 'i': 'r', 'sub_4019F0': 'dial'}"}
[ [ 0.8005456328392029, 0.7765570878982544, 0.771251916885376, 0.767074465751648, 0.7436594367027283, 0.7396881580352783, 0.7375365495681763, 0.7335714101791382, 0.7301290035247803, 0.7266127467155457, 0.726161003112793, 0.7252570390701294, 0.7242791652679443, 0.7203155755996704, 0.7167350053787231, 0.7136854529380798, 0.7116262912750244, 0.7072082757949829, 0.7017155885696411, 0.700934648513794 ], [ 103130, 126284, 187950, 158749, 199460, 8434, 134335, 224877, 160722, 27675, 14528, 157840, 18986, 105102, 212227, 20199, 153475, 14296, 64964, 164432 ] ]
bits_val
db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc
thanks4opensource
regbits
NA
__attribute__((noinline)) void bits_val( const enum SERIAL_CONFIG bit , const uint32_t value) { SERIAL2->config.word = 0; switch (bit) { case MODE: SERIAL2->config.mode = value; SERIAL2->config.mode = value; break; case POLARITY: SERIAL2->config.polarity = value; SERIAL2->config.polarity = value; break; case ENDIAN: SERIAL2->config.endian = value; SERIAL2->config.endian = value; break; default: break; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401C7F", "function_addr": 4201599, "binary_name": "db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "mov [rbp+var_8], esi"], [4, "mov eax, 7002C0h"], [5, "mov dword ptr [rax+4], 0"], [6, "cmp [rbp+var_4], 4"], [7, "jz short loc_401CFB"], [8, "cmp [rbp+var_4], 4"], [9, "ja loc_401D83"], [10, "cmp [rbp+var_4], 0"], [11, "jz short loc_401CBA"], [12, "cmp [rbp+var_4], 3"], [13, "jz loc_401D3F"], [14, "jmp loc_401D83"], [15, "mov edx, 7002C0h"], [16, "mov eax, [rbp+var_8]"], [17, "and eax, 1"], [18, "movzx eax, al"], [19, "and eax, 1"], [20, "mov ecx, eax"], [21, "mov eax, [rdx+4]"], [22, "and eax, 0FFFFFFFEh"], [23, "or eax, ecx"], [24, "mov [rdx+4], eax"], [25, "mov edx, 7002C0h"], [26, "mov eax, [rbp+var_8]"], [27, "and eax, 1"], [28, "movzx eax, al"], [29, "and eax, 1"], [30, "mov ecx, eax"], [31, "mov eax, [rdx+4]"], [32, "and eax, 0FFFFFFFEh"], [33, "or eax, ecx"], [34, "mov [rdx+4], eax"], [35, "jmp loc_401D84"], [36, "mov edx, 7002C0h"], [37, "mov eax, [rbp+var_8]"], [38, "and eax, 1"], [39, "movzx eax, al"], [40, "and eax, 1"], [41, "shl eax, 6"], [42, "mov ecx, eax"], [43, "mov eax, [rdx+4]"], [44, "and eax, 0FFFFFFBFh"], [45, "or eax, ecx"], [46, "mov [rdx+4], eax"], [47, "mov edx, 7002C0h"], [48, "mov eax, [rbp+var_8]"], [49, "and eax, 1"], [50, "movzx eax, al"], [51, "and eax, 1"], [52, "shl eax, 6"], [53, "mov ecx, eax"], [54, "mov eax, [rdx+4]"], [55, "and eax, 0FFFFFFBFh"], [56, "or eax, ecx"], [57, "mov [rdx+4], eax"], [58, "jmp short loc_401D84"], [59, "mov edx, 7002C0h"], [60, "mov eax, [rbp+var_8]"], [61, "and eax, 1"], [62, "movzx eax, al"], [63, "and eax, 1"], [64, "shl eax, 5"], [65, "mov ecx, eax"], [66, "mov eax, [rdx+4]"], [67, "and eax, 0FFFFFFDFh"], [68, "or eax, ecx"], [69, "mov [rdx+4], eax"], [70, "mov edx, 7002C0h"], [71, "mov eax, [rbp+var_8]"], [72, "and eax, 1"], [73, "movzx eax, al"], [74, "and eax, 1"], [75, "shl eax, 5"], [76, "mov ecx, eax"], [77, "mov eax, [rdx+4]"], [78, "and eax, 0FFFFFFDFh"], [79, "or eax, ecx"], [80, "mov [rdx+4], eax"], [81, "jmp short loc_401D84"], [82, "nop"], [83, "nop"], [84, "pop rbp"], [85, "retn"]], "data_dep": [[5, 4], [6, 2], [7, 6], [8, 2], [9, 8], [10, 2], [11, 10], [12, 2], [13, 12], [16, 3], [17, 16], [18, 17], [19, 18], [20, 19], [21, 34], [21, 15], [21, 24], [21, 5], [22, 21], [23, 20], [23, 22], [24, 23], [24, 15], [26, 3], [27, 26], [28, 27], [29, 28], [30, 29], [31, 24], [31, 25], [32, 31], [33, 30], [33, 32], [34, 25], [34, 33], [37, 3], [38, 37], [39, 38], [40, 39], [41, 40], [42, 41], [43, 46], [43, 5], [43, 57], [43, 36], [44, 43], [45, 42], [45, 44], [46, 36], [46, 45], [48, 3], [49, 48], [50, 49], [51, 50], [52, 51], [53, 52], [54, 46], [54, 47], [55, 54], [56, 53], [56, 55], [57, 47], [57, 56], [60, 3], [61, 60], [62, 61], [63, 62], [64, 63], [65, 64], [66, 5], [66, 69], [66, 80], [66, 59], [67, 66], [68, 65], [68, 67], [69, 59], [69, 68], [71, 3], [72, 71], [73, 72], [74, 73], [75, 74], [76, 75], [77, 69], [77, 70], [78, 77], [79, 76], [79, 78], [80, 70], [80, 79], [84, 0], [85, 4], [85, 79], [85, 56], [85, 33]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc_db0ab7a0b8684e1cc9de62f82fa3c990f35ec686b14bca7a654d303686f98cbc.jsonl.gz", "strip_func_name": "sub_401C7F", "query": "\n\n\n__int64 __fastcall sub_401C7F(unsigned int a1, char a2)\n{\n__int64 result; // rax\nint v3; // ecx\nint v4; // ecx\nint v5; // ecx\n\nresult = 7340736LL;\nMEMORY[0x7002C4] = 0;\nif ( a1 == 4 )\n{\nMEMORY[0x7002C4] = ((a2 & 1) << 6) | MEMORY[0x7002C4] & 0xFFFFFFBF;\nv4 = (a2 & 1) << 6;\nresult = v4 | MEMORY[0x7002C4] & 0xFFFFFFBF;\nMEMORY[0x7002C4] = v4 | MEMORY[0x7002C4] & 0xFFFFFFBF;\n}\nelse if ( a1 <= 4 )\n{\nif ( a1 )\n{\nif ( a1 == 3 )\n{\nMEMORY[0x7002C4] = (32 * (a2 & 1)) | MEMORY[0x7002C4] & 0xFFFFFFDF;\nv5 = 32 * (a2 & 1);\nresult = v5 | MEMORY[0x7002C4] & 0xFFFFFFDF;\nMEMORY[0x7002C4] = v5 | MEMORY[0x7002C4] & 0xFFFFFFDF;\n}\n}\nelse\n{\nMEMORY[0x7002C4] = a2 & 1 | MEMORY[0x7002C4] & 0xFFFFFFFE;\nv3 = a2 & 1;\nresult = v3 | MEMORY[0x7002C4] & 0xFFFFFFFE;\nMEMORY[0x7002C4] = v3 | MEMORY[0x7002C4] & 0xFFFFFFFE;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_401C7F,]", "hints": "[]", "response": "{'a1': 'bit', 'a2': 'value', 'sub_401C7F': 'bits_val'}"}
[ [ 0.8119586706161499, 0.7707862257957458, 0.7673341631889343, 0.7545182704925537, 0.7351499795913696, 0.7350441813468933, 0.7314135432243347, 0.7282418608665466, 0.726844310760498, 0.726237416267395, 0.7187343239784241, 0.7130535840988159, 0.7117708325386047, 0.707912802696228, 0.7072937488555908, 0.7063334584236145, 0.7058924436569214, 0.7037513256072998, 0.7037267684936523, 0.702411949634552 ], [ 124655, 23170, 143900, 201852, 211743, 69415, 230963, 239095, 110483, 10061, 215142, 165483, 39050, 138706, 258718, 217683, 123390, 215897, 206844, 108175 ] ]
parse_string
f1453469e52c8b05368fa3f43fd36f30545becdf49a46b3747cb8d6df8025528
aliyun
iotkit-embedded
NA
static int parse_string(lite_cjson_t *const item, parse_buffer *const input_buffer) { const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; /* unsigned char *output_pointer = NULL; */ /* unsigned char *output = NULL; */ /* not a string */ if (buffer_at_offset(input_buffer)[0] != '\"') { /* printf("not a string"); */ goto fail; } { /* calculate approximate size of the output (overestimate) */ /* int allocation_length = 0; */ int skipped_bytes = 0; while (((int)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) { /* is escape sequence */ if (input_end[0] == '\\') { if ((int)(input_end + 1 - input_buffer->content) >= input_buffer->length) { /* prevent buffer overflow when last input character is a backslash */ goto fail; } skipped_bytes++; input_end++; } input_end++; } if (((int)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) { /* printf("end error\n"); */ goto fail; /* string ended unexpectedly */ } #if 0 /* This is at most how much we need for the output */ allocation_length = (int)(input_end - buffer_at_offset(input_buffer)) - skipped_bytes; output = (unsigned char *)input_buffer->hooks.allocate(allocation_length + sizeof("")); if (output == NULL) { goto fail; /* allocation failure */ } #endif } #if 0 output_pointer = output; /* loop through the string literal */ while (input_pointer < input_end) { if (*input_pointer != '\\') { *output_pointer++ = *input_pointer++; } /* escape sequence */ else { unsigned char sequence_length = 2; if ((input_end - input_pointer) < 1) { goto fail; } switch (input_pointer[1]) { case 'b': *output_pointer++ = '\b'; break; case 'f': *output_pointer++ = '\f'; break; case 'n': *output_pointer++ = '\n'; break; case 'r': *output_pointer++ = '\r'; break; case 't': *output_pointer++ = '\t'; break; case '\"': case '\\': case '/': *output_pointer++ = input_pointer[1]; break; /* UTF-16 literal */ case 'u': sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); if (sequence_length == 0) { /* failed to convert UTF16-literal to UTF-8 */ goto fail; } break; default: goto fail; } input_pointer += sequence_length; } } /* zero terminate the output */ *output_pointer = '\0'; #endif item->type = cJSON_String; item->value = (char *)input_pointer; item->value_length = input_end - input_pointer; input_buffer->offset = (int)(input_end - input_buffer->content); input_buffer->offset++; return 0; fail: #if 0 if (output != NULL) { input_buffer->hooks.deallocate(output); } #endif if (input_pointer != NULL) { input_buffer->offset = (int)(input_pointer - input_buffer->content); } return -1; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_419E70", "function_addr": 4300400, "binary_name": "f1453469e52c8b05368fa3f43fd36f30545becdf49a46b3747cb8d6df8025528.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov rax, [rbp+var_30]"], [5, "mov rdx, [rax]"], [6, "mov rax, [rbp+var_30]"], [7, "mov eax, [rax+0Ch]"], [8, "cdqe"], [9, "add rax, 1"], [10, "add rax, rdx"], [11, "mov [rbp+var_18], rax"], [12, "mov rax, [rbp+var_30]"], [13, "mov rdx, [rax]"], [14, "mov rax, [rbp+var_30]"], [15, "mov eax, [rax+0Ch]"], [16, "cdqe"], [17, "add rax, 1"], [18, "add rax, rdx"], [19, "mov [rbp+var_8], rax"], [20, "mov rax, [rbp+var_30]"], [21, "mov rdx, [rax]"], [22, "mov rax, [rbp+var_30]"], [23, "mov eax, [rax+0Ch]"], [24, "cdqe"], [25, "add rax, rdx"], [26, "movzx eax, byte ptr [rax]"], [27, "cmp al, 22h "], [28, "jnz loc_419FBA"], [29, "mov [rbp+var_C], 0"], [30, "jmp short loc_419F18"], [31, "mov rax, [rbp+var_8]"], [32, "movzx eax, byte ptr [rax]"], [33, "cmp al, 5Ch "], [34, "jnz short loc_419F13"], [35, "mov rax, [rbp+var_8]"], [36, "lea rdx, [rax+1]"], [37, "mov rax, [rbp+var_30]"], [38, "mov rcx, [rax]"], [39, "mov rax, rdx"], [40, "sub rax, rcx"], [41, "mov edx, eax"], [42, "mov rax, [rbp+var_30]"], [43, "mov eax, [rax+8]"], [44, "cmp edx, eax"], [45, "jge loc_419FBD"], [46, "add [rbp+var_C], 1"], [47, "add [rbp+var_8], 1"], [48, "add [rbp+var_8], 1"], [49, "mov rax, [rbp+var_30]"], [50, "mov rdx, [rax]"], [51, "mov rax, [rbp+var_8]"], [52, "sub rax, rdx"], [53, "mov edx, eax"], [54, "mov rax, [rbp+var_30]"], [55, "mov eax, [rax+8]"], [56, "cmp edx, eax"], [57, "jge short loc_419F3E"], [58, "mov rax, [rbp+var_8]"], [59, "movzx eax, byte ptr [rax]"], [60, "cmp al, 22h "], [61, "jnz short loc_419ED9"], [62, "mov rax, [rbp+var_30]"], [63, "mov rdx, [rax]"], [64, "mov rax, [rbp+var_8]"], [65, "sub rax, rdx"], [66, "mov edx, eax"], [67, "mov rax, [rbp+var_30]"], [68, "mov eax, [rax+8]"], [69, "cmp edx, eax"], [70, "jge short loc_419FC0"], [71, "mov rax, [rbp+var_8]"], [72, "movzx eax, byte ptr [rax]"], [73, "cmp al, 22h "], [74, "jnz short loc_419FC0"], [75, "mov rax, [rbp+var_28]"], [76, "mov dword ptr [rax], 10h"], [77, "mov rax, [rbp+var_28]"], [78, "mov rdx, [rbp+var_18]"], [79, "mov [rax+8], rdx"], [80, "mov rax, [rbp+var_8]"], [81, "sub rax, [rbp+var_18]"], [82, "mov edx, eax"], [83, "mov rax, [rbp+var_28]"], [84, "mov [rax+10h], edx"], [85, "mov rax, [rbp+var_30]"], [86, "mov rdx, [rax]"], [87, "mov rax, [rbp+var_8]"], [88, "sub rax, rdx"], [89, "mov edx, eax"], [90, "mov rax, [rbp+var_30]"], [91, "mov [rax+0Ch], edx"], [92, "mov rax, [rbp+var_30]"], [93, "mov eax, [rax+0Ch]"], [94, "lea edx, [rax+1]"], [95, "mov rax, [rbp+var_30]"], [96, "mov [rax+0Ch], edx"], [97, "mov eax, 0"], [98, "jmp short loc_419FE4"], [99, "nop"], [100, "jmp short loc_419FC1"], [101, "nop"], [102, "jmp short loc_419FC1"], [103, "nop"], [104, "cmp [rbp+var_18], 0"], [105, "jz short loc_419FDF"], [106, "mov rax, [rbp+var_30]"], [107, "mov rdx, [rax]"], [108, "mov rax, [rbp+var_18]"], [109, "sub rax, rdx"], [110, "mov edx, eax"], [111, "mov rax, [rbp+var_30]"], [112, "mov [rax+0Ch], edx"], [113, "mov eax, 0FFFFFFFFh"], [114, "pop rbp"], [115, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 3], [7, 6], [9, 7], [10, 5], [10, 9], [11, 10], [12, 3], [13, 12], [14, 3], [15, 14], [17, 15], [18, 17], [18, 13], [19, 18], [20, 3], [21, 20], [22, 3], [23, 22], [25, 23], [25, 21], [26, 25], [27, 26], [28, 27], [31, 19], [31, 48], [32, 31], [33, 32], [34, 33], [35, 19], [35, 48], [36, 53], [36, 35], [37, 3], [38, 37], [39, 36], [40, 38], [40, 39], [41, 40], [42, 3], [43, 42], [44, 41], [44, 43], [45, 44], [46, 29], [46, 46], [47, 48], [47, 19], [48, 47], [48, 19], [48, 48], [49, 3], [50, 49], [51, 19], [51, 48], [52, 51], [52, 50], [53, 52], [54, 3], [55, 54], [56, 53], [56, 55], [57, 56], [58, 19], [58, 48], [59, 58], [60, 59], [61, 60], [62, 3], [63, 62], [64, 48], [64, 19], [65, 63], [65, 64], [66, 65], [67, 3], [68, 67], [69, 66], [69, 68], [70, 69], [71, 19], [71, 48], [72, 71], [73, 72], [74, 73], [75, 2], [76, 75], [77, 2], [78, 11], [79, 78], [79, 77], [80, 19], [80, 48], [81, 80], [81, 11], [82, 81], [83, 2], [84, 83], [84, 82], [85, 3], [86, 76], [86, 85], [86, 84], [87, 48], [87, 19], [88, 86], [88, 87], [89, 88], [90, 3], [91, 89], [91, 90], [92, 3], [93, 92], [93, 91], [94, 89], [94, 91], [94, 93], [95, 3], [96, 95], [96, 94], [104, 11], [105, 104], [106, 3], [107, 106], [108, 11], [109, 108], [109, 107], [110, 109], [111, 3], [112, 111], [112, 110], [114, 0], [115, 113], [115, 97]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f1453469e52c8b05368fa3f43fd36f30545becdf49a46b3747cb8d6df8025528_f1453469e52c8b05368fa3f43fd36f30545becdf49a46b3747cb8d6df8025528.jsonl.gz", "strip_func_name": "sub_419E70", "query": "\n\n\n__int64 __fastcall sub_419E70(__int64 a1, __int64 a2)\n{\n__int64 result; // rax\n__int64 v3; // [rsp+18h] [rbp-18h]\nint v4; // [rsp+24h] [rbp-Ch]\n_BYTE *v5; // [rsp+28h] [rbp-8h]\n\nv3 = *(_QWORD *)a2 + *(int *)(a2 + 12) + 1LL;\nv5 = (_BYTE *)v3;\nif ( *(_BYTE *)(*(_QWORD *)a2 + *(int *)(a2 + 12)) != 34 )\ngoto LABEL_12;\nv4 = 0;\nwhile ( (signed int)((_DWORD)v5 - *(_QWORD *)a2) < *(_DWORD *)(a2 + 8) && *v5 != 34 )\n{\nif ( *v5 == 92 )\n{\nif ( (signed int)((_DWORD)v5 + 1 - *(_QWORD *)a2) >= *(_DWORD *)(a2 + 8) )\ngoto LABEL_12;\n++v4;\n++v5;\n}\n++v5;\n}\nif ( (signed int)((_DWORD)v5 - *(_QWORD *)a2) < *(_DWORD *)(a2 + 8) && *v5 == 34 )\n{\n*(_DWORD *)a1 = 16;\n*(_QWORD *)(a1 + 8) = v3;\n*(_DWORD *)(a1 + 16) = (_DWORD)v5 - v3;\n*(_DWORD *)(a2 + 12) = (_DWORD)v5 - *(_DWORD *)a2;\n++*(_DWORD *)(a2 + 12);\nresult = 0LL;\n}\nelse\n{\nLABEL_12:\nif ( v3 )\n*(_DWORD *)(a2 + 12) = v3 - *(_DWORD *)a2;\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,sub_419E70,]", "hints": "[]", "response": "{'a1': 'item', 'a2': 'input_buffer', 'v3': 'input_pointer', 'v4': 'skipped_bytes', 'v5': 'input_end', 'sub_419E70': 'parse_string_0'}"}
[ [ 0.7526399493217468, 0.724602997303009, 0.7191512584686279, 0.7165697813034058, 0.7152129411697388, 0.7146848440170288, 0.7019572854042053, 0.7017509937286377, 0.6996710300445557, 0.6980679035186768, 0.6960443258285522, 0.6958772540092468, 0.6904230117797852, 0.6854487657546997, 0.6853024959564209, 0.6826997995376587, 0.6810387372970581, 0.6792861223220825, 0.6777184009552002, 0.6763275861740112 ], [ 2079, 69872, 2221, 18661, 115693, 7722, 217223, 36474, 247532, 72157, 159149, 89416, 8218, 224066, 199730, 7091, 69721, 168476, 8488, 212842 ] ]
strbuf_appendf
7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53
kgabis
ape
NA
bool strbuf_appendf(strbuf_t *buf, const char *fmt, ...) { if (buf->failed) { return false; } va_list args; va_start(args, fmt); int to_write = vsnprintf(NULL, 0, fmt, args); va_end(args); if (to_write == 0) { return true; } size_t required_capacity = buf->len + to_write + 1; if (required_capacity > buf->capacity) { bool ok = strbuf_grow(buf, required_capacity * 2); if (!ok) { return false; } } va_start(args, fmt); int written = vsprintf(buf->data + buf->len, fmt, args); (void)written; va_end(args); if (written != to_write) { return false; } buf->len = buf->len + to_write; buf->data[buf->len] = '\0'; return true; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405174", "function_addr": 4215156, "binary_name": "7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0F0h"], [3, "mov [rbp+var_E8], rdi"], [4, "mov [rbp+format], rsi"], [5, "mov [rbp+var_A0], rdx"], [6, "mov [rbp+var_98], rcx"], [7, "mov [rbp+var_90], r8"], [8, "mov [rbp+var_88], r9"], [9, "test al, al"], [10, "jz short loc_4051CD"], [11, "movaps [rbp+var_80], xmm0"], [12, "movaps [rbp+var_70], xmm1"], [13, "movaps [rbp+var_60], xmm2"], [14, "movaps [rbp+var_50], xmm3"], [15, "movaps [rbp+var_40], xmm4"], [16, "movaps [rbp+var_30], xmm5"], [17, "movaps [rbp+var_20], xmm6"], [18, "movaps [rbp+var_10], xmm7"], [19, "mov rax, [rbp+var_E8]"], [20, "movzx eax, byte ptr [rax+8]"], [21, "test al, al"], [22, "jz short loc_4051E6"], [23, "mov eax, 0"], [24, "jmp locret_40537C"], [25, "mov [rbp+arg], 10h"], [26, "mov [rbp+var_DC], 30h "], [27, "lea rax, [rbp+arg_0]"], [28, "mov [rbp+var_D8], rax"], [29, "lea rax, [rbp+var_B0]"], [30, "mov [rbp+var_D0], rax"], [31, "lea rdx, [rbp+arg]"], [32, "mov rax, [rbp+format]"], [33, "mov rcx, rdx"], [34, "mov rdx, rax"], [35, "mov esi, 0"], [36, "mov edi, 0"], [37, "call _vsnprintf"], [38, "mov [rbp+var_B4], eax"], [39, "cmp [rbp+var_B4], 0"], [40, "jnz short loc_40524F"], [41, "mov eax, 1"], [42, "jmp locret_40537C"], [43, "mov rax, [rbp+var_E8]"], [44, "mov rdx, [rax+20h]"], [45, "mov eax, [rbp+var_B4]"], [46, "cdqe"], [47, "add rax, rdx"], [48, "add rax, 1"], [49, "mov [rbp+var_C0], rax"], [50, "mov rax, [rbp+var_E8]"], [51, "mov rax, [rax+18h]"], [52, "cmp [rbp+var_C0], rax"], [53, "jbe short loc_4052BF"], [54, "mov rax, [rbp+var_C0]"], [55, "lea rdx, [rax+rax]"], [56, "mov rax, [rbp+var_E8]"], [57, "mov rsi, rdx"], [58, "mov rdi, rax"], [59, "call sub_40542F"], [60, "mov [rbp+var_C1], al"], [61, "movzx eax, [rbp+var_C1]"], [62, "xor eax, 1"], [63, "test al, al"], [64, "jz short loc_4052BF"], [65, "mov eax, 0"], [66, "jmp locret_40537C"], [67, "mov [rbp+arg], 10h"], [68, "mov [rbp+var_DC], 30h "], [69, "lea rax, [rbp+arg_0]"], [70, "mov [rbp+var_D8], rax"], [71, "lea rax, [rbp+var_B0]"], [72, "mov [rbp+var_D0], rax"], [73, "mov rax, [rbp+var_E8]"], [74, "mov rdx, [rax+10h]"], [75, "mov rax, [rbp+var_E8]"], [76, "mov rax, [rax+20h]"], [77, "lea rcx, [rdx+rax]"], [78, "lea rdx, [rbp+arg]"], [79, "mov rax, [rbp+format]"], [80, "mov rsi, rax"], [81, "mov rdi, rcx"], [82, "call _vsprintf"], [83, "mov [rbp+var_C8], eax"], [84, "mov eax, [rbp+var_C8]"], [85, "cmp eax, [rbp+var_B4]"], [86, "jz short loc_40533A"], [87, "mov eax, 0"], [88, "jmp short locret_40537C"], [89, "mov rax, [rbp+var_E8]"], [90, "mov rdx, [rax+20h]"], [91, "mov eax, [rbp+var_B4]"], [92, "cdqe"], [93, "add rdx, rax"], [94, "mov rax, [rbp+var_E8]"], [95, "mov [rax+20h], rdx"], [96, "mov rax, [rbp+var_E8]"], [97, "mov rdx, [rax+10h]"], [98, "mov rax, [rbp+var_E8]"], [99, "mov rax, [rax+20h]"], [100, "add rax, rdx"], [101, "mov byte ptr [rax], 0"], [102, "mov eax, 1"], [103, "leave"], [104, "retn"]], "data_dep": [[10, 9], [19, 3], [20, 19], [21, 20], [22, 21], [27, 21], [28, 27], [29, 27], [30, 29], [31, 25], [32, 4], [33, 31], [34, 32], [38, 37], [39, 38], [40, 39], [43, 3], [44, 43], [45, 38], [47, 45], [47, 44], [48, 47], [49, 48], [50, 3], [51, 50], [52, 49], [52, 51], [53, 52], [54, 49], [55, 54], [55, 44], [56, 3], [57, 55], [58, 56], [60, 59], [61, 60], [62, 61], [63, 62], [64, 63], [69, 51], [69, 63], [70, 69], [71, 69], [72, 71], [73, 3], [74, 73], [75, 3], [76, 75], [77, 76], [77, 33], [78, 74], [78, 67], [79, 4], [80, 79], [81, 77], [83, 82], [84, 83], [85, 84], [85, 38], [86, 85], [89, 3], [90, 89], [91, 38], [93, 90], [93, 91], [94, 3], [95, 93], [95, 94], [96, 3], [97, 95], [97, 96], [98, 3], [99, 95], [99, 98], [100, 97], [100, 99], [101, 100], [104, 23], [104, 87], [104, 41], [104, 102], [104, 65]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53_7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.jsonl.gz", "strip_func_name": "sub_405174", "query": "\n\n\n__int64 sub_405174(__int64 a1, const char *a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, ...)\n{\ngcc_va_list arg; // [rsp+10h] [rbp-E0h] BYREF\nint v8; // [rsp+28h] [rbp-C8h]\nchar v9; // [rsp+2Fh] [rbp-C1h]\nunsigned __int64 v10; // [rsp+30h] [rbp-C0h]\nint v11; // [rsp+3Ch] [rbp-B4h]\n__int64 v12; // [rsp+50h] [rbp-A0h]\n__int64 v13; // [rsp+58h] [rbp-98h]\n__int64 v14; // [rsp+60h] [rbp-90h]\n__int64 v15; // [rsp+68h] [rbp-88h]\n\nv12 = a3;\nv13 = a4;\nv14 = a5;\nv15 = a6;\nif ( *(_BYTE *)(a1 + 8) )\nreturn 0LL;\narg[0].gp_offset = 16;\nva_start(arg, a6);\nv11 = vsnprintf(0LL, 0LL, a2, arg);\nif ( !v11 )\nreturn 1LL;\nv10 = *(_QWORD *)(a1 + 32) + v11 + 1LL;\nif ( v10 > *(_QWORD *)(a1 + 24) )\n{\nv9 = sub_40542F(a1, 2 * v10);\nif ( v9 != 1 )\nreturn 0LL;\n}\narg[0].gp_offset = 16;\nva_end(arg);\nva_start(arg, a6);\nv8 = vsprintf((char *)(*(_QWORD *)(a1 + 16) + *(_QWORD *)(a1 + 32)), a2, arg);\nif ( v8 != v11 )\nreturn 0LL;\n*(_QWORD *)(a1 + 32) += v11;\n*(_BYTE *)(*(_QWORD *)(a1 + 16) + *(_QWORD *)(a1 + 32)) = 0;\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,arg,v8,v10,v11,sub_405174,sub_40542F,]", "hints": "[]", "response": "{'a1': 'buf', 'a2': 'fmt', 'arg': 'args', 'v8': 'written', 'v10': 'required_capacity', 'v11': 'to_write', 'sub_405174': 'strbuf_appendf', 'sub_40542F': 'strbuf_grow'}"}
[ [ 0.7245916128158569, 0.6815364956855774, 0.661339521408081, 0.6608321666717529, 0.6600004434585571, 0.6566764116287231, 0.6520603895187378, 0.6506757736206055, 0.6479989886283875, 0.6473520994186401, 0.6471695303916931, 0.6465649008750916, 0.6456682682037354, 0.6414361000061035, 0.6256577372550964, 0.6197088956832886, 0.6187705397605896, 0.6184009313583374, 0.6072097420692444, 0.6064859628677368 ], [ 137965, 184025, 72507, 117546, 190878, 121403, 8835, 52293, 101892, 105721, 93912, 236547, 129697, 15957, 28456, 190324, 231875, 84714, 202852, 84086 ] ]
recv_fd
89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6
Tachone
Tachftp
NA
int recv_fd(const int sock_fd) { int ret; struct msghdr msg; char recvchar; struct iovec vec; int recv_fd; char cmsgbuf[CMSG_SPACE(sizeof(recv_fd))]; struct cmsghdr *p_cmsg; int *p_fd; vec.iov_base = &recvchar; vec.iov_len = sizeof(recvchar); msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &vec; msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); msg.msg_flags = 0; p_fd = (int*)CMSG_DATA(CMSG_FIRSTHDR(&msg)); *p_fd = -1; ret = recvmsg(sock_fd, &msg, 0); if (ret != 1) ERR_EXIT("recvmsg"); p_cmsg = CMSG_FIRSTHDR(&msg); if (p_cmsg == NULL) ERR_EXIT("no passed fd"); p_fd = (int*)CMSG_DATA(p_cmsg); recv_fd = *p_fd; if (recv_fd == -1) ERR_EXIT("no passed fd"); return recv_fd; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403942", "function_addr": 4208962, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0B0h"], [3, "mov [rbp+fd], edi"], [4, "lea rax, [rbp+var_61]"], [5, "mov [rbp+var_80], rax"], [6, "mov [rbp+var_78], 1"], [7, "mov [rbp+message.msg_name], 0"], [8, "mov [rbp+message.msg_namelen], 0"], [9, "lea rax, [rbp+var_80]"], [10, "mov [rbp+message.msg_iov], rax"], [11, "mov [rbp+message.msg_iovlen], 1"], [12, "lea rax, [rbp+var_A0]"], [13, "mov [rbp+message.msg_control], rax"], [14, "mov [rbp+message.msg_controllen], 18h"], [15, "mov [rbp+message.msg_flags], 0"], [16, "mov rax, [rbp+message.msg_controllen]"], [17, "cmp rax, 0Fh"], [18, "jbe short loc_4039AC"], [19, "mov rax, [rbp+message.msg_control]"], [20, "jmp short loc_4039B1"], [21, "mov eax, 0"], [22, "add rax, 10h"], [23, "mov [rbp+var_8], rax"], [24, "mov rax, [rbp+var_8]"], [25, "mov dword ptr [rax], 0FFFFFFFFh"], [26, "lea rcx, [rbp+message]"], [27, "mov eax, [rbp+fd]"], [28, "mov edx, 0"], [29, "mov rsi, rcx"], [30, "mov edi, eax"], [31, "call _recvmsg"], [32, "mov [rbp+var_C], eax"], [33, "cmp [rbp+var_C], 1"], [34, "jz short loc_4039F9"], [35, "mov edi, offset aRecvmsg_0"], [36, "call _perror"], [37, "mov edi, 1"], [38, "call _exit"], [39, "mov rax, [rbp+message.msg_controllen]"], [40, "cmp rax, 0Fh"], [41, "jbe short loc_403A09"], [42, "mov rax, [rbp+message.msg_control]"], [43, "jmp short loc_403A0E"], [44, "mov eax, 0"], [45, "mov [rbp+var_18], rax"], [46, "cmp [rbp+var_18], 0"], [47, "jnz short loc_403A2D"], [48, "mov edi, offset aNoPassedFd"], [49, "call _perror"], [50, "mov edi, 1"], [51, "call _exit"], [52, "mov rax, [rbp+var_18]"], [53, "add rax, 10h"], [54, "mov [rbp+var_8], rax"], [55, "mov rax, [rbp+var_8]"], [56, "mov eax, [rax]"], [57, "mov [rbp+var_1C], eax"], [58, "cmp [rbp+var_1C], 0FFFFFFFFh"], [59, "jnz short loc_403A5C"], [60, "mov edi, offset aNoPassedFd"], [61, "call _perror"], [62, "mov edi, 1"], [63, "call _exit"], [64, "mov eax, [rbp+var_1C]"], [65, "leave"], [66, "retn"]], "data_dep": [[5, 4], [9, 5], [9, 4], [10, 9], [12, 9], [13, 12], [16, 14], [17, 16], [18, 17], [19, 13], [22, 19], [22, 21], [23, 22], [24, 23], [25, 24], [27, 3], [29, 26], [30, 27], [32, 31], [33, 32], [34, 33], [39, 14], [40, 39], [41, 40], [42, 13], [45, 42], [45, 44], [46, 45], [47, 46], [52, 45], [53, 52], [54, 53], [55, 54], [56, 25], [56, 55], [57, 56], [58, 57], [59, 58], [64, 57], [66, 64]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6_89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.jsonl.gz", "strip_func_name": "sub_403942", "query": "\n\n\n__int64 __fastcall sub_403942(int a1)\n{\n_DWORD *v1; // rax\nchar v3; // [rsp+10h] [rbp-A0h] BYREF\nint v4; // [rsp+20h] [rbp-90h] BYREF\n__int64 v5[3]; // [rsp+30h] [rbp-80h] BYREF\nchar v6; // [rsp+4Fh] [rbp-61h] BYREF\nstruct msghdr message; // [rsp+50h] [rbp-60h] BYREF\nunsigned int v8; // [rsp+94h] [rbp-1Ch]\n_DWORD *v9; // [rsp+98h] [rbp-18h]\nint v10; // [rsp+A4h] [rbp-Ch]\nint *v11; // [rsp+A8h] [rbp-8h]\n\nv5[0] = (__int64)&v6;\nv5[1] = 1LL;\nmessage.msg_name = 0LL;\nmessage.msg_namelen = 0;\nmessage.msg_iov = (iovec *)v5;\nmessage.msg_iovlen = 1LL;\nmessage.msg_control = &v3;\nmessage.msg_controllen = 24LL;\nmessage.msg_flags = 0;\nv11 = &v4;\nv4 = -1;\nv10 = recvmsg(a1, &message, 0);\nif ( v10 != 1 )\n{\nperror(\"recvmsg\");\nexit(1);\n}\nif ( message.msg_controllen <= 0xF )\nv1 = 0LL;\nelse\nv1 = message.msg_control;\nv9 = v1;\nif ( !v1 )\n{\nperror(\"no passed fd\");\nexit(1);\n}\nv11 = v9 + 4;\nv8 = v9[4];\nif ( v8 == -1 )\n{\nperror(\"no passed fd\");\nexit(1);\n}\nreturn v8;\n}\n\n\n\nQ:[a1,v3,v5,v6,message,v9,v11,sub_403942,]", "hints": "[]", "response": "{'a1': 'sock_fd', 'v3': 'cmsgbuf', 'v5': 'vec', 'v6': 'recvchar', 'message': 'msg', 'v9': 'p_cmsg', 'v11': 'p_fd', 'sub_403942': 'recv_fd'}"}
[ [ 0.8035526275634766, 0.7758790850639343, 0.7103190422058105, 0.6998275518417358, 0.6993834376335144, 0.6987189054489136, 0.6878138780593872, 0.6814306378364563, 0.666581392288208, 0.6663301587104797, 0.665317714214325, 0.6645965576171875, 0.6644270420074463, 0.6634647846221924, 0.6632583737373352, 0.6622083187103271, 0.6582471132278442, 0.6576937437057495, 0.6544332504272461, 0.65360027551651 ], [ 74657, 225373, 188107, 12830, 241610, 66931, 58492, 13670, 157297, 104779, 13877, 110140, 79999, 259441, 96659, 154031, 186557, 127122, 202391, 150512 ] ]
parse_time
54c09fcd7f9bb3dbf7a245bfbce5b9b2d9856ccd6bbf8a35b8bc1982b50a0706
wbx-github
openadk
NA
static time_t parse_time(char *s) { struct tm tm; int day = atoi(s); int hour = 0; while (*s && *s != '.') { s++; } if (*s) { s++; hour = atoi(s); } tm.tm_year = day / 10000 - 1900; tm.tm_mon = (day % 10000) / 100 - 1; tm.tm_mday = day % 100; tm.tm_hour = hour / 10000; tm.tm_min = (hour % 10000) / 100; tm.tm_sec = hour % 100; tm.tm_isdst = -1; return mktime(&tm); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4011CE", "function_addr": 4198862, "binary_name": "54c09fcd7f9bb3dbf7a245bfbce5b9b2d9856ccd6bbf8a35b8bc1982b50a0706.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+nptr], rdi"], [4, "mov rax, [rbp+nptr]"], [5, "mov rdi, rax"], [6, "call _atoi"], [7, "mov [rbp+var_8], eax"], [8, "mov [rbp+var_4], 0"], [9, "jmp short loc_4011F7"], [10, "add [rbp+nptr], 1"], [11, "mov rax, [rbp+nptr]"], [12, "movzx eax, byte ptr [rax]"], [13, "test al, al"], [14, "jz short loc_40120D"], [15, "mov rax, [rbp+nptr]"], [16, "movzx eax, byte ptr [rax]"], [17, "cmp al, 2Eh "], [18, "jnz short loc_4011F2"], [19, "mov rax, [rbp+nptr]"], [20, "movzx eax, byte ptr [rax]"], [21, "test al, al"], [22, "jz short loc_40122C"], [23, "add [rbp+nptr], 1"], [24, "mov rax, [rbp+nptr]"], [25, "mov rdi, rax"], [26, "call _atoi"], [27, "mov [rbp+var_4], eax"], [28, "mov eax, [rbp+var_8]"], [29, "movsxd rdx, eax"], [30, "imul rdx, 68DB8BADh"], [31, "shr rdx, 20h"], [32, "sar edx, 0Ch"], [33, "sar eax, 1Fh"], [34, "mov ecx, eax"], [35, "mov eax, edx"], [36, "sub eax, ecx"], [37, "sub eax, 76Ch"], [38, "mov [rbp+tp.tm_year], eax"], [39, "mov edx, [rbp+var_8]"], [40, "movsxd rax, edx"], [41, "imul rax, 68DB8BADh"], [42, "shr rax, 20h"], [43, "sar eax, 0Ch"], [44, "mov ecx, edx"], [45, "sar ecx, 1Fh"], [46, "sub eax, ecx"], [47, "imul ecx, eax, 2710h"], [48, "mov eax, edx"], [49, "sub eax, ecx"], [50, "movsxd rdx, eax"], [51, "imul rdx, 51EB851Fh"], [52, "shr rdx, 20h"], [53, "sar edx, 5"], [54, "sar eax, 1Fh"], [55, "mov ecx, eax"], [56, "mov eax, edx"], [57, "sub eax, ecx"], [58, "sub eax, 1"], [59, "mov [rbp+tp.tm_mon], eax"], [60, "mov edx, [rbp+var_8]"], [61, "movsxd rax, edx"], [62, "imul rax, 51EB851Fh"], [63, "shr rax, 20h"], [64, "sar eax, 5"], [65, "mov ecx, edx"], [66, "sar ecx, 1Fh"], [67, "sub eax, ecx"], [68, "imul ecx, eax, 64h "], [69, "mov eax, edx"], [70, "sub eax, ecx"], [71, "mov [rbp+tp.tm_mday], eax"], [72, "mov eax, [rbp+var_4]"], [73, "movsxd rdx, eax"], [74, "imul rdx, 68DB8BADh"], [75, "shr rdx, 20h"], [76, "sar edx, 0Ch"], [77, "sar eax, 1Fh"], [78, "mov ecx, eax"], [79, "mov eax, edx"], [80, "sub eax, ecx"], [81, "mov [rbp+tp.tm_hour], eax"], [82, "mov edx, [rbp+var_4]"], [83, "movsxd rax, edx"], [84, "imul rax, 68DB8BADh"], [85, "shr rax, 20h"], [86, "sar eax, 0Ch"], [87, "mov ecx, edx"], [88, "sar ecx, 1Fh"], [89, "sub eax, ecx"], [90, "imul ecx, eax, 2710h"], [91, "mov eax, edx"], [92, "sub eax, ecx"], [93, "movsxd rdx, eax"], [94, "imul rdx, 51EB851Fh"], [95, "shr rdx, 20h"], [96, "sar edx, 5"], [97, "sar eax, 1Fh"], [98, "mov ecx, eax"], [99, "mov eax, edx"], [100, "sub eax, ecx"], [101, "mov [rbp+tp.tm_min], eax"], [102, "mov edx, [rbp+var_4]"], [103, "movsxd rax, edx"], [104, "imul rax, 51EB851Fh"], [105, "shr rax, 20h"], [106, "sar eax, 5"], [107, "mov ecx, edx"], [108, "sar ecx, 1Fh"], [109, "sub eax, ecx"], [110, "imul ecx, eax, 64h "], [111, "mov eax, edx"], [112, "sub eax, ecx"], [113, "mov [rbp+tp.tm_sec], eax"], [114, "mov [rbp+tp.tm_isdst], 0FFFFFFFFh"], [115, "lea rax, [rbp+tp]"], [116, "mov rdi, rax"], [117, "call _mktime"], [118, "leave"], [119, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [10, 10], [10, 3], [11, 10], [11, 3], [12, 11], [13, 12], [14, 13], [15, 10], [15, 3], [16, 15], [17, 16], [18, 17], [19, 10], [19, 3], [20, 19], [21, 20], [22, 21], [23, 10], [23, 3], [24, 23], [25, 24], [27, 26], [28, 7], [29, 28], [30, 29], [31, 30], [32, 31], [33, 28], [34, 33], [35, 32], [36, 34], [36, 35], [37, 36], [38, 37], [39, 7], [40, 39], [41, 40], [42, 41], [43, 42], [44, 39], [45, 44], [46, 43], [46, 45], [47, 45], [47, 46], [48, 39], [49, 48], [49, 47], [50, 49], [51, 50], [52, 51], [53, 52], [54, 49], [55, 54], [56, 53], [57, 56], [57, 55], [58, 57], [59, 58], [60, 7], [61, 60], [62, 61], [63, 62], [64, 63], [65, 60], [66, 65], [67, 64], [67, 66], [68, 66], [68, 67], [69, 60], [70, 68], [70, 69], [71, 70], [72, 27], [72, 8], [73, 72], [74, 73], [75, 74], [76, 75], [77, 72], [78, 77], [79, 76], [80, 78], [80, 79], [81, 80], [82, 8], [82, 27], [83, 82], [84, 83], [85, 84], [86, 85], [87, 82], [88, 87], [89, 86], [89, 88], [90, 88], [90, 89], [91, 82], [92, 90], [92, 91], [93, 92], [94, 93], [95, 94], [96, 95], [97, 92], [98, 97], [99, 96], [100, 98], [100, 99], [101, 100], [102, 27], [102, 8], [103, 102], [104, 103], [105, 104], [106, 105], [107, 102], [108, 107], [109, 106], [109, 108], [110, 109], [110, 108], [111, 102], [112, 111], [112, 110], [113, 112], [115, 112], [116, 115], [119, 117]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/54c09fcd7f9bb3dbf7a245bfbce5b9b2d9856ccd6bbf8a35b8bc1982b50a0706_54c09fcd7f9bb3dbf7a245bfbce5b9b2d9856ccd6bbf8a35b8bc1982b50a0706.jsonl.gz", "strip_func_name": "sub_4011CE", "query": "\n\n\ntime_t __fastcall sub_4011CE(const char *a1)\n{\nchar *nptr; // [rsp+8h] [rbp-48h]\nstruct tm tp; // [rsp+10h] [rbp-40h] BYREF\nint v4; // [rsp+48h] [rbp-8h]\nint v5; // [rsp+4Ch] [rbp-4h]\n\nnptr = (char *)a1;\nv4 = atoi(a1);\nv5 = 0;\nwhile ( *nptr && *nptr != 46 )\n++nptr;\nif ( *nptr )\nv5 = atoi(nptr + 1);\ntp.tm_year = v4 / 10000 - 1900;\ntp.tm_mon = v4 % 10000 / 100 - 1;\ntp.tm_mday = v4 % 100;\ntp.tm_hour = v5 / 10000;\ntp.tm_min = v5 % 10000 / 100;\ntp.tm_sec = v5 % 100;\ntp.tm_isdst = -1;\nreturn mktime(&tp);\n}\n\n\n\nQ:[a1,nptr,tp,v4,v5,sub_4011CE,]", "hints": "[]", "response": "{'a1': 's', 'nptr': 'sa', 'tp': 'tm', 'v4': 'day', 'v5': 'hour', 'sub_4011CE': 'parse_time'}"}
[ [ 0.726015567779541, 0.6749773621559143, 0.6715866327285767, 0.6647464632987976, 0.6626218557357788, 0.6618120074272156, 0.6603556871414185, 0.6588722467422485, 0.6571544408798218, 0.6552035212516785, 0.6530157327651978, 0.647201657295227, 0.6457662582397461, 0.644192636013031, 0.6432939171791077, 0.6423729062080383, 0.641576886177063, 0.6408275365829468, 0.6393609642982483, 0.6387524604797363 ], [ 170757, 194312, 81205, 80181, 107739, 159808, 256430, 98304, 71230, 231223, 241516, 56983, 261986, 6076, 216954, 34763, 227936, 184333, 145485, 47377 ] ]
loadFile
e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321
syoyo
tinyobjloader-c
NA
static void loadFile(void *ctx, const char * filename, const int is_mtl, const char *obj_filename, char ** buffer, size_t * len) { *buffer = NULL; long string_size = 0, read_size = 0; FILE * handler = fopen(filename, "r"); if (handler) { fseek(handler, 0, SEEK_END); string_size = ftell(handler); rewind(handler); *buffer = (char *) malloc(sizeof(char) * (string_size + 1)); read_size = fread(*buffer, sizeof(char), (size_t) string_size, handler); (*buffer)[string_size] = '\0'; if (string_size != read_size) { free(buffer); *buffer = NULL; } fclose(handler); } *len = read_size; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B888", "function_addr": 4241544, "binary_name": "e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+filename], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov [rbp+var_40], rcx"], [7, "mov [rbp+ptr], r8"], [8, "mov [rbp+var_50], r9"], [9, "mov rax, [rbp+ptr]"], [10, "mov qword ptr [rax], 0"], [11, "mov [rbp+n], 0"], [12, "mov [rbp+var_8], 0"], [13, "mov rax, [rbp+filename]"], [14, "mov esi, offset aR"], [15, "mov rdi, rax"], [16, "call _fopen"], [17, "mov [rbp+stream], rax"], [18, "cmp [rbp+stream], 0"], [19, "jz loc_40B98C"], [20, "mov rax, [rbp+stream]"], [21, "mov edx, 2"], [22, "mov esi, 0"], [23, "mov rdi, rax"], [24, "call _fseek"], [25, "mov rax, [rbp+stream]"], [26, "mov rdi, rax"], [27, "call _ftell"], [28, "mov [rbp+n], rax"], [29, "mov rax, [rbp+stream]"], [30, "mov rdi, rax"], [31, "call _rewind"], [32, "mov rax, [rbp+n]"], [33, "add rax, 1"], [34, "mov rdi, rax"], [35, "call _malloc"], [36, "mov rdx, rax"], [37, "mov rax, [rbp+ptr]"], [38, "mov [rax], rdx"], [39, "mov rdx, [rbp+n]"], [40, "mov rax, [rbp+ptr]"], [41, "mov rax, [rax]"], [42, "mov rcx, [rbp+stream]"], [43, "mov esi, 1"], [44, "mov rdi, rax"], [45, "call _fread"], [46, "mov [rbp+var_8], rax"], [47, "mov rax, [rbp+ptr]"], [48, "mov rdx, [rax]"], [49, "mov rax, [rbp+n]"], [50, "add rax, rdx"], [51, "mov byte ptr [rax], 0"], [52, "mov rax, [rbp+n]"], [53, "cmp rax, [rbp+var_8]"], [54, "jz short loc_40B980"], [55, "mov rax, [rbp+ptr]"], [56, "mov rdi, rax"], [57, "call _free"], [58, "mov rax, [rbp+ptr]"], [59, "mov qword ptr [rax], 0"], [60, "mov rax, [rbp+stream]"], [61, "mov rdi, rax"], [62, "call _fclose"], [63, "mov rdx, [rbp+var_8]"], [64, "mov rax, [rbp+var_50]"], [65, "mov [rax], rdx"], [66, "nop"], [67, "leave"], [68, "retn"]], "data_dep": [[9, 7], [10, 9], [13, 4], [15, 13], [17, 16], [18, 17], [19, 18], [20, 17], [23, 20], [25, 17], [26, 25], [28, 27], [29, 17], [30, 29], [32, 28], [33, 32], [34, 33], [36, 35], [37, 7], [38, 37], [38, 36], [39, 28], [40, 7], [41, 40], [41, 38], [42, 17], [44, 41], [46, 45], [47, 7], [48, 38], [48, 47], [49, 28], [50, 49], [50, 48], [51, 50], [52, 28], [53, 46], [53, 52], [54, 53], [55, 7], [56, 55], [58, 7], [59, 58], [60, 17], [61, 60], [63, 46], [63, 12], [64, 8], [65, 64], [65, 63], [68, 64]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321_e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321.jsonl.gz", "strip_func_name": "sub_40B888", "query": "\n\n\nsize_t *__fastcall sub_40B888(__int64 a1, const char *a2, __int64 a3, __int64 a4, void **a5, size_t *a6)\n{\nsize_t *result; // rax\nFILE *stream; // [rsp+38h] [rbp-18h]\n__int64 n; // [rsp+40h] [rbp-10h]\nsize_t v11; // [rsp+48h] [rbp-8h]\n\n*a5 = 0LL;\nv11 = 0LL;\nstream = fopen(a2, \"r\");\nif ( stream )\n{\nfseek(stream, 0LL, 2);\nn = ftell(stream);\nrewind(stream);\n*a5 = malloc(n + 1);\nv11 = fread(*a5, 1uLL, n, stream);\n*((_BYTE *)*a5 + n) = 0;\nif ( n != v11 )\n{\nfree(a5);\n*a5 = 0LL;\n}\nfclose(stream);\n}\nresult = a6;\n*a6 = v11;\nreturn result;\n}\n\n\n\nQ:[a2,a5,a6,a1,a3,a4,stream,n,v11,sub_40B888,]", "hints": "[]", "response": "{'a2': 'filename', 'a5': 'buffer', 'a6': 'len', 'a1': 'ctx', 'a3': 'is_mtl', 'a4': 'obj_filename', 'stream': 'handler', 'n': 'string_size', 'v11': 'read_size', 'sub_40B888': 'loadFile'}"}
[ [ 0.7544634342193604, 0.7544634342193604, 0.7470028400421143, 0.7460793256759644, 0.7385178804397583, 0.7350265979766846, 0.7264049649238586, 0.7257006168365479, 0.7251467108726501, 0.7238631844520569, 0.7210032343864441, 0.7200369834899902, 0.7192973494529724, 0.7185028791427612, 0.7177104353904724, 0.7107315063476562, 0.7101235389709473, 0.7089395523071289, 0.7087868452072144, 0.7078191041946411 ], [ 43914, 184225, 229418, 7321, 103747, 185158, 251875, 90645, 171136, 112641, 234169, 210546, 32027, 154396, 170514, 234516, 253120, 205766, 39504, 251941 ] ]
sockaddr_cmp
bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62
ncopa
pingu
NA
int sockaddr_cmp(union sockaddr_any *a, union sockaddr_any *b) { if (a->sa.sa_family != b->sa.sa_family) return a->sa.sa_family - b->sa.sa_family; switch (a->sa.sa_family) { case AF_INET: return a->sin.sin_addr.s_addr - b->sin.sin_addr.s_addr; break; case AF_INET6: return memcmp((char *) &a->sin6.sin6_addr, (char *) &b->sin6.sin6_addr, sizeof(a->sin6.sin6_addr)); break; } return -1; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_409439", "function_addr": 4232249, "binary_name": "bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_10], rsi"], [5, "mov rax, [rbp+var_8]"], [6, "movzx edx, word ptr [rax]"], [7, "mov rax, [rbp+var_10]"], [8, "movzx eax, word ptr [rax]"], [9, "cmp dx, ax"], [10, "jz short loc_409476"], [11, "mov rax, [rbp+var_8]"], [12, "movzx eax, word ptr [rax]"], [13, "movzx edx, ax"], [14, "mov rax, [rbp+var_10]"], [15, "movzx eax, word ptr [rax]"], [16, "movzx ecx, ax"], [17, "mov eax, edx"], [18, "sub eax, ecx"], [19, "jmp short locret_4094C7"], [20, "mov rax, [rbp+var_8]"], [21, "movzx eax, word ptr [rax]"], [22, "movzx eax, ax"], [23, "cmp eax, 2"], [24, "jz short loc_40948C"], [25, "cmp eax, 0Ah"], [26, "jz short loc_4094A0"], [27, "jmp short loc_4094C2"], [28, "mov rax, [rbp+var_8]"], [29, "mov edx, [rax+4]"], [30, "mov rax, [rbp+var_10]"], [31, "mov ecx, [rax+4]"], [32, "mov eax, edx"], [33, "sub eax, ecx"], [34, "jmp short locret_4094C7"], [35, "mov rax, [rbp+var_10]"], [36, "lea rcx, [rax+8]"], [37, "mov rax, [rbp+var_8]"], [38, "add rax, 8"], [39, "mov edx, 10h"], [40, "mov rsi, rcx"], [41, "mov rdi, rax"], [42, "call _memcmp"], [43, "jmp short locret_4094C7"], [44, "mov eax, 0FFFFFFFFh"], [45, "leave"], [46, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [8, 7], [9, 8], [9, 6], [10, 9], [11, 3], [12, 11], [13, 12], [14, 4], [15, 14], [16, 15], [17, 13], [18, 17], [18, 16], [20, 3], [21, 20], [22, 21], [23, 22], [24, 23], [25, 22], [26, 25], [28, 3], [29, 28], [30, 4], [31, 30], [32, 29], [33, 32], [33, 31], [35, 4], [36, 35], [37, 3], [38, 37], [40, 36], [41, 38], [46, 33], [46, 42], [46, 44], [46, 18]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62_bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62.jsonl.gz", "strip_func_name": "sub_409439", "query": "\n\n\nint __fastcall sub_409439(unsigned __int16 *a1, unsigned __int16 *a2)\n{\nint v3; // eax\n\nif ( *a1 != *a2 )\nreturn *a1 - *a2;\nv3 = *a1;\nif ( v3 == 2 )\nreturn *((_DWORD *)a1 + 1) - *((_DWORD *)a2 + 1);\nif ( v3 == 10 )\nreturn memcmp(a1 + 4, a2 + 4, 0x10uLL);\nreturn -1;\n}\n\n\n\nQ:[a1,a2,sub_409439,]", "hints": "[]", "response": "{'a1': 'a', 'a2': 'b', 'sub_409439': 'sockaddr_cmp'}"}
[ [ 0.7800619006156921, 0.7612389326095581, 0.7531535625457764, 0.7447426319122314, 0.7370462417602539, 0.7334592342376709, 0.7317464351654053, 0.7210641503334045, 0.7175730466842651, 0.7020413279533386, 0.6978104114532471, 0.6963699460029602, 0.6955296993255615, 0.6951414942741394, 0.6897578835487366, 0.6881541013717651, 0.6835294961929321, 0.6823911070823669, 0.679466962814331, 0.6776249408721924 ], [ 84656, 250256, 168837, 109285, 8651, 110445, 219756, 132471, 116593, 149366, 172587, 221708, 18774, 163484, 190828, 72153, 260796, 34506, 179831, 252359 ] ]
buf_add_buf
7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807
arendst
Tasmota
NA
static size_t buf_add_buf(buf_impl* attr, buf_impl* attr2) { if (attr->len + attr2->len <= attr->size) { for (int32_t i = 0; i < attr2->len; i++) { attr->bufptr[attr->len++] = attr2->bufptr[i]; } } return attr->len; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_415956", "function_addr": 4282710, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_20], rsi"], [4, "mov rax, [rbp+var_18]"], [5, "mov edx, [rax+4]"], [6, "mov rax, [rbp+var_20]"], [7, "mov eax, [rax+4]"], [8, "add edx, eax"], [9, "mov rax, [rbp+var_18]"], [10, "mov eax, [rax]"], [11, "cmp edx, eax"], [12, "jg short loc_4159CA"], [13, "mov [rbp+var_4], 0"], [14, "jmp short loc_4159BE"], [15, "mov rax, [rbp+var_20]"], [16, "mov rdx, [rax+8]"], [17, "mov eax, [rbp+var_4]"], [18, "cdqe"], [19, "lea rsi, [rdx+rax]"], [20, "mov rax, [rbp+var_18]"], [21, "mov rdi, [rax+8]"], [22, "mov rax, [rbp+var_18]"], [23, "mov eax, [rax+4]"], [24, "lea ecx, [rax+1]"], [25, "mov rdx, [rbp+var_18]"], [26, "mov [rdx+4], ecx"], [27, "cdqe"], [28, "lea rdx, [rdi+rax]"], [29, "movzx eax, byte ptr [rsi]"], [30, "mov [rdx], al"], [31, "add [rbp+var_4], 1"], [32, "mov rax, [rbp+var_20]"], [33, "mov eax, [rax+4]"], [34, "cmp [rbp+var_4], eax"], [35, "jl short loc_415985"], [36, "mov rax, [rbp+var_18]"], [37, "mov eax, [rax+4]"], [38, "cdqe"], [39, "pop rbp"], [40, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 3], [7, 6], [8, 5], [8, 7], [9, 2], [10, 9], [11, 8], [11, 10], [12, 11], [15, 3], [16, 26], [16, 15], [16, 30], [17, 13], [17, 31], [19, 30], [19, 17], [19, 26], [19, 19], [20, 2], [21, 30], [21, 20], [21, 26], [22, 2], [23, 22], [23, 30], [23, 26], [24, 30], [24, 23], [24, 26], [24, 24], [25, 2], [26, 24], [26, 25], [28, 23], [28, 26], [28, 25], [29, 26], [29, 19], [30, 29], [30, 28], [31, 13], [31, 31], [32, 3], [33, 30], [33, 26], [33, 32], [34, 13], [34, 31], [34, 33], [35, 34], [36, 2], [37, 30], [37, 36], [37, 26], [39, 0], [40, 37]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_415956", "query": "\n\n\n__int64 __fastcall sub_415956(__int64 a1, __int64 a2)\n{\n_BYTE *v2; // rsi\n__int64 v3; // rdi\nint v4; // eax\nint i; // [rsp+1Ch] [rbp-4h]\n\nif ( *(_DWORD *)(a2 + 4) + *(_DWORD *)(a1 + 4) <= *(_DWORD *)a1 )\n{\nfor ( i = 0; i < *(_DWORD *)(a2 + 4); ++i )\n{\nv2 = (_BYTE *)(*(_QWORD *)(a2 + 8) + i);\nv3 = *(_QWORD *)(a1 + 8);\nv4 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v4 + 1;\n*(_BYTE *)(v3 + v4) = *v2;\n}\n}\nreturn *(int *)(a1 + 4);\n}\n\n\n\nQ:[a1,a2,sub_415956,]", "hints": "[]", "response": "{'a1': 'attr', 'a2': 'attr2', 'sub_415956': 'buf_add_buf'}"}
[ [ 0.7629624009132385, 0.7195950746536255, 0.717769205570221, 0.7118589878082275, 0.7043824195861816, 0.7041071057319641, 0.6880021095275879, 0.6819888949394226, 0.6789693832397461, 0.6760205626487732, 0.6745748519897461, 0.6741955280303955, 0.673007607460022, 0.6680595874786377, 0.6680004596710205, 0.6644495725631714, 0.66159588098526, 0.6615198254585266, 0.6609030961990356, 0.6582770347595215 ], [ 110066, 90312, 260944, 189399, 213371, 9895, 255038, 2015, 209009, 239151, 185946, 263280, 138551, 144205, 55469, 3237, 70232, 97458, 226915, 30219 ] ]
hexdump
89002890075f892e5768e6b3d4f847f19edd2d2eb1a80a739172920be0165437
mikeryan
sm5emu
NA
static void hexdump(u8 *ptr, unsigned len, int bytes) { int i; for (i = 0; i < len; ++i) { if (bytes) printf("%02x ", ptr[i]); else printf("%x ", ptr[i] & 0xf); if ((i & 15) == 15) printf("\n"); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40126B", "function_addr": 4199019, "binary_name": "89002890075f892e5768e6b3d4f847f19edd2d2eb1a80a739172920be0165437.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov [rbp+var_20], edx"], [6, "mov [rbp+var_4], 0"], [7, "jmp short loc_4012F2"], [8, "cmp [rbp+var_20], 0"], [9, "jz short loc_4012B2"], [10, "mov eax, [rbp+var_4]"], [11, "movsxd rdx, eax"], [12, "mov rax, [rbp+var_18]"], [13, "add rax, rdx"], [14, "movzx eax, byte ptr [rax]"], [15, "movzx eax, al"], [16, "mov esi, eax"], [17, "mov edi, offset format"], [18, "mov eax, 0"], [19, "call _printf"], [20, "jmp short loc_4012D9"], [21, "mov eax, [rbp+var_4]"], [22, "movsxd rdx, eax"], [23, "mov rax, [rbp+var_18]"], [24, "add rax, rdx"], [25, "movzx eax, byte ptr [rax]"], [26, "movzx eax, al"], [27, "and eax, 0Fh"], [28, "mov esi, eax"], [29, "mov edi, offset asc_40200A"], [30, "mov eax, 0"], [31, "call _printf"], [32, "mov eax, [rbp+var_4]"], [33, "and eax, 0Fh"], [34, "cmp eax, 0Fh"], [35, "jnz short loc_4012EE"], [36, "mov edi, 0Ah"], [37, "call _putchar"], [38, "add [rbp+var_4], 1"], [39, "mov eax, [rbp+var_4]"], [40, "cmp [rbp+var_1C], eax"], [41, "ja short loc_401286"], [42, "nop"], [43, "nop"], [44, "leave"], [45, "retn"]], "data_dep": [[8, 5], [9, 8], [10, 6], [10, 38], [11, 10], [12, 3], [13, 11], [13, 12], [14, 13], [15, 14], [16, 15], [21, 6], [21, 38], [22, 21], [23, 3], [24, 23], [24, 22], [25, 24], [26, 25], [27, 26], [28, 27], [32, 6], [32, 38], [33, 32], [34, 33], [35, 34], [38, 38], [38, 6], [39, 38], [39, 6], [40, 4], [40, 39], [41, 40], [45, 39]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89002890075f892e5768e6b3d4f847f19edd2d2eb1a80a739172920be0165437_89002890075f892e5768e6b3d4f847f19edd2d2eb1a80a739172920be0165437.jsonl.gz", "strip_func_name": "sub_40126B", "query": "\n\n\n__int64 __fastcall sub_40126B(__int64 a1, unsigned int a2, int a3)\n{\n__int64 result; // rax\nunsigned int i; // [rsp+1Ch] [rbp-4h]\n\nfor ( i = 0; ; ++i )\n{\nresult = i;\nif ( a2 <= i )\nbreak;\nif ( a3 )\nprintf(\"%02x \", *(unsigned __int8 *)((int)i + a1));\nelse\nprintf(\"%x \", *(_BYTE *)((int)i + a1) & 0xF);\nif ( (i & 0xF) == 15 )\nputchar(10);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_40126B,]", "hints": "[]", "response": "{'a3': 'bytes', 'a1': 'ptr', 'a2': 'len', 'sub_40126B': 'hexdump'}"}
[ [ 0.8155463933944702, 0.7923779487609863, 0.7803827524185181, 0.7754051685333252, 0.7698441743850708, 0.7679725885391235, 0.7679668068885803, 0.7604392766952515, 0.7596131563186646, 0.7580567002296448, 0.7547574043273926, 0.754412829875946, 0.7527351379394531, 0.7434908151626587, 0.7434072494506836, 0.7417052984237671, 0.7402964234352112, 0.7402357459068298, 0.7395238876342773, 0.7394556999206543 ], [ 247527, 107328, 150771, 194792, 203560, 55843, 163998, 28617, 38310, 248061, 46352, 179254, 144978, 111216, 256814, 12439, 252792, 5980, 207464, 47779 ] ]
test
fc25a184c7d1fff5cbc58f50c7b88f668e3dcdd5b77742e5ce2144bc4a342dc4
radareorg
sdb
NA
static int test(TestFcn tf) { const char *name = NULL; int ret = tf (&name); printf ("%s %s\n", ret? OK:ER, name); success += ret; return ret; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013FC", "function_addr": 4199420, "binary_name": "fc25a184c7d1fff5cbc58f50c7b88f668e3dcdd5b77742e5ce2144bc4a342dc4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_10], 0"], [5, "lea rax, [rbp+var_10]"], [6, "mov rdx, [rbp+var_18]"], [7, "mov rdi, rax"], [8, "call rdx"], [9, "mov [rbp+var_4], eax"], [10, "mov rax, [rbp+var_10]"], [11, "cmp [rbp+var_4], 0"], [12, "jz short loc_401431"], [13, "mov ecx, offset a32mok0m"], [14, "jmp short loc_401436"], [15, "mov ecx, offset a31mer0m"], [16, "mov rdx, rax"], [17, "mov rsi, rcx"], [18, "mov edi, offset aSS_0"], [19, "mov eax, 0"], [20, "call _printf"], [21, "mov edx, cs:dword_4192B0"], [22, "mov eax, [rbp+var_4]"], [23, "add eax, edx"], [24, "mov cs:dword_4192B0, eax"], [25, "mov eax, [rbp+var_4]"], [26, "leave"], [27, "retn"]], "data_dep": [[5, 4], [6, 3], [7, 5], [8, 6], [9, 8], [10, 4], [11, 9], [12, 11], [16, 10], [17, 13], [17, 15], [22, 9], [23, 22], [23, 21], [24, 23], [25, 9], [27, 25]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/fc25a184c7d1fff5cbc58f50c7b88f668e3dcdd5b77742e5ce2144bc4a342dc4_fc25a184c7d1fff5cbc58f50c7b88f668e3dcdd5b77742e5ce2144bc4a342dc4.jsonl.gz", "strip_func_name": "sub_4013FC", "query": "\n\n\n__int64 __fastcall sub_4013FC(__int64 (__fastcall *a1)(const char **))\n{\nconst char *v1; // rcx\nconst char *v3; // [rsp+10h] [rbp-10h] BYREF\nunsigned int v4; // [rsp+1Ch] [rbp-4h]\n\nv3 = 0LL;\nv4 = a1(&v3);\nif ( v4 )\nv1 = \"\\x1B[32mOK\\x1B[0m\";\nelse\nv1 = \"\\x1B[31mER\\x1B[0m\";\nprintf(\"%s %s\\n\", v1, v3);\ndword_4192B0 += v4;\nreturn v4;\n}\n\n\n\nQ:[a1,v3,sub_4013FC,]", "hints": "[]", "response": "{'a1': 'tf_0', 'v3': 'name', 'sub_4013FC': 'test'}"}
[ [ 0.7271133065223694, 0.7217880487442017, 0.7126812934875488, 0.7067084312438965, 0.7038576602935791, 0.7000906467437744, 0.6988580822944641, 0.6928250789642334, 0.6924670338630676, 0.69096440076828, 0.6906589269638062, 0.6905028223991394, 0.6861178278923035, 0.6853215098381042, 0.6853083372116089, 0.6838228702545166, 0.6837862730026245, 0.6830438375473022, 0.6829665899276733, 0.6812171936035156 ], [ 228448, 80725, 197432, 2803, 82541, 40473, 241047, 212430, 99286, 133424, 11591, 146068, 194381, 65147, 227528, 49855, 242520, 135277, 59881, 174299 ] ]
PrintHelp
7a3f18b0d2aa28007ee2b9512a0f8bdd916cf16869aa8a5902f94a0c68aa5205
Telecominfraproject
OpenCellular
NA
void PrintHelp(const char *progname) { const Param *p; printf("\nUsage:\n" " %s [--all]\n" " Prints all parameters with descriptions and current values.\n" " If --all is specified, prints even normally hidden fields.\n" " %s [param1 [param2 [...]]]\n" " Prints the current value(s) of the parameter(s).\n" " %s [param1=value1] [param2=value2 [...]]]\n" " Sets the parameter(s) to the specified value(s).\n" " %s [param1?value1] [param2?value2 [...]]]\n" " Checks if the parameter(s) all contain the specified value(s).\n" "Stops at the first error." "\n" "Valid parameters:\n", progname, progname, progname, progname); for (p = sys_param_list; p->name; p++) printf(" %-22s %s\n", p->name, p->desc); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40241D", "function_addr": 4203549, "binary_name": "7a3f18b0d2aa28007ee2b9512a0f8bdd916cf16869aa8a5902f94a0c68aa5205.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rsi, [rbp+var_18]"], [5, "mov rcx, [rbp+var_18]"], [6, "mov rdx, [rbp+var_18]"], [7, "mov rax, [rbp+var_18]"], [8, "mov r8, rsi"], [9, "mov rsi, rax"], [10, "lea rdi, format"], [11, "mov eax, 0"], [12, "call _printf"], [13, "lea rax, off_40C520"], [14, "mov [rbp+var_8], rax"], [15, "jmp short loc_402485"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdx, [rax+10h]"], [18, "mov rax, [rbp+var_8]"], [19, "mov rax, [rax]"], [20, "mov rsi, rax"], [21, "lea rdi, a22sS"], [22, "mov eax, 0"], [23, "call _printf"], [24, "add [rbp+var_8], 20h "], [25, "mov rax, [rbp+var_8]"], [26, "mov rax, [rax]"], [27, "test rax, rax"], [28, "jnz short loc_40245D"], [29, "nop"], [30, "nop"], [31, "leave"], [32, "retn"]], "data_dep": [[4, 3], [5, 3], [6, 3], [7, 3], [8, 4], [9, 7], [13, 12], [14, 13], [16, 24], [16, 14], [17, 16], [18, 14], [18, 24], [19, 18], [20, 19], [21, 10], [21, 21], [24, 14], [24, 24], [25, 24], [25, 14], [26, 25], [27, 26], [28, 27], [32, 27]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7a3f18b0d2aa28007ee2b9512a0f8bdd916cf16869aa8a5902f94a0c68aa5205_7a3f18b0d2aa28007ee2b9512a0f8bdd916cf16869aa8a5902f94a0c68aa5205.jsonl.gz", "strip_func_name": "sub_40241D", "query": "\n\n\nconst char *__fastcall sub_40241D(const char *a1)\n{\nconst char *result; // rax\nconst char **i; // [rsp+18h] [rbp-8h]\n\nprintf(\n\"\\n\"\n\"Usage:\\n\"\n\" %s [--all]\\n\"\n\" Prints all parameters with descriptions and current values.\\n\"\n\" If --all is specified, prints even normally hidden fields.\\n\"\n\" %s [param1 [param2 [...]]]\\n\"\n\" Prints the current value(s) of the parameter(s).\\n\"\n\" %s [param1=value1] [param2=value2 [...]]]\\n\"\n\" Sets the parameter(s) to the specified value(s).\\n\"\n\" %s [param1?value1] [param2?value2 [...]]]\\n\"\n\" Checks if the parameter(s) all contain the specified value(s).\\n\"\n\"Stops at the first error.\\n\"\n\"Valid parameters:\\n\",\na1,\na1,\na1,\na1);\nfor ( i = (const char **)&off_40C520; ; i += 4 )\n{\nresult = *i;\nif ( !*i )\nbreak;\nprintf(\" %-22s %s\\n\", *i, i[2]);\n}\nreturn result;\n}\n\n\n\nQ:[a1,i,sub_40241D,]", "hints": "[]", "response": "{'a1': 'progname', 'i': 'p', 'sub_40241D': 'PrintHelp'}"}
[ [ 0.8194106221199036, 0.8141716718673706, 0.8138430118560791, 0.8067415356636047, 0.7855120897293091, 0.7819483280181885, 0.7759703993797302, 0.7736908793449402, 0.7733026146888733, 0.7680507302284241, 0.7668889760971069, 0.7629944086074829, 0.7599136829376221, 0.7552626132965088, 0.7534601092338562, 0.7512928247451782, 0.7504369616508484, 0.7456744909286499, 0.7428784966468811, 0.7413954138755798 ], [ 100092, 63013, 111784, 216146, 209578, 85179, 113483, 202409, 190260, 222636, 224384, 42838, 190248, 245376, 257294, 110818, 246630, 229347, 8590, 244298 ] ]
open_tty
06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018
RIOT-OS
Tutorials
NA
int open_tty(void) { int r, fd; struct termios term_setting; fd = open("/dev/tty", O_RDWR); if (fd < 0) { return -1; } r = tcgetattr(fd, &term_setting); if (r != 0) { return -2; } old_term_setting = term_setting; term_setting.c_oflag |= (ONLRET); term_setting.c_iflag |= (/*IGNBRK |*/ BRKINT | IGNPAR); term_setting.c_iflag &= ~(ISTRIP); term_setting.c_lflag &= ~(ICANON |/* ISIG |*/ ECHO); term_setting.c_lflag |= (ISIG); term_setting.c_cflag |= CREAD; term_setting.c_cc[VMIN] = 1; term_setting.c_cc[VTIME] = 1; r = tcsetattr(fd, TCSANOW, &term_setting); if (r != 0) { return -3; } return fd; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401453", "function_addr": 4199507, "binary_name": "06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov esi, 2"], [4, "mov edi, offset file"], [5, "mov eax, 0"], [6, "call _open"], [7, "mov [rbp+fd], eax"], [8, "cmp [rbp+fd], 0"], [9, "jns short loc_401482"], [10, "mov eax, 0FFFFFFFFh"], [11, "jmp locret_40155F"], [12, "lea rdx, [rbp+termios_p]"], [13, "mov eax, [rbp+fd]"], [14, "mov rsi, rdx"], [15, "mov edi, eax"], [16, "call _tcgetattr"], [17, "mov [rbp+var_8], eax"], [18, "cmp [rbp+var_8], 0"], [19, "jz short loc_4014A6"], [20, "mov eax, 0FFFFFFFEh"], [21, "jmp locret_40155F"], [22, "mov rax, qword ptr [rbp+termios_p.c_iflag]"], [23, "mov rdx, qword ptr [rbp+termios_p.c_cflag]"], [24, "mov qword ptr cs:termios_p.c_iflag, rax"], [25, "mov qword ptr cs:termios_p.c_cflag, rdx"], [26, "mov rax, qword ptr [rbp+termios_p.c_line]"], [27, "mov rdx, qword ptr [rbp+termios_p.c_cc+7]"], [28, "mov qword ptr cs:termios_p.c_line, rax"], [29, "mov qword ptr cs:termios_p.c_cc+7, rdx"], [30, "mov rax, qword ptr [rbp+termios_p.c_cc+0Fh]"], [31, "mov rdx, qword ptr [rbp+termios_p.c_cc+17h]"], [32, "mov qword ptr cs:termios_p.c_cc+0Fh, rax"], [33, "mov qword ptr cs:termios_p.c_cc+17h, rdx"], [34, "mov rax, qword ptr [rbp+termios_p.c_cc+1Fh]"], [35, "mov qword ptr cs:termios_p.c_cc+1Fh, rax"], [36, "mov eax, [rbp+termios_p.c_ospeed]"], [37, "mov cs:termios_p.c_ospeed, eax"], [38, "mov eax, [rbp+termios_p.c_oflag]"], [39, "or eax, 20h"], [40, "mov [rbp+termios_p.c_oflag], eax"], [41, "mov eax, [rbp+termios_p.c_iflag]"], [42, "or eax, 6"], [43, "mov [rbp+termios_p.c_iflag], eax"], [44, "mov eax, [rbp+termios_p.c_iflag]"], [45, "and eax, 0FFFFFFDFh"], [46, "mov [rbp+termios_p.c_iflag], eax"], [47, "mov eax, [rbp+termios_p.c_lflag]"], [48, "and eax, 0FFFFFFF5h"], [49, "mov [rbp+termios_p.c_lflag], eax"], [50, "mov eax, [rbp+termios_p.c_lflag]"], [51, "or eax, 1"], [52, "mov [rbp+termios_p.c_lflag], eax"], [53, "mov eax, [rbp+termios_p.c_cflag]"], [54, "or al, 80h"], [55, "mov [rbp+termios_p.c_cflag], eax"], [56, "mov [rbp+termios_p.c_cc+6], 1"], [57, "mov [rbp+termios_p.c_cc+5], 1"], [58, "lea rdx, [rbp+termios_p]"], [59, "mov eax, [rbp+fd]"], [60, "mov esi, 0"], [61, "mov edi, eax"], [62, "call _tcsetattr"], [63, "mov [rbp+var_8], eax"], [64, "cmp [rbp+var_8], 0"], [65, "jz short loc_40155C"], [66, "mov eax, 0FFFFFFFDh"], [67, "jmp short locret_40155F"], [68, "mov eax, [rbp+fd]"], [69, "leave"], [70, "retn"]], "data_dep": [[7, 6], [8, 7], [9, 8], [13, 7], [14, 12], [15, 13], [17, 16], [18, 17], [19, 18], [24, 22], [25, 23], [28, 26], [29, 27], [32, 30], [33, 31], [35, 34], [37, 36], [39, 38], [40, 39], [42, 41], [43, 42], [44, 43], [45, 44], [46, 45], [48, 47], [49, 48], [50, 49], [51, 50], [52, 51], [54, 53], [55, 54], [58, 31], [59, 7], [61, 59], [63, 62], [64, 63], [65, 64], [68, 7], [70, 66], [70, 20], [70, 68], [70, 10]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018_06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018.jsonl.gz", "strip_func_name": "sub_401453", "query": "\n\n\n__int64 sub_401453()\n{\n__int64 result; // rax\ntcflag_t v1; // eax\nstruct termios termios_p; // [rsp+0h] [rbp-50h] BYREF\nint v3; // [rsp+48h] [rbp-8h]\nint fd; // [rsp+4Ch] [rbp-4h]\n\nfd = open(\"/dev/tty\", 2);\nif ( fd < 0 )\nreturn 0xFFFFFFFFLL;\nv3 = tcgetattr(fd, &termios_p);\nif ( v3 )\nreturn 4294967294LL;\n::termios_p = termios_p;\ntermios_p.c_oflag |= 0x20u;\ntermios_p.c_iflag |= 6u;\ntermios_p.c_iflag &= 0xFFFFFFDF;\ntermios_p.c_lflag &= 0xFFFFFFF5;\ntermios_p.c_lflag |= 1u;\nv1 = termios_p.c_cflag;\nLOBYTE(v1) = LOBYTE(termios_p.c_cflag) | 0x80;\ntermios_p.c_cflag = v1;\ntermios_p.c_cc[6] = 1;\ntermios_p.c_cc[5] = 1;\nv3 = tcsetattr(fd, 0, &termios_p);\nif ( v3 )\nresult = 4294967293LL;\nelse\nresult = (unsigned int)fd;\nreturn result;\n}\n\n\n\nQ:[termios_p,v3,sub_401453,]", "hints": "[]", "response": "{'termios_p': 'term_setting', 'v3': 'r', 'sub_401453': 'open_tty'}"}
[ [ 0.8041892051696777, 0.7959465980529785, 0.795137882232666, 0.7634046077728271, 0.7630047798156738, 0.7200444936752319, 0.7116701006889343, 0.7099676728248596, 0.7075649499893188, 0.7049882411956787, 0.7031400799751282, 0.701877772808075, 0.7012220621109009, 0.698158323764801, 0.6977517604827881, 0.6951030492782593, 0.6933389902114868, 0.6899615526199341, 0.6890467405319214, 0.6875232458114624 ], [ 236226, 102206, 128147, 132769, 139328, 85166, 115822, 115511, 48579, 203564, 261402, 54294, 172236, 183469, 204595, 176966, 113377, 197501, 130386, 175997 ] ]
print_error
2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567
solusipse
fiche
NA
static void print_error(const char *format, ...) { va_list args; va_start(args, format); printf("[Fiche][ERROR] "); vprintf(format, args); printf("\n"); va_end(args); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4016E7", "function_addr": 4200167, "binary_name": "2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0E0h"], [3, "mov [rbp+format], rdi"], [4, "mov [rbp+var_A8], rsi"], [5, "mov [rbp+var_A0], rdx"], [6, "mov [rbp+var_98], rcx"], [7, "mov [rbp+var_90], r8"], [8, "mov [rbp+var_88], r9"], [9, "test al, al"], [10, "jz short loc_401740"], [11, "movaps [rbp+var_80], xmm0"], [12, "movaps [rbp+var_70], xmm1"], [13, "movaps [rbp+var_60], xmm2"], [14, "movaps [rbp+var_50], xmm3"], [15, "movaps [rbp+var_40], xmm4"], [16, "movaps [rbp+var_30], xmm5"], [17, "movaps [rbp+var_20], xmm6"], [18, "movaps [rbp+var_10], xmm7"], [19, "mov [rbp+arg], 8"], [20, "mov [rbp+var_C4], 30h "], [21, "lea rax, [rbp+arg_0]"], [22, "mov [rbp+var_C0], rax"], [23, "lea rax, [rbp+var_B0]"], [24, "mov [rbp+var_B8], rax"], [25, "mov edi, offset format"], [26, "mov eax, 0"], [27, "call _printf"], [28, "lea rdx, [rbp+arg]"], [29, "mov rax, [rbp+format]"], [30, "mov rsi, rdx"], [31, "mov rdi, rax"], [32, "call _vprintf"], [33, "mov edi, 0Ah"], [34, "call _putchar"], [35, "nop"], [36, "leave"], [37, "retn"]], "data_dep": [[10, 9], [21, 9], [22, 21], [23, 21], [24, 23], [28, 19], [29, 3], [30, 28], [31, 29], [37, 34]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567_2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.jsonl.gz", "strip_func_name": "sub_4016E7", "query": "\n\n\nint sub_4016E7(const char *a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, ...)\n{\ngcc_va_list arg; // [rsp+18h] [rbp-C8h] BYREF\n__int64 v8; // [rsp+38h] [rbp-A8h]\n__int64 v9; // [rsp+40h] [rbp-A0h]\n__int64 v10; // [rsp+48h] [rbp-98h]\n__int64 v11; // [rsp+50h] [rbp-90h]\n__int64 v12; // [rsp+58h] [rbp-88h]\n\nva_start(arg, a6);\nv8 = a2;\nv9 = a3;\nv10 = a4;\nv11 = a5;\nv12 = a6;\narg[0].gp_offset = 8;\nprintf(\"[Fiche][ERROR] \");\nvprintf(a1, arg);\nreturn putchar(10);\n}\n\n\n\nQ:[a1,arg,sub_4016E7,]", "hints": "[]", "response": "{'a1': 'format', 'arg': 'args', 'sub_4016E7': 'print_error'}"}
[ [ 0.8564982414245605, 0.8338680863380432, 0.8327841758728027, 0.8219227194786072, 0.7935329079627991, 0.7753013968467712, 0.7541650533676147, 0.7430553436279297, 0.7426952719688416, 0.7404950857162476, 0.7402572631835938, 0.7401015758514404, 0.7387446165084839, 0.731945276260376, 0.7279362678527832, 0.7268096208572388, 0.721663236618042, 0.719942569732666, 0.7185575366020203, 0.717124342918396 ], [ 157197, 121817, 112999, 119662, 27220, 82297, 75465, 25873, 185272, 251996, 203786, 259568, 38930, 221992, 127455, 232672, 20164, 34324, 195261, 260964 ] ]
print_usage
553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c
noporpoise
jelly-hash
NA
void print_usage() { printf("usage: speedtest [Options] <num_ops>\n" " Test hash table speed. Table capacity is: b*2^l. Memory is: (k-l+%i)*capacity.\n" " Rehash limit is: %i\n" " -k <k> Element size\n" " -l <l> Bits for bucket addressing\n" " -b <b> Number of elements per bucket\n" " -t <t> Number of threads to use\n", JH_NRBITS+1, (1<<JH_NRBITS)-1); exit(EXIT_FAILURE); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4028DC", "function_addr": 4204764, "binary_name": "553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov edx, 0Fh"], [3, "mov esi, 5"], [4, "mov edi, offset aUsageSpeedtest"], [5, "mov eax, 0"], [6, "call _printf"], [7, "mov edi, 1"], [8, "call _exit"]], "data_dep": []}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c_553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c.jsonl.gz", "strip_func_name": "sub_4028DC", "query": "\n\n\nvoid __noreturn sub_4028DC()\n{\nprintf(\n\"usage: speedtest [Options] <num_ops>\\n\"\n\" Test hash table speed. Table capacity is: b*2^l. Memory is: (k-l+%i)*capacity.\\n\"\n\" Rehash limit is: %i\\n\"\n\" -k <k> Element size\\n\"\n\" -l <l> Bits for bucket addressing\\n\"\n\" -b <b> Number of elements per bucket\\n\"\n\" -t <t> Number of threads to use\\n\",\n5LL,\n15LL);\nexit(1);\n}\n\n\n\nQ:[sub_4028DC,]", "hints": "[]", "response": "{'sub_4028DC': 'print_usage'}"}
[ [ 0.8176283240318298, 0.8166227340698242, 0.8103118538856506, 0.7982912063598633, 0.7979710102081299, 0.7956708669662476, 0.790303647518158, 0.7895575761795044, 0.7864041924476624, 0.7853509187698364, 0.783810019493103, 0.7825475931167603, 0.7823836207389832, 0.781757652759552, 0.780802309513092, 0.7807680368423462, 0.7805773615837097, 0.7805657982826233, 0.7805064916610718, 0.7801367044448853 ], [ 138956, 46413, 238519, 98424, 226026, 109934, 178161, 48138, 46591, 104951, 142344, 212746, 177529, 191921, 181924, 4043, 130918, 27768, 259149, 92544 ] ]
parse_options
a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40
vanhauser-thc
thc-hydra
NA
int32_t parse_options(char *miscptr, ptr_header_node *ptr_head) { char *ptr, *ptr2, *tmp; if (miscptr == NULL) return 1; /* * Parse the user-supplied options. * Beware of the backslashes (\)! */ while (*miscptr != 0) { if (strlen(miscptr) < 2 || miscptr[1] != '=') { hydra_report(stderr, "[ERROR] optional parameters must have the format X=value: %s\n", miscptr); return 0; } switch (miscptr[0]) { case 'a': // fall through case 'A': // only for http, not http-form! ptr = miscptr + 2; if (strncasecmp(ptr, "NTLM", 4) == 0) http_auth_mechanism = AUTH_NTLM; else if (strncasecmp(ptr, "MD5", 3) == 0 || strncasecmp(ptr, "DIGEST", 6) == 0) http_auth_mechanism = AUTH_DIGESTMD5; else if (strncasecmp(ptr, "BASIC", 4) == 0) http_auth_mechanism = AUTH_BASIC; else fprintf(stderr, "[WARNING] unknown http auth type: %s\n", ptr); while (*ptr != 0 && *ptr != ':') ptr++; if (*ptr != 0) { *ptr = 0; ptr += 1; } miscptr = ptr; break; case 'c': // fall through case 'C': ptr = miscptr + 2; while (*ptr != 0 && (*ptr != ':' || *(ptr - 1) == '\\')) ptr++; if (*ptr != 0) *ptr++ = 0; sprintf(cookieurl, "%.1000s", hydra_strrep(miscptr + 2, "\\:", ":")); miscptr = ptr; break; case '1': code_401_is_failure = 1; tmp = strchr(miscptr, ':'); if (tmp) miscptr = tmp + 1; else miscptr += strlen(miscptr); break; case '2': code_302_is_success = 1; tmp = strchr(miscptr, ':'); if (tmp) miscptr = tmp + 1; else miscptr += strlen(miscptr); break; case 'g': // fall through case 'G': ptr = miscptr + 2; while (*ptr != 0 && (*ptr != ':' || *(ptr - 1) == '\\')) ptr++; if (*ptr != 0) *ptr++ = 0; getcookie = 0; miscptr = ptr; break; case 'h': // add a new header at the end ptr = miscptr + 2; while (*ptr != 0 && *ptr != ':') ptr++; if (*(ptr - 1) == '\\') *(ptr - 1) = 0; if (*ptr != 0) { *ptr = 0; ptr += 1; } ptr2 = ptr; while (*ptr2 != 0 && (*ptr2 != ':' || *(ptr2 - 1) == '\\')) ptr2++; if (*ptr2 != 0) *ptr2++ = 0; /* * At this point: * - (optional1 + 2) contains the header's name * - ptr contains the header's value */ if (add_header(ptr_head, miscptr + 2, hydra_strrep(ptr, "\\:", ":"), HEADER_TYPE_USERHEADER)) { // Success: break the switch and go ahead miscptr = ptr2; break; } // Error: abort execution hydra_report(stderr, "[ERROR] Out of memory for HTTP headers (h).\n"); return 0; case 'H': // add a new header, or replace an existing one's value ptr = miscptr + 2; while (*ptr != 0 && *ptr != ':') ptr++; if (*(ptr - 1) == '\\') *(ptr - 1) = 0; if (*ptr != 0) { *ptr = 0; ptr += 1; } ptr2 = ptr; while (*ptr2 != 0 && (*ptr2 != ':' || *(ptr2 - 1) == '\\')) ptr2++; if (*ptr2 != 0) *ptr2++ = 0; /* * At this point: * - (optional1 + 2) contains the header's name * - ptr contains the header's value */ if (add_header(ptr_head, miscptr + 2, hydra_strrep(ptr, "\\:", ":"), HEADER_TYPE_USERHEADER_REPL)) { // Success: break the switch and go ahead miscptr = ptr2; break; } // Error: abort execution hydra_report(stderr, "[ERROR] Out of memory for HTTP headers (H).\n"); return 0; default: hydra_report(stderr, "[ERROR] no valid optional parameter type given: %c\n", miscptr[0]); return 0; } } return 1; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43C2EF", "function_addr": 4440815, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+s], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov rax, fs:28h"], [6, "mov [rbp+var_8], rax"], [7, "xor eax, eax"], [8, "cmp [rbp+s], 0"], [9, "jnz loc_43C815"], [10, "mov eax, 1"], [11, "jmp loc_43C829"], [12, "mov rax, [rbp+s]"], [13, "mov rdi, rax"], [14, "call _strlen"], [15, "cmp rax, 1"], [16, "jbe short loc_43C344"], [17, "mov rax, [rbp+s]"], [18, "add rax, 1"], [19, "movzx eax, byte ptr [rax]"], [20, "cmp al, 3Dh "], [21, "jz short loc_43C36B"], [22, "mov rax, cs:stderr"], [23, "mov rdx, [rbp+s]"], [24, "mov esi, offset aErrorOptionalP"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _fprintf"], [28, "mov eax, 0"], [29, "jmp loc_43C829"], [30, "mov rax, [rbp+s]"], [31, "movzx eax, byte ptr [rax]"], [32, "movsx eax, al"], [33, "sub eax, 32h "], [34, "cmp eax, 36h"], [35, "ja def_43C38B"], [36, "mov eax, eax"], [37, "mov rax, ds:jpt_43C38B[rax*8]"], [38, "jmp rax"], [39, "mov rax, [rbp+s]"], [40, "add rax, 2"], [41, "mov [rbp+s1], rax"], [42, "mov rax, [rbp+s1]"], [43, "mov edx, 4"], [44, "mov esi, offset aNtlm_5"], [45, "mov rdi, rax"], [46, "call _strncasecmp"], [47, "test eax, eax"], [48, "jnz short loc_43C3C2"], [49, "mov cs:dword_46E04C, 9"], [50, "jmp loc_43C44C"], [51, "mov rax, [rbp+s1]"], [52, "mov edx, 3"], [53, "mov esi, offset aMd5_1"], [54, "mov rdi, rax"], [55, "call _strncasecmp"], [56, "test eax, eax"], [57, "jz short loc_43C3F6"], [58, "mov rax, [rbp+s1]"], [59, "mov edx, 6"], [60, "mov esi, offset aDigest"], [61, "mov rdi, rax"], [62, "call _strncasecmp"], [63, "test eax, eax"], [64, "jnz short loc_43C402"], [65, "mov cs:dword_46E04C, 7"], [66, "jmp short loc_43C445"], [67, "mov rax, [rbp+s1]"], [68, "mov edx, 4"], [69, "mov esi, offset aBasic"], [70, "mov rdi, rax"], [71, "call _strncasecmp"], [72, "test eax, eax"], [73, "jnz short loc_43C428"], [74, "mov cs:dword_46E04C, 0Bh"], [75, "jmp short loc_43C44C"], [76, "mov rax, cs:stderr"], [77, "mov rdx, [rbp+s1]"], [78, "mov esi, offset aWarningUnknown"], [79, "mov rdi, rax"], [80, "mov eax, 0"], [81, "call _fprintf"], [82, "jmp short loc_43C44C"], [83, "add [rbp+s1], 1"], [84, "mov rax, [rbp+s1]"], [85, "movzx eax, byte ptr [rax]"], [86, "test al, al"], [87, "jz short loc_43C462"], [88, "mov rax, [rbp+s1]"], [89, "movzx eax, byte ptr [rax]"], [90, "cmp al, 3Ah "], [91, "jnz short loc_43C447"], [92, "mov rax, [rbp+s1]"], [93, "movzx eax, byte ptr [rax]"], [94, "test al, al"], [95, "jz short loc_43C479"], [96, "mov rax, [rbp+s1]"], [97, "mov byte ptr [rax], 0"], [98, "add [rbp+s1], 1"], [99, "mov rax, [rbp+s1]"], [100, "mov [rbp+s], rax"], [101, "jmp loc_43C815"], [102, "mov rax, [rbp+s]"], [103, "add rax, 2"], [104, "mov [rbp+s1], rax"], [105, "jmp short loc_43C499"], [106, "add [rbp+s1], 1"], [107, "mov rax, [rbp+s1]"], [108, "movzx eax, byte ptr [rax]"], [109, "test al, al"], [110, "jz short loc_43C4BE"], [111, "mov rax, [rbp+s1]"], [112, "movzx eax, byte ptr [rax]"], [113, "cmp al, 3Ah "], [114, "jnz short loc_43C494"], [115, "mov rax, [rbp+s1]"], [116, "sub rax, 1"], [117, "movzx eax, byte ptr [rax]"], [118, "cmp al, 5Ch "], [119, "jz short loc_43C494"], [120, "mov rax, [rbp+s1]"], [121, "movzx eax, byte ptr [rax]"], [122, "test al, al"], [123, "jz short loc_43C4D8"], [124, "mov rax, [rbp+s1]"], [125, "lea rdx, [rax+1]"], [126, "mov [rbp+s1], rdx"], [127, "mov byte ptr [rax], 0"], [128, "mov rax, [rbp+s]"], [129, "add rax, 2"], [130, "mov edx, offset asc_462B36"], [131, "mov esi, offset asc_462B38"], [132, "mov rdi, rax"], [133, "call sub_4504B8"], [134, "mov rdx, rax"], [135, "mov esi, offset a1000s"], [136, "mov edi, offset byte_471500"], [137, "mov eax, 0"], [138, "call _sprintf"], [139, "mov rax, [rbp+s1]"], [140, "mov [rbp+s], rax"], [141, "jmp loc_43C815"], [142, "mov cs:dword_4704E8, 1"], [143, "mov rax, [rbp+s]"], [144, "mov esi, 3Ah "], [145, "mov rdi, rax"], [146, "call _strchr"], [147, "mov [rbp+var_10], rax"], [148, "cmp [rbp+var_10], 0"], [149, "jz short loc_43C54D"], [150, "mov rax, [rbp+var_10]"], [151, "add rax, 1"], [152, "mov [rbp+s], rax"], [153, "jmp loc_43C815"], [154, "mov rax, [rbp+s]"], [155, "mov rdi, rax"], [156, "call _strlen"], [157, "add [rbp+s], rax"], [158, "jmp loc_43C815"], [159, "mov rax, [rbp+s]"], [160, "add rax, 2"], [161, "mov [rbp+s1], rax"], [162, "jmp short loc_43C575"], [163, "add [rbp+s1], 1"], [164, "mov rax, [rbp+s1]"], [165, "movzx eax, byte ptr [rax]"], [166, "test al, al"], [167, "jz short loc_43C59A"], [168, "mov rax, [rbp+s1]"], [169, "movzx eax, byte ptr [rax]"], [170, "cmp al, 3Ah "], [171, "jnz short loc_43C570"], [172, "mov rax, [rbp+s1]"], [173, "sub rax, 1"], [174, "movzx eax, byte ptr [rax]"], [175, "cmp al, 5Ch "], [176, "jz short loc_43C570"], [177, "mov rax, [rbp+s1]"], [178, "movzx eax, byte ptr [rax]"], [179, "test al, al"], [180, "jz short loc_43C5B4"], [181, "mov rax, [rbp+s1]"], [182, "lea rdx, [rax+1]"], [183, "mov [rbp+s1], rdx"], [184, "mov byte ptr [rax], 0"], [185, "mov cs:dword_46E3F4, 0"], [186, "mov rax, [rbp+s1]"], [187, "mov [rbp+s], rax"], [188, "jmp loc_43C815"], [189, "mov rax, [rbp+s]"], [190, "add rax, 2"], [191, "mov [rbp+s1], rax"], [192, "jmp short loc_43C5DE"], [193, "add [rbp+s1], 1"], [194, "mov rax, [rbp+s1]"], [195, "movzx eax, byte ptr [rax]"], [196, "test al, al"], [197, "jz short loc_43C5F4"], [198, "mov rax, [rbp+s1]"], [199, "movzx eax, byte ptr [rax]"], [200, "cmp al, 3Ah "], [201, "jnz short loc_43C5D9"], [202, "mov rax, [rbp+s1]"], [203, "sub rax, 1"], [204, "movzx eax, byte ptr [rax]"], [205, "cmp al, 5Ch "], [206, "jnz short loc_43C60E"], [207, "mov rax, [rbp+s1]"], [208, "sub rax, 1"], [209, "mov byte ptr [rax], 0"], [210, "mov rax, [rbp+s1]"], [211, "movzx eax, byte ptr [rax]"], [212, "test al, al"], [213, "jz short loc_43C625"], [214, "mov rax, [rbp+s1]"], [215, "mov byte ptr [rax], 0"], [216, "add [rbp+s1], 1"], [217, "mov rax, [rbp+s1]"], [218, "mov [rbp+var_18], rax"], [219, "jmp short loc_43C634"], [220, "add [rbp+var_18], 1"], [221, "mov rax, [rbp+var_18]"], [222, "movzx eax, byte ptr [rax]"], [223, "test al, al"], [224, "jz short loc_43C659"], [225, "mov rax, [rbp+var_18]"], [226, "movzx eax, byte ptr [rax]"], [227, "cmp al, 3Ah "], [228, "jnz short loc_43C62F"], [229, "mov rax, [rbp+var_18]"], [230, "sub rax, 1"], [231, "movzx eax, byte ptr [rax]"], [232, "cmp al, 5Ch "], [233, "jz short loc_43C62F"], [234, "mov rax, [rbp+var_18]"], [235, "movzx eax, byte ptr [rax]"], [236, "test al, al"], [237, "jz short loc_43C673"], [238, "mov rax, [rbp+var_18]"], [239, "lea rdx, [rax+1]"], [240, "mov [rbp+var_18], rdx"], [241, "mov byte ptr [rax], 0"], [242, "mov rax, [rbp+s1]"], [243, "mov edx, offset asc_462B36"], [244, "mov esi, offset asc_462B38"], [245, "mov rdi, rax"], [246, "call sub_4504B8"], [247, "mov rdx, rax"], [248, "mov rax, [rbp+s]"], [249, "lea rsi, [rax+2]"], [250, "mov rax, [rbp+var_30]"], [251, "mov ecx, 68h "], [252, "mov rdi, rax"], [253, "call sub_43BC7A"], [254, "test eax, eax"], [255, "jz short loc_43C6B6"], [256, "mov rax, [rbp+var_18]"], [257, "mov [rbp+s], rax"], [258, "jmp loc_43C815"], [259, "mov rax, cs:stderr"], [260, "mov rcx, rax"], [261, "mov edx, 2Ch "], [262, "mov esi, 1"], [263, "mov edi, offset aErrorOutOfMemo_1"], [264, "call _fwrite"], [265, "mov eax, 0"], [266, "jmp loc_43C829"], [267, "mov rax, [rbp+s]"], [268, "add rax, 2"], [269, "mov [rbp+s1], rax"], [270, "jmp short loc_43C6F1"], [271, "add [rbp+s1], 1"], [272, "mov rax, [rbp+s1]"], [273, "movzx eax, byte ptr [rax]"], [274, "test al, al"], [275, "jz short loc_43C707"], [276, "mov rax, [rbp+s1]"], [277, "movzx eax, byte ptr [rax]"], [278, "cmp al, 3Ah "], [279, "jnz short loc_43C6EC"], [280, "mov rax, [rbp+s1]"], [281, "sub rax, 1"], [282, "movzx eax, byte ptr [rax]"], [283, "cmp al, 5Ch "], [284, "jnz short loc_43C721"], [285, "mov rax, [rbp+s1]"], [286, "sub rax, 1"], [287, "mov byte ptr [rax], 0"], [288, "mov rax, [rbp+s1]"], [289, "movzx eax, byte ptr [rax]"], [290, "test al, al"], [291, "jz short loc_43C738"], [292, "mov rax, [rbp+s1]"], [293, "mov byte ptr [rax], 0"], [294, "add [rbp+s1], 1"], [295, "mov rax, [rbp+s1]"], [296, "mov [rbp+var_18], rax"], [297, "jmp short loc_43C747"], [298, "add [rbp+var_18], 1"], [299, "mov rax, [rbp+var_18]"], [300, "movzx eax, byte ptr [rax]"], [301, "test al, al"], [302, "jz short loc_43C76C"], [303, "mov rax, [rbp+var_18]"], [304, "movzx eax, byte ptr [rax]"], [305, "cmp al, 3Ah "], [306, "jnz short loc_43C742"], [307, "mov rax, [rbp+var_18]"], [308, "sub rax, 1"], [309, "movzx eax, byte ptr [rax]"], [310, "cmp al, 5Ch "], [311, "jz short loc_43C742"], [312, "mov rax, [rbp+var_18]"], [313, "movzx eax, byte ptr [rax]"], [314, "test al, al"], [315, "jz short loc_43C786"], [316, "mov rax, [rbp+var_18]"], [317, "lea rdx, [rax+1]"], [318, "mov [rbp+var_18], rdx"], [319, "mov byte ptr [rax], 0"], [320, "mov rax, [rbp+s1]"], [321, "mov edx, offset asc_462B36"], [322, "mov esi, offset asc_462B38"], [323, "mov rdi, rax"], [324, "call sub_4504B8"], [325, "mov rdx, rax"], [326, "mov rax, [rbp+s]"], [327, "lea rsi, [rax+2]"], [328, "mov rax, [rbp+var_30]"], [329, "mov ecx, 48h "], [330, "mov rdi, rax"], [331, "call sub_43BC7A"], [332, "test eax, eax"], [333, "jz short loc_43C7C6"], [334, "mov rax, [rbp+var_18]"], [335, "mov [rbp+s], rax"], [336, "jmp short loc_43C815"], [337, "mov rax, cs:stderr"], [338, "mov rcx, rax"], [339, "mov edx, 2Ch "], [340, "mov esi, 1"], [341, "mov edi, offset aErrorOutOfMemo_2"], [342, "call _fwrite"], [343, "mov eax, 0"], [344, "jmp short loc_43C829"], [345, "mov rax, [rbp+s]"], [346, "movzx eax, byte ptr [rax]"], [347, "movsx edx, al"], [348, "mov rax, cs:stderr"], [349, "mov esi, offset aErrorNoValidOp"], [350, "mov rdi, rax"], [351, "mov eax, 0"], [352, "call _fprintf"], [353, "mov eax, 0"], [354, "jmp short loc_43C829"], [355, "mov rax, [rbp+s]"], [356, "movzx eax, byte ptr [rax]"], [357, "test al, al"], [358, "jnz loc_43C323"], [359, "mov eax, 1"], [360, "mov rcx, [rbp+var_8]"], [361, "sub rcx, fs:28h"], [362, "jz short locret_43C83D"], [363, "call ___stack_chk_fail"], [364, "leave"], [365, "retn"]], "data_dep": [[6, 5], [8, 3], [9, 8], [12, 100], [12, 187], [12, 257], [12, 140], [12, 335], [12, 157], [12, 152], [12, 3], [13, 12], [15, 14], [16, 15], [17, 187], [17, 257], [17, 140], [17, 335], [17, 157], [17, 152], [17, 3], [17, 100], [18, 17], [19, 18], [19, 241], [19, 97], [19, 209], [19, 319], [19, 184], [19, 287], [19, 127], [19, 215], [19, 293], [20, 19], [21, 20], [23, 100], [23, 187], [23, 257], [23, 140], [23, 335], [23, 157], [23, 152], [23, 3], [25, 22], [30, 335], [30, 157], [30, 152], [30, 3], [30, 100], [30, 257], [30, 187], [30, 140], [31, 215], [31, 293], [31, 241], [31, 97], [31, 209], [31, 319], [31, 184], [31, 287], [31, 30], [31, 127], [32, 31], [33, 32], [34, 33], [35, 34], [36, 33], [38, 37], [39, 187], [39, 335], [39, 140], [39, 157], [39, 152], [39, 3], [39, 100], [39, 257], [40, 39], [41, 40], [42, 41], [45, 42], [47, 46], [48, 47], [51, 41], [54, 51], [56, 55], [57, 56], [58, 41], [61, 58], [63, 62], [64, 63], [67, 41], [70, 67], [72, 71], [73, 72], [77, 41], [79, 76], [83, 83], [83, 41], [84, 83], [84, 41], [85, 84], [85, 293], [85, 241], [85, 97], [85, 209], [85, 319], [85, 184], [85, 287], [85, 127], [85, 215], [86, 85], [87, 86], [88, 83], [88, 41], [89, 319], [89, 184], [89, 287], [89, 127], [89, 215], [89, 293], [89, 241], [89, 88], [89, 97], [89, 209], [90, 89], [91, 90], [92, 83], [92, 41], [93, 209], [93, 293], [93, 287], [93, 241], [93, 97], [93, 92], [93, 319], [93, 184], [93, 127], [93, 215], [94, 93], [95, 94], [96, 41], [96, 83], [97, 96], [98, 41], [98, 83], [99, 98], [99, 83], [99, 41], [100, 99], [102, 257], [102, 187], [102, 335], [102, 140], [102, 157], [102, 3], [102, 100], [102, 152], [103, 102], [104, 103], [106, 106], [106, 104], [107, 104], [107, 106], [108, 319], [108, 184], [108, 287], [108, 127], [108, 215], [108, 293], [108, 107], [108, 241], [108, 97], [108, 209], [109, 108], [110, 109], [111, 104], [111, 106], [112, 209], [112, 293], [112, 111], [112, 241], [112, 97], [112, 319], [112, 184], [112, 287], [112, 127], [112, 215], [113, 112], [114, 113], [115, 106], [115, 104], [116, 115], [117, 293], [117, 116], [117, 241], [117, 97], [117, 319], [117, 184], [117, 287], [117, 127], [117, 215], [117, 209], [118, 117], [119, 118], [120, 106], [120, 104], [121, 127], [121, 215], [121, 293], [121, 120], [121, 241], [121, 97], [121, 209], [121, 319], [121, 184], [121, 287], [122, 121], [123, 122], [124, 104], [124, 106], [125, 247], [125, 134], [125, 241], [125, 97], [125, 124], [125, 209], [125, 325], [125, 59], [125, 68], [125, 77], [125, 319], [125, 184], [125, 287], [125, 127], [125, 215], [125, 43], [125, 52], [125, 182], [125, 293], [126, 125], [127, 124], [128, 140], [128, 157], [128, 152], [128, 3], [128, 100], [128, 257], [128, 187], [128, 335], [129, 128], [132, 129], [134, 133], [139, 106], [139, 104], [139, 126], [140, 139], [143, 187], [143, 257], [143, 140], [143, 335], [143, 157], [143, 152], [143, 3], [143, 100], [145, 143], [147, 146], [148, 147], [149, 148], [150, 147], [151, 150], [152, 151], [154, 257], [154, 187], [154, 335], [154, 140], [154, 157], [154, 152], [154, 3], [154, 100], [155, 154], [157, 100], [157, 156], [157, 257], [157, 140], [157, 187], [157, 335], [157, 157], [157, 152], [157, 3], [159, 257], [159, 187], [159, 335], [159, 140], [159, 157], [159, 152], [159, 3], [159, 100], [160, 159], [161, 160], [163, 161], [163, 163], [164, 163], [164, 161], [165, 319], [165, 184], [165, 164], [165, 127], [165, 215], [165, 209], [165, 293], [165, 287], [165, 241], [165, 97], [166, 165], [167, 166], [168, 163], [168, 161], [169, 97], [169, 209], [169, 293], [169, 287], [169, 241], [169, 319], [169, 184], [169, 168], [169, 127], [169, 215], [170, 169], [171, 170], [172, 163], [172, 161], [173, 172], [174, 287], [174, 241], [174, 319], [174, 184], [174, 173], [174, 127], [174, 215], [174, 97], [174, 209], [174, 293], [175, 174], [176, 175], [177, 161], [177, 163], [178, 127], [178, 215], [178, 97], [178, 209], [178, 177], [178, 293], [178, 287], [178, 241], [178, 319], [178, 184], [179, 178], [180, 179], [181, 163], [181, 161], [182, 134], [182, 241], [182, 97], [182, 59], [182, 68], [182, 77], [182, 319], [182, 184], [182, 43], [182, 127], [182, 247], [182, 215], [182, 52], [182, 182], [182, 209], [182, 325], [182, 181], [182, 293], [182, 287], [183, 182], [184, 181], [186, 163], [186, 161], [186, 183], [187, 186], [189, 257], [189, 140], [189, 335], [189, 157], [189, 152], [189, 3], [189, 100], [189, 187], [190, 189], [191, 190], [193, 193], [193, 191], [194, 191], [194, 193], [195, 319], [195, 184], [195, 127], [195, 215], [195, 97], [195, 209], [195, 293], [195, 194], [195, 287], [195, 241], [196, 195], [197, 196], [198, 193], [198, 191], [199, 97], [199, 209], [199, 293], [199, 287], [199, 241], [199, 198], [199, 319], [199, 184], [199, 127], [199, 215], [200, 199], [201, 200], [202, 191], [202, 193], [203, 202], [204, 293], [204, 287], [204, 241], [204, 203], [204, 319], [204, 184], [204, 127], [204, 215], [204, 97], [204, 209], [205, 204], [206, 205], [207, 191], [207, 193], [208, 207], [209, 208], [210, 191], [210, 193], [211, 127], [211, 215], [211, 210], [211, 97], [211, 209], [211, 293], [211, 287], [211, 241], [211, 319], [211, 184], [212, 211], [213, 212], [214, 193], [214, 191], [215, 214], [216, 191], [216, 193], [217, 216], [217, 193], [217, 191], [218, 217], [220, 220], [220, 218], [221, 218], [221, 220], [222, 127], [222, 215], [222, 97], [222, 209], [222, 293], [222, 287], [222, 241], [222, 221], [222, 319], [222, 184], [223, 222], [224, 223], [225, 220], [225, 218], [226, 97], [226, 209], [226, 293], [226, 287], [226, 241], [226, 225], [226, 319], [226, 184], [226, 127], [226, 215], [227, 226], [228, 227], [229, 218], [229, 220], [230, 229], [231, 319], [231, 184], [231, 287], [231, 127], [231, 230], [231, 215], [231, 293], [231, 241], [231, 97], [231, 209], [232, 231], [233, 232], [234, 220], [234, 218], [235, 127], [235, 293], [235, 241], [235, 97], [235, 209], [235, 319], [235, 184], [235, 287], [235, 234], [235, 215], [236, 235], [237, 236], [238, 218], [238, 220], [239, 77], [239, 319], [239, 184], [239, 215], [239, 43], [239, 52], [239, 182], [239, 127], [239, 293], [239, 238], [239, 247], [239, 241], [239, 97], [239, 209], [239, 325], [239, 59], [239, 68], [239, 287], [239, 134], [240, 239], [241, 238], [242, 216], [242, 193], [242, 191], [245, 242], [247, 246], [248, 335], [248, 157], [248, 152], [248, 3], [248, 100], [248, 187], [248, 257], [248, 140], [249, 215], [249, 127], [249, 293], [249, 241], [249, 97], [249, 209], [249, 287], [249, 244], [249, 248], [249, 319], [249, 184], [250, 4], [252, 250], [254, 253], [255, 254], [256, 240], [256, 220], [256, 218], [257, 256], [260, 259], [267, 335], [267, 157], [267, 152], [267, 3], [267, 100], [267, 187], [267, 257], [267, 140], [268, 267], [269, 268], [271, 271], [271, 269], [272, 269], [272, 271], [273, 293], [273, 241], [273, 97], [273, 209], [273, 319], [273, 184], [273, 287], [273, 272], [273, 127], [273, 215], [274, 273], [275, 274], [276, 271], [276, 269], [277, 127], [277, 215], [277, 276], [277, 293], [277, 241], [277, 97], [277, 209], [277, 319], [277, 184], [277, 287], [278, 277], [279, 278], [280, 269], [280, 271], [281, 280], [282, 215], [282, 293], [282, 241], [282, 97], [282, 209], [282, 319], [282, 184], [282, 287], [282, 281], [282, 127], [283, 282], [284, 283], [285, 271], [285, 269], [286, 285], [287, 286], [288, 271], [288, 269], [289, 241], [289, 97], [289, 209], [289, 319], [289, 184], [289, 287], [289, 127], [289, 215], [289, 293], [289, 288], [290, 289], [291, 290], [292, 271], [292, 269], [293, 292], [294, 271], [294, 269], [295, 294], [295, 271], [295, 269], [296, 295], [298, 298], [298, 296], [299, 296], [299, 298], [300, 241], [300, 97], [300, 209], [300, 287], [300, 319], [300, 184], [300, 215], [300, 299], [300, 127], [300, 293], [301, 300], [302, 301], [303, 298], [303, 296], [304, 127], [304, 215], [304, 303], [304, 293], [304, 241], [304, 97], [304, 209], [304, 319], [304, 184], [304, 287], [305, 304], [306, 305], [307, 298], [307, 296], [308, 307], [309, 215], [309, 308], [309, 293], [309, 241], [309, 97], [309, 209], [309, 319], [309, 184], [309, 287], [309, 127], [310, 309], [311, 310], [312, 298], [312, 296], [313, 209], [313, 319], [313, 184], [313, 287], [313, 127], [313, 215], [313, 312], [313, 293], [313, 241], [313, 97], [314, 313], [315, 314], [316, 296], [316, 298], [317, 215], [317, 43], [317, 52], [317, 182], [317, 293], [317, 247], [317, 241], [317, 97], [317, 209], [317, 316], [317, 325], [317, 59], [317, 68], [317, 319], [317, 184], [317, 287], [317, 134], [317, 127], [317, 77], [318, 317], [319, 316], [320, 294], [320, 271], [320, 269], [323, 320], [325, 324], [326, 3], [326, 100], [326, 187], [326, 257], [326, 140], [326, 335], [326, 152], [326, 157], [327, 241], [327, 97], [327, 209], [327, 319], [327, 184], [327, 287], [327, 127], [327, 215], [327, 322], [327, 326], [327, 293], [328, 4], [330, 328], [332, 331], [333, 332], [334, 318], [334, 298], [334, 296], [335, 334], [338, 337], [345, 3], [345, 100], [345, 257], [345, 187], [345, 140], [345, 335], [345, 157], [345, 152], [346, 241], [346, 97], [346, 209], [346, 319], [346, 184], [346, 287], [346, 127], [346, 215], [346, 345], [346, 293], [347, 346], [350, 348], [355, 187], [355, 140], [355, 335], [355, 157], [355, 152], [355, 3], [355, 100], [355, 257], [356, 127], [356, 355], [356, 215], [356, 209], [356, 293], [356, 241], [356, 97], [356, 319], [356, 184], [356, 287], [357, 356], [358, 357], [360, 6], [361, 360], [362, 361], [365, 353], [365, 343], [365, 359], [365, 10], [365, 28], [365, 265]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40_a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.jsonl.gz", "strip_func_name": "sub_43C2EF", "query": "\n\n\n__int64 __fastcall sub_43C2EF(char *a1, __int64 *a2)\n{\nchar *v3; // rax\nconst char *v4; // rax\nchar *v5; // rax\nchar *v6; // rax\nconst char *v7; // rax\nchar *v8; // rax\nconst char *v9; // rax\nchar *s; // [rsp+8h] [rbp-28h]\nchar *s1; // [rsp+10h] [rbp-20h]\nchar *s1a; // [rsp+10h] [rbp-20h]\nchar *s1b; // [rsp+10h] [rbp-20h]\nchar *s1c; // [rsp+10h] [rbp-20h]\nchar *s1d; // [rsp+10h] [rbp-20h]\nchar *j; // [rsp+18h] [rbp-18h]\nchar *i; // [rsp+18h] [rbp-18h]\nchar *v18; // [rsp+20h] [rbp-10h]\n\ns = a1;\nif ( !a1 )\nreturn 1LL;\nLABEL_77:\nwhile ( *s )\n{\nif ( strlen(s) <= 1 || s[1] != 61 )\n{\nfprintf(stderr, \"[ERROR] optional parameters must have the format X=value: %s\\n\", s);\nreturn 0LL;\n}\nswitch ( *s )\n{\ncase '2':\ndword_4704E8 = 1;\nv18 = strchr(s, 58);\nif ( v18 )\ns = v18 + 1;\nelse\ns += strlen(s);\ngoto LABEL_77;\ncase 'A':\ncase 'a':\ns1 = s + 2;\nif ( !strncasecmp(s + 2, \"NTLM\", 4uLL) )\n{\ndword_46E04C = 9;\n}\nelse if ( !strncasecmp(s1, \"MD5\", 3uLL) || !strncasecmp(s1, \"DIGEST\", 6uLL) )\n{\ndword_46E04C = 7;\n}\nelse if ( !strncasecmp(s1, \"BASIC\", 4uLL) )\n{\ndword_46E04C = 11;\n}\nelse\n{\nfprintf(stderr, \"[WARNING] unknown http auth type: %s\\n\", s1);\n}\nwhile ( *s1 && *s1 != 58 )\n++s1;\nif ( *s1 )\n*s1++ = 0;\ns = s1;\ngoto LABEL_77;\ncase 'C':\ncase 'c':\nfor ( s1a = s + 2; *s1a && (*s1a != 58 || *(s1a - 1) == 92); ++s1a )\n;\nif ( *s1a )\n{\nv3 = s1a++;\n*v3 = 0;\n}\nv4 = (const char *)sub_4504B8(s + 2, \"\\\\:\", \":\");\nsprintf(byte_471500, \"%.1000s\", v4);\ns = s1a;\ngoto LABEL_77;\ncase 'G':\ncase 'g':\nfor ( s1b = s + 2; *s1b && (*s1b != 58 || *(s1b - 1) == 92); ++s1b )\n;\nif ( *s1b )\n{\nv5 = s1b++;\n*v5 = 0;\n}\ndword_46E3F4 = 0;\ns = s1b;\ngoto LABEL_77;\ncase 'H':\nfor ( s1d = s + 2; *s1d && *s1d != 58; ++s1d )\n;\nif ( *(s1d - 1) == 92 )\n*(s1d - 1) = 0;\nif ( *s1d )\n*s1d++ = 0;\nfor ( i = s1d; *i && (*i != 58 || *(i - 1) == 92); ++i )\n;\nif ( *i )\n{\nv8 = i++;\n*v8 = 0;\n}\nv9 = (const char *)sub_4504B8(s1d, \"\\\\:\", \":\");\nif ( !(unsigned int)sub_43BC7A(a2, s + 2, v9, 72) )\n{\nfwrite(\"[ERROR] Out of memory for HTTP headers (H).\\n\", 1uLL, 0x2CuLL, stderr);\nreturn 0LL;\n}\ns = i;\nbreak;\ncase 'h':\nfor ( s1c = s + 2; *s1c && *s1c != 58; ++s1c )\n;\nif ( *(s1c - 1) == 92 )\n*(s1c - 1) = 0;\nif ( *s1c )\n*s1c++ = 0;\nfor ( j = s1c; *j && (*j != 58 || *(j - 1) == 92); ++j )\n;\nif ( *j )\n{\nv6 = j++;\n*v6 = 0;\n}\nv7 = (const char *)sub_4504B8(s1c, \"\\\\:\", \":\");\nif ( !(unsigned int)sub_43BC7A(a2, s + 2, v7, 104) )\n{\nfwrite(\"[ERROR] Out of memory for HTTP headers (h).\\n\", 1uLL, 0x2CuLL, stderr);\nreturn 0LL;\n}\ns = j;\ngoto LABEL_77;\ndefault:\nfprintf(stderr, \"[ERROR] no valid optional parameter type given: %c\\n\", (unsigned int)*s);\nreturn 0LL;\n}\n}\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,s,s1b,j,v18,sub_43C2EF,sub_4504B8,sub_43BC7A,]", "hints": "[]", "response": "{'a1': 'miscptr', 'a2': 'ptr_head', 's': 'miscptra', 's1b': 'ptrc', 'j': 'ptr2a', 'v18': 'tmp', 'sub_43C2EF': 'parse_options', 'sub_4504B8': 'hydra_strrep', 'sub_43BC7A': 'add_header'}"}
[ [ 0.765356719493866, 0.7465936541557312, 0.7332974076271057, 0.7305772304534912, 0.7290397882461548, 0.7205575108528137, 0.7185694575309753, 0.7183157205581665, 0.71373450756073, 0.7060675621032715, 0.7009767293930054, 0.6995911002159119, 0.6984884738922119, 0.6957828998565674, 0.6944595575332642, 0.6894224882125854, 0.6852109432220459, 0.6846133470535278, 0.6838147640228271, 0.682225227355957 ], [ 113563, 189017, 106676, 69002, 222684, 234549, 52130, 122091, 5239, 55053, 258190, 26418, 124327, 111193, 207920, 108563, 87651, 123742, 5210, 24808 ] ]
write_file
52873c6b9518cfb23adf74a2c247ecf59c8a27f0b1b6e037bd573d7f8c4042ed
posixninja
ideviceactivate
NA
int write_file(const char *filename, char data[BUFSIZE]) { FILE *f=fopen(filename, "w"); if (f==NULL) { printf("ERROR: Could not open %s for writing\n", filename); fclose(f); return -1; } else { fwrite(data, strlen(data), 1, f); fclose(f); return 0; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40352C", "function_addr": 4207916, "binary_name": "52873c6b9518cfb23adf74a2c247ecf59c8a27f0b1b6e037bd573d7f8c4042ed.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+filename], rdi"], [4, "mov [rbp+s], rsi"], [5, "mov rax, [rbp+filename]"], [6, "mov esi, offset modes"], [7, "mov rdi, rax"], [8, "call _fopen"], [9, "mov [rbp+stream], rax"], [10, "cmp [rbp+stream], 0"], [11, "jnz short loc_403581"], [12, "mov rax, [rbp+filename]"], [13, "mov rsi, rax"], [14, "mov edi, offset aErrorCouldNotO"], [15, "mov eax, 0"], [16, "call _printf"], [17, "mov rax, [rbp+stream]"], [18, "mov rdi, rax"], [19, "call _fclose"], [20, "mov eax, 0FFFFFFFFh"], [21, "jmp short locret_4035B9"], [22, "mov rax, [rbp+s]"], [23, "mov rdi, rax"], [24, "call _strlen"], [25, "mov rsi, rax"], [26, "mov rdx, [rbp+stream]"], [27, "mov rax, [rbp+s]"], [28, "mov rcx, rdx"], [29, "mov edx, 1"], [30, "mov rdi, rax"], [31, "call _fwrite"], [32, "mov rax, [rbp+stream]"], [33, "mov rdi, rax"], [34, "call _fclose"], [35, "mov eax, 0"], [36, "leave"], [37, "retn"]], "data_dep": [[5, 3], [7, 5], [9, 8], [10, 9], [11, 10], [12, 3], [13, 12], [17, 9], [18, 17], [22, 4], [23, 22], [25, 24], [26, 9], [27, 4], [28, 26], [30, 27], [32, 9], [33, 32], [37, 20], [37, 35]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/52873c6b9518cfb23adf74a2c247ecf59c8a27f0b1b6e037bd573d7f8c4042ed_52873c6b9518cfb23adf74a2c247ecf59c8a27f0b1b6e037bd573d7f8c4042ed.jsonl.gz", "strip_func_name": "sub_40352C", "query": "\n\n\n__int64 __fastcall sub_40352C(const char *a1, const char *a2)\n{\n__int64 result; // rax\nsize_t v3; // rax\nFILE *stream; // [rsp+18h] [rbp-8h]\n\nstream = fopen(a1, \"w\");\nif ( stream )\n{\nv3 = strlen(a2);\nfwrite(a2, v3, 1uLL, stream);\nfclose(stream);\nresult = 0LL;\n}\nelse\n{\nprintf(\"ERROR: Could not open %s for writing\\n\", a1);\nfclose(0LL);\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,stream,sub_40352C,]", "hints": "[]", "response": "{'a1': 'filename', 'a2': 'data', 'stream': 'f', 'sub_40352C': 'write_file'}"}
[ [ 0.8400173187255859, 0.8324013352394104, 0.8234413862228394, 0.8188841342926025, 0.8155695796012878, 0.8103323578834534, 0.80912846326828, 0.8072643876075745, 0.8046480417251587, 0.8039273619651794, 0.7993921041488647, 0.7967358231544495, 0.7905212044715881, 0.7895281314849854, 0.7874656915664673, 0.7809165120124817, 0.7786577343940735, 0.7770272493362427, 0.7727148532867432, 0.7684446573257446 ], [ 226152, 222382, 89904, 256402, 95915, 75796, 88607, 187914, 228734, 108481, 111192, 127611, 52882, 245875, 255620, 187053, 114290, 28883, 246274, 164371 ] ]
print_usage
a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0
sysml
minipython
NA
static void print_usage(char *argv0) { printf("Usage: %s [OPTION]... [DEVICE]...\n", argv0); printf("Formats a device with SHFS.\n"); printf("\n"); printf("Mandatory arguments to long options are mandatory for short options too.\n"); printf("\n"); printf(" General option:\n"); printf(" -h, --help displays this help and exit\n"); printf(" -V, --version displays program version and exit\n"); printf(" -v, --verbose increases verbosity level (max. %d times)\n", D_MAX); printf(" -f, --force suppresses user questions\n"); printf(" -x, --erase erase volume area (full format)\n"); printf("\n"); printf(" Volume settings:\n"); printf(" -n, --name [NAME] sets volume name to NAME\n"); printf(" -s, --stripesize [BYTES] sets the stripesize for each volume member\n"); printf(" -c, --combined-striping enables combined striping for the volume\n"); printf("\n"); printf(" Hash table related configuration:\n"); printf(" -b, --bucket-count [COUNT] sets the total number of buckets\n"); printf(" -e, --entries-per-bucket [COUNT] sets the number of entries for each bucket\n"); printf(" -F, --hash-function [FUNCTION] sets the object hashing function:\n"); printf(" sha (default), crc, md5, haval, manual\n"); printf(" -l, --hash-length [BYTES] sets the the hash digest length in bytes\n"); printf(" at least 1 (8 Bits), at most 64 (512 Bits)\n"); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013E2", "function_addr": 4199394, "binary_name": "a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, [rbp+var_8]"], [5, "mov rsi, rax"], [6, "mov edi, offset aUsageSOptionDe"], [7, "mov eax, 0"], [8, "call _printf"], [9, "mov edi, offset s"], [10, "call _puts"], [11, "mov edi, 0Ah"], [12, "call _putchar"], [13, "mov edi, offset aMandatoryArgum"], [14, "call _puts"], [15, "mov edi, 0Ah"], [16, "call _putchar"], [17, "mov edi, offset aGeneralOption"], [18, "call _puts"], [19, "mov edi, offset aHHelpDisplaysT"], [20, "call _puts"], [21, "mov edi, offset aVVersionDispla"], [22, "call _puts"], [23, "mov esi, 2"], [24, "mov edi, offset aVVerboseIncrea"], [25, "mov eax, 0"], [26, "call _printf"], [27, "mov edi, offset aFForceSuppress"], [28, "call _puts"], [29, "mov edi, offset aXEraseEraseVol"], [30, "call _puts"], [31, "mov edi, 0Ah"], [32, "call _putchar"], [33, "mov edi, offset aVolumeSettings"], [34, "call _puts"], [35, "mov edi, offset aNNameNameSetsV"], [36, "call _puts"], [37, "mov edi, offset aSStripesizeByt"], [38, "call _puts"], [39, "mov edi, offset aCCombinedStrip"], [40, "call _puts"], [41, "mov edi, 0Ah"], [42, "call _putchar"], [43, "mov edi, offset aHashTableRelat"], [44, "call _puts"], [45, "mov edi, offset aBBucketCountCo"], [46, "call _puts"], [47, "mov edi, offset aEEntriesPerBuc"], [48, "call _puts"], [49, "mov edi, offset aFHashFunctionF"], [50, "call _puts"], [51, "mov edi, offset aShaDefaultCrcM"], [52, "call _puts"], [53, "mov edi, offset aLHashLengthByt"], [54, "call _puts"], [55, "mov edi, offset aAtLeast18BitsA"], [56, "call _puts"], [57, "nop"], [58, "leave"], [59, "retn"]], "data_dep": [[4, 3], [5, 4], [59, 56]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0_a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0.jsonl.gz", "strip_func_name": "sub_4013E2", "query": "\n\n\nint __fastcall sub_4013E2(const char *a1)\n{\nprintf(\"Usage: %s [OPTION]... [DEVICE]...\\n\", a1);\nputs(\"Formats a device with SHFS.\");\nputchar(10);\nputs(\"Mandatory arguments to long options are mandatory for short options too.\");\nputchar(10);\nputs(\" General option:\");\nputs(\" -h, --help displays this help and exit\");\nputs(\" -V, --version displays program version and exit\");\nprintf(\" -v, --verbose increases verbosity level (max. %d times)\\n\", 2LL);\nputs(\" -f, --force suppresses user questions\");\nputs(\" -x, --erase erase volume area (full format)\");\nputchar(10);\nputs(\" Volume settings:\");\nputs(\" -n, --name [NAME] sets volume name to NAME\");\nputs(\" -s, --stripesize [BYTES] sets the stripesize for each volume member\");\nputs(\" -c, --combined-striping enables combined striping for the volume\");\nputchar(10);\nputs(\" Hash table related configuration:\");\nputs(\" -b, --bucket-count [COUNT] sets the total number of buckets\");\nputs(\" -e, --entries-per-bucket [COUNT] sets the number of entries for each bucket\");\nputs(\" -F, --hash-function [FUNCTION] sets the object hashing function:\");\nputs(\" sha (default), crc, md5, haval, manual\");\nputs(\" -l, --hash-length [BYTES] sets the the hash digest length in bytes\");\nreturn puts(\" at least 1 (8 Bits), at most 64 (512 Bits)\");\n}\n\n\n\nQ:[a1,sub_4013E2,]", "hints": "[]", "response": "{'a1': 'argv0', 'sub_4013E2': 'print_usage'}"}
[ [ 0.8703824281692505, 0.8534613847732544, 0.8532456159591675, 0.8501289486885071, 0.8474542498588562, 0.8428778648376465, 0.841966450214386, 0.8400243520736694, 0.8301189541816711, 0.825735330581665, 0.8245859146118164, 0.8243734836578369, 0.8231080770492554, 0.8226305246353149, 0.8215965032577515, 0.8210415840148926, 0.8208461999893188, 0.8201317191123962, 0.8190205097198486, 0.8187106847763062 ], [ 158251, 129742, 232137, 14340, 260974, 5544, 19847, 205038, 122273, 234099, 110808, 141409, 56774, 130776, 140410, 263562, 249840, 156877, 57744, 84387 ] ]
parse_args
afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4
michael-lazar
hn-gopher
NA
void parse_args(state *st, int argc, char *argv[]) { FILE *fp; static const char readme[] = README; static const char license[] = LICENSE; struct stat file; char buf[BUFSIZE]; int opt; /* Parse args */ while ((opt = getopt(argc, argv, "h:p:T:r:t:g:a:c:u:m:l:w:o:s:i:k:f:e:R:D:L:A:P:n:dbv?-")) != ERROR) { switch(opt) { case 'h': sstrlcpy(st->server_host, optarg); break; case 'p': st->server_port = atoi(optarg); break; case 'T': st->server_tls_port = atoi(optarg); break; case 'r': sstrlcpy(st->server_root, optarg); break; case 't': st->default_filetype = *optarg; break; case 'g': sstrlcpy(st->map_file, optarg); break; case 'a': sstrlcpy(st->map_file, optarg); break; case 'c': sstrlcpy(st->cgi_file, optarg); break; case 'u': sstrlcpy(st->user_dir, optarg); break; case 'm': /* obsolete, replaced by -l */ case 'l': sstrlcpy(st->log_file, optarg); break; case 'w': st->out_width = atoi(optarg); break; case 'o': if (sstrncasecmp(optarg, "UTF-8") == MATCH) st->out_charset = UTF_8; if (sstrncasecmp(optarg, "ISO-8859-1") == MATCH) st->out_charset = ISO_8859_1; break; case 's': st->session_timeout = atoi(optarg); break; case 'i': st->session_max_kbytes = abs(atoi(optarg)); break; case 'k': st->session_max_hits = abs(atoi(optarg)); break; case 'f': sstrlcpy(st->filter_dir, optarg); break; case 'e': add_ftype_mapping(st, optarg); break; case 'R': add_rewrite_mapping(st, optarg); break; case 'D': sstrlcpy(st->server_description, optarg); break; case 'L': sstrlcpy(st->server_location, optarg); break; case 'A': sstrlcpy(st->server_admin, optarg); break; case 'n': if (*optarg == 'v') { st->opt_vhost = FALSE; break; } if (*optarg == 'l') { st->opt_parent = FALSE; break; } if (*optarg == 'h') { st->opt_header = FALSE; break; } if (*optarg == 'f') { st->opt_footer = FALSE; break; } if (*optarg == 'd') { st->opt_date = FALSE; break; } if (*optarg == 'c') { st->opt_magic = FALSE; break; } if (*optarg == 'o') { st->opt_iconv = FALSE; break; } if (*optarg == 'q') { st->opt_query = FALSE; break; } if (*optarg == 's') { st->opt_syslog = FALSE; break; } if (*optarg == 'a') { st->opt_caps = FALSE; break; } if (*optarg == 'm') { st->opt_shm = FALSE; break; } if (*optarg == 'r') { st->opt_root = FALSE; break; } break; case 'd': st->debug = TRUE; break; case 'b': puts(license); exit(EXIT_SUCCESS); case 'v': printf("%s/%s \"%s\" (built %s)\n", SERVER_SOFTWARE, VERSION, CODENAME, __DATE__); exit(EXIT_SUCCESS); default : puts(readme); exit(EXIT_SUCCESS); } } /* Sanitize options */ if (st->out_width > MAX_WIDTH) st->out_width = MAX_WIDTH; if (st->out_width < MIN_WIDTH) st->out_width = MIN_WIDTH; if (st->out_width < MIN_WIDTH + DATE_WIDTH) st->opt_date = FALSE; if (!st->opt_syslog) st->debug = FALSE; /* Primary vhost directory must exist or we disable vhosting */ if (st->opt_vhost) { snprintf(buf, sizeof(buf), "%s/%s", st->server_root, st->server_host); if (stat(buf, &file) == ERROR) st->opt_vhost = FALSE; } /* If -D arg looks like a file load the file contents */ if (*st->server_description == '/') { if ((fp = fopen(st->server_description , "r"))) { fgets(st->server_description, sizeof(st->server_description), fp); chomp(st->server_description); fclose(fp); } else strclear(st->server_description); } /* If -L arg looks like a file load the file contents */ if (*st->server_location == '/') { if ((fp = fopen(st->server_location , "r"))) { fgets(st->server_location, sizeof(st->server_location), fp); chomp(st->server_location); fclose(fp); } else strclear(st->server_location); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_409125", "function_addr": 4231461, "binary_name": "afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 4C0h"], [3, "mov [rbp+var_4A8], rdi"], [4, "mov [rbp+argc], esi"], [5, "mov [rbp+argv], rdx"], [6, "jmp loc_4096AE"], [7, "mov eax, [rbp+var_4]"], [8, "sub eax, 41h "], [9, "cmp eax, 36h"], [10, "ja def_409162"], [11, "mov eax, eax"], [12, "mov rax, ds:jpt_409162[rax*8]"], [13, "jmp rax"], [14, "mov rax, cs:optarg"], [15, "mov rdx, [rbp+var_4A8]"], [16, "lea rcx, [rdx+12D8h]"], [17, "mov edx, 40h "], [18, "mov rsi, rax"], [19, "mov rdi, rcx"], [20, "call sub_407B7E"], [21, "jmp loc_4096AE"], [22, "mov rax, cs:optarg"], [23, "mov rdi, rax"], [24, "call _atoi"], [25, "mov rdx, [rbp+var_4A8]"], [26, "mov [rdx+1318h], eax"], [27, "jmp loc_4096AE"], [28, "mov rax, cs:optarg"], [29, "mov rdi, rax"], [30, "call _atoi"], [31, "mov rdx, [rbp+var_4A8]"], [32, "mov [rdx+131Ch], eax"], [33, "jmp loc_4096AE"], [34, "mov rax, cs:optarg"], [35, "mov rdx, [rbp+var_4A8]"], [36, "lea rcx, [rdx+1198h]"], [37, "mov edx, 100h"], [38, "mov rsi, rax"], [39, "mov rdi, rcx"], [40, "call sub_407B7E"], [41, "jmp loc_4096AE"], [42, "mov rax, cs:optarg"], [43, "movzx edx, byte ptr [rax]"], [44, "mov rax, [rbp+var_4A8]"], [45, "mov [rax+1320h], dl"], [46, "jmp loc_4096AE"], [47, "mov rax, cs:optarg"], [48, "mov rdx, [rbp+var_4A8]"], [49, "lea rcx, [rdx+1321h]"], [50, "mov edx, 40h "], [51, "mov rsi, rax"], [52, "mov rdi, rcx"], [53, "call sub_407B7E"], [54, "jmp loc_4096AE"], [55, "mov rax, cs:optarg"], [56, "mov rdx, [rbp+var_4A8]"], [57, "lea rcx, [rdx+1321h]"], [58, "mov edx, 40h "], [59, "mov rsi, rax"], [60, "mov rdi, rcx"], [61, "call sub_407B7E"], [62, "jmp loc_4096AE"], [63, "mov rax, cs:optarg"], [64, "mov rdx, [rbp+var_4A8]"], [65, "lea rcx, [rdx+13A1h]"], [66, "mov edx, 40h "], [67, "mov rsi, rax"], [68, "mov rdi, rcx"], [69, "call sub_407B7E"], [70, "jmp loc_4096AE"], [71, "mov rax, cs:optarg"], [72, "mov rdx, [rbp+var_4A8]"], [73, "lea rcx, [rdx+13E1h]"], [74, "mov edx, 40h "], [75, "mov rsi, rax"], [76, "mov rdi, rcx"], [77, "call sub_407B7E"], [78, "jmp loc_4096AE"], [79, "mov rax, cs:optarg"], [80, "mov rdx, [rbp+var_4A8]"], [81, "lea rcx, [rdx+1421h]"], [82, "mov edx, 100h"], [83, "mov rsi, rax"], [84, "mov rdi, rcx"], [85, "call sub_407B7E"], [86, "jmp loc_4096AE"], [87, "mov rax, cs:optarg"], [88, "mov rdi, rax"], [89, "call _atoi"], [90, "mov rdx, [rbp+var_4A8]"], [91, "mov [rdx+1090h], eax"], [92, "jmp loc_4096AE"], [93, "mov rax, cs:optarg"], [94, "mov edx, 5"], [95, "mov esi, offset aUtf8_0"], [96, "mov rdi, rax"], [97, "call _strncasecmp"], [98, "test eax, eax"], [99, "jnz short loc_409337"], [100, "mov rax, [rbp+var_4A8]"], [101, "mov dword ptr [rax+1094h], 3"], [102, "mov rax, cs:optarg"], [103, "mov edx, 0Ah"], [104, "mov esi, offset aIso88591_0"], [105, "mov rdi, rax"], [106, "call _strncasecmp"], [107, "test eax, eax"], [108, "jnz loc_4096AE"], [109, "mov rax, [rbp+var_4A8]"], [110, "mov dword ptr [rax+1094h], 2"], [111, "jmp loc_4096AE"], [112, "mov rax, cs:optarg"], [113, "mov rdi, rax"], [114, "call _atoi"], [115, "mov rdx, [rbp+var_4A8]"], [116, "mov [rdx+13D70h], eax"], [117, "jmp loc_4096AE"], [118, "mov rax, cs:optarg"], [119, "mov rdi, rax"], [120, "call _atoi"], [121, "cdq"], [122, "xor eax, edx"], [123, "sub eax, edx"], [124, "mov rdx, [rbp+var_4A8]"], [125, "mov [rdx+13D74h], eax"], [126, "jmp loc_4096AE"], [127, "mov rax, cs:optarg"], [128, "mov rdi, rax"], [129, "call _atoi"], [130, "cdq"], [131, "xor eax, edx"], [132, "sub eax, edx"], [133, "mov rdx, [rbp+var_4A8]"], [134, "mov [rdx+13D78h], eax"], [135, "jmp loc_4096AE"], [136, "mov rax, cs:optarg"], [137, "mov rdx, [rbp+var_4A8]"], [138, "lea rcx, [rdx+3D2Ch]"], [139, "mov edx, 40h "], [140, "mov rsi, rax"], [141, "mov rdi, rcx"], [142, "call sub_407B7E"], [143, "jmp loc_4096AE"], [144, "mov rdx, cs:optarg"], [145, "mov rax, [rbp+var_4A8]"], [146, "mov rsi, rdx"], [147, "mov rdi, rax"], [148, "call sub_408ED6"], [149, "jmp loc_4096AE"], [150, "mov rdx, cs:optarg"], [151, "mov rax, [rbp+var_4A8]"], [152, "mov rsi, rdx"], [153, "mov rdi, rax"], [154, "call sub_409027"], [155, "jmp loc_4096AE"], [156, "mov rax, cs:optarg"], [157, "mov rdx, [rbp+var_4A8]"], [158, "lea rcx, [rdx+1098h]"], [159, "mov edx, 40h "], [160, "mov rsi, rax"], [161, "mov rdi, rcx"], [162, "call sub_407B7E"], [163, "jmp loc_4096AE"], [164, "mov rax, cs:optarg"], [165, "mov rdx, [rbp+var_4A8]"], [166, "lea rcx, [rdx+10D8h]"], [167, "mov edx, 40h "], [168, "mov rsi, rax"], [169, "mov rdi, rcx"], [170, "call sub_407B7E"], [171, "jmp loc_4096AE"], [172, "mov rax, cs:optarg"], [173, "mov rdx, [rbp+var_4A8]"], [174, "lea rcx, [rdx+1158h]"], [175, "mov edx, 40h "], [176, "mov rsi, rax"], [177, "mov rdi, rcx"], [178, "call sub_407B7E"], [179, "jmp loc_4096AE"], [180, "mov rax, cs:optarg"], [181, "movzx eax, byte ptr [rax]"], [182, "cmp al, 76h "], [183, "jnz short loc_4094E0"], [184, "mov rax, [rbp+var_4A8]"], [185, "mov byte ptr [rax+13D87h], 0"], [186, "jmp loc_4096AE"], [187, "mov rax, cs:optarg"], [188, "movzx eax, byte ptr [rax]"], [189, "cmp al, 6Ch "], [190, "jnz short loc_409501"], [191, "mov rax, [rbp+var_4A8]"], [192, "mov byte ptr [rax+13D80h], 0"], [193, "jmp loc_4096AE"], [194, "mov rax, cs:optarg"], [195, "movzx eax, byte ptr [rax]"], [196, "cmp al, 68h "], [197, "jnz short loc_409522"], [198, "mov rax, [rbp+var_4A8]"], [199, "mov byte ptr [rax+13D81h], 0"], [200, "jmp loc_4096AE"], [201, "mov rax, cs:optarg"], [202, "movzx eax, byte ptr [rax]"], [203, "cmp al, 66h "], [204, "jnz short loc_409543"], [205, "mov rax, [rbp+var_4A8]"], [206, "mov byte ptr [rax+13D82h], 0"], [207, "jmp loc_4096AE"], [208, "mov rax, cs:optarg"], [209, "movzx eax, byte ptr [rax]"], [210, "cmp al, 64h "], [211, "jnz short loc_409564"], [212, "mov rax, [rbp+var_4A8]"], [213, "mov byte ptr [rax+13D83h], 0"], [214, "jmp loc_4096AE"], [215, "mov rax, cs:optarg"], [216, "movzx eax, byte ptr [rax]"], [217, "cmp al, 63h "], [218, "jnz short loc_409585"], [219, "mov rax, [rbp+var_4A8]"], [220, "mov byte ptr [rax+13D85h], 0"], [221, "jmp loc_4096AE"], [222, "mov rax, cs:optarg"], [223, "movzx eax, byte ptr [rax]"], [224, "cmp al, 6Fh "], [225, "jnz short loc_4095A6"], [226, "mov rax, [rbp+var_4A8]"], [227, "mov byte ptr [rax+13D86h], 0"], [228, "jmp loc_4096AE"], [229, "mov rax, cs:optarg"], [230, "movzx eax, byte ptr [rax]"], [231, "cmp al, 71h "], [232, "jnz short loc_4095C7"], [233, "mov rax, [rbp+var_4A8]"], [234, "mov byte ptr [rax+13D88h], 0"], [235, "jmp loc_4096AE"], [236, "mov rax, cs:optarg"], [237, "movzx eax, byte ptr [rax]"], [238, "cmp al, 73h "], [239, "jnz short loc_4095E8"], [240, "mov rax, [rbp+var_4A8]"], [241, "mov byte ptr [rax+13D84h], 0"], [242, "jmp loc_4096AE"], [243, "mov rax, cs:optarg"], [244, "movzx eax, byte ptr [rax]"], [245, "cmp al, 61h "], [246, "jnz short loc_409609"], [247, "mov rax, [rbp+var_4A8]"], [248, "mov byte ptr [rax+13D89h], 0"], [249, "jmp loc_4096AE"], [250, "mov rax, cs:optarg"], [251, "movzx eax, byte ptr [rax]"], [252, "cmp al, 6Dh "], [253, "jnz short loc_40962A"], [254, "mov rax, [rbp+var_4A8]"], [255, "mov byte ptr [rax+13D8Ah], 0"], [256, "jmp loc_4096AE"], [257, "mov rax, cs:optarg"], [258, "movzx eax, byte ptr [rax]"], [259, "cmp al, 72h "], [260, "jnz short loc_4096AE"], [261, "mov rax, [rbp+var_4A8]"], [262, "mov byte ptr [rax+13D8Bh], 0"], [263, "jmp short loc_4096AE"], [264, "mov rax, [rbp+var_4A8]"], [265, "mov byte ptr [rax+13D8Ch], 1"], [266, "jmp short loc_4096AE"], [267, "mov edi, offset aGophernicusCop"], [268, "call _puts"], [269, "mov edi, 0"], [270, "call _exit"], [271, "mov r8d, offset aJun32023"], [272, "mov ecx, offset aMillenniumEdit_0"], [273, "mov edx, offset a24"], [274, "mov esi, offset aGophernicus"], [275, "mov edi, offset aSSSBuiltS"], [276, "mov eax, 0"], [277, "call _printf"], [278, "mov edi, 0"], [279, "call _exit"], [280, "mov edi, offset aGophernicusCop_0"], [281, "call _puts"], [282, "mov edi, 0"], [283, "call _exit"], [284, "mov rcx, [rbp+argv]"], [285, "mov eax, [rbp+argc]"], [286, "mov edx, offset shortopts"], [287, "mov rsi, rcx"], [288, "mov edi, eax"], [289, "call _getopt"], [290, "mov [rbp+var_4], eax"], [291, "cmp [rbp+var_4], 0FFFFFFFFh"], [292, "jnz loc_409149"], [293, "mov rax, [rbp+var_4A8]"], [294, "mov eax, [rax+1090h]"], [295, "cmp eax, 0C8h"], [296, "jle short loc_4096FC"], [297, "mov rax, [rbp+var_4A8]"], [298, "mov dword ptr [rax+1090h], 0C8h"], [299, "mov rax, [rbp+var_4A8]"], [300, "mov eax, [rax+1090h]"], [301, "cmp eax, 20h "], [302, "jg short loc_40971F"], [303, "mov rax, [rbp+var_4A8]"], [304, "mov dword ptr [rax+1090h], 21h "], [305, "mov rax, [rbp+var_4A8]"], [306, "mov eax, [rax+1090h]"], [307, "cmp eax, 31h "], [308, "jg short loc_40973F"], [309, "mov rax, [rbp+var_4A8]"], [310, "mov byte ptr [rax+13D83h], 0"], [311, "mov rax, [rbp+var_4A8]"], [312, "movzx eax, byte ptr [rax+13D84h]"], [313, "test al, al"], [314, "jnz short loc_40975F"], [315, "mov rax, [rbp+var_4A8]"], [316, "mov byte ptr [rax+13D8Ch], 0"], [317, "mov rax, [rbp+var_4A8]"], [318, "movzx eax, byte ptr [rax+13D87h]"], [319, "test al, al"], [320, "jz short loc_4097DD"], [321, "mov rax, [rbp+var_4A8]"], [322, "lea rcx, [rax+12D8h]"], [323, "mov rax, [rbp+var_4A8]"], [324, "lea rdx, [rax+1198h]"], [325, "lea rax, [rbp+s]"], [326, "mov r8, rcx"], [327, "mov rcx, rdx"], [328, "mov edx, offset aSS_3"], [329, "mov esi, 400h"], [330, "mov rdi, rax"], [331, "mov eax, 0"], [332, "call _snprintf"], [333, "lea rdx, [rbp+stat_buf]"], [334, "lea rax, [rbp+s]"], [335, "mov rsi, rdx"], [336, "mov rdi, rax"], [337, "call sub_409970"], [338, "cmp eax, 0FFFFFFFFh"], [339, "jnz short loc_4097DD"], [340, "mov rax, [rbp+var_4A8]"], [341, "mov byte ptr [rax+13D87h], 0"], [342, "mov rax, [rbp+var_4A8]"], [343, "movzx eax, byte ptr [rax+1098h]"], [344, "cmp al, 2Fh "], [345, "jnz short loc_409867"], [346, "mov rax, [rbp+var_4A8]"], [347, "add rax, 1098h"], [348, "mov esi, offset aR_1"], [349, "mov rdi, rax"], [350, "call _fopen64"], [351, "mov [rbp+stream], rax"], [352, "cmp [rbp+stream], 0"], [353, "jz short loc_409859"], [354, "mov rax, [rbp+var_4A8]"], [355, "lea rcx, [rax+1098h]"], [356, "mov rax, [rbp+stream]"], [357, "mov rdx, rax"], [358, "mov esi, 40h "], [359, "mov rdi, rcx"], [360, "call _fgets"], [361, "mov rax, [rbp+var_4A8]"], [362, "add rax, 1098h"], [363, "mov rdi, rax"], [364, "call sub_40747C"], [365, "mov rax, [rbp+stream]"], [366, "mov rdi, rax"], [367, "call _fclose"], [368, "jmp short loc_409867"], [369, "mov rax, [rbp+var_4A8]"], [370, "mov byte ptr [rax+1098h], 0"], [371, "mov rax, [rbp+var_4A8]"], [372, "movzx eax, byte ptr [rax+10D8h]"], [373, "cmp al, 2Fh "], [374, "jnz short loc_4098F1"], [375, "mov rax, [rbp+var_4A8]"], [376, "add rax, 10D8h"], [377, "mov esi, offset aR_1"], [378, "mov rdi, rax"], [379, "call _fopen64"], [380, "mov [rbp+stream], rax"], [381, "cmp [rbp+stream], 0"], [382, "jz short loc_4098E3"], [383, "mov rax, [rbp+var_4A8]"], [384, "lea rcx, [rax+10D8h]"], [385, "mov rax, [rbp+stream]"], [386, "mov rdx, rax"], [387, "mov esi, 40h "], [388, "mov rdi, rcx"], [389, "call _fgets"], [390, "mov rax, [rbp+var_4A8]"], [391, "add rax, 10D8h"], [392, "mov rdi, rax"], [393, "call sub_40747C"], [394, "mov rax, [rbp+stream]"], [395, "mov rdi, rax"], [396, "call _fclose"], [397, "jmp short loc_4098F1"], [398, "mov rax, [rbp+var_4A8]"], [399, "mov byte ptr [rax+10D8h], 0"], [400, "nop"], [401, "leave"], [402, "retn"]], "data_dep": [[7, 290], [8, 7], [9, 8], [10, 9], [11, 8], [13, 12], [15, 3], [16, 241], [16, 227], [16, 213], [16, 199], [16, 185], [16, 32], [16, 45], [16, 134], [16, 26], [16, 101], [16, 110], [16, 91], [16, 248], [16, 234], [16, 220], [16, 206], [16, 192], [16, 15], [16, 262], [16, 284], [16, 265], [16, 116], [16, 125], [16, 255], [18, 14], [19, 16], [23, 22], [25, 3], [26, 25], [26, 24], [29, 28], [31, 3], [32, 31], [32, 30], [35, 3], [36, 192], [36, 284], [36, 32], [36, 265], [36, 116], [36, 125], [36, 134], [36, 255], [36, 241], [36, 227], [36, 101], [36, 110], [36, 213], [36, 199], [36, 185], [36, 45], [36, 26], [36, 35], [36, 262], [36, 91], [36, 248], [36, 234], [36, 220], [36, 206], [38, 34], [39, 36], [43, 101], [43, 110], [43, 213], [43, 199], [43, 91], [43, 185], [43, 45], [43, 26], [43, 262], [43, 248], [43, 234], [43, 220], [43, 206], [43, 192], [43, 42], [43, 32], [43, 265], [43, 116], [43, 125], [43, 134], [43, 255], [43, 241], [43, 227], [44, 3], [45, 43], [45, 44], [48, 3], [49, 265], [49, 116], [49, 125], [49, 134], [49, 255], [49, 241], [49, 227], [49, 101], [49, 213], [49, 199], [49, 185], [49, 32], [49, 45], [49, 26], [49, 110], [49, 262], [49, 91], [49, 248], [49, 234], [49, 220], [49, 206], [49, 192], [49, 48], [49, 284], [51, 47], [52, 49], [56, 3], [57, 116], [57, 125], [57, 134], [57, 255], [57, 241], [57, 227], [57, 101], [57, 110], [57, 213], [57, 199], [57, 91], [57, 185], [57, 45], [57, 26], [57, 262], [57, 248], [57, 234], [57, 220], [57, 206], [57, 192], [57, 56], [57, 284], [57, 32], [57, 265], [59, 55], [60, 57], [64, 3], [65, 116], [65, 125], [65, 134], [65, 255], [65, 241], [65, 227], [65, 101], [65, 110], [65, 213], [65, 199], [65, 64], [65, 91], [65, 185], [65, 45], [65, 26], [65, 262], [65, 248], [65, 234], [65, 220], [65, 206], [65, 192], [65, 284], [65, 32], [65, 265], [67, 63], [68, 65], [72, 3], [73, 227], [73, 101], [73, 110], [73, 213], [73, 199], [73, 91], [73, 185], [73, 45], [73, 72], [73, 26], [73, 262], [73, 248], [73, 234], [73, 220], [73, 206], [73, 192], [73, 284], [73, 32], [73, 265], [73, 116], [73, 125], [73, 134], [73, 255], [73, 241], [75, 71], [76, 73], [80, 3], [81, 213], [81, 199], [81, 91], [81, 185], [81, 45], [81, 26], [81, 262], [81, 248], [81, 234], [81, 220], [81, 206], [81, 80], [81, 192], [81, 284], [81, 32], [81, 265], [81, 116], [81, 125], [81, 134], [81, 255], [81, 241], [81, 227], [81, 101], [81, 110], [83, 79], [84, 81], [88, 87], [90, 3], [91, 90], [91, 89], [96, 93], [98, 97], [99, 98], [100, 3], [101, 100], [105, 102], [107, 106], [108, 107], [109, 3], [110, 109], [113, 112], [115, 3], [116, 114], [116, 115], [119, 118], [122, 286], [122, 120], [123, 286], [123, 122], [124, 3], [125, 124], [125, 123], [128, 127], [131, 129], [131, 286], [132, 286], [132, 131], [133, 3], [134, 133], [134, 132], [137, 3], [138, 110], [138, 213], [138, 199], [138, 91], [138, 185], [138, 45], [138, 26], [138, 137], [138, 262], [138, 248], [138, 234], [138, 220], [138, 206], [138, 192], [138, 284], [138, 32], [138, 265], [138, 116], [138, 125], [138, 134], [138, 255], [138, 241], [138, 227], [138, 101], [140, 136], [141, 138], [145, 3], [146, 144], [147, 145], [151, 3], [152, 150], [153, 151], [157, 3], [158, 284], [158, 32], [158, 265], [158, 157], [158, 116], [158, 125], [158, 134], [158, 255], [158, 241], [158, 227], [158, 101], [158, 110], [158, 213], [158, 199], [158, 91], [158, 185], [158, 45], [158, 26], [158, 262], [158, 248], [158, 234], [158, 220], [158, 206], [158, 192], [160, 156], [161, 158], [165, 3], [166, 284], [166, 185], [166, 32], [166, 265], [166, 116], [166, 125], [166, 134], [166, 255], [166, 241], [166, 227], [166, 101], [166, 110], [166, 213], [166, 199], [166, 91], [166, 45], [166, 26], [166, 165], [166, 192], [166, 262], [166, 248], [166, 234], [166, 220], [166, 206], [168, 164], [169, 166], [173, 3], [174, 32], [174, 265], [174, 45], [174, 125], [174, 134], [174, 255], [174, 26], [174, 241], [174, 227], [174, 101], [174, 110], [174, 91], [174, 206], [174, 192], [174, 173], [174, 262], [174, 248], [174, 284], [174, 234], [174, 220], [174, 116], [174, 213], [174, 199], [174, 185], [176, 172], [177, 174], [181, 192], [181, 262], [181, 248], [181, 234], [181, 265], [181, 116], [181, 227], [181, 213], [181, 199], [181, 185], [181, 32], [181, 180], [181, 45], [181, 125], [181, 134], [181, 255], [181, 26], [181, 241], [181, 101], [181, 110], [181, 91], [181, 220], [181, 206], [182, 181], [183, 182], [184, 3], [185, 184], [188, 187], [188, 199], [188, 185], [188, 32], [188, 265], [188, 45], [188, 125], [188, 134], [188, 255], [188, 26], [188, 241], [188, 227], [188, 101], [188, 110], [188, 213], [188, 91], [188, 206], [188, 192], [188, 262], [188, 248], [188, 234], [188, 220], [188, 116], [189, 188], [190, 189], [191, 3], [192, 191], [195, 91], [195, 220], [195, 206], [195, 192], [195, 262], [195, 248], [195, 234], [195, 265], [195, 116], [195, 213], [195, 199], [195, 185], [195, 194], [195, 32], [195, 45], [195, 125], [195, 134], [195, 255], [195, 26], [195, 241], [195, 227], [195, 101], [195, 110], [196, 195], [197, 196], [198, 3], [199, 198], [202, 265], [202, 116], [202, 125], [202, 227], [202, 213], [202, 199], [202, 185], [202, 32], [202, 45], [202, 134], [202, 255], [202, 26], [202, 241], [202, 101], [202, 110], [202, 91], [202, 234], [202, 220], [202, 206], [202, 192], [202, 201], [202, 262], [202, 248], [203, 202], [204, 203], [205, 3], [206, 205], [209, 255], [209, 26], [209, 241], [209, 227], [209, 101], [209, 110], [209, 208], [209, 91], [209, 206], [209, 192], [209, 262], [209, 248], [209, 234], [209, 220], [209, 116], [209, 213], [209, 199], [209, 185], [209, 32], [209, 265], [209, 45], [209, 125], [209, 134], [210, 209], [211, 210], [212, 3], [213, 212], [216, 262], [216, 248], [216, 234], [216, 265], [216, 215], [216, 116], [216, 227], [216, 213], [216, 199], [216, 185], [216, 32], [216, 45], [216, 125], [216, 134], [216, 255], [216, 26], [216, 241], [216, 101], [216, 110], [216, 91], [216, 220], [216, 206], [216, 192], [217, 216], [218, 217], [219, 3], [220, 219], [223, 45], [223, 134], [223, 255], [223, 26], [223, 101], [223, 110], [223, 222], [223, 91], [223, 234], [223, 220], [223, 206], [223, 192], [223, 262], [223, 248], [223, 265], [223, 116], [223, 125], [223, 241], [223, 227], [223, 213], [223, 199], [223, 185], [223, 32], [224, 223], [225, 224], [226, 3], [227, 226], [230, 206], [230, 192], [230, 262], [230, 248], [230, 234], [230, 220], [230, 229], [230, 116], [230, 213], [230, 199], [230, 185], [230, 32], [230, 265], [230, 45], [230, 125], [230, 134], [230, 255], [230, 26], [230, 241], [230, 227], [230, 101], [230, 110], [230, 91], [231, 230], [232, 231], [233, 3], [234, 233], [237, 227], [237, 213], [237, 199], [237, 185], [237, 32], [237, 45], [237, 125], [237, 134], [237, 255], [237, 26], [237, 241], [237, 236], [237, 101], [237, 110], [237, 91], [237, 234], [237, 220], [237, 206], [237, 192], [237, 262], [237, 248], [237, 265], [237, 116], [238, 237], [239, 238], [240, 3], [241, 240], [244, 91], [244, 248], [244, 234], [244, 220], [244, 206], [244, 192], [244, 262], [244, 243], [244, 265], [244, 116], [244, 125], [244, 241], [244, 227], [244, 213], [244, 199], [244, 185], [244, 32], [244, 45], [244, 134], [244, 255], [244, 26], [244, 101], [244, 110], [245, 244], [246, 245], [247, 3], [248, 247], [251, 234], [251, 265], [251, 116], [251, 213], [251, 199], [251, 185], [251, 32], [251, 45], [251, 125], [251, 134], [251, 255], [251, 26], [251, 250], [251, 227], [251, 101], [251, 110], [251, 91], [251, 220], [251, 241], [251, 206], [251, 192], [251, 262], [251, 248], [252, 251], [253, 252], [254, 3], [255, 254], [258, 255], [258, 26], [258, 241], [258, 101], [258, 110], [258, 91], [258, 234], [258, 220], [258, 206], [258, 192], [258, 262], [258, 248], [258, 257], [258, 265], [258, 116], [258, 125], [258, 227], [258, 213], [258, 199], [258, 185], [258, 32], [258, 45], [258, 134], [259, 258], [260, 259], [261, 3], [262, 261], [264, 3], [265, 264], [284, 5], [285, 4], [287, 284], [288, 285], [290, 289], [291, 290], [292, 291], [293, 3], [294, 101], [294, 213], [294, 199], [294, 185], [294, 45], [294, 26], [294, 110], [294, 262], [294, 91], [294, 248], [294, 234], [294, 220], [294, 206], [294, 192], [294, 293], [294, 32], [294, 265], [294, 116], [294, 125], [294, 134], [294, 255], [294, 241], [294, 227], [295, 294], [296, 295], [297, 3], [298, 297], [299, 3], [300, 265], [300, 116], [300, 125], [300, 241], [300, 227], [300, 213], [300, 199], [300, 185], [300, 32], [300, 45], [300, 134], [300, 255], [300, 26], [300, 101], [300, 110], [300, 91], [300, 248], [300, 234], [300, 220], [300, 206], [300, 192], [300, 299], [300, 262], [300, 298], [301, 300], [302, 301], [303, 3], [304, 303], [305, 3], [306, 304], [306, 298], [306, 32], [306, 265], [306, 116], [306, 125], [306, 134], [306, 255], [306, 241], [306, 227], [306, 101], [306, 110], [306, 213], [306, 199], [306, 91], [306, 185], [306, 45], [306, 305], [306, 26], [306, 262], [306, 248], [306, 234], [306, 220], [306, 206], [306, 192], [307, 306], [308, 307], [309, 3], [310, 309], [311, 3], [312, 262], [312, 91], [312, 248], [312, 234], [312, 220], [312, 206], [312, 192], [312, 304], [312, 298], [312, 265], [312, 116], [312, 125], [312, 255], [312, 241], [312, 227], [312, 101], [312, 213], [312, 199], [312, 311], [312, 185], [312, 32], [312, 45], [312, 310], [312, 134], [312, 26], [312, 110], [313, 312], [314, 313], [315, 3], [316, 315], [317, 3], [318, 45], [318, 310], [318, 26], [318, 125], [318, 110], [318, 262], [318, 91], [318, 248], [318, 234], [318, 220], [318, 206], [318, 192], [318, 304], [318, 317], [318, 298], [318, 265], [318, 116], [318, 134], [318, 255], [318, 241], [318, 227], [318, 101], [318, 213], [318, 316], [318, 199], [318, 185], [318, 32], [319, 318], [320, 319], [321, 3], [322, 298], [322, 284], [322, 265], [322, 116], [322, 125], [322, 255], [322, 241], [322, 227], [322, 321], [322, 101], [322, 213], [322, 316], [322, 199], [322, 185], [322, 32], [322, 45], [322, 310], [322, 134], [322, 26], [322, 110], [322, 262], [322, 91], [322, 248], [322, 234], [322, 220], [322, 206], [322, 192], [322, 304], [323, 3], [324, 227], [324, 101], [324, 213], [324, 316], [324, 199], [324, 185], [324, 45], [324, 310], [324, 26], [324, 286], [324, 110], [324, 262], [324, 91], [324, 248], [324, 234], [324, 220], [324, 323], [324, 206], [324, 192], [324, 304], [324, 298], [324, 32], [324, 265], [324, 116], [324, 125], [324, 134], [324, 255], [324, 241], [325, 323], [326, 322], [327, 324], [330, 325], [333, 328], [334, 332], [335, 333], [336, 334], [338, 337], [339, 338], [340, 3], [341, 340], [342, 3], [343, 227], [343, 101], [343, 213], [343, 316], [343, 199], [343, 185], [343, 32], [343, 45], [343, 310], [343, 26], [343, 110], [343, 298], [343, 262], [343, 91], [343, 248], [343, 342], [343, 234], [343, 220], [343, 241], [343, 341], [343, 206], [343, 192], [343, 304], [343, 265], [343, 116], [343, 125], [343, 134], [343, 255], [344, 343], [345, 344], [346, 3], [347, 346], [349, 347], [351, 350], [352, 351], [353, 352], [354, 3], [355, 327], [355, 192], [355, 304], [355, 298], [355, 284], [355, 206], [355, 32], [355, 265], [355, 116], [355, 354], [355, 125], [355, 134], [355, 255], [355, 241], [355, 227], [355, 101], [355, 213], [355, 316], [355, 199], [355, 185], [355, 45], [355, 310], [355, 26], [355, 110], [355, 262], [355, 91], [355, 248], [355, 234], [355, 220], [355, 341], [356, 351], [357, 356], [359, 355], [361, 3], [362, 361], [363, 362], [365, 351], [366, 365], [369, 3], [370, 369], [371, 3], [372, 370], [372, 262], [372, 248], [372, 234], [372, 220], [372, 341], [372, 206], [372, 192], [372, 304], [372, 298], [372, 316], [372, 32], [372, 265], [372, 116], [372, 125], [372, 134], [372, 255], [372, 241], [372, 371], [372, 227], [372, 101], [372, 110], [372, 213], [372, 199], [372, 91], [372, 185], [372, 45], [372, 310], [372, 26], [373, 372], [374, 373], [375, 3], [376, 375], [378, 376], [380, 379], [381, 380], [382, 381], [383, 3], [384, 116], [384, 125], [384, 134], [384, 255], [384, 241], [384, 227], [384, 101], [384, 110], [384, 213], [384, 199], [384, 91], [384, 185], [384, 45], [384, 310], [384, 26], [384, 304], [384, 370], [384, 262], [384, 383], [384, 248], [384, 234], [384, 355], [384, 220], [384, 341], [384, 206], [384, 327], [384, 192], [384, 298], [384, 316], [384, 284], [384, 32], [384, 265], [385, 380], [386, 385], [388, 384], [390, 3], [391, 390], [392, 391], [394, 380], [395, 394], [398, 3], [399, 398], [402, 396], [402, 372], [402, 398]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4_afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.jsonl.gz", "strip_func_name": "sub_409125", "query": "\n\n\nint __fastcall sub_409125(unsigned __int64 a1, int a2, char *const *a3)\n{\nint i; // eax\nint result; // eax\nchar s[1024]; // [rsp+20h] [rbp-4A0h] BYREF\nstruct stat64 stat_buf; // [rsp+420h] [rbp-A0h] BYREF\nFILE *stream; // [rsp+4B0h] [rbp-10h]\nint v9; // [rsp+4BCh] [rbp-4h]\n\nfor ( i = getopt(a2, a3, \"h:p:T:r:t:g:a:c:u:m:l:w:o:s:i:k:f:e:R:D:L:A:P:n:dbv?-\");\n;\ni = getopt(a2, a3, \"h:p:T:r:t:g:a:c:u:m:l:w:o:s:i:k:f:e:R:D:L:A:P:n:dbv?-\") )\n{\nv9 = i;\nif ( i == -1 )\nbreak;\nswitch ( v9 )\n{\ncase 'A':\nsub_407B7E((_BYTE *)(a1 + 4440), optarg, 64LL);\nbreak;\ncase 'D':\nsub_407B7E((_BYTE *)(a1 + 4248), optarg, 64LL);\nbreak;\ncase 'L':\nsub_407B7E((_BYTE *)(a1 + 4312), optarg, 64LL);\nbreak;\ncase 'R':\nsub_409027(a1, optarg);\nbreak;\ncase 'T':\n*(_DWORD *)(a1 + 4892) = atoi(optarg);\nbreak;\ncase 'a':\ncase 'g':\nsub_407B7E((_BYTE *)(a1 + 4897), optarg, 64LL);\nbreak;\ncase 'b':\nputs(\n\"Gophernicus - Copyright (c) 2009-2017 Kim Holviala <[email protected]>\\n\"\n\"All rights reserved.\\n\"\n\"\\n\"\n\"Redistribution and use in source and binary forms, with or without\\n\"\n\"modification, are permitted provided that the following conditions are met:\\n\"\n\" * Redistributions of source code must retain the above copyright\\n\"\n\" notice, this list of conditions and the following disclaimer.\\n\"\n\" * Redistributions in binary form must reproduce the above copyright\\n\"\n\" notice, this list of conditions and the following disclaimer in the\\n\"\n\" documentation and/or other materials provided with the distribution.\\n\"\n\"\\n\"\n\"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\" AND\\n\"\n\"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\\n\"\n\"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\\n\"\n\"DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY\\n\"\n\"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\\n\"\n\"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\\n\"\n\"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\\n\"\n\"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n\"\n\"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\\n\"\n\"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n\"\n\"\\n\");\nexit(0);\ncase 'c':\nsub_407B7E((_BYTE *)(a1 + 5025), optarg, 64LL);\nbreak;\ncase 'd':\n*(_BYTE *)(a1 + 81292) = 1;\nbreak;\ncase 'e':\nsub_408ED6(a1, optarg);\nbreak;\ncase 'f':\nsub_407B7E((_BYTE *)(a1 + 15660), optarg, 64LL);\nbreak;\ncase 'h':\nsub_407B7E((_BYTE *)(a1 + 4824), optarg, 64LL);\nbreak;\ncase 'i':\n*(_DWORD *)(a1 + 81268) = abs32(atoi(optarg));\nbreak;\ncase 'k':\n*(_DWORD *)(a1 + 81272) = abs32(atoi(optarg));\nbreak;\ncase 'l':\ncase 'm':\nsub_407B7E((_BYTE *)(a1 + 5153), optarg, 256LL);\nbreak;\ncase 'n':\nswitch ( *optarg )\n{\ncase 'v':\n*(_BYTE *)(a1 + 81287) = 0;\nbreak;\ncase 'l':\n*(_BYTE *)(a1 + 81280) = 0;\nbreak;\ncase 'h':\n*(_BYTE *)(a1 + 81281) = 0;\nbreak;\ncase 'f':\n*(_BYTE *)(a1 + 81282) = 0;\nbreak;\ncase 'd':\n*(_BYTE *)(a1 + 81283) = 0;\nbreak;\ncase 'c':\n*(_BYTE *)(a1 + 81285) = 0;\nbreak;\ncase 'o':\n*(_BYTE *)(a1 + 81286) = 0;\nbreak;\ncase 'q':\n*(_BYTE *)(a1 + 81288) = 0;\nbreak;\ncase 's':\n*(_BYTE *)(a1 + 81284) = 0;\nbreak;\ncase 'a':\n*(_BYTE *)(a1 + 81289) = 0;\nbreak;\ncase 'm':\n*(_BYTE *)(a1 + 81290) = 0;\nbreak;\ncase 'r':\n*(_BYTE *)(a1 + 81291) = 0;\nbreak;\n}\nbreak;\ncase 'o':\nif ( !strncasecmp(optarg, \"UTF-8\", 5uLL) )\n*(_DWORD *)(a1 + 4244) = 3;\nif ( !strncasecmp(optarg, \"ISO-8859-1\", 0xAuLL) )\n*(_DWORD *)(a1 + 4244) = 2;\nbreak;\ncase 'p':\n*(_DWORD *)(a1 + 4888) = atoi(optarg);\nbreak;\ncase 'r':\nsub_407B7E((_BYTE *)(a1 + 4504), optarg, 256LL);\nbreak;\ncase 's':\n*(_DWORD *)(a1 + 81264) = atoi(optarg);\nbreak;\ncase 't':\n*(_BYTE *)(a1 + 4896) = *optarg;\nbreak;\ncase 'u':\nsub_407B7E((_BYTE *)(a1 + 5089), optarg, 64LL);\nbreak;\ncase 'v':\nprintf(\"%s/%s \\\"%s\\\" (built %s)\\n\", \"Gophernicus\", \"2.4\", \"Millennium Edition\", \"Jun 3 2023\");\nexit(0);\ncase 'w':\n*(_DWORD *)(a1 + 4240) = atoi(optarg);\nbreak;\ndefault:\nputs(\n\"Gophernicus - Copyright (c) 2009-2017 Kim Holviala <[email protected]>\\n\"\n\"\\n\"\n\"Gophernicus is a modern full-featured (and hopefully) secure gopher\\n\"\n\"daemon. It is licensed under the BSD license.\\n\"\n\"\\n\"\n\"Command line options:\\n\"\n\" -h hostname Change server hostname (FQDN) [$HOSTNAME]\\n\"\n\" -p port Change server port [70]\\n\"\n\" -T port Change TLS/SSL port [0 = disabled]\\n\"\n\" -r root Change gopher root [/var/gopher]\\n\"\n\" -t type Change default gopher filetype [0]\\n\"\n\" -g mapfile Change gophermap file [gophermap]\\n\"\n\" -a tagfile Change gophertag file [gophertag]\\n\"\n\" -c cgidir Change CGI script directory [/cgi-bin/]\\n\"\n\" -u userdir Change users personal gopherspace [public_gopher]\\n\"\n\" -l logfile Log to Apache-compatible combined format logfile\\n\"\n\"\\n\"\n\" -w width Change default page width [76]\\n\"\n\" -o charset Change default output charset [US-ASCII]\\n\"\n\"\\n\"\n\" -s seconds Session timeout in seconds [1800]\\n\"\n\" -i hits Maximum hits until throttling [4096]\\n\"\n\" -k kbytes Maximum transfer until throttling [4194304]\\n\"\n\"\\n\"\n\" -f filterdir Specify directory for output filters\\n\"\n\" -e ext=type Map file extension to gopher filetype\\n\"\n\" -R old=new Rewrite the beginning of a selector\\n\"\n\"\\n\"\n\" -D text|file Set or load server description for caps.txt\\n\"\n\" -L text|file Set or load server location for caps.txt\\n\"\n\" -A admin Set admin email for caps.txt\\n\"\n\"\\n\"\n\" -nv Disable virtual hosting\\n\"\n\" -nl Disable parent directory links\\n\"\n\" -nh Disable menu header (title)\\n\"\n\" -nf Disable menu footer\\n\"\n\" -nd Disable dates and filesizes in menus\\n\"\n\" -nc Disable file content detection\\n\"\n\" -no Disable charset conversion for output\\n\"\n\" -nq Disable HTTP-style query strings (?query)\\n\"\n\" -ns Disable logging to syslog\\n\"\n\" -na Disable autogenerated caps.txt\\n\"\n\" -nm Disable shared memory use (for debugging)\\n\"\n\" -nr Disable root user checking (for debugging)\\n\"\n\"\\n\"\n\" -d Debug to syslog (not for production use)\\n\"\n\" -v Display version number and build date\\n\"\n\" -b Display the BSD license\\n\"\n\" -? Display this help\\n\"\n\" \\n\");\nexit(0);\n}\n}\nif ( *(int *)(a1 + 4240) > 200 )\n*(_DWORD *)(a1 + 4240) = 200;\nif ( *(int *)(a1 + 4240) <= 32 )\n*(_DWORD *)(a1 + 4240) = 33;\nif ( *(int *)(a1 + 4240) <= 49 )\n*(_BYTE *)(a1 + 81283) = 0;\nif ( !*(_BYTE *)(a1 + 81284) )\n*(_BYTE *)(a1 + 81292) = 0;\nif ( *(_BYTE *)(a1 + 81287) )\n{\nsnprintf(s, 0x400uLL, \"%s/%s\", (const char *)(a1 + 4504), (const char *)(a1 + 4824));\nif ( (unsigned int)sub_409970(s, &stat_buf) == -1 )\n*(_BYTE *)(a1 + 81287) = 0;\n}\nif ( *(_BYTE *)(a1 + 4248) == 47 )\n{\nstream = fopen64((const char *)(a1 + 4248), \"r\");\nif ( stream )\n{\nfgets((char *)(a1 + 4248), 64, stream);\nsub_40747C((const char *)(a1 + 4248));\nfclose(stream);\n}\nelse\n{\n*(_BYTE *)(a1 + 4248) = 0;\n}\n}\nresult = *(unsigned __int8 *)(a1 + 4312);\nif ( (_BYTE)result == 47 )\n{\nstream = fopen64((const char *)(a1 + 4312), \"r\");\nif ( stream )\n{\nfgets((char *)(a1 + 4312), 64, stream);\nsub_40747C((const char *)(a1 + 4312));\nresult = fclose(stream);\n}\nelse\n{\nresult = a1;\n*(_BYTE *)(a1 + 4312) = 0;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,s,stat_buf,stream,v9,sub_409125,sub_407B7E,sub_409027,sub_408ED6,sub_409970,sub_40747C,]", "hints": "[]", "response": "{'a3': 'argv', 'a1': 'st', 'a2': 'argc', 's': 'buf', 'stat_buf': 'file', 'stream': 'fp', 'v9': 'opt', 'sub_409125': 'parse_args', 'sub_407B7E': 'strlcpy', 'sub_409027': 'add_rewrite_mapping', 'sub_408ED6': 'add_ftype_mapping', 'sub_409970': 'stat64', 'sub_40747C': 'chomp'}"}
[ [ 0.7008751630783081, 0.6991216540336609, 0.6948919296264648, 0.685880184173584, 0.6823135018348694, 0.6804390549659729, 0.6793062686920166, 0.6791866421699524, 0.678227424621582, 0.6752515435218811, 0.6709463596343994, 0.6697783470153809, 0.6672064065933228, 0.6667581796646118, 0.6653879880905151, 0.6636185646057129, 0.6624947190284729, 0.662306547164917, 0.661984384059906, 0.6614021062850952 ], [ 264825, 251386, 148153, 248730, 191226, 249006, 53838, 135682, 243153, 80478, 224537, 78746, 117548, 11351, 210779, 190573, 152843, 114874, 75881, 95521 ] ]
print_header
ddac7fc87639a4f1a51dab56b1f09c3aa090022833a91cf6ba744a4defdd1dbe
freeors
War-Of-Kingdom
NA
void print_header(ogg_page *og){ int j; fprintf(stderr,"\nHEADER:\n"); fprintf(stderr," capture: %c %c %c %c version: %d flags: %x\n", og->header[0],og->header[1],og->header[2],og->header[3], (int)og->header[4],(int)og->header[5]); fprintf(stderr," granulepos: %d serialno: %d pageno: %ld\n", (og->header[9]<<24)|(og->header[8]<<16)| (og->header[7]<<8)|og->header[6], (og->header[17]<<24)|(og->header[16]<<16)| (og->header[15]<<8)|og->header[14], ((long)(og->header[21])<<24)|(og->header[20]<<16)| (og->header[19]<<8)|og->header[18]); fprintf(stderr," checksum: %02x:%02x:%02x:%02x\n segments: %d (", (int)og->header[22],(int)og->header[23], (int)og->header[24],(int)og->header[25], (int)og->header[26]); for(j=27;j<og->header_len;j++) fprintf(stderr,"%d ",(int)og->header[j]); fprintf(stderr,")\n\n"); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4036D5", "function_addr": 4208341, "binary_name": "ddac7fc87639a4f1a51dab56b1f09c3aa090022833a91cf6ba744a4defdd1dbe.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, cs:stderr"], [5, "mov rcx, rax"], [6, "mov edx, 9"], [7, "mov esi, 1"], [8, "mov edi, offset aHeader"], [9, "call _fwrite"], [10, "mov rax, [rbp+var_18]"], [11, "mov rax, [rax]"], [12, "add rax, 5"], [13, "movzx eax, byte ptr [rax]"], [14, "movzx edi, al"], [15, "mov rax, [rbp+var_18]"], [16, "mov rax, [rax]"], [17, "add rax, 4"], [18, "movzx eax, byte ptr [rax]"], [19, "movzx esi, al"], [20, "mov rax, [rbp+var_18]"], [21, "mov rax, [rax]"], [22, "add rax, 3"], [23, "movzx eax, byte ptr [rax]"], [24, "movzx r9d, al"], [25, "mov rax, [rbp+var_18]"], [26, "mov rax, [rax]"], [27, "add rax, 2"], [28, "movzx eax, byte ptr [rax]"], [29, "movzx r8d, al"], [30, "mov rax, [rbp+var_18]"], [31, "mov rax, [rax]"], [32, "add rax, 1"], [33, "movzx eax, byte ptr [rax]"], [34, "movzx ecx, al"], [35, "mov rax, [rbp+var_18]"], [36, "mov rax, [rax]"], [37, "movzx eax, byte ptr [rax]"], [38, "movzx edx, al"], [39, "mov rax, cs:stderr"], [40, "push rdi"], [41, "push rsi"], [42, "mov esi, offset aCaptureCCCCVer"], [43, "mov rdi, rax"], [44, "mov eax, 0"], [45, "call _fprintf"], [46, "add rsp, 10h"], [47, "mov rax, [rbp+var_18]"], [48, "mov rax, [rax]"], [49, "add rax, 15h"], [50, "movzx eax, byte ptr [rax]"], [51, "movzx eax, al"], [52, "shl rax, 18h"], [53, "mov rdx, rax"], [54, "mov rax, [rbp+var_18]"], [55, "mov rax, [rax]"], [56, "add rax, 14h"], [57, "movzx eax, byte ptr [rax]"], [58, "movzx eax, al"], [59, "shl eax, 10h"], [60, "cdqe"], [61, "or rdx, rax"], [62, "mov rax, [rbp+var_18]"], [63, "mov rax, [rax]"], [64, "add rax, 13h"], [65, "movzx eax, byte ptr [rax]"], [66, "movzx eax, al"], [67, "shl eax, 8"], [68, "cdqe"], [69, "or rdx, rax"], [70, "mov rax, [rbp+var_18]"], [71, "mov rax, [rax]"], [72, "add rax, 12h"], [73, "movzx eax, byte ptr [rax]"], [74, "movzx eax, al"], [75, "mov rsi, rdx"], [76, "or rsi, rax"], [77, "mov rax, [rbp+var_18]"], [78, "mov rax, [rax]"], [79, "add rax, 11h"], [80, "movzx eax, byte ptr [rax]"], [81, "movzx eax, al"], [82, "shl eax, 18h"], [83, "mov edx, eax"], [84, "mov rax, [rbp+var_18]"], [85, "mov rax, [rax]"], [86, "add rax, 10h"], [87, "movzx eax, byte ptr [rax]"], [88, "movzx eax, al"], [89, "shl eax, 10h"], [90, "or edx, eax"], [91, "mov rax, [rbp+var_18]"], [92, "mov rax, [rax]"], [93, "add rax, 0Fh"], [94, "movzx eax, byte ptr [rax]"], [95, "movzx eax, al"], [96, "shl eax, 8"], [97, "or edx, eax"], [98, "mov rax, [rbp+var_18]"], [99, "mov rax, [rax]"], [100, "add rax, 0Eh"], [101, "movzx eax, byte ptr [rax]"], [102, "movzx eax, al"], [103, "mov ecx, edx"], [104, "or ecx, eax"], [105, "mov rax, [rbp+var_18]"], [106, "mov rax, [rax]"], [107, "add rax, 9"], [108, "movzx eax, byte ptr [rax]"], [109, "movzx eax, al"], [110, "shl eax, 18h"], [111, "mov edx, eax"], [112, "mov rax, [rbp+var_18]"], [113, "mov rax, [rax]"], [114, "add rax, 8"], [115, "movzx eax, byte ptr [rax]"], [116, "movzx eax, al"], [117, "shl eax, 10h"], [118, "or edx, eax"], [119, "mov rax, [rbp+var_18]"], [120, "mov rax, [rax]"], [121, "add rax, 7"], [122, "movzx eax, byte ptr [rax]"], [123, "movzx eax, al"], [124, "shl eax, 8"], [125, "or edx, eax"], [126, "mov rax, [rbp+var_18]"], [127, "mov rax, [rax]"], [128, "add rax, 6"], [129, "movzx eax, byte ptr [rax]"], [130, "movzx eax, al"], [131, "or edx, eax"], [132, "mov rax, cs:stderr"], [133, "mov r8, rsi"], [134, "mov esi, offset aGranuleposDSer"], [135, "mov rdi, rax"], [136, "mov eax, 0"], [137, "call _fprintf"], [138, "mov rax, [rbp+var_18]"], [139, "mov rax, [rax]"], [140, "add rax, 1Ah"], [141, "movzx eax, byte ptr [rax]"], [142, "movzx esi, al"], [143, "mov rax, [rbp+var_18]"], [144, "mov rax, [rax]"], [145, "add rax, 19h"], [146, "movzx eax, byte ptr [rax]"], [147, "movzx r8d, al"], [148, "mov rax, [rbp+var_18]"], [149, "mov rax, [rax]"], [150, "add rax, 18h"], [151, "movzx eax, byte ptr [rax]"], [152, "movzx edi, al"], [153, "mov rax, [rbp+var_18]"], [154, "mov rax, [rax]"], [155, "add rax, 17h"], [156, "movzx eax, byte ptr [rax]"], [157, "movzx ecx, al"], [158, "mov rax, [rbp+var_18]"], [159, "mov rax, [rax]"], [160, "add rax, 16h"], [161, "movzx eax, byte ptr [rax]"], [162, "movzx edx, al"], [163, "mov rax, cs:stderr"], [164, "sub rsp, 8"], [165, "push rsi"], [166, "mov r9d, r8d"], [167, "mov r8d, edi"], [168, "mov esi, offset aChecksum02x02x"], [169, "mov rdi, rax"], [170, "mov eax, 0"], [171, "call _fprintf"], [172, "add rsp, 10h"], [173, "mov [rbp+var_4], 1Bh"], [174, "jmp short loc_403964"], [175, "mov rax, [rbp+var_18]"], [176, "mov rdx, [rax]"], [177, "mov eax, [rbp+var_4]"], [178, "cdqe"], [179, "add rax, rdx"], [180, "movzx eax, byte ptr [rax]"], [181, "movzx edx, al"], [182, "mov rax, cs:stderr"], [183, "mov esi, offset aD"], [184, "mov rdi, rax"], [185, "mov eax, 0"], [186, "call _fprintf"], [187, "add [rbp+var_4], 1"], [188, "mov eax, [rbp+var_4]"], [189, "movsxd rdx, eax"], [190, "mov rax, [rbp+var_18]"], [191, "mov rax, [rax+8]"], [192, "cmp rdx, rax"], [193, "jl short loc_403932"], [194, "mov rax, cs:stderr"], [195, "mov rcx, rax"], [196, "mov edx, 3"], [197, "mov esi, 1"], [198, "mov edi, offset asc_4065FD"], [199, "call _fwrite"], [200, "nop"], [201, "leave"], [202, "retn"]], "data_dep": [[5, 4], [10, 3], [11, 10], [12, 11], [13, 12], [14, 13], [15, 3], [16, 15], [17, 16], [18, 17], [19, 18], [20, 3], [21, 20], [22, 21], [23, 22], [24, 23], [25, 3], [26, 25], [27, 26], [28, 27], [29, 28], [30, 3], [31, 30], [32, 31], [33, 32], [34, 33], [35, 3], [36, 35], [37, 36], [38, 37], [40, 14], [41, 19], [43, 39], [46, 2], [47, 3], [48, 47], [49, 48], [50, 49], [51, 50], [52, 51], [53, 52], [54, 3], [55, 54], [56, 55], [57, 56], [58, 57], [59, 58], [61, 53], [61, 59], [62, 3], [63, 62], [64, 63], [65, 64], [66, 65], [67, 66], [69, 67], [69, 61], [70, 3], [71, 70], [72, 71], [73, 72], [74, 73], [75, 69], [76, 74], [76, 75], [77, 3], [78, 77], [79, 78], [80, 79], [81, 80], [82, 81], [83, 82], [84, 3], [85, 84], [86, 85], [87, 86], [88, 87], [89, 88], [90, 83], [90, 89], [91, 3], [92, 91], [93, 92], [94, 93], [95, 94], [96, 95], [97, 90], [97, 96], [98, 3], [99, 98], [100, 99], [101, 100], [102, 101], [103, 97], [104, 102], [104, 103], [105, 3], [106, 105], [107, 106], [108, 107], [109, 108], [110, 109], [111, 110], [112, 3], [113, 112], [114, 113], [115, 114], [116, 115], [117, 116], [118, 117], [118, 111], [119, 3], [120, 119], [121, 120], [122, 121], [123, 122], [124, 123], [125, 118], [125, 124], [126, 3], [127, 126], [128, 127], [129, 128], [130, 129], [131, 125], [131, 130], [133, 76], [135, 132], [138, 3], [139, 138], [140, 139], [141, 140], [142, 141], [143, 3], [144, 143], [145, 144], [146, 145], [147, 146], [148, 3], [149, 148], [150, 149], [151, 150], [152, 151], [153, 3], [154, 153], [155, 154], [156, 155], [157, 156], [158, 3], [159, 158], [160, 159], [161, 160], [162, 161], [164, 46], [165, 142], [166, 147], [167, 152], [169, 163], [172, 164], [175, 3], [176, 175], [177, 173], [177, 187], [179, 176], [179, 177], [180, 179], [181, 180], [184, 182], [187, 173], [187, 187], [188, 187], [188, 173], [189, 188], [190, 3], [191, 190], [192, 189], [192, 191], [193, 192], [195, 194], [202, 199]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ddac7fc87639a4f1a51dab56b1f09c3aa090022833a91cf6ba744a4defdd1dbe_ddac7fc87639a4f1a51dab56b1f09c3aa090022833a91cf6ba744a4defdd1dbe.jsonl.gz", "strip_func_name": "sub_4036D5", "query": "\n\n\nsize_t __fastcall sub_4036D5(unsigned __int8 **a1)\n{\nint i; // [rsp+1Ch] [rbp-4h]\n\nfwrite(\"\\nHEADER:\\n\", 1uLL, 9uLL, stderr);\nfprintf(\nstderr,\n\" capture: %c %c %c %c version: %d flags: %x\\n\",\n**a1,\n(*a1)[1],\n(*a1)[2],\n(*a1)[3],\n(*a1)[4],\n(*a1)[5]);\nfprintf(\nstderr,\n\" granulepos: %d serialno: %d pageno: %ld\\n\",\n(*a1)[6] | ((*a1)[7] << 8) | ((*a1)[8] << 16) | ((*a1)[9] << 24),\n(*a1)[14] | ((*a1)[15] << 8) | ((*a1)[16] << 16) | ((*a1)[17] << 24),\n(*a1)[18] | ((*a1)[19] << 8) | ((*a1)[20] << 16) | ((unsigned __int64)(*a1)[21] << 24));\nfprintf(\nstderr,\n\" checksum: %02x:%02x:%02x:%02x\\n segments: %d (\",\n(*a1)[22],\n(*a1)[23],\n(*a1)[24],\n(*a1)[25],\n(*a1)[26]);\nfor ( i = 27; i < (__int64)a1[1]; ++i )\nfprintf(stderr, \"%d \", (*a1)[i]);\nreturn fwrite(\")\\n\\n\", 1uLL, 3uLL, stderr);\n}\n\n\n\nQ:[a1,sub_4036D5,]", "hints": "[]", "response": "{'a1': 'og', 'sub_4036D5': 'print_header'}"}
[ [ 0.7902964353561401, 0.7884258031845093, 0.7821052670478821, 0.7754670977592468, 0.7684125900268555, 0.7648540735244751, 0.7504496574401855, 0.7452409863471985, 0.7447331547737122, 0.7391951680183411, 0.7367231249809265, 0.7360736131668091, 0.7333784699440002, 0.7268609404563904, 0.7229785323143005, 0.7224352955818176, 0.72226881980896, 0.7199580669403076, 0.7106874585151672, 0.7078918218612671 ], [ 192544, 64907, 63645, 211825, 71528, 163887, 98294, 107774, 142331, 17884, 243352, 122762, 172551, 237690, 213588, 65500, 145731, 16204, 35297, 249788 ] ]
print_usage
a7f0a057e3595fda4579432c28c32741dc464b504b2a03b91823cd9b6f26bfd8
yarrick
pingfs
NA
static void print_usage(char *progname) { fprintf(stderr, "Usage: %s [options] hostfile mountpoint\n" "Options:\n" " -h : Print this help and exit\n" " -u username : Mount the filesystem as this user\n" " -t timeout : Max time to wait for icmp reply " "(seconds, default 1)\n", progname); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40370E", "function_addr": 4208398, "binary_name": "a7f0a057e3595fda4579432c28c32741dc464b504b2a03b91823cd9b6f26bfd8.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, cs:stderr"], [5, "mov rdx, [rbp+var_8]"], [6, "mov esi, offset aUsageSOptionsH"], [7, "mov rdi, rax"], [8, "mov eax, 0"], [9, "call _fprintf"], [10, "nop"], [11, "leave"], [12, "retn"]], "data_dep": [[5, 3], [7, 4], [12, 9]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a7f0a057e3595fda4579432c28c32741dc464b504b2a03b91823cd9b6f26bfd8_a7f0a057e3595fda4579432c28c32741dc464b504b2a03b91823cd9b6f26bfd8.jsonl.gz", "strip_func_name": "sub_40370E", "query": "\n\n\nint __fastcall sub_40370E(const char *a1)\n{\nreturn fprintf(\nstderr,\n\"Usage: %s [options] hostfile mountpoint\\n\"\n\"Options:\\n\"\n\" -h : Print this help and exit\\n\"\n\" -u username : Mount the filesystem as this user\\n\"\n\" -t timeout : Max time to wait for icmp reply (seconds, default 1)\\n\",\na1);\n}\n\n\n\nQ:[a1,sub_40370E,]", "hints": "[]", "response": "{'a1': 'progname', 'sub_40370E': 'print_usage'}"}
[ [ 0.9540046453475952, 0.9532191753387451, 0.9514399170875549, 0.9512709379196167, 0.9512447714805603, 0.9511473774909973, 0.9510900974273682, 0.9503753781318665, 0.9502694010734558, 0.9500454664230347, 0.950040876865387, 0.950033962726593, 0.9499333500862122, 0.9492603540420532, 0.9491931200027466, 0.9489325284957886, 0.9488415718078613, 0.9486923813819885, 0.9486052393913269, 0.9482226371765137 ], [ 253552, 7463, 228247, 61987, 94927, 99400, 167972, 148525, 135969, 216513, 99879, 2328, 171995, 90182, 109134, 254514, 236754, 111152, 223620, 166187 ] ]
parsetime
de34e7111b0f4f0a406c6ce7da8a4538c59bce293cdef5dcb3db6d31ef225f8e
winfsp
winfsp
NA
int parsetime(char *t) { int i = 0; int secs = 0; char b[128]; bzero(b, 128); for (i=0; i < strlen(t); i++) { switch (t[i]) { case 's': secs += atoi(b); bzero(b, 128); break; case 'm': secs += atoi(b) * 60; bzero(b, 128); break; case 'h': secs += atoi(b) * 60 * 60; bzero(b, 128); break; case 'd': secs += atoi(b) * 60 * 60 * 24; bzero(b, 128); break; case 'w': secs += atoi(b) * 60 * 60 * 24 * 7; bzero(b, 128); break; case 'y': secs += atoi(b) * 60 * 60 * 24 * 365; bzero(b, 128); break; default: sprintf(b, "%s%c", b, t[i]); } } if (secs == 0) // maybe they just gave us a number? secs = atoi(t); return(secs); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402550", "function_addr": 4203856, "binary_name": "de34e7111b0f4f0a406c6ce7da8a4538c59bce293cdef5dcb3db6d31ef225f8e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 0A8h"], [4, "mov [rbp+s], rdi"], [5, "mov [rbp+var_14], 0"], [6, "mov [rbp+var_18], 0"], [7, "lea rax, [rbp+nptr]"], [8, "mov rsi, rax"], [9, "mov eax, 0"], [10, "mov edx, 10h"], [11, "mov rdi, rsi"], [12, "mov rcx, rdx"], [13, "rep stosq"], [14, "mov [rbp+var_14], 0"], [15, "jmp loc_40274F"], [16, "mov eax, [rbp+var_14]"], [17, "movsxd rdx, eax"], [18, "mov rax, [rbp+s]"], [19, "add rax, rdx"], [20, "movzx eax, byte ptr [rax]"], [21, "movsx eax, al"], [22, "sub eax, 64h "], [23, "cmp eax, 15h"], [24, "ja def_4025C6"], [25, "mov eax, eax"], [26, "mov rax, ds:jpt_4025C6[rax*8]"], [27, "jmp rax"], [28, "lea rax, [rbp+nptr]"], [29, "mov rdi, rax"], [30, "call _atoi"], [31, "add [rbp+var_18], eax"], [32, "lea rax, [rbp+nptr]"], [33, "mov rsi, rax"], [34, "mov eax, 0"], [35, "mov edx, 10h"], [36, "mov rdi, rsi"], [37, "mov rcx, rdx"], [38, "rep stosq"], [39, "jmp loc_40274B"], [40, "lea rax, [rbp+nptr]"], [41, "mov rdi, rax"], [42, "call _atoi"], [43, "imul eax, 3Ch "], [44, "add [rbp+var_18], eax"], [45, "lea rax, [rbp+nptr]"], [46, "mov rsi, rax"], [47, "mov eax, 0"], [48, "mov edx, 10h"], [49, "mov rdi, rsi"], [50, "mov rcx, rdx"], [51, "rep stosq"], [52, "jmp loc_40274B"], [53, "lea rax, [rbp+nptr]"], [54, "mov rdi, rax"], [55, "call _atoi"], [56, "imul eax, 0E10h"], [57, "add [rbp+var_18], eax"], [58, "lea rax, [rbp+nptr]"], [59, "mov rsi, rax"], [60, "mov eax, 0"], [61, "mov edx, 10h"], [62, "mov rdi, rsi"], [63, "mov rcx, rdx"], [64, "rep stosq"], [65, "jmp loc_40274B"], [66, "lea rax, [rbp+nptr]"], [67, "mov rdi, rax"], [68, "call _atoi"], [69, "imul eax, 15180h"], [70, "add [rbp+var_18], eax"], [71, "lea rax, [rbp+nptr]"], [72, "mov rsi, rax"], [73, "mov eax, 0"], [74, "mov edx, 10h"], [75, "mov rdi, rsi"], [76, "mov rcx, rdx"], [77, "rep stosq"], [78, "jmp loc_40274B"], [79, "lea rax, [rbp+nptr]"], [80, "mov rdi, rax"], [81, "call _atoi"], [82, "imul eax, 93A80h"], [83, "add [rbp+var_18], eax"], [84, "lea rax, [rbp+nptr]"], [85, "mov rsi, rax"], [86, "mov eax, 0"], [87, "mov edx, 10h"], [88, "mov rdi, rsi"], [89, "mov rcx, rdx"], [90, "rep stosq"], [91, "jmp short loc_40274B"], [92, "lea rax, [rbp+nptr]"], [93, "mov rdi, rax"], [94, "call _atoi"], [95, "imul eax, 1E13380h"], [96, "add [rbp+var_18], eax"], [97, "lea rax, [rbp+nptr]"], [98, "mov rsi, rax"], [99, "mov eax, 0"], [100, "mov edx, 10h"], [101, "mov rdi, rsi"], [102, "mov rcx, rdx"], [103, "rep stosq"], [104, "jmp short loc_40274B"], [105, "mov eax, [rbp+var_14]"], [106, "movsxd rdx, eax"], [107, "mov rax, [rbp+s]"], [108, "add rax, rdx"], [109, "movzx eax, byte ptr [rax]"], [110, "movsx ecx, al"], [111, "lea rdx, [rbp+nptr]"], [112, "lea rax, [rbp+nptr]"], [113, "mov esi, offset format"], [114, "mov rdi, rax"], [115, "mov eax, 0"], [116, "call _sprintf"], [117, "add [rbp+var_14], 1"], [118, "mov eax, [rbp+var_14]"], [119, "movsxd rbx, eax"], [120, "mov rax, [rbp+s]"], [121, "mov rdi, rax"], [122, "call _strlen"], [123, "cmp rbx, rax"], [124, "jb loc_40259A"], [125, "cmp [rbp+var_18], 0"], [126, "jnz short loc_402785"], [127, "mov rax, [rbp+s]"], [128, "mov rdi, rax"], [129, "call _atoi"], [130, "mov [rbp+var_18], eax"], [131, "mov eax, [rbp+var_18]"], [132, "mov rbx, [rbp+var_8]"], [133, "leave"], [134, "retn"]], "data_dep": [[8, 7], [11, 8], [12, 10], [16, 14], [16, 117], [17, 16], [18, 4], [19, 18], [19, 17], [20, 19], [21, 20], [22, 21], [23, 22], [24, 23], [25, 22], [27, 26], [28, 26], [29, 28], [31, 31], [31, 44], [31, 83], [31, 30], [31, 96], [31, 57], [31, 6], [31, 70], [32, 30], [33, 32], [36, 33], [37, 35], [38, 64], [38, 103], [38, 38], [38, 13], [38, 77], [38, 90], [38, 51], [40, 26], [41, 40], [43, 42], [44, 31], [44, 44], [44, 83], [44, 96], [44, 57], [44, 43], [44, 6], [44, 70], [45, 43], [46, 45], [49, 46], [50, 48], [51, 64], [51, 13], [51, 77], [51, 38], [51, 51], [51, 90], [51, 103], [53, 26], [54, 53], [56, 55], [57, 57], [57, 6], [57, 70], [57, 56], [57, 31], [57, 44], [57, 83], [57, 96], [58, 56], [59, 58], [62, 59], [63, 61], [64, 64], [64, 13], [64, 77], [64, 38], [64, 51], [64, 90], [64, 103], [66, 26], [67, 66], [69, 68], [70, 57], [70, 6], [70, 70], [70, 31], [70, 44], [70, 83], [70, 69], [70, 96], [71, 69], [72, 71], [75, 72], [76, 74], [77, 90], [77, 103], [77, 64], [77, 13], [77, 77], [77, 38], [77, 51], [79, 26], [80, 79], [82, 81], [83, 96], [83, 82], [83, 57], [83, 6], [83, 70], [83, 31], [83, 44], [83, 83], [84, 82], [85, 84], [88, 85], [89, 87], [90, 51], [90, 90], [90, 103], [90, 64], [90, 13], [90, 77], [90, 38], [92, 26], [93, 92], [95, 94], [96, 95], [96, 44], [96, 83], [96, 96], [96, 57], [96, 6], [96, 70], [96, 31], [97, 95], [98, 97], [101, 98], [102, 100], [103, 38], [103, 51], [103, 90], [103, 103], [103, 64], [103, 13], [103, 77], [105, 117], [105, 14], [106, 105], [107, 4], [108, 107], [108, 106], [109, 108], [110, 109], [111, 106], [112, 109], [114, 112], [117, 117], [117, 14], [118, 117], [118, 14], [119, 118], [120, 4], [121, 120], [123, 122], [123, 119], [124, 123], [125, 57], [125, 6], [125, 70], [125, 31], [125, 44], [125, 83], [125, 96], [126, 125], [127, 4], [128, 127], [130, 129], [131, 6], [131, 70], [131, 83], [131, 44], [131, 57], [131, 96], [131, 130], [131, 31], [134, 131]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/de34e7111b0f4f0a406c6ce7da8a4538c59bce293cdef5dcb3db6d31ef225f8e_de34e7111b0f4f0a406c6ce7da8a4538c59bce293cdef5dcb3db6d31ef225f8e.jsonl.gz", "strip_func_name": "sub_402550", "query": "\n\n\n__int64 __fastcall sub_402550(const char *a1)\n{\nint v1; // eax\nint v2; // eax\nint v3; // eax\nint v4; // eax\nint v5; // eax\nint v6; // eax\nsize_t v7; // rbx\nchar nptr[136]; // [rsp+10h] [rbp-A0h] BYREF\nunsigned int v10; // [rsp+98h] [rbp-18h]\nint i; // [rsp+9Ch] [rbp-14h]\n\nv10 = 0;\nmemset(nptr, 0, 0x80uLL);\nfor ( i = 0; ; ++i )\n{\nv7 = i;\nif ( v7 >= strlen(a1) )\nbreak;\nswitch ( a1[i] )\n{\ncase 'd':\nv4 = atoi(nptr);\nv10 += 86400 * v4;\nmemset(nptr, 0, 0x80uLL);\nbreak;\ncase 'h':\nv3 = atoi(nptr);\nv10 += 3600 * v3;\nmemset(nptr, 0, 0x80uLL);\nbreak;\ncase 'm':\nv2 = atoi(nptr);\nv10 += 60 * v2;\nmemset(nptr, 0, 0x80uLL);\nbreak;\ncase 's':\nv1 = atoi(nptr);\nv10 += v1;\nmemset(nptr, 0, 0x80uLL);\nbreak;\ncase 'w':\nv5 = atoi(nptr);\nv10 += 604800 * v5;\nmemset(nptr, 0, 0x80uLL);\nbreak;\ncase 'y':\nv6 = atoi(nptr);\nv10 += 31536000 * v6;\nmemset(nptr, 0, 0x80uLL);\nbreak;\ndefault:\nsprintf(nptr, \"%s%c\", nptr, (unsigned int)a1[i]);\nbreak;\n}\n}\nif ( !v10 )\nv10 = atoi(a1);\nreturn v10;\n}\n\n\n\nQ:[a1,nptr,v10,sub_402550,]", "hints": "[]", "response": "{'a1': 't', 'nptr': 'b', 'v10': 'secs', 'sub_402550': 'parsetime'}"}
[ [ 0.7449634075164795, 0.7245237231254578, 0.7176600098609924, 0.7162848711013794, 0.7107228636741638, 0.7074910998344421, 0.707127571105957, 0.7023537158966064, 0.6997567415237427, 0.6925328373908997, 0.6914259195327759, 0.6887708902359009, 0.6878122091293335, 0.6873489618301392, 0.6867098212242126, 0.6827531456947327, 0.6820796728134155, 0.6819668412208557, 0.6816091537475586, 0.6809395551681519 ], [ 181470, 115706, 46421, 104669, 158474, 154542, 253482, 140735, 188303, 116758, 181553, 118940, 120804, 189891, 158657, 247278, 81989, 252734, 108549, 30859 ] ]
parser_args
840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c
hc0d3r
alfheim
NA
void parser_args(int argc, char **argv, options_t *opt){ static const struct option options[]={ {"shellcode", required_argument, NULL, 's'}, {"file", required_argument, NULL, 'f'}, {"format", required_argument, NULL, 'F'}, {"address", required_argument, NULL, 0}, {"write", no_argument, NULL, 'w'}, {"no-restore-memory", no_argument, NULL, 0}, {"no-restore-ip", no_argument, NULL, 0}, {"ptrace", no_argument, NULL, 0}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; int index = 0, optc; const char *name; while((optc = getopt_long(argc, argv, "s:f:F:wh", options, &index)) != -1){ switch(optc){ case 0: name = options[index].name; if(!strcmp(name, "address")){ opt->options.address = strtol(optarg, NULL, 16); } if(!strcmp(name, "no-restore-memory")){ opt->options.restore = 0; } else if(!strcmp(name, "no-restore-ip")){ opt->options.restore_ip = 0; } else if(!strcmp(name, "ptrace")){ memwrite = ignotum_ptrace_write; memread = ignotum_ptrace_read; } break; case 's': opt->shellcode = optarg; break; case 'f': opt->filename = optarg; break; case 'F': if(!strcmp(optarg, "ascii")) opt->format = 1; else if(strcmp(optarg, "bin")){ printf("%s is not a valid format\n", optarg); exit(1); } break; case 'w': opt->write = 1; break; case 'h': help(); break; case '?': exit(1); default: help(); } } if(optind+1 != argc || (!opt->filename && !opt->shellcode)){ printf("alfheim: try 'alfheim --help' for more information\n"); exit(0); } opt->options.pid = atoi(argv[optind]); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402442", "function_addr": 4203586, "binary_name": "840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+argc], edi"], [4, "mov [rbp+argv], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "mov [rbp+longind], 0"], [7, "jmp loc_40264E"], [8, "cmp [rbp+var_4], 77h "], [9, "jz loc_40262B"], [10, "cmp [rbp+var_4], 77h "], [11, "jg loc_402649"], [12, "cmp [rbp+var_4], 73h "], [13, "jz loc_4025A4"], [14, "cmp [rbp+var_4], 73h "], [15, "jg loc_402649"], [16, "cmp [rbp+var_4], 68h "], [17, "jz loc_402638"], [18, "cmp [rbp+var_4], 68h "], [19, "jg loc_402649"], [20, "cmp [rbp+var_4], 66h "], [21, "jz loc_4025B8"], [22, "cmp [rbp+var_4], 66h "], [23, "jg loc_402649"], [24, "cmp [rbp+var_4], 46h "], [25, "jz loc_4025CB"], [26, "cmp [rbp+var_4], 46h "], [27, "jg loc_402649"], [28, "cmp [rbp+var_4], 0"], [29, "jz short loc_4024DA"], [30, "cmp [rbp+var_4], 3Fh "], [31, "jz loc_40263F"], [32, "jmp loc_402649"], [33, "mov eax, [rbp+longind]"], [34, "cdqe"], [35, "shl rax, 5"], [36, "add rax, 4036E0h"], [37, "mov rax, [rax]"], [38, "mov [rbp+s1], rax"], [39, "mov rax, [rbp+s1]"], [40, "mov esi, offset s2"], [41, "mov rdi, rax"], [42, "call _strcmp"], [43, "test eax, eax"], [44, "jnz short loc_402526"], [45, "mov rax, cs:optarg"], [46, "mov edx, 10h"], [47, "mov esi, 0"], [48, "mov rdi, rax"], [49, "call _strtol"], [50, "mov rdx, [rbp+var_38]"], [51, "mov [rdx+28h], rax"], [52, "mov rax, [rbp+s1]"], [53, "mov esi, offset aNoRestoreMemor"], [54, "mov rdi, rax"], [55, "call _strcmp"], [56, "test eax, eax"], [57, "jnz short loc_40254B"], [58, "mov rax, [rbp+var_38]"], [59, "mov dword ptr [rax+18h], 0"], [60, "jmp loc_40264E"], [61, "mov rax, [rbp+s1]"], [62, "mov esi, offset aNoRestoreIp"], [63, "mov rdi, rax"], [64, "call _strcmp"], [65, "test eax, eax"], [66, "jnz short loc_402570"], [67, "mov rax, [rbp+var_38]"], [68, "mov dword ptr [rax+1Ch], 0"], [69, "jmp loc_40264E"], [70, "mov rax, [rbp+s1]"], [71, "mov esi, offset aPtrace_0"], [72, "mov rdi, rax"], [73, "call _strcmp"], [74, "test eax, eax"], [75, "jnz loc_40264E"], [76, "mov cs:off_406108, offset sub_401D87"], [77, "mov cs:off_406110, offset sub_401F38"], [78, "jmp loc_40264E"], [79, "mov rdx, cs:optarg"], [80, "mov rax, [rbp+var_38]"], [81, "mov [rax+8], rdx"], [82, "jmp loc_40264E"], [83, "mov rdx, cs:optarg"], [84, "mov rax, [rbp+var_38]"], [85, "mov [rax], rdx"], [86, "jmp loc_40264E"], [87, "mov rax, cs:optarg"], [88, "mov esi, offset aAscii"], [89, "mov rdi, rax"], [90, "call _strcmp"], [91, "test eax, eax"], [92, "jnz short loc_4025F0"], [93, "mov rax, [rbp+var_38]"], [94, "mov dword ptr [rax+10h], 1"], [95, "jmp short loc_40264E"], [96, "mov rax, cs:optarg"], [97, "mov esi, offset aBin"], [98, "mov rdi, rax"], [99, "call _strcmp"], [100, "test eax, eax"], [101, "jz short loc_40264E"], [102, "mov rax, cs:optarg"], [103, "mov rsi, rax"], [104, "mov edi, offset aSIsNotAValidFo"], [105, "mov eax, 0"], [106, "call _printf"], [107, "mov edi, 1"], [108, "call _exit"], [109, "mov rax, [rbp+var_38]"], [110, "mov dword ptr [rax+14h], 1"], [111, "jmp short loc_40264E"], [112, "call sub_4026E1"], [113, "jmp short loc_40264E"], [114, "mov edi, 1"], [115, "call _exit"], [116, "call sub_4026E1"], [117, "lea rdx, [rbp+longind]"], [118, "mov rsi, [rbp+argv]"], [119, "mov eax, [rbp+argc]"], [120, "mov r8, rdx"], [121, "mov ecx, offset longopts"], [122, "mov edx, offset shortopts"], [123, "mov edi, eax"], [124, "call _getopt_long"], [125, "mov [rbp+var_4], eax"], [126, "cmp [rbp+var_4], 0FFFFFFFFh"], [127, "jnz loc_402461"], [128, "mov eax, cs:optind"], [129, "add eax, 1"], [130, "cmp [rbp+argc], eax"], [131, "jnz short loc_4026A1"], [132, "mov rax, [rbp+var_38]"], [133, "mov rax, [rax]"], [134, "test rax, rax"], [135, "jnz short loc_4026B5"], [136, "mov rax, [rbp+var_38]"], [137, "mov rax, [rax+8]"], [138, "test rax, rax"], [139, "jnz short loc_4026B5"], [140, "mov edi, offset s"], [141, "call _puts"], [142, "mov edi, 0"], [143, "call _exit"], [144, "mov eax, cs:optind"], [145, "cdqe"], [146, "lea rdx, ds:0[rax*8]"], [147, "mov rax, [rbp+argv]"], [148, "add rax, rdx"], [149, "mov rax, [rax]"], [150, "mov rdi, rax"], [151, "call _atoi"], [152, "mov rdx, [rbp+var_38]"], [153, "mov [rdx+20h], eax"], [154, "nop"], [155, "leave"], [156, "retn"]], "data_dep": [[8, 125], [9, 8], [10, 125], [11, 10], [12, 125], [13, 12], [14, 125], [15, 14], [16, 125], [17, 16], [18, 125], [19, 18], [20, 125], [21, 20], [22, 125], [23, 22], [24, 125], [25, 24], [26, 125], [27, 26], [28, 125], [29, 28], [30, 125], [31, 30], [33, 6], [35, 33], [36, 35], [37, 81], [37, 85], [37, 94], [37, 51], [37, 110], [37, 59], [37, 68], [37, 36], [38, 37], [39, 38], [41, 39], [43, 42], [44, 43], [48, 45], [50, 5], [51, 50], [51, 49], [52, 38], [54, 52], [56, 55], [57, 56], [58, 5], [59, 58], [61, 38], [63, 61], [65, 64], [66, 65], [67, 5], [68, 67], [70, 38], [72, 70], [74, 73], [75, 74], [77, 76], [78, 77], [80, 5], [81, 80], [81, 79], [84, 5], [85, 84], [85, 83], [89, 87], [91, 90], [92, 91], [93, 5], [94, 93], [98, 96], [100, 99], [101, 100], [103, 102], [109, 5], [110, 109], [117, 83], [117, 50], [117, 6], [117, 79], [117, 122], [118, 4], [119, 3], [120, 117], [123, 119], [125, 124], [126, 125], [127, 126], [129, 128], [130, 3], [130, 129], [131, 130], [132, 5], [133, 59], [133, 68], [133, 132], [133, 81], [133, 51], [133, 110], [133, 85], [133, 94], [134, 133], [135, 134], [136, 5], [137, 51], [137, 81], [137, 110], [137, 85], [137, 94], [137, 59], [137, 68], [137, 136], [138, 137], [139, 138], [146, 122], [147, 4], [148, 147], [148, 146], [149, 110], [149, 85], [149, 94], [149, 153], [149, 148], [149, 68], [149, 59], [149, 81], [149, 51], [150, 149], [152, 5], [153, 152], [153, 151], [156, 151]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c_840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c.jsonl.gz", "strip_func_name": "sub_402442", "query": "\n\n\nint __fastcall sub_402442(int a1, char *const *a2, __int64 a3)\n{\nint result; // eax\nint longind; // [rsp+2Ch] [rbp-14h] BYREF\nchar *s1; // [rsp+30h] [rbp-10h]\nint v7; // [rsp+3Ch] [rbp-4h]\n\nlongind = 0;\nwhile ( 1 )\n{\nv7 = getopt_long(a1, a2, \"s:f:F:wh\", &longopts, &longind);\nif ( v7 == -1 )\nbreak;\nif ( v7 == 119 )\n{\n*(_DWORD *)(a3 + 20) = 1;\n}\nelse\n{\nif ( v7 > 119 )\ngoto LABEL_32;\nif ( v7 == 115 )\n{\n*(_QWORD *)(a3 + 8) = optarg;\n}\nelse\n{\nif ( v7 > 115 )\ngoto LABEL_32;\nif ( v7 == 104 )\nsub_4026E1();\nif ( v7 > 104 )\ngoto LABEL_32;\nif ( v7 == 102 )\n{\n*(_QWORD *)a3 = optarg;\n}\nelse\n{\nif ( v7 > 102 )\ngoto LABEL_32;\nif ( v7 == 70 )\n{\nif ( !strcmp(optarg, \"ascii\") )\n{\n*(_DWORD *)(a3 + 16) = 1;\n}\nelse if ( strcmp(optarg, \"bin\") )\n{\nprintf(\"%s is not a valid format\\n\", optarg);\nexit(1);\n}\n}\nelse\n{\nif ( v7 > 70 )\ngoto LABEL_32;\nif ( v7 )\n{\nif ( v7 == 63 )\nexit(1);\nLABEL_32:\nsub_4026E1();\n}\ns1 = (char *)*((_QWORD *)&longopts.name + 4 * longind);\nif ( !strcmp(s1, \"address\") )\n*(_QWORD *)(a3 + 40) = strtol(optarg, 0LL, 16);\nif ( !strcmp(s1, \"no-restore-memory\") )\n{\n*(_DWORD *)(a3 + 24) = 0;\n}\nelse if ( !strcmp(s1, \"no-restore-ip\") )\n{\n*(_DWORD *)(a3 + 28) = 0;\n}\nelse if ( !strcmp(s1, \"ptrace\") )\n{\noff_406108 = (__int64 (__fastcall *)(_QWORD, _QWORD, _QWORD, _QWORD))sub_401D87;\noff_406110 = (__int64 (__fastcall *)(_QWORD, _QWORD, _QWORD, _QWORD))sub_401F38;\n}\n}\n}\n}\n}\n}\nif ( a1 != optind + 1 || !*(_QWORD *)a3 && !*(_QWORD *)(a3 + 8) )\n{\nputs(\"alfheim: try 'alfheim --help' for more information\");\nexit(0);\n}\nresult = atoi(a2[optind]);\n*(_DWORD *)(a3 + 32) = result;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,longind,s1,v7,sub_402442,sub_4026E1,sub_401D87,sub_401F38,]", "hints": "[]", "response": "{'a3': 'opt', 'a1': 'argc', 'a2': 'argv', 'longind': 'index', 's1': 'name', 'v7': 'optc', 'sub_402442': 'parser_args', 'sub_4026E1': 'help', 'sub_401D87': 'ignotum_ptrace_write', 'sub_401F38': 'ignotum_ptrace_read'}"}
[ [ 0.8038889169692993, 0.7987058162689209, 0.7843179702758789, 0.7699201107025146, 0.7621219754219055, 0.7577115893363953, 0.7467423677444458, 0.7467423677444458, 0.7463563084602356, 0.7391162514686584, 0.7277630567550659, 0.726927638053894, 0.7268663048744202, 0.7252823710441589, 0.7240558862686157, 0.7211831212043762, 0.7207773923873901, 0.7130217552185059, 0.7061142921447754, 0.7017765045166016 ], [ 11490, 249006, 142198, 195281, 114874, 51376, 261762, 245252, 1218, 59039, 149866, 113506, 207849, 77052, 83259, 157677, 256490, 35917, 167713, 260394 ] ]
count_word
96e0f52c3477cd6e14c87ce97e232354945219735728be995330e73e335a580f
xianjimli
sysprog-code
NA
int count_word(const char* text) { enum _State { STAT_INIT, STAT_IN_WORD, STAT_OUT_WORD, }state = STAT_INIT; int count = 0; const char* p = text; for(p = text; *p != '\0'; p++) { switch(state) { case STAT_INIT: { if(IS_WORD_CHAR(*p)) { state = STAT_IN_WORD; } else { state = STAT_OUT_WORD; } break; } case STAT_IN_WORD: { if(!IS_WORD_CHAR(*p)) { count++; state = STAT_OUT_WORD; } break; } case STAT_OUT_WORD: { if(IS_WORD_CHAR(*p)) { state = STAT_IN_WORD; } break; } default:break; } } if(state == STAT_IN_WORD) { count++; } return count; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401132", "function_addr": 4198706, "binary_name": "96e0f52c3477cd6e14c87ce97e232354945219735728be995330e73e335a580f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_4], 0"], [5, "mov [rbp+var_8], 0"], [6, "mov rax, [rbp+var_18]"], [7, "mov [rbp+var_10], rax"], [8, "mov rax, [rbp+var_18]"], [9, "mov [rbp+var_10], rax"], [10, "jmp loc_4012B4"], [11, "cmp [rbp+var_4], 2"], [12, "jz loc_40124F"], [13, "cmp [rbp+var_4], 2"], [14, "ja loc_4012A8"], [15, "cmp [rbp+var_4], 0"], [16, "jz short loc_401186"], [17, "cmp [rbp+var_4], 1"], [18, "jz short loc_4011EE"], [19, "jmp loc_4012A8"], [20, "call ___ctype_b_loc"], [21, "mov rdx, [rax]"], [22, "mov rax, [rbp+var_10]"], [23, "movzx eax, byte ptr [rax]"], [24, "movsx rax, al"], [25, "add rax, rax"], [26, "add rax, rdx"], [27, "movzx eax, word ptr [rax]"], [28, "movzx eax, ax"], [29, "and eax, 400h"], [30, "test eax, eax"], [31, "jnz short loc_4011D6"], [32, "call ___ctype_b_loc"], [33, "mov rdx, [rax]"], [34, "mov rax, [rbp+var_10]"], [35, "movzx eax, byte ptr [rax]"], [36, "movsx rax, al"], [37, "add rax, rax"], [38, "add rax, rdx"], [39, "movzx eax, word ptr [rax]"], [40, "movzx eax, ax"], [41, "and eax, 800h"], [42, "test eax, eax"], [43, "jz short loc_4011E2"], [44, "mov [rbp+var_4], 1"], [45, "jmp loc_4012AF"], [46, "mov [rbp+var_4], 2"], [47, "jmp loc_4012AF"], [48, "call ___ctype_b_loc"], [49, "mov rdx, [rax]"], [50, "mov rax, [rbp+var_10]"], [51, "movzx eax, byte ptr [rax]"], [52, "movsx rax, al"], [53, "add rax, rax"], [54, "add rax, rdx"], [55, "movzx eax, word ptr [rax]"], [56, "movzx eax, ax"], [57, "and eax, 400h"], [58, "test eax, eax"], [59, "jnz loc_4012AB"], [60, "call ___ctype_b_loc"], [61, "mov rdx, [rax]"], [62, "mov rax, [rbp+var_10]"], [63, "movzx eax, byte ptr [rax]"], [64, "movsx rax, al"], [65, "add rax, rax"], [66, "add rax, rdx"], [67, "movzx eax, word ptr [rax]"], [68, "movzx eax, ax"], [69, "and eax, 800h"], [70, "test eax, eax"], [71, "jnz short loc_4012AB"], [72, "add [rbp+var_8], 1"], [73, "mov [rbp+var_4], 2"], [74, "jmp short loc_4012AB"], [75, "call ___ctype_b_loc"], [76, "mov rdx, [rax]"], [77, "mov rax, [rbp+var_10]"], [78, "movzx eax, byte ptr [rax]"], [79, "movsx rax, al"], [80, "add rax, rax"], [81, "add rax, rdx"], [82, "movzx eax, word ptr [rax]"], [83, "movzx eax, ax"], [84, "and eax, 400h"], [85, "test eax, eax"], [86, "jnz short loc_40129F"], [87, "call ___ctype_b_loc"], [88, "mov rdx, [rax]"], [89, "mov rax, [rbp+var_10]"], [90, "movzx eax, byte ptr [rax]"], [91, "movsx rax, al"], [92, "add rax, rax"], [93, "add rax, rdx"], [94, "movzx eax, word ptr [rax]"], [95, "movzx eax, ax"], [96, "and eax, 800h"], [97, "test eax, eax"], [98, "jz short loc_4012AE"], [99, "mov [rbp+var_4], 1"], [100, "jmp short loc_4012AE"], [101, "nop"], [102, "jmp short loc_4012AF"], [103, "nop"], [104, "jmp short loc_4012AF"], [105, "nop"], [106, "add [rbp+var_10], 1"], [107, "mov rax, [rbp+var_10]"], [108, "movzx eax, byte ptr [rax]"], [109, "test al, al"], [110, "jnz loc_401161"], [111, "cmp [rbp+var_4], 1"], [112, "jnz short loc_4012CD"], [113, "add [rbp+var_8], 1"], [114, "mov eax, [rbp+var_8]"], [115, "leave"], [116, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 3], [9, 8], [11, 44], [11, 46], [11, 73], [11, 4], [11, 99], [12, 11], [13, 99], [13, 44], [13, 46], [13, 73], [13, 4], [14, 13], [15, 46], [15, 73], [15, 4], [15, 99], [15, 44], [16, 15], [17, 44], [17, 46], [17, 73], [17, 4], [17, 99], [18, 17], [21, 20], [22, 9], [22, 106], [23, 22], [24, 23], [25, 24], [26, 21], [26, 25], [27, 26], [28, 27], [29, 28], [30, 29], [31, 30], [33, 32], [34, 9], [34, 106], [35, 34], [36, 35], [37, 36], [38, 33], [38, 37], [39, 38], [40, 39], [41, 40], [42, 41], [43, 42], [49, 48], [50, 106], [50, 9], [51, 50], [52, 51], [53, 52], [54, 49], [54, 53], [55, 54], [56, 55], [57, 56], [58, 57], [59, 58], [61, 60], [62, 9], [62, 106], [63, 62], [64, 63], [65, 64], [66, 61], [66, 65], [67, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 72], [72, 5], [76, 75], [77, 9], [77, 106], [78, 77], [79, 78], [80, 79], [81, 76], [81, 80], [82, 81], [83, 82], [84, 83], [85, 84], [86, 85], [88, 87], [89, 106], [89, 9], [90, 89], [91, 90], [92, 91], [93, 88], [93, 92], [94, 93], [95, 94], [96, 95], [97, 96], [98, 97], [106, 106], [106, 9], [107, 106], [107, 9], [108, 107], [109, 108], [110, 109], [111, 46], [111, 73], [111, 4], [111, 99], [111, 44], [112, 111], [113, 5], [113, 72], [114, 72], [114, 113], [114, 5], [116, 114]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/96e0f52c3477cd6e14c87ce97e232354945219735728be995330e73e335a580f_96e0f52c3477cd6e14c87ce97e232354945219735728be995330e73e335a580f.jsonl.gz", "strip_func_name": "sub_401132", "query": "\n\n\n__int64 __fastcall sub_401132(_BYTE *a1)\n{\nunsigned int v3; // [rsp+18h] [rbp-8h]\nint v4; // [rsp+1Ch] [rbp-4h]\n\nv4 = 0;\nv3 = 0;\nwhile ( *a1 )\n{\nif ( v4 == 2 )\n{\nif ( ((*__ctype_b_loc())[(char)*a1] & 0x400) != 0 || ((*__ctype_b_loc())[(char)*a1] & 0x800) != 0 )\nv4 = 1;\n}\nelse if ( v4 )\n{\nif ( ((*__ctype_b_loc())[(char)*a1] & 0x400) == 0 && ((*__ctype_b_loc())[(char)*a1] & 0x800) == 0 )\n{\n++v3;\nv4 = 2;\n}\n}\nelse if ( ((*__ctype_b_loc())[(char)*a1] & 0x400) != 0 || ((*__ctype_b_loc())[(char)*a1] & 0x800) != 0 )\n{\nv4 = 1;\n}\nelse\n{\nv4 = 2;\n}\n++a1;\n}\nif ( v4 == 1 )\n++v3;\nreturn v3;\n}\n\n\n\nQ:[a1,v3,v4,sub_401132,]", "hints": "[]", "response": "{'a1': 'text', 'v3': 'count', 'v4': 'state', 'sub_401132': 'count_word'}"}
[ [ 0.7338340282440186, 0.7328416109085083, 0.7219913005828857, 0.7167235016822815, 0.7077452540397644, 0.7040660977363586, 0.6924769282341003, 0.6890823245048523, 0.6872415542602539, 0.6789065599441528, 0.67705899477005, 0.6763510704040527, 0.671391487121582, 0.670915961265564, 0.6695927381515503, 0.6692124009132385, 0.6662988066673279, 0.6637096405029297, 0.6620816588401794, 0.6595455408096313 ], [ 52423, 261917, 246907, 164613, 250724, 185617, 29494, 191292, 18451, 95280, 23794, 49752, 195316, 232867, 192938, 237946, 107521, 22460, 104701, 174479 ] ]
printstr
74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0
jech
babeld
NA
void printstr(const char *str, int len) { for ( ; len-- > 0; str++) putchar(isprint((unsigned char)*str) ? *str : '.'); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403EAD", "function_addr": 4210349, "binary_name": "74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_C], esi"], [5, "jmp short loc_403F02"], [6, "call ___ctype_b_loc"], [7, "mov rdx, [rax]"], [8, "mov rax, [rbp+var_8]"], [9, "movzx eax, byte ptr [rax]"], [10, "movzx eax, al"], [11, "add rax, rax"], [12, "add rax, rdx"], [13, "movzx eax, word ptr [rax]"], [14, "movzx eax, ax"], [15, "and eax, 4000h"], [16, "test eax, eax"], [17, "jz short loc_403EF1"], [18, "mov rax, [rbp+var_8]"], [19, "movzx eax, byte ptr [rax]"], [20, "movsx eax, al"], [21, "jmp short loc_403EF6"], [22, "mov eax, 2Eh "], [23, "mov edi, eax"], [24, "call _putchar"], [25, "add [rbp+var_8], 1"], [26, "mov eax, [rbp+var_C]"], [27, "lea edx, [rax-1]"], [28, "mov [rbp+var_C], edx"], [29, "test eax, eax"], [30, "jg short loc_403EBE"], [31, "nop"], [32, "nop"], [33, "leave"], [34, "retn"]], "data_dep": [[7, 6], [8, 3], [8, 25], [9, 8], [10, 9], [11, 10], [12, 7], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 16], [18, 25], [18, 3], [19, 18], [20, 19], [23, 22], [23, 20], [25, 25], [25, 3], [26, 4], [26, 28], [27, 7], [27, 26], [28, 27], [29, 26], [30, 29], [34, 29]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0_74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0.jsonl.gz", "strip_func_name": "sub_403EAD", "query": "\n\n\n__int64 __fastcall sub_403EAD(unsigned __int8 *a1, unsigned int a2)\n{\nint v2; // eax\n__int64 result; // rax\n\nwhile ( 1 )\n{\nresult = a2--;\nif ( (int)result <= 0 )\nbreak;\nif ( ((*__ctype_b_loc())[*a1] & 0x4000) != 0 )\nv2 = (char)*a1;\nelse\nv2 = 46;\nputchar(v2);\n++a1;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_403EAD,]", "hints": "[]", "response": "{'a1': 'str', 'a2': 'len', 'sub_403EAD': 'printstr'}"}
[ [ 0.7686488032341003, 0.7670246958732605, 0.766609251499176, 0.7600716352462769, 0.7540925145149231, 0.7377583980560303, 0.7318081855773926, 0.7182508111000061, 0.7087978720664978, 0.7059339880943298, 0.6980472803115845, 0.6971786618232727, 0.6957578659057617, 0.693199098110199, 0.6897354125976562, 0.686164140701294, 0.6831351518630981, 0.680387020111084, 0.6753828525543213, 0.6719121336936951 ], [ 3977, 30362, 235223, 53354, 9780, 223485, 174445, 253248, 105801, 173170, 31364, 177289, 7391, 53714, 119026, 51126, 110327, 189917, 56034, 179556 ] ]
showhelp
3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa
xenogenesi
hidclient
NA
void showhelp ( void ) { fprintf ( stdout, "hidclient - Virtual Bluetooth Mouse and Keyboard\n\n" \ "hidclient allows you to emulate a bluetooth HID device, based on the\n" \ "Bluez Bluetooth stack for Linux.\n\n" \ "The following command-line parameters can be used:\n" \ "-h|-? Show this information\n" \ "-e<num>\t Use only the one event device numbered <num>\n" \ "-f<name> Use fifo <name> instead of event input devices\n" \ "-l List available input devices\n" \ "-x Disable device in X11 while hidclient is running\n" \ "-s|--skipsdp Skip SDP registration\n" \ " Do not register with the Service Discovery Infrastructure\n" \ " (for debug purposes)\n\n" \ "Using hidclient in conjunction with \'openvt\' is recommended to minize\n" \ "impact of keystrokes meant to be transmitted to the local user interface\n" \ "(like running hidclient from a xterm window). You can make \'openvt\'\n" \ "spawn a text mode console, switch there and run hidclient with the\n" \ "following command line:\n" \ " openvt -s -w hidclient\n" \ "This will even return to your xsession after hidclient terminates.\n\n" \ "hidclient connections can be dropped at any time by pressing the PAUSE\n" \ "key; the program will wait for other connections afterward.\n" \ "To stop hidclient, press LeftCtrl+LeftAlt+Pause.\n" ); return; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404E05", "function_addr": 4214277, "binary_name": "3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov rax, cs:stdout"], [3, "mov rcx, rax"], [4, "mov edx, 465h"], [5, "mov esi, 1"], [6, "mov edi, offset aHidclientVirtu"], [7, "call _fwrite"], [8, "nop"], [9, "pop rbp"], [10, "retn"]], "data_dep": [[3, 2], [9, 0], [10, 7]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa_3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.jsonl.gz", "strip_func_name": "sub_404E05", "query": "\n\n\nsize_t sub_404E05()\n{\nreturn fwrite(\n\"hidclient - Virtual Bluetooth Mouse and Keyboard\\n\"\n\"\\n\"\n\"hidclient allows you to emulate a bluetooth HID device, based on the\\n\"\n\"Bluez Bluetooth stack for Linux.\\n\"\n\"\\n\"\n\"The following command-line parameters can be used:\\n\"\n\"-h|-?\\t\\tShow this information\\n\"\n\"-e<num>\\t\\tUse only the one event device numbered <num>\\n\"\n\"-f<name>\\tUse fifo <name> instead of event input devices\\n\"\n\"-l\\t\\tList available input devices\\n\"\n\"-x\\t\\tDisable device in X11 while hidclient is running\\n\"\n\"-s|--skipsdp\\tSkip SDP registration\\n\"\n\"\\t\\tDo not register with the Service Discovery Infrastructure\\n\"\n\"\\t\\t(for debug purposes)\\n\"\n\"\\n\"\n\"Using hidclient in conjunction with 'openvt' is recommended to minize\\n\"\n\"impact of keystrokes meant to be transmitted to the local user interface\\n\"\n\"(like running hidclient from a xterm window). You can make 'openvt'\\n\"\n\"spawn a text mode console, switch there and run hidclient with the\\n\"\n\"following command line:\\n\"\n\"\\t\\topenvt -s -w hidclient\\n\"\n\"This will even return to your xsession after hidclient terminates.\\n\"\n\"\\n\"\n\"hidclient connections can be dropped at any time by pressing the PAUSE\\n\"\n\"key; the program will wait for other connections afterward.\\n\"\n\"To stop hidclient, press LeftCtrl+LeftAlt+Pause.\\n\",\n1uLL,\n0x465uLL,\nstdout);\n}\n\n\n\nQ:[sub_404E05,]", "hints": "[]", "response": "{'sub_404E05': 'showhelp'}"}
[ [ 0.861674964427948, 0.8580945730209351, 0.8576640486717224, 0.8574869632720947, 0.8573921322822571, 0.856099009513855, 0.8559777736663818, 0.8558485507965088, 0.849449634552002, 0.8489977121353149, 0.8470373153686523, 0.8443658351898193, 0.84232497215271, 0.8421774506568909, 0.8399208188056946, 0.8376707434654236, 0.8369503021240234, 0.8341951370239258, 0.8305435180664062, 0.8292450308799744 ], [ 44135, 70236, 226830, 76176, 228666, 51994, 136391, 35641, 36665, 89479, 192127, 123387, 229176, 167472, 163220, 35970, 134544, 151915, 69348, 178869 ] ]
isnumber
23c8d2ee21d5b657bbc121fdb9d154232447728183b46f7c5868121d35569893
pbatard
ms-sys
NA
int isnumber(const char *szString) { int bRet = (szString && *szString); while(bRet && *szString) { if((*szString < '0') || (*szString > '9')) bRet = 0; szString++; } return bRet; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405B32", "function_addr": 4217650, "binary_name": "23c8d2ee21d5b657bbc121fdb9d154232447728183b46f7c5868121d35569893.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "cmp [rbp+var_18], 0"], [4, "jz short loc_405B53"], [5, "mov rax, [rbp+var_18]"], [6, "movzx eax, byte ptr [rax]"], [7, "test al, al"], [8, "jz short loc_405B53"], [9, "mov eax, 1"], [10, "jmp short loc_405B58"], [11, "mov eax, 0"], [12, "mov [rbp+var_4], eax"], [13, "jmp short loc_405B7F"], [14, "mov rax, [rbp+var_18]"], [15, "movzx eax, byte ptr [rax]"], [16, "cmp al, 2Fh "], [17, "jle short loc_405B73"], [18, "mov rax, [rbp+var_18]"], [19, "movzx eax, byte ptr [rax]"], [20, "cmp al, 39h "], [21, "jle short loc_405B7A"], [22, "mov [rbp+var_4], 0"], [23, "add [rbp+var_18], 1"], [24, "cmp [rbp+var_4], 0"], [25, "jz short loc_405B90"], [26, "mov rax, [rbp+var_18]"], [27, "movzx eax, byte ptr [rax]"], [28, "test al, al"], [29, "jnz short loc_405B5D"], [30, "mov eax, [rbp+var_4]"], [31, "pop rbp"], [32, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 2], [6, 5], [7, 6], [8, 7], [12, 9], [12, 11], [14, 2], [14, 23], [15, 14], [16, 15], [17, 16], [18, 23], [18, 2], [19, 18], [20, 19], [21, 20], [23, 2], [23, 23], [24, 22], [24, 12], [25, 24], [26, 2], [26, 23], [27, 26], [28, 27], [29, 28], [30, 12], [30, 22], [31, 0], [32, 30]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/23c8d2ee21d5b657bbc121fdb9d154232447728183b46f7c5868121d35569893_23c8d2ee21d5b657bbc121fdb9d154232447728183b46f7c5868121d35569893.jsonl.gz", "strip_func_name": "sub_405B32", "query": "\n\n\n_BOOL8 __fastcall sub_405B32(char *a1)\n{\n_BOOL4 v1; // eax\nchar *v3; // [rsp+0h] [rbp-18h]\n_BOOL4 v4; // [rsp+14h] [rbp-4h]\n\nv3 = a1;\nv1 = a1 && *a1;\nv4 = v1;\nwhile ( v4 && *v3 )\n{\nif ( *v3 <= 47 || *v3 > 57 )\nv4 = 0;\n++v3;\n}\nreturn v4;\n}\n\n\n\nQ:[a1,v3,v4,sub_405B32,]", "hints": "[]", "response": "{'a1': 'szString', 'v3': 'szStringa', 'v4': 'bRet', 'sub_405B32': 'isnumber'}"}
[ [ 0.8327221870422363, 0.8238586187362671, 0.8041367530822754, 0.8026154041290283, 0.7902786731719971, 0.7851802110671997, 0.7836946249008179, 0.7799385190010071, 0.7739379405975342, 0.7705104947090149, 0.7671737670898438, 0.76629239320755, 0.7627872228622437, 0.7609899044036865, 0.760741114616394, 0.7581708431243896, 0.7577184438705444, 0.7572746276855469, 0.7570921182632446, 0.7555308938026428 ], [ 232491, 87436, 227936, 228409, 1814, 39852, 164388, 220455, 49239, 256195, 97470, 124269, 170437, 203976, 100869, 168001, 237879, 122709, 154190, 236066 ] ]
hex2uint
498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63
projecthorus
radiosonde_auto_rx
NA
static int hex2uint(char *str, int nibs) { int i; int erg = 0; int h = 0; if (nibs > 7) return -2; for (i = 0; i < nibs; i++) { // MSB i.e. most significant nibble first if (str[i] >= '0' && str[i] <= '9') h = str[i]-'0'; else if (str[i] >= 'a' && str[i] <= 'f') h = str[i]-'a'+0xA; else if (str[i] >= 'A' && str[i] <= 'F') h = str[i]-'A'+0xA; else return -1; erg = (erg << 4) | (h & 0xF); } return erg; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404495", "function_addr": 4211861, "binary_name": "498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_1C], esi"], [4, "mov [rbp+var_8], 0"], [5, "mov [rbp+var_C], 0"], [6, "cmp [rbp+var_1C], 7"], [7, "jle short loc_4044BE"], [8, "mov eax, 0FFFFFFFEh"], [9, "jmp loc_4045C3"], [10, "mov [rbp+var_4], 0"], [11, "jmp loc_4045B4"], [12, "mov eax, [rbp+var_4]"], [13, "movsxd rdx, eax"], [14, "mov rax, [rbp+var_18]"], [15, "add rax, rdx"], [16, "movzx eax, byte ptr [rax]"], [17, "cmp al, 2Fh "], [18, "jle short loc_404510"], [19, "mov eax, [rbp+var_4]"], [20, "movsxd rdx, eax"], [21, "mov rax, [rbp+var_18]"], [22, "add rax, rdx"], [23, "movzx eax, byte ptr [rax]"], [24, "cmp al, 39h "], [25, "jg short loc_404510"], [26, "mov eax, [rbp+var_4]"], [27, "movsxd rdx, eax"], [28, "mov rax, [rbp+var_18]"], [29, "add rax, rdx"], [30, "movzx eax, byte ptr [rax]"], [31, "movsx eax, al"], [32, "sub eax, 30h "], [33, "mov [rbp+var_C], eax"], [34, "jmp loc_40459D"], [35, "mov eax, [rbp+var_4]"], [36, "movsxd rdx, eax"], [37, "mov rax, [rbp+var_18]"], [38, "add rax, rdx"], [39, "movzx eax, byte ptr [rax]"], [40, "cmp al, 60h "], [41, "jle short loc_404553"], [42, "mov eax, [rbp+var_4]"], [43, "movsxd rdx, eax"], [44, "mov rax, [rbp+var_18]"], [45, "add rax, rdx"], [46, "movzx eax, byte ptr [rax]"], [47, "cmp al, 66h "], [48, "jg short loc_404553"], [49, "mov eax, [rbp+var_4]"], [50, "movsxd rdx, eax"], [51, "mov rax, [rbp+var_18]"], [52, "add rax, rdx"], [53, "movzx eax, byte ptr [rax]"], [54, "movsx eax, al"], [55, "sub eax, 57h "], [56, "mov [rbp+var_C], eax"], [57, "jmp short loc_40459D"], [58, "mov eax, [rbp+var_4]"], [59, "movsxd rdx, eax"], [60, "mov rax, [rbp+var_18]"], [61, "add rax, rdx"], [62, "movzx eax, byte ptr [rax]"], [63, "cmp al, 40h "], [64, "jle short loc_404596"], [65, "mov eax, [rbp+var_4]"], [66, "movsxd rdx, eax"], [67, "mov rax, [rbp+var_18]"], [68, "add rax, rdx"], [69, "movzx eax, byte ptr [rax]"], [70, "cmp al, 46h "], [71, "jg short loc_404596"], [72, "mov eax, [rbp+var_4]"], [73, "movsxd rdx, eax"], [74, "mov rax, [rbp+var_18]"], [75, "add rax, rdx"], [76, "movzx eax, byte ptr [rax]"], [77, "movsx eax, al"], [78, "sub eax, 37h "], [79, "mov [rbp+var_C], eax"], [80, "jmp short loc_40459D"], [81, "mov eax, 0FFFFFFFFh"], [82, "jmp short loc_4045C3"], [83, "mov eax, [rbp+var_8]"], [84, "shl eax, 4"], [85, "mov edx, eax"], [86, "mov eax, [rbp+var_C]"], [87, "and eax, 0Fh"], [88, "or eax, edx"], [89, "mov [rbp+var_8], eax"], [90, "add [rbp+var_4], 1"], [91, "mov eax, [rbp+var_4]"], [92, "cmp eax, [rbp+var_1C]"], [93, "jl loc_4044CA"], [94, "mov eax, [rbp+var_8]"], [95, "pop rbp"], [96, "retn"]], "data_dep": [[6, 3], [7, 6], [12, 90], [12, 10], [13, 12], [14, 2], [15, 14], [15, 13], [16, 15], [17, 16], [18, 17], [19, 90], [19, 10], [20, 19], [21, 2], [22, 21], [22, 20], [23, 22], [24, 23], [25, 24], [26, 90], [26, 10], [27, 26], [28, 2], [29, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 32], [35, 90], [35, 10], [36, 35], [37, 2], [38, 36], [38, 37], [39, 38], [40, 39], [41, 40], [42, 90], [42, 10], [43, 42], [44, 2], [45, 43], [45, 44], [46, 45], [47, 46], [48, 47], [49, 90], [49, 10], [50, 49], [51, 2], [52, 51], [52, 50], [53, 52], [54, 53], [55, 54], [56, 55], [58, 90], [58, 10], [59, 58], [60, 2], [61, 60], [61, 59], [62, 61], [63, 62], [64, 63], [65, 90], [65, 10], [66, 65], [67, 2], [68, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 10], [72, 90], [73, 72], [74, 2], [75, 74], [75, 73], [76, 75], [77, 76], [78, 77], [79, 78], [83, 89], [83, 4], [84, 83], [85, 84], [86, 56], [86, 33], [86, 79], [87, 86], [88, 85], [88, 87], [89, 88], [90, 90], [90, 10], [91, 90], [91, 10], [92, 3], [92, 91], [93, 92], [94, 89], [94, 4], [95, 0], [96, 81], [96, 94], [96, 8]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63_498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63.jsonl.gz", "strip_func_name": "sub_404495", "query": "\n\n\n__int64 __fastcall sub_404495(__int64 a1, int a2)\n{\nchar v3; // [rsp+10h] [rbp-Ch]\nunsigned int v4; // [rsp+14h] [rbp-8h]\nint i; // [rsp+18h] [rbp-4h]\n\nv4 = 0;\nif ( a2 > 7 )\nreturn 4294967294LL;\nfor ( i = 0; i < a2; ++i )\n{\nif ( *(char *)(i + a1) <= 47 || *(char *)(i + a1) > 57 )\n{\nif ( *(char *)(i + a1) <= 96 || *(char *)(i + a1) > 102 )\n{\nif ( *(char *)(i + a1) <= 64 || *(char *)(i + a1) > 70 )\nreturn 0xFFFFFFFFLL;\nv3 = *(_BYTE *)(i + a1) - 55;\n}\nelse\n{\nv3 = *(_BYTE *)(i + a1) - 87;\n}\n}\nelse\n{\nv3 = *(_BYTE *)(i + a1) - 48;\n}\nv4 = (16 * v4) | v3 & 0xF;\n}\nreturn v4;\n}\n\n\n\nQ:[a1,a2,v3,v4,sub_404495,]", "hints": "[]", "response": "{'a1': 'str', 'a2': 'nibs', 'v3': 'h', 'v4': 'erg', 'sub_404495': 'hex2uint'}"}
[ [ 0.7644083499908447, 0.7643872499465942, 0.757860004901886, 0.7440856695175171, 0.7428741455078125, 0.7346059083938599, 0.7289833426475525, 0.7235474586486816, 0.7213866710662842, 0.7205289602279663, 0.7143245935440063, 0.7126069068908691, 0.706049382686615, 0.7050724625587463, 0.7037391662597656, 0.7026211023330688, 0.7021742463111877, 0.6984037160873413, 0.6979820728302002, 0.6910485029220581 ], [ 53252, 105594, 29246, 201385, 97005, 168225, 73652, 195879, 32239, 95551, 20681, 165978, 205763, 88807, 13144, 60152, 40650, 189055, 46687, 156053 ] ]
getlocalip
89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6
Tachone
Tachftp
NA
int getlocalip(char *ip) { char host[100] = {0}; if (gethostname(host, sizeof(host)) < 0) return -1; struct hostent *hp; if ((hp = gethostbyname(host)) == NULL) return -1; strcpy(ip, inet_ntoa(*(struct in_addr*)hp->h_addr)); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402EB7", "function_addr": 4206263, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "add rsp, 0FFFFFFFFFFFFFF80h"], [3, "mov [rbp+dest], rdi"], [4, "mov qword ptr [rbp+name], 0"], [5, "mov [rbp+var_68], 0"], [6, "mov [rbp+var_60], 0"], [7, "mov [rbp+var_58], 0"], [8, "mov [rbp+var_50], 0"], [9, "mov [rbp+var_48], 0"], [10, "mov [rbp+var_40], 0"], [11, "mov [rbp+var_38], 0"], [12, "mov [rbp+var_30], 0"], [13, "mov [rbp+var_28], 0"], [14, "mov [rbp+var_20], 0"], [15, "mov [rbp+var_18], 0"], [16, "mov [rbp+var_10], 0"], [17, "lea rax, [rbp+name]"], [18, "mov esi, 64h "], [19, "mov rdi, rax"], [20, "call _gethostname"], [21, "test eax, eax"], [22, "jns short loc_402F46"], [23, "mov eax, 0FFFFFFFFh"], [24, "jmp short locret_402F8D"], [25, "lea rax, [rbp+name]"], [26, "mov rdi, rax"], [27, "call _gethostbyname"], [28, "mov [rbp+var_8], rax"], [29, "cmp [rbp+var_8], 0"], [30, "jnz short loc_402F64"], [31, "mov eax, 0FFFFFFFFh"], [32, "jmp short locret_402F8D"], [33, "mov rax, [rbp+var_8]"], [34, "mov rax, [rax+18h]"], [35, "mov rax, [rax]"], [36, "mov edi, [rax]"], [37, "call _inet_ntoa"], [38, "mov rdx, rax"], [39, "mov rax, [rbp+dest]"], [40, "mov rsi, rdx"], [41, "mov rdi, rax"], [42, "call _strcpy"], [43, "mov eax, 0"], [44, "leave"], [45, "retn"]], "data_dep": [[17, 4], [19, 17], [21, 20], [22, 21], [25, 4], [25, 21], [26, 25], [28, 27], [29, 28], [30, 29], [33, 28], [34, 33], [35, 34], [36, 35], [38, 37], [39, 3], [40, 38], [41, 39], [45, 31], [45, 43], [45, 23]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6_89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.jsonl.gz", "strip_func_name": "sub_402EB7", "query": "\n\n\n__int64 __fastcall sub_402EB7(char *a1)\n{\nchar *v2; // rax\nchar name[8]; // [rsp+10h] [rbp-70h] BYREF\n__int64 v4; // [rsp+18h] [rbp-68h]\n__int64 v5; // [rsp+20h] [rbp-60h]\n__int64 v6; // [rsp+28h] [rbp-58h]\n__int64 v7; // [rsp+30h] [rbp-50h]\n__int64 v8; // [rsp+38h] [rbp-48h]\n__int64 v9; // [rsp+40h] [rbp-40h]\n__int64 v10; // [rsp+48h] [rbp-38h]\n__int64 v11; // [rsp+50h] [rbp-30h]\n__int64 v12; // [rsp+58h] [rbp-28h]\n__int64 v13; // [rsp+60h] [rbp-20h]\n__int64 v14; // [rsp+68h] [rbp-18h]\nint v15; // [rsp+70h] [rbp-10h]\nstruct hostent *v16; // [rsp+78h] [rbp-8h]\n\n*(_QWORD *)name = 0LL;\nv4 = 0LL;\nv5 = 0LL;\nv6 = 0LL;\nv7 = 0LL;\nv8 = 0LL;\nv9 = 0LL;\nv10 = 0LL;\nv11 = 0LL;\nv12 = 0LL;\nv13 = 0LL;\nv14 = 0LL;\nv15 = 0;\nif ( gethostname(name, 0x64uLL) < 0 )\nreturn 0xFFFFFFFFLL;\nv16 = gethostbyname(name);\nif ( !v16 )\nreturn 0xFFFFFFFFLL;\nv2 = inet_ntoa((struct in_addr)(*(struct in_addr **)v16->h_addr_list)->s_addr);\nstrcpy(a1, v2);\nreturn 0LL;\n}\n\n\n\nQ:[a1,name,v16,sub_402EB7,]", "hints": "[]", "response": "{'a1': 'ip_0', 'name': 'host', 'v16': 'hp', 'sub_402EB7': 'getlocalip'}"}
[ [ 0.7295682430267334, 0.7255258560180664, 0.7178930044174194, 0.7071763277053833, 0.7034517526626587, 0.7009119391441345, 0.6995177268981934, 0.6891942620277405, 0.6885135173797607, 0.6883591413497925, 0.6856911778450012, 0.6852156519889832, 0.6833266615867615, 0.6784700155258179, 0.67836993932724, 0.6763634085655212, 0.6715429425239563, 0.6709716320037842, 0.6653500199317932, 0.6649808883666992 ], [ 174007, 256867, 203086, 94213, 80368, 229087, 55846, 179098, 217695, 41648, 115826, 212646, 145575, 22087, 227458, 206416, 125133, 18801, 172660, 256427 ] ]
cebsocket_listen
9735602c47416468fa32bbe45ac347870a9250708ecf086f206a6c4a7b5f2e8f
rohanrhu
cebsocket
NA
extern void cebsocket_listen(cebsocket_t* ws) { sigaction(SIGPIPE, &(struct sigaction){broken_pipe_handler}, NULL); int server_socket; int client_socket; int client_addr_len; struct sockaddr_in serv_addr; struct sockaddr_in cli_addr; server_socket = socket(AF_INET, SOCK_STREAM, 0); if (server_socket < 0) { perror("Socket error"); exit(1); } setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int)); memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = INADDR_ANY; serv_addr.sin_port = htons(ws->port); if (ws->bind_address) { serv_addr.sin_addr.s_addr = inet_addr(ws->bind_address); } else { serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); } if (bind(server_socket, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { perror("Bind error."); exit(1); } listen(server_socket, 10); client_addr_len = sizeof(cli_addr); cebsocket_clients_t* clients = NULL; ws->clients = clients; cebsocket_util_verbose("WebSocket server is listening from 0.0.0.0:%d\n", ws->port); pthread_t client_thread; char str_addr[INET6_ADDRSTRLEN+1]; cebsocket_clients_t* client = NULL; ws->current_client = NULL; for (;;) { client_socket = accept(server_socket, (struct sockaddr *) &cli_addr, &client_addr_len); if (client_socket < 0) { perror("Accept error"); exit(1); } inet_ntop(AF_INET, (void*)&cli_addr.sin_addr, str_addr, INET_ADDRSTRLEN); client = cebsocket_client_init(); client->id = ++clients_id_i; client->ws = ws; client->server_socket = server_socket; client->socket = client_socket; client->address = cli_addr.sin_addr.s_addr; cebsocket_util_verbose("Client connected: #%d (%s)\n", client->id, str_addr); client->ws->on_connected(client); if (!ws->clients) { ws->clients = client; } else { client->prev = ws->current_client; ws->current_client->next = client; } ws->current_client = client; pthread_create( &client_thread, NULL, (void *) &client_handler, (void *) client ); pthread_detach(client_thread); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4018F2", "function_addr": 4200690, "binary_name": "9735602c47416468fa32bbe45ac347870a9250708ecf086f206a6c4a7b5f2e8f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 140h"], [3, "mov [rbp+var_138], rdi"], [4, "lea rdx, [rbp+var_C0]"], [5, "mov eax, 0"], [6, "mov ecx, 13h"], [7, "mov rdi, rdx"], [8, "rep stosq"], [9, "mov [rbp+var_C0], offset sub_40269C"], [10, "lea rax, [rbp+var_C0]"], [11, "mov edx, 0"], [12, "mov rsi, rax"], [13, "mov edi, 0Dh"], [14, "call _sigaction"], [15, "mov edx, 0"], [16, "mov esi, 1"], [17, "mov edi, 2"], [18, "call _socket"], [19, "mov [rbp+fd], eax"], [20, "cmp [rbp+fd], 0"], [21, "jns short loc_401970"], [22, "mov edi, offset aSocketError"], [23, "call _perror"], [24, "mov edi, 1"], [25, "call _exit"], [26, "mov [rbp+optval], 1"], [27, "lea rdx, [rbp+optval]"], [28, "mov eax, [rbp+fd]"], [29, "mov r8d, 4"], [30, "mov rcx, rdx"], [31, "mov edx, 2"], [32, "mov esi, 1"], [33, "mov edi, eax"], [34, "call _setsockopt"], [35, "lea rax, [rbp+s]"], [36, "mov edx, 10h"], [37, "mov esi, 0"], [38, "mov rdi, rax"], [39, "call _memset"], [40, "mov [rbp+s], 2"], [41, "mov [rbp+var_DC], 0"], [42, "mov rax, [rbp+var_138]"], [43, "mov eax, [rax]"], [44, "movzx eax, ax"], [45, "mov edi, eax"], [46, "call _htons"], [47, "mov [rbp+var_DE], ax"], [48, "mov rax, [rbp+var_138]"], [49, "mov rax, [rax+10h]"], [50, "test rax, rax"], [51, "jz short loc_401A0F"], [52, "mov rax, [rbp+var_138]"], [53, "mov rax, [rax+10h]"], [54, "mov rdi, rax"], [55, "call _inet_addr"], [56, "mov [rbp+var_DC], eax"], [57, "jmp short loc_401A1F"], [58, "mov edi, offset cp"], [59, "call _inet_addr"], [60, "mov [rbp+var_DC], eax"], [61, "lea rax, [rbp+s]"], [62, "mov rcx, rax"], [63, "mov eax, [rbp+fd]"], [64, "mov edx, 10h"], [65, "mov rsi, rcx"], [66, "mov edi, eax"], [67, "call _bind"], [68, "test eax, eax"], [69, "jns short loc_401A53"], [70, "mov edi, offset aBindError"], [71, "call _perror"], [72, "mov edi, 1"], [73, "call _exit"], [74, "mov eax, [rbp+fd]"], [75, "mov esi, 0Ah"], [76, "mov edi, eax"], [77, "call _listen"], [78, "mov [rbp+addr_len], 10h"], [79, "mov [rbp+var_10], 0"], [80, "mov rax, [rbp+var_138]"], [81, "mov rdx, [rbp+var_10]"], [82, "mov [rax+18h], rdx"], [83, "mov rax, [rbp+var_138]"], [84, "mov eax, [rax]"], [85, "mov esi, eax"], [86, "mov edi, offset aWebsocketServe"], [87, "mov eax, 0"], [88, "call sub_4014EE"], [89, "mov [rbp+arg], 0"], [90, "mov rax, [rbp+var_138]"], [91, "mov qword ptr [rax+20h], 0"], [92, "lea rax, [rbp+addr]"], [93, "mov rcx, rax"], [94, "lea rdx, [rbp+addr_len]"], [95, "mov eax, [rbp+fd]"], [96, "mov rsi, rcx"], [97, "mov edi, eax"], [98, "call _accept"], [99, "mov [rbp+var_1C], eax"], [100, "cmp [rbp+var_1C], 0"], [101, "jns short loc_401AEF"], [102, "mov edi, offset aAcceptError"], [103, "call _perror"], [104, "mov edi, 1"], [105, "call _exit"], [106, "lea rax, [rbp+buf]"], [107, "lea rdx, [rbp+addr]"], [108, "lea rsi, [rdx+4]"], [109, "mov ecx, 10h"], [110, "mov rdx, rax"], [111, "mov edi, 2"], [112, "call _inet_ntop"], [113, "mov eax, 0"], [114, "call sub_4025A5"], [115, "mov [rbp+arg], rax"], [116, "mov rax, cs:qword_405188"], [117, "add rax, 1"], [118, "mov cs:qword_405188, rax"], [119, "mov rax, cs:qword_405188"], [120, "mov edx, eax"], [121, "mov rax, [rbp+arg]"], [122, "mov [rax+8], edx"], [123, "mov rax, [rbp+arg]"], [124, "mov rdx, [rbp+var_138]"], [125, "mov [rax], rdx"], [126, "mov rax, [rbp+arg]"], [127, "mov edx, [rbp+fd]"], [128, "mov [rax+10h], edx"], [129, "mov rax, [rbp+arg]"], [130, "mov edx, [rbp+var_1C]"], [131, "mov [rax+0Ch], edx"], [132, "mov eax, dword ptr [rbp+addr.sa_data+2]"], [133, "mov edx, eax"], [134, "mov rax, [rbp+arg]"], [135, "mov [rax+14h], edx"], [136, "mov rax, [rbp+arg]"], [137, "mov eax, [rax+8]"], [138, "lea rdx, [rbp+buf]"], [139, "mov esi, eax"], [140, "mov edi, offset aClientConnecte_0"], [141, "mov eax, 0"], [142, "call sub_4014EE"], [143, "mov rax, [rbp+arg]"], [144, "mov rax, [rax]"], [145, "mov rdx, [rax+30h]"], [146, "mov rax, [rbp+arg]"], [147, "mov rdi, rax"], [148, "call rdx"], [149, "mov rax, [rbp+var_138]"], [150, "mov rax, [rax+18h]"], [151, "test rax, rax"], [152, "jnz short loc_401BC8"], [153, "mov rax, [rbp+var_138]"], [154, "mov rdx, [rbp+arg]"], [155, "mov [rax+18h], rdx"], [156, "jmp short loc_401BEE"], [157, "mov rax, [rbp+var_138]"], [158, "mov rdx, [rax+20h]"], [159, "mov rax, [rbp+arg]"], [160, "mov [rax+28h], rdx"], [161, "mov rax, [rbp+var_138]"], [162, "mov rax, [rax+20h]"], [163, "mov rdx, [rbp+arg]"], [164, "mov [rax+30h], rdx"], [165, "mov rax, [rbp+var_138]"], [166, "mov rdx, [rbp+arg]"], [167, "mov [rax+20h], rdx"], [168, "mov rdx, [rbp+arg]"], [169, "lea rax, [rbp+newthread]"], [170, "mov rcx, rdx"], [171, "mov edx, offset start_routine"], [172, "mov esi, 0"], [173, "mov rdi, rax"], [174, "call _pthread_create"], [175, "mov rax, [rbp+newthread]"], [176, "mov rdi, rax"], [177, "call _pthread_detach"], [178, "jmp loc_401AB4"]], "data_dep": [[7, 4], [10, 5], [10, 9], [12, 10], [19, 18], [20, 19], [21, 20], [27, 15], [27, 26], [28, 19], [30, 27], [33, 28], [35, 34], [38, 35], [42, 3], [43, 42], [44, 43], [45, 44], [47, 46], [48, 3], [49, 48], [50, 49], [51, 50], [52, 3], [53, 52], [54, 53], [56, 55], [60, 59], [61, 40], [61, 55], [61, 59], [62, 61], [63, 19], [65, 62], [66, 63], [68, 67], [69, 68], [74, 19], [76, 74], [80, 3], [81, 79], [82, 81], [82, 80], [83, 3], [84, 83], [84, 82], [85, 84], [90, 3], [91, 90], [92, 177], [92, 90], [93, 92], [94, 78], [94, 171], [94, 81], [95, 19], [96, 93], [97, 95], [99, 98], [100, 99], [101, 100], [106, 98], [107, 94], [108, 107], [108, 125], [108, 164], [108, 122], [108, 131], [108, 167], [108, 96], [108, 160], [108, 135], [108, 128], [108, 82], [108, 91], [108, 155], [110, 106], [115, 114], [116, 118], [117, 116], [118, 117], [119, 118], [120, 119], [121, 115], [122, 121], [122, 120], [123, 115], [124, 3], [125, 123], [125, 124], [126, 115], [127, 19], [128, 126], [128, 127], [129, 115], [130, 99], [131, 129], [131, 130], [133, 132], [134, 115], [135, 133], [135, 134], [136, 115], [137, 122], [137, 135], [137, 136], [138, 133], [139, 137], [143, 115], [144, 125], [144, 143], [144, 135], [145, 135], [145, 144], [145, 164], [146, 115], [147, 146], [148, 145], [149, 3], [150, 149], [150, 135], [150, 82], [150, 155], [151, 150], [152, 151], [153, 3], [154, 115], [155, 153], [155, 154], [157, 3], [158, 122], [158, 131], [158, 167], [158, 160], [158, 135], [158, 128], [158, 82], [158, 91], [158, 155], [158, 164], [158, 157], [158, 125], [159, 115], [160, 158], [160, 159], [161, 3], [162, 161], [162, 167], [162, 160], [162, 91], [163, 115], [164, 162], [164, 163], [165, 3], [166, 115], [167, 166], [167, 165], [168, 115], [169, 165], [170, 168], [173, 169], [176, 175]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9735602c47416468fa32bbe45ac347870a9250708ecf086f206a6c4a7b5f2e8f_9735602c47416468fa32bbe45ac347870a9250708ecf086f206a6c4a7b5f2e8f.jsonl.gz", "strip_func_name": "sub_4018F2", "query": "\n\n\nvoid __fastcall __noreturn sub_4018F2(const char **a1)\n{\n__int64 v1; // rcx\n__int64 v2; // r8\n__int64 v3; // r9\n__int64 v4; // rcx\n__int64 v5; // r8\n__int64 v6; // r9\nchar buf[48]; // [rsp+10h] [rbp-130h] BYREF\npthread_t newthread; // [rsp+40h] [rbp-100h] BYREF\nint optval; // [rsp+4Ch] [rbp-F4h] BYREF\nstruct sockaddr addr; // [rsp+50h] [rbp-F0h] BYREF\nstruct sockaddr s; // [rsp+60h] [rbp-E0h] BYREF\nsocklen_t addr_len; // [rsp+7Ch] [rbp-C4h] BYREF\nstruct sigaction v13; // [rsp+80h] [rbp-C0h] BYREF\nint v14; // [rsp+124h] [rbp-1Ch]\nvoid *arg; // [rsp+128h] [rbp-18h]\n__int64 v16; // [rsp+130h] [rbp-10h]\nint fd; // [rsp+13Ch] [rbp-4h]\n\nmemset(&v13, 0, sizeof(v13));\nv13.sa_handler = (__sighandler_t)sub_40269C;\nsigaction(13, &v13, 0LL);\nfd = socket(2, 1, 0);\nif ( fd < 0 )\n{\nperror(\"Socket error\");\nexit(1);\n}\noptval = 1;\nsetsockopt(fd, 1, 2, &optval, 4u);\nmemset(&s, 0, sizeof(s));\ns.sa_family = 2;\n*(_DWORD *)&s.sa_data[2] = 0;\n*(_WORD *)s.sa_data = htons(*(_DWORD *)a1);\nif ( a1[2] )\n*(_DWORD *)&s.sa_data[2] = inet_addr(a1[2]);\nelse\n*(_DWORD *)&s.sa_data[2] = inet_addr(\"127.0.0.1\");\nif ( bind(fd, &s, 0x10u) < 0 )\n{\nperror(\"Bind error.\");\nexit(1);\n}\nlisten(fd, 10);\naddr_len = 16;\nv16 = 0LL;\na1[3] = 0LL;\nsub_4014EE(\"WebSocket server is listening from 0.0.0.0:%d\\n\", *(unsigned int *)a1, 0LL, v1, v2, v3);\narg = 0LL;\na1[4] = 0LL;\nwhile ( 1 )\n{\nv14 = accept(fd, &addr, &addr_len);\nif ( v14 < 0 )\nbreak;\ninet_ntop(2, &addr.sa_data[2], buf, 0x10u);\narg = (void *)sub_4025A5();\n*((_DWORD *)arg + 2) = ++qword_405188;\n*(_QWORD *)arg = a1;\n*((_DWORD *)arg + 4) = fd;\n*((_DWORD *)arg + 3) = v14;\n*((_DWORD *)arg + 5) = *(_DWORD *)&addr.sa_data[2];\nsub_4014EE(\"Client connected: #%d (%s)\\n\", *((unsigned int *)arg + 2), (__int64)buf, v4, v5, v6);\n(*(void (__fastcall **)(void *))(*(_QWORD *)arg + 48LL))(arg);\nif ( a1[3] )\n{\n*((_QWORD *)arg + 5) = a1[4];\n*((_QWORD *)a1[4] + 6) = arg;\n}\nelse\n{\na1[3] = (const char *)arg;\n}\na1[4] = (const char *)arg;\npthread_create(&newthread, 0LL, start_routine, arg);\npthread_detach(newthread);\n}\nperror(\"Accept error\");\nexit(1);\n}\n\n\n\nQ:[a1,buf,newthread,addr,s,addr_len,v13,v14,arg,v16,fd,sub_4018F2,sub_40269C,sub_4014EE,sub_4025A5,]", "hints": "[]", "response": "{'a1': 'ws', 'buf': 'str_addr', 'newthread': 'client_thread', 'addr': 'cli_addr', 's': 'serv_addr', 'addr_len': 'client_addr_len', 'v13': 'act', 'v14': 'client_socket', 'arg': 'client', 'v16': 'clients', 'fd': 'server_socket', 'sub_4018F2': 'cebsocket_listen', 'sub_40269C': 'broken_pipe_handler', 'sub_4014EE': 'cebsocket_util_verbose', 'sub_4025A5': 'cebsocket_client_init'}"}
[ [ 0.9142358303070068, 0.8063936829566956, 0.8049366474151611, 0.801410973072052, 0.794477105140686, 0.791215717792511, 0.7854747772216797, 0.7851139307022095, 0.785090446472168, 0.7840609550476074, 0.7825294137001038, 0.7689724564552307, 0.7678264379501343, 0.767451286315918, 0.7650511860847473, 0.7612709999084473, 0.7573966383934021, 0.7546632289886475, 0.753674328327179, 0.7481510639190674 ], [ 208273, 141397, 117367, 43518, 230351, 175141, 98061, 45304, 243638, 60243, 164324, 18739, 259044, 159899, 231254, 255138, 241610, 262775, 253632, 101536 ] ]
install_sighandler
06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018
RIOT-OS
Tutorials
NA
void install_sighandler() { struct sigaction action; sigemptyset(&action.sa_mask); sigaddset(&action.sa_mask, SIGINT); sigaddset(&action.sa_mask, SIGUSR1); sigaddset(&action.sa_mask, SIGUSR2); action.sa_flags = 0; action.sa_handler = sig_handler; sigaction(SIGINT, &action, NULL); sigaction(SIGUSR1, &action, NULL); sigaction(SIGUSR2, &action, NULL); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401561", "function_addr": 4199777, "binary_name": "06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "lea rax, [rbp+var_A0]"], [4, "add rax, 8"], [5, "mov rdi, rax"], [6, "call _sigemptyset"], [7, "lea rax, [rbp+var_A0]"], [8, "add rax, 8"], [9, "mov esi, 2"], [10, "mov rdi, rax"], [11, "call _sigaddset"], [12, "lea rax, [rbp+var_A0]"], [13, "add rax, 8"], [14, "mov esi, 0Ah"], [15, "mov rdi, rax"], [16, "call _sigaddset"], [17, "lea rax, [rbp+var_A0]"], [18, "add rax, 8"], [19, "mov esi, 0Ch"], [20, "mov rdi, rax"], [21, "call _sigaddset"], [22, "mov [rbp+var_18], 0"], [23, "mov [rbp+var_A0], offset sub_40137B"], [24, "lea rax, [rbp+var_A0]"], [25, "mov edx, 0"], [26, "mov rsi, rax"], [27, "mov edi, 2"], [28, "call _sigaction"], [29, "lea rax, [rbp+var_A0]"], [30, "mov edx, 0"], [31, "mov rsi, rax"], [32, "mov edi, 0Ah"], [33, "call _sigaction"], [34, "lea rax, [rbp+var_A0]"], [35, "mov edx, 0"], [36, "mov rsi, rax"], [37, "mov edi, 0Ch"], [38, "call _sigaction"], [39, "nop"], [40, "leave"], [41, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [10, 8], [12, 11], [13, 12], [15, 13], [17, 16], [18, 17], [20, 18], [24, 23], [24, 21], [26, 24], [29, 23], [29, 28], [31, 29], [34, 33], [34, 23], [36, 34], [41, 38]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018_06cdb20ff651312d644a0d760352ed69a462dac4f82fc95a3ddd6fbf721f4018.jsonl.gz", "strip_func_name": "sub_401561", "query": "\n\n\nint sub_401561()\n{\nstruct sigaction v1; // [rsp+0h] [rbp-A0h] BYREF\n\nsigemptyset(&v1.sa_mask);\nsigaddset(&v1.sa_mask, 2);\nsigaddset(&v1.sa_mask, 10);\nsigaddset(&v1.sa_mask, 12);\nv1.sa_flags = 0;\nv1.sa_handler = sub_40137B;\nsigaction(2, &v1, 0LL);\nsigaction(10, &v1, 0LL);\nreturn sigaction(12, &v1, 0LL);\n}\n\n\n\nQ:[v1,sub_401561,sub_40137B,]", "hints": "[]", "response": "{'v1': 'action', 'sub_401561': 'install_sighandler', 'sub_40137B': 'sig_handler'}"}
[ [ 0.8455675840377808, 0.8251246809959412, 0.8190067410469055, 0.8177767395973206, 0.8148577213287354, 0.8102818727493286, 0.8099189400672913, 0.8029587864875793, 0.8017867803573608, 0.7968948483467102, 0.7968350648880005, 0.7952767610549927, 0.7913141250610352, 0.7880139946937561, 0.7740175724029541, 0.7738932371139526, 0.7730342149734497, 0.7656943798065186, 0.7635406851768494, 0.7560086250305176 ], [ 249264, 204017, 106238, 70999, 212034, 38459, 173715, 116383, 49977, 140791, 71538, 9085, 111822, 192212, 148603, 241630, 13131, 76019, 184328, 236654 ] ]
i_readline
7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807
arendst
Tasmota
NA
static int i_readline(bvm *vm) { be_getmember(vm, 1, ".p"); if (be_iscomptr(vm, -1)) { void *fh = be_tocomptr(vm, -1); size_t pos = 0, size = READLINE_STEP; char *buffer = be_malloc(vm, size); char *res = be_fgets(fh, buffer, (int)size); while (res) { pos += strlen(buffer + pos); if (!pos || buffer[pos - 1] == '\n') { break; } buffer = be_realloc(vm, buffer, size, size + READLINE_STEP); res = be_fgets(fh, buffer + pos, READLINE_STEP); size += READLINE_STEP; } be_pushnstring(vm, buffer, pos); be_free(vm, buffer, size); be_return(vm); } be_return_nil(vm); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42A22D", "function_addr": 4366893, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_38], rdi"], [4, "mov rax, [rbp+var_38]"], [5, "mov edx, offset unk_444900"], [6, "mov esi, 1"], [7, "mov rdi, rax"], [8, "call be_getmember"], [9, "mov rax, [rbp+var_38]"], [10, "mov esi, 0FFFFFFFFh"], [11, "mov rdi, rax"], [12, "call be_iscomptr"], [13, "test al, al"], [14, "jz loc_42A393"], [15, "mov rax, [rbp+var_38]"], [16, "mov esi, 0FFFFFFFFh"], [17, "mov rdi, rax"], [18, "call be_tocomptr"], [19, "mov [rbp+var_28], rax"], [20, "mov [rbp+var_8], 0"], [21, "mov [rbp+var_10], 64h "], [22, "mov rdx, [rbp+var_10]"], [23, "mov rax, [rbp+var_38]"], [24, "mov rcx, rdx"], [25, "mov edx, 0"], [26, "mov esi, 0"], [27, "mov rdi, rax"], [28, "call be_realloc"], [29, "mov [rbp+var_18], rax"], [30, "mov rax, [rbp+var_10]"], [31, "mov edx, eax"], [32, "mov rcx, [rbp+var_18]"], [33, "mov rax, [rbp+var_28]"], [34, "mov rsi, rcx"], [35, "mov rdi, rax"], [36, "call be_fgets"], [37, "mov [rbp+var_20], rax"], [38, "jmp short loc_42A34A"], [39, "mov rdx, [rbp+var_18]"], [40, "mov rax, [rbp+var_8]"], [41, "add rax, rdx"], [42, "mov rdi, rax"], [43, "call _strlen"], [44, "add [rbp+var_8], rax"], [45, "cmp [rbp+var_8], 0"], [46, "jz short loc_42A355"], [47, "mov rax, [rbp+var_8]"], [48, "lea rdx, [rax-1]"], [49, "mov rax, [rbp+var_18]"], [50, "add rax, rdx"], [51, "movzx eax, byte ptr [rax]"], [52, "cmp al, 0Ah"], [53, "jz short loc_42A355"], [54, "mov rax, [rbp+var_10]"], [55, "lea rcx, [rax+64h]"], [56, "mov rdx, [rbp+var_10]"], [57, "mov rsi, [rbp+var_18]"], [58, "mov rax, [rbp+var_38]"], [59, "mov rdi, rax"], [60, "call be_realloc"], [61, "mov [rbp+var_18], rax"], [62, "mov rdx, [rbp+var_18]"], [63, "mov rax, [rbp+var_8]"], [64, "lea rcx, [rdx+rax]"], [65, "mov rax, [rbp+var_28]"], [66, "mov edx, 64h "], [67, "mov rsi, rcx"], [68, "mov rdi, rax"], [69, "call be_fgets"], [70, "mov [rbp+var_20], rax"], [71, "add [rbp+var_10], 64h "], [72, "cmp [rbp+var_20], 0"], [73, "jnz loc_42A2CD"], [74, "mov rdx, [rbp+var_8]"], [75, "mov rcx, [rbp+var_18]"], [76, "mov rax, [rbp+var_38]"], [77, "mov rsi, rcx"], [78, "mov rdi, rax"], [79, "call be_pushnstring"], [80, "mov rdx, [rbp+var_10]"], [81, "mov rsi, [rbp+var_18]"], [82, "mov rax, [rbp+var_38]"], [83, "mov ecx, 0"], [84, "mov rdi, rax"], [85, "call be_realloc"], [86, "mov rax, [rbp+var_38]"], [87, "mov rdi, rax"], [88, "call be_returnvalue"], [89, "jmp short locret_42A39F"], [90, "mov rax, [rbp+var_38]"], [91, "mov rdi, rax"], [92, "call be_returnnilvalue"], [93, "leave"], [94, "retn"]], "data_dep": [[4, 3], [7, 4], [9, 3], [11, 9], [13, 12], [14, 13], [15, 3], [17, 15], [19, 18], [22, 21], [23, 3], [24, 22], [27, 23], [29, 28], [30, 21], [31, 30], [32, 29], [33, 19], [34, 32], [35, 33], [37, 36], [39, 61], [39, 29], [40, 20], [40, 44], [41, 40], [41, 39], [42, 41], [44, 20], [44, 44], [44, 43], [45, 44], [46, 45], [47, 44], [48, 47], [48, 39], [49, 61], [49, 29], [50, 49], [50, 48], [51, 50], [52, 51], [53, 52], [54, 21], [54, 71], [55, 54], [55, 32], [55, 64], [56, 21], [56, 71], [57, 61], [57, 29], [58, 3], [59, 58], [61, 60], [62, 61], [63, 44], [64, 55], [64, 63], [65, 19], [67, 64], [68, 65], [70, 69], [71, 21], [71, 71], [72, 70], [72, 37], [73, 72], [74, 20], [74, 44], [75, 61], [75, 29], [76, 3], [77, 75], [78, 76], [80, 21], [80, 71], [81, 29], [81, 61], [82, 3], [84, 82], [86, 3], [87, 86], [90, 3], [91, 90], [94, 88], [94, 92]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_42A22D", "query": "\n\n\n__int64 __fastcall sub_42A22D(__int64 a1)\n{\n__int64 v2; // [rsp+18h] [rbp-28h]\n__int64 v3; // [rsp+20h] [rbp-20h]\nchar *v4; // [rsp+28h] [rbp-18h]\nunsigned __int64 v5; // [rsp+30h] [rbp-10h]\n__int64 v6; // [rsp+38h] [rbp-8h]\n\nbe_getmember(a1, 1u, (__int64)&unk_444900);\nif ( !be_iscomptr(a1, 0xFFFFFFFF) )\nreturn be_returnnilvalue(a1);\nv2 = be_tocomptr(a1, 0xFFFFFFFF);\nv6 = 0LL;\nv5 = 100LL;\nv4 = (char *)be_realloc(a1, 0LL, 0LL, 0x64uLL);\nv3 = be_fgets(v2, v4, 100LL);\nwhile ( v3 )\n{\nv6 += strlen(&v4[v6]);\nif ( !v6 || v4[v6 - 1] == 10 )\nbreak;\nv4 = (char *)be_realloc(a1, v4, v5, v5 + 100);\nv3 = be_fgets(v2, &v4[v6], 100LL);\nv5 += 100LL;\n}\nbe_pushnstring(a1, (__int64)v4, v6);\nbe_realloc(a1, v4, v5, 0LL);\nreturn be_returnvalue(a1);\n}\n\n\n\nQ:[a1,v2,v3,v4,v5,v6,sub_42A22D,]", "hints": "[]", "response": "{'a1': 'vm', 'v2': 'fh', 'v3': 'res', 'v4': 'buffer', 'v5': 'size', 'v6': 'pos', 'sub_42A22D': 'i_readline'}"}
[ [ 0.7374062538146973, 0.7324085831642151, 0.709357738494873, 0.7043843865394592, 0.7036726474761963, 0.7029340267181396, 0.6985653638839722, 0.6971865892410278, 0.6943078637123108, 0.6937800049781799, 0.6902115941047668, 0.6875603199005127, 0.6864333152770996, 0.6855658888816833, 0.6847759485244751, 0.6810967922210693, 0.6806331872940063, 0.6777315139770508, 0.6771579384803772, 0.6767525672912598 ], [ 153649, 34718, 153863, 181980, 117114, 191539, 179415, 1986, 31264, 117182, 27557, 215428, 55490, 257705, 72037, 192168, 7238, 131007, 13057, 246264 ] ]
connect_server
79db7bd47e1d61124837565c2eb93f655f96daceb6833f3e80704ac257944506
Qihoo360
kmemcache
NA
static int connect_server(const char *hostname, in_port_t port, bool nonblock) { struct addrinfo *ai = lookuphost(hostname, port); int sock = -1; if (ai != NULL) { if ((sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) != -1) { if (connect(sock, ai->ai_addr, ai->ai_addrlen) == -1) { fprintf(stderr, "Failed to connect socket: %s\n", strerror(errno)); close(sock); sock = -1; } else if (nonblock) { int flags = fcntl(sock, F_GETFL, 0); if (flags < 0 || fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0) { fprintf(stderr, "Failed to enable nonblocking mode: %s\n", strerror(errno)); close(sock); sock = -1; } } } else { fprintf(stderr, "Failed to create socket: %s\n", strerror(errno)); } freeaddrinfo(ai); } return sock; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403584", "function_addr": 4208004, "binary_name": "79db7bd47e1d61124837565c2eb93f655f96daceb6833f3e80704ac257944506.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_2C], ax"], [6, "mov eax, edx"], [7, "mov [rbp+var_30], al"], [8, "movzx edx, [rbp+var_2C]"], [9, "mov rax, [rbp+var_28]"], [10, "mov esi, edx"], [11, "mov rdi, rax"], [12, "call sub_4034AC"], [13, "mov [rbp+ai], rax"], [14, "mov [rbp+fd], 0FFFFFFFFh"], [15, "cmp [rbp+ai], 0"], [16, "jz loc_40370E"], [17, "mov rax, [rbp+ai]"], [18, "mov edx, [rax+0Ch]"], [19, "mov rax, [rbp+ai]"], [20, "mov ecx, [rax+8]"], [21, "mov rax, [rbp+ai]"], [22, "mov eax, [rax+4]"], [23, "mov esi, ecx"], [24, "mov edi, eax"], [25, "call _socket"], [26, "mov [rbp+fd], eax"], [27, "cmp [rbp+fd], 0FFFFFFFFh"], [28, "jz loc_4036D8"], [29, "mov rax, [rbp+ai]"], [30, "mov edx, [rax+10h]"], [31, "mov rax, [rbp+ai]"], [32, "mov rcx, [rax+18h]"], [33, "mov eax, [rbp+fd]"], [34, "mov rsi, rcx"], [35, "mov edi, eax"], [36, "call _connect"], [37, "cmp eax, 0FFFFFFFFh"], [38, "jnz short loc_40364F"], [39, "call ___errno_location"], [40, "mov eax, [rax]"], [41, "mov edi, eax"], [42, "call _strerror"], [43, "mov rdx, rax"], [44, "mov rax, cs:stderr"], [45, "mov esi, offset aFailedToConnec"], [46, "mov rdi, rax"], [47, "mov eax, 0"], [48, "call _fprintf"], [49, "mov eax, [rbp+fd]"], [50, "mov edi, eax"], [51, "call _close"], [52, "mov [rbp+fd], 0FFFFFFFFh"], [53, "jmp loc_403702"], [54, "cmp [rbp+var_30], 0"], [55, "jz loc_403702"], [56, "mov eax, [rbp+fd]"], [57, "mov edx, 0"], [58, "mov esi, 3"], [59, "mov edi, eax"], [60, "mov eax, 0"], [61, "call _fcntl"], [62, "mov [rbp+var_14], eax"], [63, "cmp [rbp+var_14], 0"], [64, "js short loc_40369B"], [65, "mov eax, [rbp+var_14]"], [66, "or ah, 8"], [67, "mov edx, eax"], [68, "mov eax, [rbp+fd]"], [69, "mov esi, 4"], [70, "mov edi, eax"], [71, "mov eax, 0"], [72, "call _fcntl"], [73, "test eax, eax"], [74, "jns short loc_403702"], [75, "call ___errno_location"], [76, "mov eax, [rax]"], [77, "mov edi, eax"], [78, "call _strerror"], [79, "mov rdx, rax"], [80, "mov rax, cs:stderr"], [81, "mov esi, offset aFailedToEnable"], [82, "mov rdi, rax"], [83, "mov eax, 0"], [84, "call _fprintf"], [85, "mov eax, [rbp+fd]"], [86, "mov edi, eax"], [87, "call _close"], [88, "mov [rbp+fd], 0FFFFFFFFh"], [89, "jmp short loc_403702"], [90, "call ___errno_location"], [91, "mov eax, [rax]"], [92, "mov edi, eax"], [93, "call _strerror"], [94, "mov rdx, rax"], [95, "mov rax, cs:stderr"], [96, "mov esi, offset aFailedToCreate"], [97, "mov rdi, rax"], [98, "mov eax, 0"], [99, "call _fprintf"], [100, "mov rax, [rbp+ai]"], [101, "mov rdi, rax"], [102, "call _freeaddrinfo"], [103, "mov eax, [rbp+fd]"], [104, "leave"], [105, "retn"]], "data_dep": [[5, 4], [7, 6], [8, 5], [9, 3], [10, 8], [11, 9], [13, 12], [15, 13], [16, 15], [17, 13], [18, 17], [19, 13], [20, 19], [21, 13], [22, 21], [23, 20], [24, 22], [26, 25], [27, 26], [28, 27], [29, 13], [30, 29], [31, 13], [32, 31], [33, 26], [34, 32], [35, 33], [37, 36], [38, 37], [40, 39], [41, 40], [43, 42], [46, 44], [49, 26], [50, 49], [54, 7], [55, 54], [56, 26], [59, 56], [62, 61], [63, 62], [64, 63], [65, 62], [66, 65], [67, 66], [68, 26], [70, 68], [73, 72], [74, 73], [76, 75], [77, 76], [79, 78], [82, 80], [85, 26], [86, 85], [91, 90], [92, 91], [94, 93], [97, 95], [100, 13], [101, 100], [103, 88], [103, 14], [103, 26], [103, 52], [105, 103]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/79db7bd47e1d61124837565c2eb93f655f96daceb6833f3e80704ac257944506_79db7bd47e1d61124837565c2eb93f655f96daceb6833f3e80704ac257944506.jsonl.gz", "strip_func_name": "sub_403584", "query": "\n\n\n__int64 __fastcall sub_403584(const char *a1, unsigned __int16 a2, char a3)\n{\nint *v3; // rax\nchar *v4; // rax\nunsigned int v5; // eax\nint *v6; // rax\nchar *v7; // rax\nint *v8; // rax\nchar *v9; // rax\nint v12; // [rsp+1Ch] [rbp-14h]\nstruct addrinfo *ai; // [rsp+20h] [rbp-10h]\nunsigned int fd; // [rsp+2Ch] [rbp-4h]\n\nai = sub_4034AC(a1, a2);\nfd = -1;\nif ( ai )\n{\nfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);\nif ( fd == -1 )\n{\nv8 = __errno_location();\nv9 = strerror(*v8);\nfprintf(stderr, \"Failed to create socket: %s\\n\", v9);\n}\nelse if ( connect(fd, ai->ai_addr, ai->ai_addrlen) == -1 )\n{\nv3 = __errno_location();\nv4 = strerror(*v3);\nfprintf(stderr, \"Failed to connect socket: %s\\n\", v4);\nclose(fd);\nfd = -1;\n}\nelse if ( a3 )\n{\nv12 = fcntl(fd, 3, 0LL);\nif ( v12 < 0 || (v5 = v12, BYTE1(v5) = BYTE1(v12) | 8, fcntl(fd, 4, v5) < 0) )\n{\nv6 = __errno_location();\nv7 = strerror(*v6);\nfprintf(stderr, \"Failed to enable nonblocking mode: %s\\n\", v7);\nclose(fd);\nfd = -1;\n}\n}\nfreeaddrinfo(ai);\n}\nreturn fd;\n}\n\n\n\nQ:[a3,a1,a2,v12,fd,sub_403584,sub_4034AC,]", "hints": "[]", "response": "{'a3': 'nonblock', 'a1': 'hostname', 'a2': 'port', 'v12': 'flags', 'fd': 'sock', 'sub_403584': 'connect_server', 'sub_4034AC': 'lookuphost'}"}
[ [ 0.7694275379180908, 0.7236087918281555, 0.7222549915313721, 0.7210624814033508, 0.6904496550559998, 0.6900429725646973, 0.6876976490020752, 0.6750348210334778, 0.6733307242393494, 0.666600227355957, 0.6660431623458862, 0.6653956770896912, 0.6635054349899292, 0.6632324457168579, 0.6627737283706665, 0.6626624464988708, 0.6593867540359497, 0.6577863097190857, 0.656995952129364, 0.655173659324646 ], [ 132046, 4326, 40418, 200012, 194363, 90787, 193991, 82658, 60810, 123853, 194548, 66055, 1285, 122849, 60072, 16757, 73244, 165986, 224052, 84210 ] ]
m_sin
7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807
arendst
Tasmota
NA
static int m_sin(bvm *vm) { if (be_top(vm) >= 1 && be_isnumber(vm, 1)) { breal x = be_toreal(vm, 1); be_pushreal(vm, mathfunc(sin)(x)); } else { be_pushreal(vm, (breal)0.0); } be_return(vm); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_427789", "function_addr": 4355977, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, [rbp+var_18]"], [5, "mov rdi, rax"], [6, "call be_top"], [7, "test eax, eax"], [8, "jle short loc_4277F4"], [9, "mov rax, [rbp+var_18]"], [10, "mov esi, 1"], [11, "mov rdi, rax"], [12, "call be_isnumber"], [13, "test al, al"], [14, "jz short loc_4277F4"], [15, "mov rax, [rbp+var_18]"], [16, "mov esi, 1"], [17, "mov rdi, rax"], [18, "call be_toreal"], [19, "movd eax, xmm0"], [20, "mov [rbp+x], eax"], [21, "mov eax, [rbp+x]"], [22, "movd xmm0, eax"], [23, "call _sinf"], [24, "movd eax, xmm0"], [25, "mov rdx, [rbp+var_18]"], [26, "movd xmm0, eax"], [27, "mov rdi, rdx"], [28, "call be_pushreal"], [29, "jmp short loc_427804"], [30, "mov rax, [rbp+var_18]"], [31, "pxor xmm0, xmm0"], [32, "mov rdi, rax"], [33, "call be_pushreal"], [34, "mov rax, [rbp+var_18]"], [35, "mov rdi, rax"], [36, "call be_returnvalue"], [37, "leave"], [38, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 3], [11, 9], [13, 12], [14, 13], [15, 3], [17, 15], [20, 19], [21, 20], [22, 21], [24, 22], [25, 3], [26, 24], [27, 25], [30, 3], [32, 30], [34, 3], [35, 34], [38, 36]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_427789", "query": "\n\n\n__int64 __fastcall sub_427789(__int64 a1, __m128i a2)\n{\n__m128i v2; // xmm0\n\nif ( (int)be_top(a1) > 0 && be_isnumber(a1, 1u) )\n{\na2.m128i_u64[0] = (unsigned __int64)be_toreal(a1, 1u);\nv2 = _mm_cvtsi32_si128(_mm_cvtsi128_si32(a2));\n*(float *)v2.m128i_i32 = sinf(*(float *)v2.m128i_i32);\nbe_pushreal(a1, COERCE_FLOAT(_mm_cvtsi128_si32(v2)));\n}\nelse\n{\nbe_pushreal(a1, 0.0);\n}\nreturn be_returnvalue(a1);\n}\n\n\n\nQ:[a1,sub_427789,]", "hints": "[]", "response": "{'a1': 'vm', 'sub_427789': 'm_sin'}"}
[ [ 0.7546141743659973, 0.7404707670211792, 0.7380738258361816, 0.7353639602661133, 0.7333763837814331, 0.7333697080612183, 0.7326499819755554, 0.7299587726593018, 0.7292770147323608, 0.7281832695007324, 0.7278337478637695, 0.7277122735977173, 0.7266260981559753, 0.7265974283218384, 0.7239014506340027, 0.7230978608131409, 0.7226437330245972, 0.7208667397499084, 0.7195820212364197, 0.7191051244735718 ], [ 243776, 259240, 29063, 171576, 233921, 188973, 127430, 247074, 215476, 47277, 137038, 104708, 119522, 258100, 21993, 123404, 7804, 161973, 241351, 77905 ] ]
next
7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807
arendst
Tasmota
NA
static int next(blexer *lexer) { struct blexerreader *lr = &lexer->reader; if (!(lr->len--)) { static const char eos = EOS; const char *s = lr->readf(lexer, lr->data, &lr->len); lr->s = s ? s : &eos; --lr->len; } lexer->reader.cursor = *lr->s++; return lexer->reader.cursor; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_413BE0", "function_addr": 4275168, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, [rbp+var_18]"], [5, "add rax, 40h "], [6, "mov [rbp+var_8], rax"], [7, "mov rax, [rbp+var_8]"], [8, "mov rax, [rax+8]"], [9, "lea rcx, [rax-1]"], [10, "mov rdx, [rbp+var_8]"], [11, "mov [rdx+8], rcx"], [12, "test rax, rax"], [13, "jnz short loc_413C62"], [14, "mov rax, [rbp+var_8]"], [15, "mov rdx, [rax+18h]"], [16, "mov rax, [rbp+var_8]"], [17, "lea rcx, [rax+8]"], [18, "mov rax, [rbp+var_8]"], [19, "mov rax, [rax+10h]"], [20, "mov rsi, rcx"], [21, "mov rdi, rax"], [22, "call rdx"], [23, "mov [rbp+var_10], rax"], [24, "cmp [rbp+var_10], 0"], [25, "jz short loc_413C42"], [26, "mov rax, [rbp+var_10]"], [27, "jmp short loc_413C47"], [28, "mov eax, offset unk_43F63E"], [29, "mov rdx, [rbp+var_8]"], [30, "mov [rdx], rax"], [31, "mov rax, [rbp+var_8]"], [32, "mov rax, [rax+8]"], [33, "lea rdx, [rax-1]"], [34, "mov rax, [rbp+var_8]"], [35, "mov [rax+8], rdx"], [36, "mov rax, [rbp+var_8]"], [37, "mov rax, [rax]"], [38, "lea rcx, [rax+1]"], [39, "mov rdx, [rbp+var_8]"], [40, "mov [rdx], rcx"], [41, "movzx eax, byte ptr [rax]"], [42, "movsx edx, al"], [43, "mov rax, [rbp+var_18]"], [44, "mov [rax+70h], edx"], [45, "mov rax, [rbp+var_18]"], [46, "mov eax, [rax+70h]"], [47, "leave"], [48, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 6], [11, 10], [11, 9], [12, 8], [13, 12], [14, 6], [15, 11], [15, 14], [16, 6], [17, 9], [17, 11], [17, 16], [18, 6], [19, 18], [19, 11], [20, 17], [21, 19], [22, 15], [23, 22], [24, 23], [25, 24], [26, 23], [29, 6], [30, 26], [30, 29], [30, 28], [31, 6], [32, 31], [32, 30], [33, 29], [33, 32], [33, 30], [34, 6], [35, 33], [35, 34], [36, 6], [37, 30], [37, 36], [37, 11], [37, 35], [37, 44], [37, 40], [38, 35], [38, 44], [38, 37], [38, 40], [38, 9], [38, 30], [38, 11], [38, 17], [39, 6], [40, 38], [40, 39], [41, 40], [41, 37], [42, 41], [43, 3], [44, 42], [44, 43], [45, 3], [46, 45], [46, 44], [48, 46]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_413BE0", "query": "\n\n\n__int64 __fastcall sub_413BE0(__int64 a1)\n{\n__int64 v1; // rax\nvoid *v2; // rax\nchar *v3; // rax\n__int64 v5; // [rsp+10h] [rbp-10h]\n_QWORD *v6; // [rsp+18h] [rbp-8h]\n\nv6 = (_QWORD *)(a1 + 64);\nv1 = *(_QWORD *)(a1 + 72);\n*(_QWORD *)(a1 + 72) = v1 - 1;\nif ( !v1 )\n{\nv5 = (*(__int64 (__fastcall **)(_QWORD, __int64))(a1 + 88))(*(_QWORD *)(a1 + 80), a1 + 72);\nif ( v5 )\nv2 = (void *)v5;\nelse\nv2 = &unk_43F63E;\n*v6 = v2;\n--*(_QWORD *)(a1 + 72);\n}\nv3 = (char *)(*v6)++;\n*(_DWORD *)(a1 + 112) = *v3;\nreturn *(unsigned int *)(a1 + 112);\n}\n\n\n\nQ:[a1,v5,v6,sub_413BE0,]", "hints": "[]", "response": "{'a1': 'lexer', 'v5': 's', 'v6': 'lr', 'sub_413BE0': 'next'}"}
[ [ 0.7876535058021545, 0.7752456665039062, 0.7657343745231628, 0.7593451738357544, 0.7582199573516846, 0.7522833347320557, 0.747136116027832, 0.7452712059020996, 0.7283024191856384, 0.7261497974395752, 0.7156135439872742, 0.7116822004318237, 0.7116802334785461, 0.7109331488609314, 0.7103018760681152, 0.7100502252578735, 0.7083273530006409, 0.7020344734191895, 0.7004315257072449, 0.699753999710083 ], [ 20593, 60857, 129926, 22143, 193324, 44675, 61513, 128038, 77609, 231082, 27709, 216460, 152700, 99750, 164215, 184885, 186587, 257024, 174500, 108784 ] ]
csum
af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4
rgerganov
nfqsed
NA
uint16_t csum(uint16_t proto, uint16_t len, uint16_t *src_addr, uint16_t *dest_addr, uint8_t *buff) { uint32_t sum = 0; int i = 0; sum += ntohs(src_addr[0]); sum += ntohs(src_addr[1]); sum += ntohs(dest_addr[0]); sum += ntohs(dest_addr[1]); sum += len; sum += proto; for (i=0; i<(len/2); i++) { sum += ntohs((buff[i*2+1] << 8) | buff[i*2]); } if ((len % 2) == 1) { sum += buff[len-1] << 8; } while (sum >> 16) { sum = (sum & 0xFFFF) + (sum >> 16); } sum = ~sum; return htons((uint16_t) sum); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40193C", "function_addr": 4200764, "binary_name": "af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov eax, esi"], [4, "mov [rbp+var_20], rdx"], [5, "mov [rbp+var_28], rcx"], [6, "mov [rbp+var_30], r8"], [7, "mov edx, edi"], [8, "mov [rbp+var_14], dx"], [9, "mov [rbp+var_18], ax"], [10, "mov [rbp+var_4], 0"], [11, "mov [rbp+var_8], 0"], [12, "mov rax, [rbp+var_20]"], [13, "movzx eax, word ptr [rax]"], [14, "movzx eax, ax"], [15, "mov edi, eax"], [16, "call _ntohs"], [17, "movzx eax, ax"], [18, "add [rbp+var_4], eax"], [19, "mov rax, [rbp+var_20]"], [20, "add rax, 2"], [21, "movzx eax, word ptr [rax]"], [22, "movzx eax, ax"], [23, "mov edi, eax"], [24, "call _ntohs"], [25, "movzx eax, ax"], [26, "add [rbp+var_4], eax"], [27, "mov rax, [rbp+var_28]"], [28, "movzx eax, word ptr [rax]"], [29, "movzx eax, ax"], [30, "mov edi, eax"], [31, "call _ntohs"], [32, "movzx eax, ax"], [33, "add [rbp+var_4], eax"], [34, "mov rax, [rbp+var_28]"], [35, "add rax, 2"], [36, "movzx eax, word ptr [rax]"], [37, "movzx eax, ax"], [38, "mov edi, eax"], [39, "call _ntohs"], [40, "movzx eax, ax"], [41, "add [rbp+var_4], eax"], [42, "movzx eax, [rbp+var_18]"], [43, "add [rbp+var_4], eax"], [44, "movzx eax, [rbp+var_14]"], [45, "add [rbp+var_4], eax"], [46, "mov [rbp+var_8], 0"], [47, "jmp short loc_401A2D"], [48, "mov eax, [rbp+var_8]"], [49, "add eax, eax"], [50, "cdqe"], [51, "lea rdx, [rax+1]"], [52, "mov rax, [rbp+var_30]"], [53, "add rax, rdx"], [54, "movzx eax, byte ptr [rax]"], [55, "movzx eax, al"], [56, "shl eax, 8"], [57, "mov ecx, eax"], [58, "mov eax, [rbp+var_8]"], [59, "add eax, eax"], [60, "movsxd rdx, eax"], [61, "mov rax, [rbp+var_30]"], [62, "add rax, rdx"], [63, "movzx eax, byte ptr [rax]"], [64, "movzx eax, al"], [65, "or eax, ecx"], [66, "movzx eax, ax"], [67, "mov edi, eax"], [68, "call _ntohs"], [69, "movzx eax, ax"], [70, "add [rbp+var_4], eax"], [71, "add [rbp+var_8], 1"], [72, "movzx eax, [rbp+var_18]"], [73, "shr ax, 1"], [74, "movzx eax, ax"], [75, "cmp [rbp+var_8], eax"], [76, "jl short loc_4019E5"], [77, "movzx eax, [rbp+var_18]"], [78, "and eax, 1"], [79, "test ax, ax"], [80, "jz short loc_401A76"], [81, "movzx eax, [rbp+var_18]"], [82, "lea rdx, [rax-1]"], [83, "mov rax, [rbp+var_30]"], [84, "add rax, rdx"], [85, "movzx eax, byte ptr [rax]"], [86, "movzx eax, al"], [87, "shl eax, 8"], [88, "add [rbp+var_4], eax"], [89, "jmp short loc_401A76"], [90, "mov eax, [rbp+var_4]"], [91, "movzx edx, ax"], [92, "mov eax, [rbp+var_4]"], [93, "shr eax, 10h"], [94, "add eax, edx"], [95, "mov [rbp+var_4], eax"], [96, "mov eax, [rbp+var_4]"], [97, "shr eax, 10h"], [98, "test eax, eax"], [99, "jnz short loc_401A65"], [100, "not [rbp+var_4]"], [101, "mov eax, [rbp+var_4]"], [102, "movzx eax, ax"], [103, "mov edi, eax"], [104, "call _htons"], [105, "leave"], [106, "retn"]], "data_dep": [[8, 7], [9, 3], [12, 4], [13, 12], [14, 13], [15, 14], [17, 16], [18, 17], [18, 10], [19, 4], [20, 19], [21, 20], [22, 21], [23, 22], [25, 24], [26, 25], [26, 18], [27, 5], [28, 27], [29, 28], [30, 29], [32, 31], [33, 26], [33, 32], [34, 5], [35, 34], [36, 35], [37, 36], [38, 37], [40, 39], [41, 40], [41, 33], [42, 9], [43, 41], [43, 42], [44, 8], [45, 43], [45, 44], [48, 46], [48, 71], [49, 48], [51, 7], [51, 49], [51, 60], [52, 6], [53, 52], [53, 51], [54, 53], [55, 54], [56, 55], [57, 56], [58, 46], [58, 71], [59, 58], [60, 59], [61, 6], [62, 60], [62, 61], [63, 62], [64, 63], [65, 64], [65, 57], [66, 65], [67, 66], [69, 68], [70, 70], [70, 45], [70, 69], [71, 71], [71, 46], [72, 9], [73, 72], [74, 73], [75, 74], [75, 71], [75, 46], [76, 75], [77, 9], [78, 77], [79, 78], [80, 79], [81, 9], [82, 81], [82, 60], [82, 7], [83, 6], [84, 83], [84, 82], [85, 84], [86, 85], [87, 86], [88, 45], [88, 87], [88, 70], [90, 88], [90, 70], [90, 45], [90, 95], [91, 90], [92, 88], [92, 70], [92, 45], [92, 95], [93, 92], [94, 91], [94, 93], [95, 94], [96, 95], [96, 88], [96, 70], [96, 45], [97, 96], [98, 97], [99, 98], [100, 70], [100, 45], [100, 95], [100, 88], [101, 100], [102, 101], [103, 102], [106, 104]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4_af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4.jsonl.gz", "strip_func_name": "sub_40193C", "query": "\n\n\nuint16_t __fastcall sub_40193C(unsigned __int16 a1, unsigned __int16 a2, uint16_t *a3, uint16_t *a4, __int64 a5)\n{\nint i; // [rsp+28h] [rbp-8h]\nint v10; // [rsp+2Ch] [rbp-4h]\nint v11; // [rsp+2Ch] [rbp-4h]\nint v12; // [rsp+2Ch] [rbp-4h]\nunsigned int v13; // [rsp+2Ch] [rbp-4h]\n\nv10 = ntohs(*a3);\nv11 = ntohs(a3[1]) + v10;\nv12 = ntohs(*a4) + v11;\nv13 = a1 + a2 + ntohs(a4[1]) + v12;\nfor ( i = 0; i < a2 >> 1; ++i )\nv13 += ntohs((*(unsigned __int8 *)(2 * i + 1LL + a5) << 8) | *(unsigned __int8 *)(2 * i + a5));\nif ( (a2 & 1) != 0 )\nv13 += *(unsigned __int8 *)(a2 - 1LL + a5) << 8;\nwhile ( HIWORD(v13) )\nv13 = (unsigned __int16)v13 + HIWORD(v13);\nreturn htons(~(_WORD)v13);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,v11,sub_40193C,]", "hints": "[]", "response": "{'a3': 'src_addr', 'a4': 'dest_addr', 'a1': 'proto', 'a2': 'len', 'a5': 'buff', 'v11': 'sumc', 'sub_40193C': 'csum'}"}
[ [ 0.7268831729888916, 0.6934459209442139, 0.6853477954864502, 0.6808587908744812, 0.6751129031181335, 0.6659454703330994, 0.6632806062698364, 0.6580217480659485, 0.656443178653717, 0.6562087535858154, 0.6539102792739868, 0.650536060333252, 0.6502382755279541, 0.6384410858154297, 0.6374378204345703, 0.6334997415542603, 0.6316987872123718, 0.6305060982704163, 0.6298844218254089, 0.6294581294059753 ], [ 195380, 227333, 166950, 241014, 86008, 126590, 202578, 170010, 71150, 11153, 213689, 179861, 201447, 27605, 14986, 176153, 239612, 179605, 77980, 257663 ] ]
get_hwmac
fd42e9348d5f9de247966e7e4bdec17c60c6ea503495bea4097fb16bc7c5097d
hak5
nano-tetra-packages-community
NA
int get_hwmac(char *ifname, uint8 *mac) { int sock = 0, result; struct ifreq irq; memset(&irq, 0, sizeof(struct iwreq)); strncpy(irq.ifr_name, ifname, IFNAMSIZ); if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return sock; if ((result = ioctl(sock, SIOCGIFHWADDR, &irq)) < 0) return result; memcpy(mac, irq.ifr_hwaddr.sa_data, 6); close(sock); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41B1D9", "function_addr": 4305369, "binary_name": "fd42e9348d5f9de247966e7e4bdec17c60c6ea503495bea4097fb16bc7c5097d.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+src], rdi"], [4, "mov [rbp+dest], rsi"], [5, "mov [rbp+fd], 0"], [6, "lea rax, [rbp+s]"], [7, "mov edx, 20h "], [8, "mov esi, 0"], [9, "mov rdi, rax"], [10, "call _memset"], [11, "mov rcx, [rbp+src]"], [12, "lea rax, [rbp+s]"], [13, "mov edx, 10h"], [14, "mov rsi, rcx"], [15, "mov rdi, rax"], [16, "call _strncpy"], [17, "mov edx, 0"], [18, "mov esi, 2"], [19, "mov edi, 2"], [20, "call _socket"], [21, "mov [rbp+fd], eax"], [22, "cmp [rbp+fd], 0"], [23, "jns short loc_41B240"], [24, "mov eax, [rbp+fd]"], [25, "jmp short locret_41B291"], [26, "lea rdx, [rbp+s]"], [27, "mov eax, [rbp+fd]"], [28, "mov esi, 8927h"], [29, "mov edi, eax"], [30, "mov eax, 0"], [31, "call _ioctl"], [32, "mov [rbp+var_8], eax"], [33, "cmp [rbp+var_8], 0"], [34, "jns short loc_41B266"], [35, "mov eax, [rbp+var_8]"], [36, "jmp short locret_41B291"], [37, "lea rax, [rbp+s]"], [38, "lea rcx, [rax+12h]"], [39, "mov rax, [rbp+dest]"], [40, "mov edx, 6"], [41, "mov rsi, rcx"], [42, "mov rdi, rax"], [43, "call _memcpy"], [44, "mov eax, [rbp+fd]"], [45, "mov edi, eax"], [46, "call _close"], [47, "mov eax, 0"], [48, "leave"], [49, "retn"]], "data_dep": [[9, 6], [11, 3], [12, 10], [14, 11], [15, 12], [21, 20], [22, 21], [23, 22], [24, 21], [26, 17], [27, 21], [29, 27], [32, 31], [33, 32], [34, 33], [35, 32], [37, 31], [38, 37], [38, 11], [39, 4], [41, 38], [42, 39], [44, 21], [45, 44], [49, 35], [49, 47], [49, 24]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/fd42e9348d5f9de247966e7e4bdec17c60c6ea503495bea4097fb16bc7c5097d_fd42e9348d5f9de247966e7e4bdec17c60c6ea503495bea4097fb16bc7c5097d.jsonl.gz", "strip_func_name": "sub_41B1D9", "query": "\n\n\n__int64 __fastcall sub_41B1D9(const char *a1, void *a2)\n{\nchar s[18]; // [rsp+10h] [rbp-30h] BYREF\n_BYTE v4[6]; // [rsp+22h] [rbp-1Eh] BYREF\nint v5; // [rsp+38h] [rbp-8h]\nint fd; // [rsp+3Ch] [rbp-4h]\n\nfd = 0;\nmemset(s, 0, 0x20uLL);\nstrncpy(s, a1, 0x10uLL);\nfd = socket(2, 2, 0);\nif ( fd < 0 )\nreturn (unsigned int)fd;\nv5 = ioctl(fd, 0x8927uLL, s);\nif ( v5 < 0 )\nreturn (unsigned int)v5;\nmemcpy(a2, v4, 6uLL);\nclose(fd);\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,s,v5,fd,sub_41B1D9,]", "hints": "[]", "response": "{'a1': 'ifname', 'a2': 'mac', 's': 'irq', 'v5': 'result', 'fd': 'sock', 'sub_41B1D9': 'get_hwmac'}"}
[ [ 0.8221064805984497, 0.7908427715301514, 0.7893944978713989, 0.782710075378418, 0.7798110842704773, 0.7726863622665405, 0.7648715376853943, 0.7560583353042603, 0.7555932402610779, 0.7553420662879944, 0.7552815079689026, 0.7530354857444763, 0.7502520084381104, 0.7481571435928345, 0.747174859046936, 0.7467483282089233, 0.7462755441665649, 0.7434900403022766, 0.7428547739982605, 0.7426443696022034 ], [ 221600, 124091, 147250, 131402, 56740, 34585, 181162, 187950, 187695, 141151, 205162, 107355, 88480, 110009, 19703, 102453, 7442, 143694, 58877, 244812 ] ]
loadFile
e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321
syoyo
tinyobjloader-c
NA
void loadFile(void *ctx, const char * filename, const int is_mtl, const char *obj_filename, char ** buffer, size_t * len) { long string_size = 0, read_size = 0; FILE * handler = fopen(filename, "r"); if (handler) { fseek(handler, 0, SEEK_END); string_size = ftell(handler); rewind(handler); *buffer = (char *) malloc(sizeof(char) * (string_size + 1)); read_size = fread(*buffer, sizeof(char), (size_t) string_size, handler); (*buffer)[string_size] = '\0'; if (string_size != read_size) { free(buffer); *buffer = NULL; } fclose(handler); } *len = read_size; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B0BF", "function_addr": 4239551, "binary_name": "e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+filename], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov [rbp+var_40], rcx"], [7, "mov [rbp+ptr], r8"], [8, "mov [rbp+var_50], r9"], [9, "mov [rbp+n], 0"], [10, "mov [rbp+var_8], 0"], [11, "mov rax, [rbp+filename]"], [12, "mov esi, offset modes"], [13, "mov rdi, rax"], [14, "call _fopen"], [15, "mov [rbp+stream], rax"], [16, "cmp [rbp+stream], 0"], [17, "jz loc_40B1B8"], [18, "mov rax, [rbp+stream]"], [19, "mov edx, 2"], [20, "mov esi, 0"], [21, "mov rdi, rax"], [22, "call _fseek"], [23, "mov rax, [rbp+stream]"], [24, "mov rdi, rax"], [25, "call _ftell"], [26, "mov [rbp+n], rax"], [27, "mov rax, [rbp+stream]"], [28, "mov rdi, rax"], [29, "call _rewind"], [30, "mov rax, [rbp+n]"], [31, "add rax, 1"], [32, "mov rdi, rax"], [33, "call _malloc"], [34, "mov rdx, rax"], [35, "mov rax, [rbp+ptr]"], [36, "mov [rax], rdx"], [37, "mov rdx, [rbp+n]"], [38, "mov rax, [rbp+ptr]"], [39, "mov rax, [rax]"], [40, "mov rcx, [rbp+stream]"], [41, "mov esi, 1"], [42, "mov rdi, rax"], [43, "call _fread"], [44, "mov [rbp+var_8], rax"], [45, "mov rax, [rbp+ptr]"], [46, "mov rdx, [rax]"], [47, "mov rax, [rbp+n]"], [48, "add rax, rdx"], [49, "mov byte ptr [rax], 0"], [50, "mov rax, [rbp+n]"], [51, "cmp rax, [rbp+var_8]"], [52, "jz short loc_40B1AC"], [53, "mov rax, [rbp+ptr]"], [54, "mov rdi, rax"], [55, "call _free"], [56, "mov rax, [rbp+ptr]"], [57, "mov qword ptr [rax], 0"], [58, "mov rax, [rbp+stream]"], [59, "mov rdi, rax"], [60, "call _fclose"], [61, "mov rdx, [rbp+var_8]"], [62, "mov rax, [rbp+var_50]"], [63, "mov [rax], rdx"], [64, "nop"], [65, "leave"], [66, "retn"]], "data_dep": [[11, 4], [13, 11], [15, 14], [16, 15], [17, 16], [18, 15], [21, 18], [23, 15], [24, 23], [26, 25], [27, 15], [28, 27], [30, 26], [31, 30], [32, 31], [34, 33], [35, 7], [36, 34], [36, 35], [37, 26], [38, 7], [39, 36], [39, 38], [40, 15], [42, 39], [44, 43], [45, 7], [46, 36], [46, 45], [47, 26], [48, 47], [48, 46], [49, 48], [50, 26], [51, 44], [51, 50], [52, 51], [53, 7], [54, 53], [56, 7], [57, 56], [58, 15], [59, 58], [61, 44], [61, 10], [62, 8], [63, 62], [63, 61], [66, 62]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321_e5369f8ea3aa9bc9d207427d8242ac333f2507a768b52b1cb96b47a0e805e321.jsonl.gz", "strip_func_name": "sub_40B0BF", "query": "\n\n\nsize_t *__fastcall sub_40B0BF(__int64 a1, const char *a2, __int64 a3, __int64 a4, void **a5, size_t *a6)\n{\nsize_t *result; // rax\nFILE *stream; // [rsp+38h] [rbp-18h]\n__int64 n; // [rsp+40h] [rbp-10h]\nsize_t v11; // [rsp+48h] [rbp-8h]\n\nv11 = 0LL;\nstream = fopen(a2, \"r\");\nif ( stream )\n{\nfseek(stream, 0LL, 2);\nn = ftell(stream);\nrewind(stream);\n*a5 = malloc(n + 1);\nv11 = fread(*a5, 1uLL, n, stream);\n*((_BYTE *)*a5 + n) = 0;\nif ( n != v11 )\n{\nfree(a5);\n*a5 = 0LL;\n}\nfclose(stream);\n}\nresult = a6;\n*a6 = v11;\nreturn result;\n}\n\n\n\nQ:[a2,a5,a6,a1,a3,a4,stream,n,v11,sub_40B0BF,]", "hints": "[]", "response": "{'a2': 'filename', 'a5': 'buffer', 'a6': 'len', 'a1': 'ctx', 'a3': 'is_mtl', 'a4': 'obj_filename', 'stream': 'handler', 'n': 'string_size', 'v11': 'read_size', 'sub_40B0BF': 'loadFile_0'}"}
[ [ 0.7570545077323914, 0.7570545077323914, 0.7376914620399475, 0.7302086353302002, 0.7301632165908813, 0.7301101684570312, 0.7275651693344116, 0.7272295355796814, 0.7261073589324951, 0.7233409881591797, 0.7232752442359924, 0.7213859558105469, 0.7209227085113525, 0.7192445993423462, 0.7139683961868286, 0.7137855291366577, 0.7136906385421753, 0.7128096222877502, 0.7124730348587036, 0.7121534943580627 ], [ 43914, 184225, 229418, 171136, 251875, 7321, 112641, 154396, 234169, 185158, 103747, 210546, 32027, 90645, 253120, 235327, 26374, 27442, 251941, 39504 ] ]
registerHandler
3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f
yquake2
yquake2
NA
void registerHandler(void) { /* Crash */ signal(SIGSEGV, signalhandler); signal(SIGILL, signalhandler); signal(SIGFPE, signalhandler); signal(SIGABRT, signalhandler); signal(SIGBUS, signalhandler); /* User abort */ signal(SIGINT, terminate); signal(SIGTERM, terminate); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4AD0DD", "function_addr": 4903133, "binary_name": "3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.elf_extract.pkl\n"}, "code": [[0, "sub rsp, 8"], [1, "mov esi, offset handler"], [2, "mov edi, 0Bh"], [3, "call _signal"], [4, "mov esi, offset handler"], [5, "mov edi, 4"], [6, "call _signal"], [7, "mov esi, offset handler"], [8, "mov edi, 8"], [9, "call _signal"], [10, "mov esi, offset handler"], [11, "mov edi, 6"], [12, "call _signal"], [13, "mov esi, offset handler"], [14, "mov edi, 7"], [15, "call _signal"], [16, "mov esi, offset sub_4AD0CD"], [17, "mov edi, 2"], [18, "call _signal"], [19, "mov esi, offset sub_4AD0CD"], [20, "mov edi, 0Fh"], [21, "call _signal"], [22, "nop"], [23, "add rsp, 8"], [24, "retn"]], "data_dep": [[23, 0], [24, 21]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f_3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.jsonl.gz", "strip_func_name": "sub_4AD0DD", "query": "\n\n\n__sighandler_t sub_4AD0DD()\n{\nsignal(11, (__sighandler_t)handler);\nsignal(4, (__sighandler_t)handler);\nsignal(8, (__sighandler_t)handler);\nsignal(6, (__sighandler_t)handler);\nsignal(7, (__sighandler_t)handler);\nsignal(2, (__sighandler_t)sub_4AD0CD);\nreturn signal(15, (__sighandler_t)sub_4AD0CD);\n}\n\n\n\nQ:[sub_4AD0DD,sub_4AD0CD,]", "hints": "[]", "response": "{'sub_4AD0DD': 'registerHandler', 'sub_4AD0CD': 'terminate'}"}
[ [ 0.9190798997879028, 0.9085841178894043, 0.8984804153442383, 0.8832036256790161, 0.8683445453643799, 0.8590482473373413, 0.8530687093734741, 0.8460264205932617, 0.8242191076278687, 0.820493757724762, 0.8150603771209717, 0.803217351436615, 0.7973954081535339, 0.7875236868858337, 0.7792598605155945, 0.7785636186599731, 0.7741337418556213, 0.7736127376556396, 0.7666617631912231, 0.7666505575180054 ], [ 14367, 126665, 184592, 154189, 47052, 112267, 217001, 98759, 113635, 249264, 88835, 14476, 80144, 15269, 132390, 177456, 48901, 57994, 7013, 195439 ] ]
udp_checksum
4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6
seclab-ucr
INTANG
NA
u_int16_t udp_checksum(char *packet, int len) { struct myiphdr *iphdr = (struct myiphdr*)packet; int iphdr_len = iphdr->ihl << 2; struct myudphdr *udphdr = (struct myudphdr*)(packet + iphdr_len); int udphdr_len = 8; int payload_len = len - iphdr_len - udphdr_len; // set udp checksum to zero udphdr->uh_sum = 0; // calculate checksum int ppkt_size = sizeof(struct pseudohdr) + udphdr_len + payload_len; char *ppkt = (char*)malloc(ppkt_size); struct pseudohdr *phdr = (struct pseudohdr*)ppkt; phdr->saddr = iphdr->saddr; phdr->daddr = iphdr->daddr; phdr->zero = 0; phdr->protocol = 17; // udp phdr->length = htons(udphdr_len + payload_len); memcpy(ppkt + sizeof(struct pseudohdr), packet + iphdr_len, udphdr_len + payload_len); u_int16_t *buf = (u_int16_t*)ppkt; int nbytes = ppkt_size; u_int32_t sum; sum = 0; while (nbytes > 1) { sum += *buf++; nbytes -= 2; } if (nbytes == 1) { sum += *((u_int8_t*)buf); } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); free(ppkt); return (u_int16_t) ~sum; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407AFF", "function_addr": 4225791, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_58], rdi"], [4, "mov [rbp+var_5C], esi"], [5, "mov rax, [rbp+var_58]"], [6, "mov [rbp+var_18], rax"], [7, "mov rax, [rbp+var_18]"], [8, "movzx eax, byte ptr [rax]"], [9, "and eax, 0Fh"], [10, "movzx eax, al"], [11, "shl eax, 2"], [12, "mov [rbp+var_1C], eax"], [13, "mov eax, [rbp+var_1C]"], [14, "movsxd rdx, eax"], [15, "mov rax, [rbp+var_58]"], [16, "add rax, rdx"], [17, "mov [rbp+var_28], rax"], [18, "mov [rbp+var_2C], 8"], [19, "mov eax, [rbp+var_5C]"], [20, "sub eax, [rbp+var_1C]"], [21, "sub eax, [rbp+var_2C]"], [22, "mov [rbp+var_30], eax"], [23, "mov rax, [rbp+var_28]"], [24, "mov word ptr [rax+6], 0"], [25, "mov edx, [rbp+var_2C]"], [26, "mov eax, [rbp+var_30]"], [27, "add eax, edx"], [28, "add eax, 0Ch"], [29, "mov [rbp+var_34], eax"], [30, "mov eax, [rbp+var_34]"], [31, "cdqe"], [32, "mov rdi, rax"], [33, "call _malloc"], [34, "mov [rbp+ptr], rax"], [35, "mov rax, [rbp+ptr]"], [36, "mov [rbp+var_48], rax"], [37, "mov rax, [rbp+var_18]"], [38, "mov edx, [rax+0Ch]"], [39, "mov rax, [rbp+var_48]"], [40, "mov [rax], edx"], [41, "mov rax, [rbp+var_18]"], [42, "mov edx, [rax+10h]"], [43, "mov rax, [rbp+var_48]"], [44, "mov [rax+4], edx"], [45, "mov rax, [rbp+var_48]"], [46, "mov byte ptr [rax+8], 0"], [47, "mov rax, [rbp+var_48]"], [48, "mov byte ptr [rax+9], 11h"], [49, "mov eax, [rbp+var_2C]"], [50, "mov edx, eax"], [51, "mov eax, [rbp+var_30]"], [52, "add eax, edx"], [53, "movzx eax, ax"], [54, "mov edi, eax"], [55, "call _htons"], [56, "mov rdx, [rbp+var_48]"], [57, "mov [rdx+0Ah], ax"], [58, "mov edx, [rbp+var_2C]"], [59, "mov eax, [rbp+var_30]"], [60, "add eax, edx"], [61, "cdqe"], [62, "mov edx, [rbp+var_1C]"], [63, "movsxd rcx, edx"], [64, "mov rdx, [rbp+var_58]"], [65, "lea rsi, [rcx+rdx]"], [66, "mov rdx, [rbp+ptr]"], [67, "lea rcx, [rdx+0Ch]"], [68, "mov rdx, rax"], [69, "mov rdi, rcx"], [70, "call _memcpy"], [71, "mov rax, [rbp+ptr]"], [72, "mov [rbp+var_8], rax"], [73, "mov eax, [rbp+var_34]"], [74, "mov [rbp+var_C], eax"], [75, "mov [rbp+var_10], 0"], [76, "jmp short loc_407C20"], [77, "mov rax, [rbp+var_8]"], [78, "lea rdx, [rax+2]"], [79, "mov [rbp+var_8], rdx"], [80, "movzx eax, word ptr [rax]"], [81, "movzx eax, ax"], [82, "add [rbp+var_10], eax"], [83, "sub [rbp+var_C], 2"], [84, "cmp [rbp+var_C], 1"], [85, "jg short loc_407C07"], [86, "cmp [rbp+var_C], 1"], [87, "jnz short loc_407C39"], [88, "mov rax, [rbp+var_8]"], [89, "movzx eax, byte ptr [rax]"], [90, "movzx eax, al"], [91, "add [rbp+var_10], eax"], [92, "mov eax, [rbp+var_10]"], [93, "shr eax, 10h"], [94, "mov edx, eax"], [95, "mov eax, [rbp+var_10]"], [96, "movzx eax, ax"], [97, "add eax, edx"], [98, "mov [rbp+var_10], eax"], [99, "mov eax, [rbp+var_10]"], [100, "shr eax, 10h"], [101, "add [rbp+var_10], eax"], [102, "mov rax, [rbp+ptr]"], [103, "mov rdi, rax"], [104, "call _free"], [105, "mov eax, [rbp+var_10]"], [106, "not eax"], [107, "leave"], [108, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 3], [16, 15], [16, 14], [17, 16], [19, 4], [20, 19], [20, 12], [21, 18], [21, 20], [22, 21], [23, 17], [24, 23], [25, 18], [26, 22], [27, 26], [27, 25], [28, 27], [29, 28], [30, 29], [32, 30], [34, 33], [35, 34], [36, 35], [37, 6], [38, 24], [38, 37], [39, 36], [40, 38], [40, 39], [41, 6], [42, 41], [42, 40], [43, 36], [44, 42], [44, 43], [45, 36], [46, 45], [47, 36], [48, 47], [49, 18], [50, 49], [51, 22], [52, 51], [52, 50], [53, 52], [54, 53], [56, 36], [57, 56], [57, 55], [58, 18], [59, 22], [60, 59], [60, 58], [62, 12], [63, 62], [64, 3], [65, 63], [65, 57], [66, 34], [67, 63], [67, 57], [67, 66], [68, 60], [69, 67], [71, 34], [72, 71], [73, 29], [74, 73], [77, 79], [77, 72], [78, 68], [78, 77], [78, 40], [78, 24], [78, 44], [78, 46], [78, 78], [78, 48], [78, 57], [79, 78], [80, 40], [80, 24], [80, 44], [80, 46], [80, 48], [80, 57], [80, 77], [81, 80], [82, 81], [82, 82], [82, 75], [83, 74], [83, 83], [84, 74], [84, 83], [85, 84], [86, 74], [86, 83], [87, 86], [88, 72], [88, 79], [89, 40], [89, 24], [89, 88], [89, 44], [89, 46], [89, 48], [89, 57], [90, 89], [91, 82], [91, 75], [91, 90], [92, 82], [92, 75], [92, 91], [93, 92], [94, 93], [95, 75], [95, 82], [95, 91], [96, 95], [97, 94], [97, 96], [98, 97], [99, 98], [100, 99], [101, 98], [101, 100], [102, 34], [103, 102], [105, 101], [106, 105], [108, 106]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6_4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.jsonl.gz", "strip_func_name": "sub_407AFF", "query": "\n\n\n__int64 __fastcall sub_407AFF(__int64 a1, int a2)\n{\nunsigned __int16 *v2; // rax\n_DWORD *ptr; // [rsp+20h] [rbp-40h]\nint v5; // [rsp+30h] [rbp-30h]\nint v6; // [rsp+44h] [rbp-1Ch]\nunsigned int v7; // [rsp+50h] [rbp-10h]\nint v8; // [rsp+54h] [rbp-Ch]\nunsigned __int16 *v9; // [rsp+58h] [rbp-8h]\n\nv6 = 4 * (*(_BYTE *)a1 & 0xF);\nv5 = a2 - v6 - 8;\n*(_WORD *)(v6 + a1 + 6) = 0;\nptr = malloc(v5 + 20);\n*ptr = *(_DWORD *)(a1 + 12);\nptr[1] = *(_DWORD *)(a1 + 16);\n*((_BYTE *)ptr + 8) = 0;\n*((_BYTE *)ptr + 9) = 17;\n*((_WORD *)ptr + 5) = htons(a2 - v6);\nmemcpy(ptr + 3, (const void *)(v6 + a1), a2 - v6);\nv9 = (unsigned __int16 *)ptr;\nv8 = v5 + 20;\nv7 = 0;\nwhile ( v8 > 1 )\n{\nv2 = v9++;\nv7 += *v2;\nv8 -= 2;\n}\nif ( v8 == 1 )\nv7 += *(unsigned __int8 *)v9;\nfree(ptr);\nreturn ~(((unsigned int)(HIWORD(v7) + (unsigned __int16)v7) >> 16) + HIWORD(v7) + (unsigned __int16)v7);\n}\n\n\n\nQ:[a1,a2,ptr,v5,v6,v7,v8,v9,sub_407AFF,]", "hints": "[]", "response": "{'a1': 'packet', 'a2': 'len', 'ptr': 'ppkt', 'v5': 'payload_len', 'v6': 'iphdr_len', 'v7': 'sum', 'v8': 'nbytes', 'v9': 'buf', 'sub_407AFF': 'udp_checksum'}"}
[ [ 0.7737606763839722, 0.7669647932052612, 0.7640476226806641, 0.7580239772796631, 0.757341742515564, 0.7564078569412231, 0.7524359226226807, 0.7506582736968994, 0.7442445755004883, 0.7435320615768433, 0.7367427349090576, 0.7340958714485168, 0.7240844368934631, 0.7234960198402405, 0.7216879725456238, 0.721373975276947, 0.7208062410354614, 0.7191318869590759, 0.7141692638397217, 0.7141143083572388 ], [ 205016, 110120, 69738, 41288, 122322, 206838, 91918, 204356, 262934, 37521, 57828, 207096, 67923, 107676, 33679, 225176, 220031, 51552, 76596, 137178 ] ]
udp_checksum
b67e388c3f50e2f370939d1427830c0c028c98e81fb853c23b2761cfbdfea679
vi
udptap_tunnel
NA
uint16_t udp_checksum(const void *buff, size_t len, in_addr_t src_addr, in_addr_t dest_addr) { const uint16_t *buf=buff; uint16_t *ip_src=(void *)&src_addr, *ip_dst=(void *)&dest_addr; uint32_t sum; size_t length=len; // Calculate the sum // sum = 0; while (len > 1) { sum += *buf++; if (sum & 0x80000000) sum = (sum & 0xFFFF) + (sum >> 16); len -= 2; } if ( len & 1 ) // Add the padding if the packet lenght is odd // sum += *((uint8_t *)buf); // Add the pseudo-header // sum += *(ip_src++); sum += *ip_src; sum += *(ip_dst++); sum += *ip_dst; sum += htons(IPPROTO_UDP); sum += htons(length); // Add the carries // while (sum >> 16) sum = (sum & 0xFFFF) + (sum >> 16); // Return the one's complement of sum // return ( (uint16_t)(~sum) ); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401182", "function_addr": 4198786, "binary_name": "b67e388c3f50e2f370939d1427830c0c028c98e81fb853c23b2761cfbdfea679.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+var_44], edx"], [6, "mov [rbp+var_48], ecx"], [7, "mov rax, [rbp+var_38]"], [8, "mov [rbp+var_8], rax"], [9, "lea rax, [rbp+var_44]"], [10, "mov [rbp+var_18], rax"], [11, "lea rax, [rbp+var_48]"], [12, "mov [rbp+var_20], rax"], [13, "mov rax, [rbp+var_40]"], [14, "mov [rbp+var_28], rax"], [15, "mov [rbp+var_C], 0"], [16, "jmp short loc_4011F3"], [17, "mov rax, [rbp+var_8]"], [18, "lea rdx, [rax+2]"], [19, "mov [rbp+var_8], rdx"], [20, "movzx eax, word ptr [rax]"], [21, "movzx eax, ax"], [22, "add [rbp+var_C], eax"], [23, "mov eax, [rbp+var_C]"], [24, "test eax, eax"], [25, "jns short loc_4011EE"], [26, "mov eax, [rbp+var_C]"], [27, "movzx edx, ax"], [28, "mov eax, [rbp+var_C]"], [29, "shr eax, 10h"], [30, "add eax, edx"], [31, "mov [rbp+var_C], eax"], [32, "sub [rbp+var_40], 2"], [33, "cmp [rbp+var_40], 1"], [34, "ja short loc_4011C1"], [35, "mov rax, [rbp+var_40]"], [36, "and eax, 1"], [37, "test rax, rax"], [38, "jz short loc_401213"], [39, "mov rax, [rbp+var_8]"], [40, "movzx eax, byte ptr [rax]"], [41, "movzx eax, al"], [42, "add [rbp+var_C], eax"], [43, "mov rax, [rbp+var_18]"], [44, "lea rdx, [rax+2]"], [45, "mov [rbp+var_18], rdx"], [46, "movzx eax, word ptr [rax]"], [47, "movzx eax, ax"], [48, "add [rbp+var_C], eax"], [49, "mov rax, [rbp+var_18]"], [50, "movzx eax, word ptr [rax]"], [51, "movzx eax, ax"], [52, "add [rbp+var_C], eax"], [53, "mov rax, [rbp+var_20]"], [54, "lea rdx, [rax+2]"], [55, "mov [rbp+var_20], rdx"], [56, "movzx eax, word ptr [rax]"], [57, "movzx eax, ax"], [58, "add [rbp+var_C], eax"], [59, "mov rax, [rbp+var_20]"], [60, "movzx eax, word ptr [rax]"], [61, "movzx eax, ax"], [62, "add [rbp+var_C], eax"], [63, "mov edi, 11h"], [64, "call _htons"], [65, "movzx eax, ax"], [66, "add [rbp+var_C], eax"], [67, "mov rax, [rbp+var_28]"], [68, "movzx eax, ax"], [69, "mov edi, eax"], [70, "call _htons"], [71, "movzx eax, ax"], [72, "add [rbp+var_C], eax"], [73, "jmp short loc_40128E"], [74, "mov eax, [rbp+var_C]"], [75, "movzx edx, ax"], [76, "mov eax, [rbp+var_C]"], [77, "shr eax, 10h"], [78, "add eax, edx"], [79, "mov [rbp+var_C], eax"], [80, "mov eax, [rbp+var_C]"], [81, "shr eax, 10h"], [82, "test eax, eax"], [83, "jnz short loc_40127D"], [84, "mov eax, [rbp+var_C]"], [85, "not eax"], [86, "leave"], [87, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 5], [9, 7], [10, 9], [11, 9], [11, 6], [12, 11], [13, 4], [14, 13], [17, 8], [17, 19], [18, 17], [18, 18], [18, 27], [19, 18], [20, 17], [21, 20], [22, 21], [22, 22], [22, 31], [22, 15], [23, 22], [24, 23], [25, 24], [26, 22], [27, 26], [28, 22], [29, 28], [30, 27], [30, 29], [31, 30], [32, 32], [32, 4], [33, 32], [33, 4], [34, 33], [35, 32], [35, 4], [36, 35], [37, 36], [38, 37], [39, 19], [39, 8], [40, 39], [41, 40], [42, 41], [42, 22], [42, 31], [42, 15], [43, 10], [44, 18], [44, 43], [44, 27], [45, 44], [46, 43], [47, 46], [48, 47], [48, 22], [48, 31], [48, 15], [48, 42], [49, 45], [50, 49], [51, 50], [52, 51], [52, 48], [53, 12], [54, 44], [54, 53], [55, 54], [56, 53], [57, 56], [58, 57], [58, 52], [59, 55], [60, 59], [61, 60], [62, 61], [62, 58], [65, 64], [66, 62], [66, 65], [67, 14], [68, 67], [69, 68], [71, 70], [72, 66], [72, 71], [74, 79], [74, 72], [75, 74], [76, 79], [76, 72], [77, 76], [78, 77], [78, 75], [79, 78], [80, 79], [80, 72], [81, 80], [82, 81], [83, 82], [84, 79], [84, 72], [85, 84], [87, 85]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b67e388c3f50e2f370939d1427830c0c028c98e81fb853c23b2761cfbdfea679_b67e388c3f50e2f370939d1427830c0c028c98e81fb853c23b2761cfbdfea679.jsonl.gz", "strip_func_name": "sub_401182", "query": "\n\n\n__int64 __fastcall sub_401182(unsigned __int8 *a1, __int64 a2, int a3, int a4)\n{\nunsigned __int16 *v4; // rax\nint *v5; // rax\nint *v6; // rax\nint v8; // [rsp+8h] [rbp-48h] BYREF\nint v9; // [rsp+Ch] [rbp-44h] BYREF\nunsigned __int64 v10; // [rsp+10h] [rbp-40h]\nunsigned __int8 *v11; // [rsp+18h] [rbp-38h]\n__int64 v12; // [rsp+28h] [rbp-28h]\nint *v13; // [rsp+30h] [rbp-20h]\nint *v14; // [rsp+38h] [rbp-18h]\nunsigned int v15; // [rsp+44h] [rbp-Ch]\nunsigned __int16 *v16; // [rsp+48h] [rbp-8h]\n\nv11 = a1;\nv10 = a2;\nv9 = a3;\nv8 = a4;\nv16 = (unsigned __int16 *)a1;\nv14 = &v9;\nv13 = &v8;\nv12 = a2;\nv15 = 0;\nwhile ( v10 > 1 )\n{\nv4 = v16++;\nv15 += *v4;\nif ( (v15 & 0x80000000) != 0 )\nv15 = (unsigned __int16)v15 + HIWORD(v15);\nv10 -= 2LL;\n}\nif ( (v10 & 1) != 0 )\nv15 += *(unsigned __int8 *)v16;\nv5 = v14;\nv14 = (int *)((char *)v14 + 2);\nv15 += *(unsigned __int16 *)v5;\nv15 += *(unsigned __int16 *)v14;\nv6 = v13;\nv13 = (int *)((char *)v13 + 2);\nv15 += *(unsigned __int16 *)v6;\nv15 += *(unsigned __int16 *)v13;\nv15 += htons(0x11u);\nfor ( v15 += htons(v12); HIWORD(v15); v15 = (unsigned __int16)v15 + HIWORD(v15) )\n;\nreturn ~v15;\n}\n\n\n\nQ:[a3,a4,a1,a2,v8,v9,v10,v11,v12,v13,v14,v15,v16,sub_401182,]", "hints": "[]", "response": "{'a3': 'src_addr', 'a4': 'dest_addr', 'a1': 'buff', 'a2': 'len', 'v8': 'dest_addra', 'v9': 'src_addra', 'v10': 'lena', 'v11': 'buffa', 'v12': 'length', 'v13': 'ip_dst', 'v14': 'ip_src', 'v15': 'sum', 'v16': 'buf', 'sub_401182': 'udp_checksum'}"}
[ [ 0.7719649076461792, 0.7389470934867859, 0.7222216725349426, 0.7117835879325867, 0.704664945602417, 0.7004375457763672, 0.7002667188644409, 0.6961187124252319, 0.692473292350769, 0.6919752955436707, 0.6890866756439209, 0.6883810758590698, 0.6851105690002441, 0.6846228837966919, 0.6804149150848389, 0.6792073845863342, 0.6779292821884155, 0.6776974201202393, 0.6776096224784851, 0.6762999892234802 ], [ 192696, 253061, 168725, 111513, 46550, 143033, 258861, 19392, 253239, 32323, 169276, 63125, 196019, 59134, 95295, 90417, 167413, 113249, 157195, 55703 ] ]
tcp_checksum
4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6
seclab-ucr
INTANG
NA
u_int16_t tcp_checksum(char *packet, int len) { struct myiphdr *iphdr = (struct myiphdr*)packet; int iphdr_len = iphdr->ihl << 2; struct mytcphdr *tcphdr = (struct mytcphdr*)(packet + iphdr_len); int tcphdr_len = tcphdr->th_off << 2; int payload_len = len - iphdr_len - tcphdr_len; // set tcp checksum to zero tcphdr->th_sum = 0; // calculate checksum int ppkt_size = sizeof(struct pseudohdr) + tcphdr_len + payload_len; char *ppkt = (char*)malloc(ppkt_size); struct pseudohdr *phdr = (struct pseudohdr*)ppkt; phdr->saddr = iphdr->saddr; phdr->daddr = iphdr->daddr; phdr->zero = 0; phdr->protocol = 6; // tcp phdr->length = htons(tcphdr_len + payload_len); memcpy(ppkt + sizeof(struct pseudohdr), packet + iphdr_len, tcphdr_len + payload_len); u_int16_t *buf = (u_int16_t*)ppkt; int nbytes = ppkt_size; u_int32_t sum; sum = 0; while (nbytes > 1) { sum += *buf++; nbytes -= 2; } if (nbytes == 1) { sum += *((u_int8_t*)buf); } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); free(ppkt); return (u_int16_t) ~sum; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407989", "function_addr": 4225417, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_58], rdi"], [4, "mov [rbp+var_5C], esi"], [5, "mov rax, [rbp+var_58]"], [6, "mov [rbp+var_18], rax"], [7, "mov rax, [rbp+var_18]"], [8, "movzx eax, byte ptr [rax]"], [9, "and eax, 0Fh"], [10, "movzx eax, al"], [11, "shl eax, 2"], [12, "mov [rbp+var_1C], eax"], [13, "mov eax, [rbp+var_1C]"], [14, "movsxd rdx, eax"], [15, "mov rax, [rbp+var_58]"], [16, "add rax, rdx"], [17, "mov [rbp+var_28], rax"], [18, "mov rax, [rbp+var_28]"], [19, "movzx eax, byte ptr [rax+0Ch]"], [20, "shr al, 4"], [21, "movzx eax, al"], [22, "shl eax, 2"], [23, "mov [rbp+var_2C], eax"], [24, "mov eax, [rbp+var_5C]"], [25, "sub eax, [rbp+var_1C]"], [26, "sub eax, [rbp+var_2C]"], [27, "mov [rbp+var_30], eax"], [28, "mov rax, [rbp+var_28]"], [29, "mov word ptr [rax+10h], 0"], [30, "mov edx, [rbp+var_2C]"], [31, "mov eax, [rbp+var_30]"], [32, "add eax, edx"], [33, "add eax, 0Ch"], [34, "mov [rbp+var_34], eax"], [35, "mov eax, [rbp+var_34]"], [36, "cdqe"], [37, "mov rdi, rax"], [38, "call _malloc"], [39, "mov [rbp+ptr], rax"], [40, "mov rax, [rbp+ptr]"], [41, "mov [rbp+var_48], rax"], [42, "mov rax, [rbp+var_18]"], [43, "mov edx, [rax+0Ch]"], [44, "mov rax, [rbp+var_48]"], [45, "mov [rax], edx"], [46, "mov rax, [rbp+var_18]"], [47, "mov edx, [rax+10h]"], [48, "mov rax, [rbp+var_48]"], [49, "mov [rax+4], edx"], [50, "mov rax, [rbp+var_48]"], [51, "mov byte ptr [rax+8], 0"], [52, "mov rax, [rbp+var_48]"], [53, "mov byte ptr [rax+9], 6"], [54, "mov eax, [rbp+var_2C]"], [55, "mov edx, eax"], [56, "mov eax, [rbp+var_30]"], [57, "add eax, edx"], [58, "movzx eax, ax"], [59, "mov edi, eax"], [60, "call _htons"], [61, "mov rdx, [rbp+var_48]"], [62, "mov [rdx+0Ah], ax"], [63, "mov edx, [rbp+var_2C]"], [64, "mov eax, [rbp+var_30]"], [65, "add eax, edx"], [66, "cdqe"], [67, "mov edx, [rbp+var_1C]"], [68, "movsxd rcx, edx"], [69, "mov rdx, [rbp+var_58]"], [70, "lea rsi, [rcx+rdx]"], [71, "mov rdx, [rbp+ptr]"], [72, "lea rcx, [rdx+0Ch]"], [73, "mov rdx, rax"], [74, "mov rdi, rcx"], [75, "call _memcpy"], [76, "mov rax, [rbp+ptr]"], [77, "mov [rbp+var_8], rax"], [78, "mov eax, [rbp+var_34]"], [79, "mov [rbp+var_C], eax"], [80, "mov [rbp+var_10], 0"], [81, "jmp short loc_407AB7"], [82, "mov rax, [rbp+var_8]"], [83, "lea rdx, [rax+2]"], [84, "mov [rbp+var_8], rdx"], [85, "movzx eax, word ptr [rax]"], [86, "movzx eax, ax"], [87, "add [rbp+var_10], eax"], [88, "sub [rbp+var_C], 2"], [89, "cmp [rbp+var_C], 1"], [90, "jg short loc_407A9E"], [91, "cmp [rbp+var_C], 1"], [92, "jnz short loc_407AD0"], [93, "mov rax, [rbp+var_8]"], [94, "movzx eax, byte ptr [rax]"], [95, "movzx eax, al"], [96, "add [rbp+var_10], eax"], [97, "mov eax, [rbp+var_10]"], [98, "shr eax, 10h"], [99, "mov edx, eax"], [100, "mov eax, [rbp+var_10]"], [101, "movzx eax, ax"], [102, "add eax, edx"], [103, "mov [rbp+var_10], eax"], [104, "mov eax, [rbp+var_10]"], [105, "shr eax, 10h"], [106, "add [rbp+var_10], eax"], [107, "mov rax, [rbp+ptr]"], [108, "mov rdi, rax"], [109, "call _free"], [110, "mov eax, [rbp+var_10]"], [111, "not eax"], [112, "leave"], [113, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 3], [16, 15], [16, 14], [17, 16], [18, 17], [19, 18], [20, 19], [21, 20], [22, 21], [23, 22], [24, 4], [25, 24], [25, 12], [26, 23], [26, 25], [27, 26], [28, 17], [29, 28], [30, 23], [31, 27], [32, 30], [32, 31], [33, 32], [34, 33], [35, 34], [37, 35], [39, 38], [40, 39], [41, 40], [42, 6], [43, 29], [43, 42], [44, 41], [45, 43], [45, 44], [46, 6], [47, 45], [47, 29], [47, 46], [48, 41], [49, 48], [49, 47], [50, 41], [51, 50], [52, 41], [53, 52], [54, 23], [55, 54], [56, 27], [57, 56], [57, 55], [58, 57], [59, 58], [61, 41], [62, 60], [62, 61], [63, 23], [64, 27], [65, 63], [65, 64], [67, 12], [68, 67], [69, 3], [70, 68], [70, 62], [71, 39], [72, 68], [72, 62], [72, 71], [73, 65], [74, 72], [76, 39], [77, 76], [78, 34], [79, 78], [82, 84], [82, 77], [83, 62], [83, 73], [83, 82], [83, 45], [83, 29], [83, 49], [83, 51], [83, 53], [83, 83], [84, 83], [85, 82], [85, 45], [85, 29], [85, 49], [85, 51], [85, 53], [85, 62], [86, 85], [87, 80], [87, 86], [87, 87], [88, 79], [88, 88], [89, 79], [89, 88], [90, 89], [91, 79], [91, 88], [92, 91], [93, 77], [93, 84], [94, 62], [94, 45], [94, 29], [94, 93], [94, 49], [94, 51], [94, 53], [95, 94], [96, 95], [96, 87], [96, 80], [97, 87], [97, 96], [97, 80], [98, 97], [99, 98], [100, 87], [100, 96], [100, 80], [101, 100], [102, 99], [102, 101], [103, 102], [104, 103], [105, 104], [106, 103], [106, 105], [107, 39], [108, 107], [110, 106], [111, 110], [113, 111]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6_4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.jsonl.gz", "strip_func_name": "sub_407989", "query": "\n\n\n__int64 __fastcall sub_407989(__int64 a1, int a2)\n{\nunsigned __int16 *v2; // rax\n_DWORD *ptr; // [rsp+20h] [rbp-40h]\nint v5; // [rsp+44h] [rbp-1Ch]\nunsigned int v6; // [rsp+50h] [rbp-10h]\nint v7; // [rsp+54h] [rbp-Ch]\nunsigned __int16 *v8; // [rsp+58h] [rbp-8h]\n\nv5 = 4 * (*(_BYTE *)a1 & 0xF);\n*(_WORD *)(v5 + a1 + 16) = 0;\nptr = malloc(a2 - v5 + 12);\n*ptr = *(_DWORD *)(a1 + 12);\nptr[1] = *(_DWORD *)(a1 + 16);\n*((_BYTE *)ptr + 8) = 0;\n*((_BYTE *)ptr + 9) = 6;\n*((_WORD *)ptr + 5) = htons(a2 - v5);\nmemcpy(ptr + 3, (const void *)(v5 + a1), a2 - v5);\nv8 = (unsigned __int16 *)ptr;\nv7 = a2 - v5 + 12;\nv6 = 0;\nwhile ( v7 > 1 )\n{\nv2 = v8++;\nv6 += *v2;\nv7 -= 2;\n}\nif ( v7 == 1 )\nv6 += *(unsigned __int8 *)v8;\nfree(ptr);\nreturn ~(((unsigned int)(HIWORD(v6) + (unsigned __int16)v6) >> 16) + HIWORD(v6) + (unsigned __int16)v6);\n}\n\n\n\nQ:[a1,a2,ptr,v5,v6,v7,v8,sub_407989,]", "hints": "[]", "response": "{'a1': 'packet', 'a2': 'len', 'ptr': 'ppkt', 'v5': 'iphdr_len', 'v6': 'sum', 'v7': 'nbytes', 'v8': 'buf', 'sub_407989': 'tcp_checksum'}"}
[ [ 0.7734753489494324, 0.7682689428329468, 0.7618411779403687, 0.7559189796447754, 0.7541839480400085, 0.7539545297622681, 0.7528284788131714, 0.751815676689148, 0.7481661438941956, 0.744723379611969, 0.7423745393753052, 0.7303943634033203, 0.7293968796730042, 0.7259875535964966, 0.7255227565765381, 0.7251362204551697, 0.7244831919670105, 0.7224709987640381, 0.7208345532417297, 0.7167634963989258 ], [ 69738, 205016, 110120, 37521, 122322, 41288, 206838, 262934, 91918, 204356, 107676, 207096, 33679, 225176, 57828, 40315, 137178, 156086, 14591, 67923 ] ]
printUsage
c137d2e1de0eb5fa8b6d0867b12f020688b47a2ce12e25753c30d5076b60dbca
yquake2
pakextract
NA
static void printUsage(const char* argv0) { fprintf(stderr, "Extractor for Quake/Quake2 (and compatible) and Daikatana .pak and Sin .sin files\n"); fprintf(stderr, "Usage: %s [-l] [-dk] [-o output dir] pakfile\n", argv0); fprintf(stderr, " -l don't extract, just list contents\n"); fprintf(stderr, " -dk Daikatana pak format (Quake is default, Sin is detected automatically)\n"); fprintf(stderr, " -o directory to extract to\n"); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401CB2", "function_addr": 4201650, "binary_name": "c137d2e1de0eb5fa8b6d0867b12f020688b47a2ce12e25753c30d5076b60dbca.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, cs:stderr"], [5, "mov rcx, rax"], [6, "mov edx, 52h "], [7, "mov esi, 1"], [8, "mov edi, offset aExtractorForQu"], [9, "call _fwrite"], [10, "mov rax, cs:stderr"], [11, "mov rdx, [rbp+var_8]"], [12, "mov esi, offset aUsageSLDkOOutp"], [13, "mov rdi, rax"], [14, "mov eax, 0"], [15, "call _fprintf"], [16, "mov rax, cs:stderr"], [17, "mov rcx, rax"], [18, "mov edx, 30h "], [19, "mov esi, 1"], [20, "mov edi, offset aLDonTExtractJu"], [21, "call _fwrite"], [22, "mov rax, cs:stderr"], [23, "mov rcx, rax"], [24, "mov edx, 55h "], [25, "mov esi, 1"], [26, "mov edi, offset aDkDaikatanaPak"], [27, "call _fwrite"], [28, "mov rax, cs:stderr"], [29, "mov rcx, rax"], [30, "mov edx, 26h "], [31, "mov esi, 1"], [32, "mov edi, offset aODirectoryToEx"], [33, "call _fwrite"], [34, "nop"], [35, "leave"], [36, "retn"]], "data_dep": [[5, 4], [11, 3], [13, 10], [17, 16], [23, 22], [29, 28], [36, 33]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/c137d2e1de0eb5fa8b6d0867b12f020688b47a2ce12e25753c30d5076b60dbca_c137d2e1de0eb5fa8b6d0867b12f020688b47a2ce12e25753c30d5076b60dbca.jsonl.gz", "strip_func_name": "sub_401CB2", "query": "\n\n\nsize_t __fastcall sub_401CB2(const char *a1)\n{\nfwrite(\"Extractor for Quake/Quake2 (and compatible) and Daikatana .pak and Sin .sin files\\n\", 1uLL, 0x52uLL, stderr);\nfprintf(stderr, \"Usage: %s [-l] [-dk] [-o output dir] pakfile\\n\", a1);\nfwrite(\" -l don't extract, just list contents\\n\", 1uLL, 0x30uLL, stderr);\nfwrite(\n\" -dk Daikatana pak format (Quake is default, Sin is detected automatically)\\n\",\n1uLL,\n0x55uLL,\nstderr);\nreturn fwrite(\" -o directory to extract to\\n\", 1uLL, 0x26uLL, stderr);\n}\n\n\n\nQ:[a1,sub_401CB2,]", "hints": "[]", "response": "{'a1': 'argv0', 'sub_401CB2': 'printUsage'}"}
[ [ 0.9382725358009338, 0.932127058506012, 0.9262474775314331, 0.9245491027832031, 0.9217036366462708, 0.9213629961013794, 0.9177230596542358, 0.9162498712539673, 0.916241466999054, 0.9153456091880798, 0.914979875087738, 0.9132633209228516, 0.9115373492240906, 0.9111757874488831, 0.9107570648193359, 0.9104007482528687, 0.9103996157646179, 0.9092839360237122, 0.9090407490730286, 0.9075292348861694 ], [ 168448, 75172, 119442, 48862, 47463, 186716, 4500, 18139, 244587, 168926, 261475, 233964, 178997, 260905, 163080, 148901, 187859, 240059, 191058, 207935 ] ]
read_pidfile
1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88
tj
mon
NA
pid_t read_pidfile(const char *file) { off_t size; struct stat s; // stat if (stat(file, &s) < 0) { perror("stat()"); exit(1); } size = s.st_size; // opens int fd = open(file, O_RDONLY, 0); if (fd < 0) { perror("open()"); exit(1); } // read char buf[size]; if (size != read(fd, buf, size)) { perror("read()"); exit(1); } return atoi(buf); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4014A9", "function_addr": 4199593, "binary_name": "1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r15"], [3, "push r14"], [4, "push r13"], [5, "push r12"], [6, "push rbx"], [7, "sub rsp, 0C8h"], [8, "mov [rbp+file], rdi"], [9, "mov rax, rsp"], [10, "mov rbx, rax"], [11, "lea rdx, [rbp+stat_buf]"], [12, "mov rax, [rbp+file]"], [13, "mov rsi, rdx"], [14, "mov rdi, rax"], [15, "call sub_403810"], [16, "test eax, eax"], [17, "jns short loc_4014FB"], [18, "mov edi, offset aStat"], [19, "call _perror"], [20, "mov edi, 1"], [21, "call _exit"], [22, "mov rax, [rbp+stat_buf.st_size]"], [23, "mov [rbp+nbytes], rax"], [24, "mov rax, [rbp+file]"], [25, "mov edx, 0"], [26, "mov esi, 0"], [27, "mov rdi, rax"], [28, "mov eax, 0"], [29, "call _open"], [30, "mov [rbp+fd], eax"], [31, "cmp [rbp+fd], 0"], [32, "jns short loc_401541"], [33, "mov edi, offset s"], [34, "call _perror"], [35, "mov edi, 1"], [36, "call _exit"], [37, "mov rax, [rbp+nbytes]"], [38, "lea rdx, [rax-1]"], [39, "mov [rbp+var_48], rdx"], [40, "mov rdx, rax"], [41, "mov r14, rdx"], [42, "mov r15d, 0"], [43, "mov rdx, rax"], [44, "mov r12, rdx"], [45, "mov r13d, 0"], [46, "mov rdx, rax"], [47, "mov eax, 10h"], [48, "sub rax, 1"], [49, "add rax, rdx"], [50, "mov ecx, 10h"], [51, "mov edx, 0"], [52, "div rcx"], [53, "imul rax, 10h"], [54, "sub rsp, rax"], [55, "mov rax, rsp"], [56, "add rax, 0"], [57, "mov [rbp+buf], rax"], [58, "mov rdx, [rbp+nbytes]"], [59, "mov rcx, [rbp+buf]"], [60, "mov eax, [rbp+fd]"], [61, "mov rsi, rcx"], [62, "mov edi, eax"], [63, "call _read"], [64, "cmp [rbp+nbytes], rax"], [65, "jz short loc_4015C2"], [66, "mov edi, offset aRead_0"], [67, "call _perror"], [68, "mov edi, 1"], [69, "call _exit"], [70, "mov rax, [rbp+buf]"], [71, "mov rdi, rax"], [72, "call _atoi"], [73, "mov rsp, rbx"], [74, "lea rsp, [rbp-28h]"], [75, "pop rbx"], [76, "pop r12"], [77, "pop r13"], [78, "pop r14"], [79, "pop r15"], [80, "pop rbp"], [81, "retn"]], "data_dep": [[9, 7], [10, 9], [12, 8], [13, 11], [14, 12], [16, 15], [17, 16], [23, 22], [24, 8], [27, 24], [30, 29], [31, 30], [32, 31], [37, 23], [38, 25], [38, 37], [39, 38], [40, 37], [41, 40], [43, 37], [44, 43], [46, 37], [48, 47], [49, 46], [49, 48], [52, 50], [53, 49], [54, 7], [54, 53], [55, 54], [56, 55], [57, 56], [58, 23], [59, 57], [60, 30], [61, 59], [62, 60], [64, 23], [64, 63], [65, 64], [70, 57], [71, 70], [73, 10], [74, 73], [75, 6], [76, 5], [77, 4], [78, 3], [79, 2], [80, 0], [81, 72]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88_1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88.jsonl.gz", "strip_func_name": "sub_4014A9", "query": "\n\n\nint __fastcall sub_4014A9(char *a1)\n{\nvoid *v1; // rsp\nssize_t v2; // rax\n__int64 v4; // [rsp+0h] [rbp-F0h] BYREF\nchar *file; // [rsp+8h] [rbp-E8h]\nstruct stat stat_buf; // [rsp+10h] [rbp-E0h] BYREF\nvoid *buf; // [rsp+A0h] [rbp-50h]\nsize_t v8; // [rsp+A8h] [rbp-48h]\nint fd; // [rsp+B4h] [rbp-3Ch]\nsize_t nbytes; // [rsp+B8h] [rbp-38h]\n\nfile = a1;\nif ( (int)sub_403810(a1, &stat_buf) < 0 )\n{\nperror(\"stat()\");\nexit(1);\n}\nnbytes = stat_buf.st_size;\nfd = open(file, 0, 0LL);\nif ( fd < 0 )\n{\nperror(\"open()\");\nexit(1);\n}\nv8 = nbytes - 1;\nv1 = alloca(16 * ((nbytes + 15) / 0x10));\nbuf = &v4;\nv2 = read(fd, &v4, nbytes);\nif ( nbytes != v2 )\n{\nperror(\"read()\");\nexit(1);\n}\nreturn atoi((const char *)buf);\n}\n\n\n\nQ:[a1,file,stat_buf,buf,nbytes,sub_4014A9,sub_403810,]", "hints": "[]", "response": "{'a1': 'file', 'file': 'filea', 'stat_buf': 's', 'buf': 'p_buf', 'nbytes': 'size', 'sub_4014A9': 'read_pidfile', 'sub_403810': 'stat_0'}"}
[ [ 0.7673712968826294, 0.7662517428398132, 0.7534601092338562, 0.7519298195838928, 0.7491644620895386, 0.7451977729797363, 0.7431366443634033, 0.7430797815322876, 0.7380674481391907, 0.7376158237457275, 0.7359986305236816, 0.7349235415458679, 0.7249178886413574, 0.723421573638916, 0.7222457528114319, 0.7218315005302429, 0.7209359407424927, 0.7168065309524536, 0.7159818410873413, 0.7152917981147766 ], [ 246712, 229440, 99082, 85044, 172742, 107603, 248891, 175663, 212478, 215428, 229534, 90247, 94057, 106108, 159096, 215011, 9980, 133228, 120758, 67649 ] ]
printUsage
ac1718121997d9982448c718e502d1d7999795794e9643c872da874a96d3e072
GBert
railroad
NA
void printUsage(char *prg) { fprintf(stderr, "\nUsage: %s -f <update file> -t <target uid>\n", prg); fprintf(stderr, " Version: %s\n\n", VERSION); fprintf(stderr, " -f <update file> path to the update file in intel hex format\n"); fprintf(stderr, " -t <target uid> CAN UID of the device to be updated\n\n"); fprintf(stderr, " -s use slow mode in case of falure or to look at the can-monitor\n\n"); fprintf(stderr, " -h show this help\n\n"); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4014D6", "function_addr": 4199638, "binary_name": "ac1718121997d9982448c718e502d1d7999795794e9643c872da874a96d3e072.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, cs:stderr"], [5, "mov rdx, [rbp+var_8]"], [6, "mov esi, offset aUsageSFUpdateF"], [7, "mov rdi, rax"], [8, "mov eax, 0"], [9, "call _fprintf"], [10, "mov rax, cs:stderr"], [11, "mov edx, offset a202001161"], [12, "mov esi, offset aVersionS"], [13, "mov rdi, rax"], [14, "mov eax, 0"], [15, "call _fprintf"], [16, "mov rax, cs:stderr"], [17, "mov rcx, rax"], [18, "mov edx, 46h "], [19, "mov esi, 1"], [20, "mov edi, offset aFUpdateFilePat"], [21, "call _fwrite"], [22, "mov rax, cs:stderr"], [23, "mov rcx, rax"], [24, "mov edx, 3Fh "], [25, "mov esi, 1"], [26, "mov edi, offset aTTargetUidCanU"], [27, "call _fwrite"], [28, "mov rax, cs:stderr"], [29, "mov rcx, rax"], [30, "mov edx, 59h "], [31, "mov esi, 1"], [32, "mov edi, offset aSUseSlowModeIn"], [33, "call _fwrite"], [34, "mov rax, cs:stderr"], [35, "mov rcx, rax"], [36, "mov edx, 2Ah "], [37, "mov esi, 1"], [38, "mov edi, offset aHShowThisHelp"], [39, "call _fwrite"], [40, "nop"], [41, "leave"], [42, "retn"]], "data_dep": [[5, 3], [7, 4], [13, 10], [17, 16], [23, 22], [29, 28], [35, 34], [42, 39]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ac1718121997d9982448c718e502d1d7999795794e9643c872da874a96d3e072_ac1718121997d9982448c718e502d1d7999795794e9643c872da874a96d3e072.jsonl.gz", "strip_func_name": "sub_4014D6", "query": "\n\n\nsize_t __fastcall sub_4014D6(const char *a1)\n{\nfprintf(stderr, \"\\nUsage: %s -f <update file> -t <target uid>\\n\", a1);\nfprintf(stderr, \" Version: %s\\n\\n\", \"[2020-01-16.1]\");\nfwrite(\" -f <update file> path to the update file in intel hex format\\n\", 1uLL, 0x46uLL, stderr);\nfwrite(\" -t <target uid> CAN UID of the device to be updated\\n\\n\", 1uLL, 0x3FuLL, stderr);\nfwrite(\n\" -s use slow mode in case of falure or to look at the can-monitor\\n\\n\",\n1uLL,\n0x59uLL,\nstderr);\nreturn fwrite(\" -h show this help\\n\\n\", 1uLL, 0x2AuLL, stderr);\n}\n\n\n\nQ:[a1,sub_4014D6,]", "hints": "[]", "response": "{'a1': 'prg', 'sub_4014D6': 'printUsage'}"}
[ [ 0.952314019203186, 0.9333682656288147, 0.9317011833190918, 0.9298869371414185, 0.928992748260498, 0.9280182719230652, 0.9274174571037292, 0.9261175990104675, 0.9256104230880737, 0.9241524934768677, 0.9225192070007324, 0.9218547940254211, 0.9217469692230225, 0.9215624928474426, 0.9213505387306213, 0.920792281627655, 0.9186630845069885, 0.9184371829032898, 0.9171697497367859, 0.9170453548431396 ], [ 168448, 48862, 119442, 75172, 244587, 187859, 186716, 47463, 261475, 233964, 4500, 46781, 60341, 126484, 207935, 178997, 240059, 52369, 247140, 168926 ] ]
lf_queue_pop
02ee8dd89a5a3f1bd68df2894715cd27f937b8d721d3a7b42127aff74759f7cc
haipome
lock_free_queue
NA
int lf_queue_pop(lf_queue queue, void *unit) { if (!queue || !unit) return -2; volatile queue_head *head = queue; volatile unit_head *u_head; /* 检查队列是否可读 */ int32_t r_len; do { if ((r_len = head->r_len) <= 0) return -1; } while (!__sync_bool_compare_and_swap(&head->r_len, r_len, r_len - 1)); /* 从链表头取出一个单元 */ int32_t p_head; do { p_head = head->p_head; u_head = UNIT_HEAD(queue, p_head); } while (!__sync_bool_compare_and_swap(&head->p_head, p_head, u_head->next)); /* 读数据 */ memcpy(unit, UNIT_DATA(queue, u_head->next), head->unit_size); /* 更新单元头 */ UNIT_HEAD(queue, u_head->next)->use_flag = false; /* 更新写计数器 */ __sync_fetch_and_sub(&head->w_len, 1); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401696", "function_addr": 4200086, "binary_name": "02ee8dd89a5a3f1bd68df2894715cd27f937b8d721d3a7b42127aff74759f7cc.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+dest], rsi"], [5, "cmp [rbp+var_28], 0"], [6, "jz short loc_4016B4"], [7, "cmp [rbp+dest], 0"], [8, "jnz short loc_4016BE"], [9, "mov eax, 0FFFFFFFEh"], [10, "jmp locret_4017D6"], [11, "mov rax, [rbp+var_28]"], [12, "mov [rbp+var_8], rax"], [13, "mov rax, [rbp+var_8]"], [14, "mov eax, [rax+18h]"], [15, "mov [rbp+var_C], eax"], [16, "cmp [rbp+var_C], 0"], [17, "jg short loc_4016E0"], [18, "mov eax, 0FFFFFFFFh"], [19, "jmp locret_4017D6"], [20, "mov eax, [rbp+var_C]"], [21, "sub eax, 1"], [22, "mov ecx, eax"], [23, "mov eax, [rbp+var_C]"], [24, "mov rdx, [rbp+var_8]"], [25, "add rdx, 18h"], [26, "lock cmpxchg [rdx], ecx"], [27, "setz al"], [28, "xor eax, 1"], [29, "test al, al"], [30, "jnz short loc_4016C6"], [31, "mov rax, [rbp+var_8]"], [32, "mov eax, [rax+8]"], [33, "mov [rbp+var_10], eax"], [34, "mov eax, [rbp+var_10]"], [35, "add eax, 1"], [36, "movsxd rdx, eax"], [37, "mov rax, [rbp+var_28]"], [38, "mov eax, [rax]"], [39, "cdqe"], [40, "add rax, 8"], [41, "imul rax, rdx"], [42, "lea rdx, [rax+1Ch]"], [43, "mov rax, [rbp+var_28]"], [44, "add rax, rdx"], [45, "mov [rbp+var_18], rax"], [46, "mov rax, [rbp+var_18]"], [47, "mov eax, [rax]"], [48, "mov ecx, eax"], [49, "mov eax, [rbp+var_10]"], [50, "mov rdx, [rbp+var_8]"], [51, "add rdx, 8"], [52, "lock cmpxchg [rdx], ecx"], [53, "setz al"], [54, "xor eax, 1"], [55, "test al, al"], [56, "jnz short loc_401701"], [57, "mov rax, [rbp+var_8]"], [58, "mov eax, [rax]"], [59, "movsxd rdx, eax"], [60, "mov rax, [rbp+var_18]"], [61, "mov eax, [rax]"], [62, "add eax, 1"], [63, "movsxd rcx, eax"], [64, "mov rax, [rbp+var_28]"], [65, "mov eax, [rax]"], [66, "cdqe"], [67, "add rax, 8"], [68, "imul rax, rcx"], [69, "lea rcx, [rax+1Ch]"], [70, "mov rax, [rbp+var_28]"], [71, "add rax, rcx"], [72, "lea rcx, [rax+8]"], [73, "mov rax, [rbp+dest]"], [74, "mov rsi, rcx"], [75, "mov rdi, rax"], [76, "call _memcpy"], [77, "mov rax, [rbp+var_18]"], [78, "mov eax, [rax]"], [79, "add eax, 1"], [80, "movsxd rdx, eax"], [81, "mov rax, [rbp+var_28]"], [82, "mov eax, [rax]"], [83, "cdqe"], [84, "add rax, 8"], [85, "imul rax, rdx"], [86, "lea rdx, [rax+1Ch]"], [87, "mov rax, [rbp+var_28]"], [88, "add rax, rdx"], [89, "mov dword ptr [rax+4], 0"], [90, "mov rax, [rbp+var_8]"], [91, "add rax, 14h"], [92, "lock sub dword ptr [rax], 1"], [93, "mov eax, 0"], [94, "leave"], [95, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [8, 7], [11, 3], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 16], [20, 15], [21, 20], [22, 21], [23, 15], [24, 12], [25, 24], [26, 22], [26, 26], [27, 23], [27, 25], [28, 27], [29, 28], [30, 29], [31, 12], [32, 31], [33, 32], [34, 33], [35, 34], [36, 35], [37, 3], [38, 37], [40, 38], [41, 40], [41, 36], [42, 41], [42, 36], [43, 3], [44, 42], [44, 43], [45, 44], [46, 45], [47, 46], [48, 47], [49, 33], [50, 12], [51, 50], [52, 26], [52, 48], [52, 52], [53, 49], [53, 51], [54, 53], [55, 54], [56, 55], [57, 12], [58, 57], [59, 58], [60, 45], [61, 60], [62, 61], [63, 62], [64, 3], [65, 64], [67, 65], [68, 63], [68, 67], [69, 68], [69, 63], [70, 3], [71, 69], [71, 70], [72, 69], [72, 71], [73, 4], [74, 72], [75, 73], [77, 45], [78, 77], [79, 78], [80, 79], [81, 3], [82, 81], [84, 82], [85, 84], [85, 80], [86, 85], [86, 80], [87, 3], [88, 86], [88, 87], [89, 88], [90, 12], [91, 90], [95, 93], [95, 9], [95, 18]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/02ee8dd89a5a3f1bd68df2894715cd27f937b8d721d3a7b42127aff74759f7cc_02ee8dd89a5a3f1bd68df2894715cd27f937b8d721d3a7b42127aff74759f7cc.jsonl.gz", "strip_func_name": "sub_401696", "query": "\n\n\n__int64 __fastcall sub_401696(volatile signed __int32 *a1, void *a2)\n{\nsigned __int32 *v3; // [rsp+18h] [rbp-18h]\nsigned __int32 v4; // [rsp+20h] [rbp-10h]\nsigned __int32 v5; // [rsp+24h] [rbp-Ch]\n\nif ( !a1 || !a2 )\nreturn 4294967294LL;\ndo\n{\nv5 = *((_DWORD *)a1 + 6);\nif ( v5 <= 0 )\nreturn 0xFFFFFFFFLL;\n}\nwhile ( v5 != _InterlockedCompareExchange(a1 + 6, v5 - 1, v5) );\ndo\n{\nv4 = *((_DWORD *)a1 + 2);\nv3 = (signed __int32 *)((char *)a1 + (v4 + 1) * (*(int *)a1 + 8LL) + 28);\n}\nwhile ( v4 != _InterlockedCompareExchange(a1 + 2, *v3, v4) );\nmemcpy(a2, (char *)a1 + (*v3 + 1) * (*(int *)a1 + 8LL) + 36, *(int *)a1);\n*(volatile signed __int32 *)((char *)a1 + (*v3 + 1) * (*(int *)a1 + 8LL) + 32) = 0;\n_InterlockedSub(a1 + 5, 1u);\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,sub_401696,]", "hints": "[]", "response": "{'a1': 'queue', 'a2': 'unit', 'v3': 'u_head', 'v4': 'p_head', 'v5': 'r_len', 'sub_401696': 'lf_queue_pop'}"}
[ [ 0.7924292087554932, 0.7412688732147217, 0.7190492153167725, 0.7060937881469727, 0.6866739988327026, 0.6833792924880981, 0.6832597255706787, 0.678493082523346, 0.6778590679168701, 0.6775701642036438, 0.6774548888206482, 0.6765943765640259, 0.6730380058288574, 0.6699607372283936, 0.66313236951828, 0.6604822278022766, 0.6593620777130127, 0.6589817404747009, 0.6577504873275757, 0.6567903757095337 ], [ 16450, 215926, 154857, 129523, 100501, 42730, 37364, 252595, 207369, 212120, 129525, 190588, 54464, 36337, 79379, 212280, 85885, 157636, 129903, 200440 ] ]
parse_bytes
f8fdeef7c0addf7b815a77aacd752aed348f010746696469083c28cf311bd254
Ryzee119
Omnispeak64
NA
ssize_t parse_bytes(const char * arg) { size_t arg_len = strlen(arg); if(arg_len < 2) { /* Need at least 2 characters to parse */ return -1; } char * suffix; size_t size = strtol(arg, &suffix, 10); /* Multiply by the suffix magnitude */ switch(suffix[0]) { case 'm': case 'M': size *= 1024; case 'k': case 'K': size *= 1024; case 'b': case 'B': default: return size; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401678", "function_addr": 4200056, "binary_name": "f8fdeef7c0addf7b815a77aacd752aed348f010746696469083c28cf311bd254.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+s], rdi"], [4, "mov rax, [rbp+s]"], [5, "mov rdi, rax"], [6, "call _strlen"], [7, "mov [rbp+var_10], rax"], [8, "cmp [rbp+var_10], 1"], [9, "ja short loc_4016A4"], [10, "mov rax, 0FFFFFFFFFFFFFFFFh"], [11, "jmp short locret_4016F6"], [12, "lea rcx, [rbp+endptr]"], [13, "mov rax, [rbp+s]"], [14, "mov edx, 0Ah"], [15, "mov rsi, rcx"], [16, "mov rdi, rax"], [17, "call _strtol"], [18, "mov [rbp+var_8], rax"], [19, "mov rax, [rbp+endptr]"], [20, "movzx eax, byte ptr [rax]"], [21, "movsx eax, al"], [22, "cmp eax, 6Dh "], [23, "jz short loc_4016E8"], [24, "cmp eax, 6Dh "], [25, "jg short loc_4016F2"], [26, "cmp eax, 6Bh "], [27, "jz short loc_4016ED"], [28, "cmp eax, 6Bh "], [29, "jg short loc_4016F2"], [30, "cmp eax, 4Bh "], [31, "jz short loc_4016ED"], [32, "cmp eax, 4Dh "], [33, "jnz short loc_4016F2"], [34, "shl [rbp+var_8], 0Ah"], [35, "shl [rbp+var_8], 0Ah"], [36, "mov rax, [rbp+var_8]"], [37, "leave"], [38, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 8], [13, 3], [15, 12], [16, 13], [18, 17], [20, 19], [21, 20], [22, 21], [23, 22], [24, 21], [25, 24], [26, 21], [27, 26], [28, 21], [29, 28], [30, 21], [31, 30], [32, 21], [33, 32], [34, 18], [35, 34], [35, 18], [36, 18], [36, 35], [38, 10], [38, 36]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f8fdeef7c0addf7b815a77aacd752aed348f010746696469083c28cf311bd254_f8fdeef7c0addf7b815a77aacd752aed348f010746696469083c28cf311bd254.jsonl.gz", "strip_func_name": "sub_401678", "query": "\n\n\n__int64 __fastcall sub_401678(const char *a1)\n{\nint v2; // eax\nchar *endptr; // [rsp+18h] [rbp-18h] BYREF\nsize_t v4; // [rsp+20h] [rbp-10h]\n__int64 v5; // [rsp+28h] [rbp-8h]\n\nv4 = strlen(a1);\nif ( v4 <= 1 )\nreturn -1LL;\nv5 = strtol(a1, &endptr, 10);\nv2 = *endptr;\nif ( v2 == 109 )\ngoto LABEL_9;\nif ( v2 <= 109 )\n{\nif ( v2 == 107 )\ngoto LABEL_10;\nif ( v2 > 107 )\nreturn v5;\nif ( v2 == 75 )\n{\nLABEL_10:\nv5 <<= 10;\nreturn v5;\n}\nif ( v2 == 77 )\n{\nLABEL_9:\nv5 <<= 10;\ngoto LABEL_10;\n}\n}\nreturn v5;\n}\n\n\n\nQ:[a1,endptr,v5,sub_401678,]", "hints": "[]", "response": "{'a1': 'arg', 'endptr': 'suffix', 'v5': 'size', 'sub_401678': 'parse_bytes'}"}
[ [ 0.7779434323310852, 0.7365542054176331, 0.7279784083366394, 0.7125389575958252, 0.7002434134483337, 0.6846362352371216, 0.6844671368598938, 0.6769683957099915, 0.6694768667221069, 0.6664896607398987, 0.6658653020858765, 0.6574164628982544, 0.654900312423706, 0.6511449813842773, 0.6507461071014404, 0.6503192186355591, 0.6493557691574097, 0.6483379602432251, 0.6480618715286255, 0.6477552056312561 ], [ 67619, 179639, 253312, 4921, 242274, 153985, 256491, 107930, 210062, 113452, 56098, 139472, 182998, 95482, 165604, 59280, 63370, 236971, 227361, 260968 ] ]
string_casencmp
b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97
marcobambini
gravity
NA
int string_casencmp(const char *s1, const char *s2, size_t n) { while(n > 0 && ((unsigned char)*s1) == ((unsigned char)*s2)) { if(*s1 == '\0') return 0; s1++; s2++; n--; } if(n == 0) return 0; return ((unsigned char)*s1) - ((unsigned char)*s2); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_45F1A0", "function_addr": 4583840, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov [rbp+var_18], rdx"], [5, "jmp short loc_45F1D3"], [6, "mov rax, [rbp+var_8]"], [7, "movzx eax, byte ptr [rax]"], [8, "test al, al"], [9, "jnz short loc_45F1C4"], [10, "mov eax, 0"], [11, "jmp short loc_45F212"], [12, "add [rbp+var_8], 1"], [13, "add [rbp+var_10], 1"], [14, "sub [rbp+var_18], 1"], [15, "cmp [rbp+var_18], 0"], [16, "jz short loc_45F1EC"], [17, "mov rax, [rbp+var_8]"], [18, "movzx edx, byte ptr [rax]"], [19, "mov rax, [rbp+var_10]"], [20, "movzx eax, byte ptr [rax]"], [21, "cmp dl, al"], [22, "jz short loc_45F1B2"], [23, "cmp [rbp+var_18], 0"], [24, "jnz short loc_45F1FA"], [25, "mov eax, 0"], [26, "jmp short loc_45F212"], [27, "mov rax, [rbp+var_8]"], [28, "movzx eax, byte ptr [rax]"], [29, "movzx edx, al"], [30, "mov rax, [rbp+var_10]"], [31, "movzx eax, byte ptr [rax]"], [32, "movzx ecx, al"], [33, "mov eax, edx"], [34, "sub eax, ecx"], [35, "pop rbp"], [36, "retn"]], "data_dep": [[6, 12], [6, 2], [7, 6], [8, 7], [9, 8], [12, 12], [12, 2], [13, 13], [13, 3], [14, 4], [14, 14], [15, 14], [15, 4], [16, 15], [17, 12], [17, 2], [18, 17], [19, 3], [19, 13], [20, 19], [21, 18], [21, 20], [22, 21], [23, 4], [23, 14], [24, 23], [27, 12], [27, 2], [28, 27], [29, 28], [30, 3], [30, 13], [31, 30], [32, 31], [33, 29], [34, 33], [34, 32], [35, 0], [36, 10], [36, 25], [36, 34]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_45F1A0", "query": "\n\n\n__int64 __fastcall sub_45F1A0(_BYTE *a1, _BYTE *a2, __int64 a3)\n{\n__int64 result; // rax\n\nwhile ( a3 && *a1 == *a2 )\n{\nif ( !*a1 )\nreturn 0LL;\n++a1;\n++a2;\n--a3;\n}\nif ( a3 )\nresult = (unsigned __int8)*a1 - (unsigned int)(unsigned __int8)*a2;\nelse\nresult = 0LL;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_45F1A0,]", "hints": "[]", "response": "{'a3': 'n', 'a1': 's1', 'a2': 's2', 'sub_45F1A0': 'string_casencmp'}"}
[ [ 0.8768051266670227, 0.8746559023857117, 0.8642339706420898, 0.8535470962524414, 0.8509206175804138, 0.8412085771560669, 0.835842490196228, 0.8329857587814331, 0.8219531774520874, 0.799439549446106, 0.7778233289718628, 0.7734533548355103, 0.7666764259338379, 0.7650777101516724, 0.7637512683868408, 0.7636001706123352, 0.7579503059387207, 0.7494400143623352, 0.7466028332710266, 0.7418922185897827 ], [ 81734, 54339, 165154, 232326, 19269, 23953, 199523, 242866, 240107, 227126, 71458, 168372, 39618, 56643, 159882, 7283, 196987, 170053, 118038, 30393 ] ]
utf16_to_utf8
f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b
0x09
hfsfuse
NA
size_t utf16_to_utf8(char *dst, size_t dst_len, const uint16_t *src, size_t src_len, int flags, int *errp) { size_t spos, dpos; int error; #define CHECK_LENGTH(l) (dpos > dst_len-(l) ? dst=NULL : NULL) #define ADD_BYTE(b) (dst ? dst[dpos] = (b) : 0, dpos++) error = 0; dpos = 0; for (spos = 0; spos < src_len; spos++) { if (src[spos] < 0x80) { CHECK_LENGTH(1); ADD_BYTE(src[spos]); } else if (src[spos] < 0x800) { CHECK_LENGTH(2); ADD_BYTE(0xc0 | (src[spos]>>6)); ADD_BYTE(0x80 | (src[spos] & 0x3f)); } else if(src[spos] >= 0xd800 && src[spos] < 0xe000) { if ((src[spos] & 0xdc00) == 0xd800) { uint32_t c; /* first surrogate */ if (spos == src_len - 1 || (src[spos+1] & 0xdc00) != 0xdc00) { /* no second surrogate present */ error++; continue; } spos++; CHECK_LENGTH(4); c = (((src[spos-1]&0x3ff) << 10) | (src[spos]&0x3ff)) + 0x10000; ADD_BYTE(0xf0 | (c>>18)); ADD_BYTE(0x80 | ((c>>12) & 0x3f)); ADD_BYTE(0x80 | ((c>>6) & 0x3f)); ADD_BYTE(0x80 | (c & 0x3f)); } else if ((src[spos] & 0xdc00) == 0xdc00) { /* second surrogate without preceding first surrogate */ error++; } else { /* in surrogate pair range but none found */ error++; } } else { CHECK_LENGTH(3); ADD_BYTE(0xe0 | src[spos]>>12); ADD_BYTE(0x80 | ((src[spos]>>6) & 0x3f)); ADD_BYTE(0x80 | (src[spos] & 0x3f)); } } if (errp) *errp = error; return dpos; #undef ADD_BYTE #undef CHECK_LENGTH }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_409BA8", "function_addr": 4234152, "binary_name": "f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_38], rdx"], [5, "mov [rbp+var_40], rcx"], [6, "mov [rbp+var_44], r8d"], [7, "mov [rbp+var_50], r9"], [8, "mov [rbp+var_14], 0"], [9, "mov [rbp+var_10], 0"], [10, "mov [rbp+var_8], 0"], [11, "jmp loc_409F69"], [12, "mov rax, [rbp+var_8]"], [13, "lea rdx, [rax+rax]"], [14, "mov rax, [rbp+var_38]"], [15, "add rax, rdx"], [16, "movzx eax, word ptr [rax]"], [17, "cmp ax, 7Fh"], [18, "ja short loc_409C3E"], [19, "mov rax, [rbp+var_30]"], [20, "sub rax, 1"], [21, "cmp [rbp+var_10], rax"], [22, "jbe short loc_409C0E"], [23, "mov [rbp+var_28], 0"], [24, "cmp [rbp+var_28], 0"], [25, "jz short loc_409C34"], [26, "mov rax, [rbp+var_8]"], [27, "lea rdx, [rax+rax]"], [28, "mov rax, [rbp+var_38]"], [29, "add rax, rdx"], [30, "movzx edx, word ptr [rax]"], [31, "mov rcx, [rbp+var_28]"], [32, "mov rax, [rbp+var_10]"], [33, "add rax, rcx"], [34, "mov [rax], dl"], [35, "add [rbp+var_10], 1"], [36, "jmp loc_409F64"], [37, "mov rax, [rbp+var_8]"], [38, "lea rdx, [rax+rax]"], [39, "mov rax, [rbp+var_38]"], [40, "add rax, rdx"], [41, "movzx eax, word ptr [rax]"], [42, "cmp ax, 7FFh"], [43, "ja loc_409CDE"], [44, "mov rax, [rbp+var_30]"], [45, "sub rax, 2"], [46, "cmp [rbp+var_10], rax"], [47, "jbe short loc_409C70"], [48, "mov [rbp+var_28], 0"], [49, "cmp [rbp+var_28], 0"], [50, "jz short loc_409CA1"], [51, "mov rax, [rbp+var_8]"], [52, "lea rdx, [rax+rax]"], [53, "mov rax, [rbp+var_38]"], [54, "add rax, rdx"], [55, "movzx eax, word ptr [rax]"], [56, "shr ax, 6"], [57, "or eax, 0FFFFFFC0h"], [58, "mov ecx, eax"], [59, "mov rdx, [rbp+var_28]"], [60, "mov rax, [rbp+var_10]"], [61, "add rax, rdx"], [62, "mov edx, ecx"], [63, "mov [rax], dl"], [64, "add [rbp+var_10], 1"], [65, "cmp [rbp+var_28], 0"], [66, "jz short loc_409CD4"], [67, "mov rax, [rbp+var_8]"], [68, "lea rdx, [rax+rax]"], [69, "mov rax, [rbp+var_38]"], [70, "add rax, rdx"], [71, "movzx eax, word ptr [rax]"], [72, "and eax, 3Fh"], [73, "mov edx, eax"], [74, "mov rcx, [rbp+var_28]"], [75, "mov rax, [rbp+var_10]"], [76, "add rax, rcx"], [77, "or edx, 0FFFFFF80h"], [78, "mov [rax], dl"], [79, "add [rbp+var_10], 1"], [80, "jmp loc_409F64"], [81, "mov rax, [rbp+var_8]"], [82, "lea rdx, [rax+rax]"], [83, "mov rax, [rbp+var_38]"], [84, "add rax, rdx"], [85, "movzx eax, word ptr [rax]"], [86, "cmp ax, 0D7FFh"], [87, "jbe loc_409EAE"], [88, "mov rax, [rbp+var_8]"], [89, "lea rdx, [rax+rax]"], [90, "mov rax, [rbp+var_38]"], [91, "add rax, rdx"], [92, "movzx eax, word ptr [rax]"], [93, "cmp ax, 0DFFFh"], [94, "ja loc_409EAE"], [95, "mov rax, [rbp+var_8]"], [96, "lea rdx, [rax+rax]"], [97, "mov rax, [rbp+var_38]"], [98, "add rax, rdx"], [99, "movzx eax, word ptr [rax]"], [100, "movzx eax, ax"], [101, "and eax, 0DC00h"], [102, "cmp eax, 0D800h"], [103, "jnz loc_409E7B"], [104, "mov rax, [rbp+var_40]"], [105, "sub rax, 1"], [106, "cmp [rbp+var_8], rax"], [107, "jz short loc_409D6E"], [108, "mov rax, [rbp+var_8]"], [109, "add rax, 1"], [110, "lea rdx, [rax+rax]"], [111, "mov rax, [rbp+var_38]"], [112, "add rax, rdx"], [113, "movzx eax, word ptr [rax]"], [114, "movzx eax, ax"], [115, "and eax, 0DC00h"], [116, "cmp eax, 0DC00h"], [117, "jz short loc_409D77"], [118, "add [rbp+var_14], 1"], [119, "jmp loc_409F64"], [120, "add [rbp+var_8], 1"], [121, "mov rax, [rbp+var_30]"], [122, "sub rax, 4"], [123, "cmp [rbp+var_10], rax"], [124, "jbe short loc_409D92"], [125, "mov [rbp+var_28], 0"], [126, "mov rax, [rbp+var_8]"], [127, "add rax, rax"], [128, "lea rdx, [rax-2]"], [129, "mov rax, [rbp+var_38]"], [130, "add rax, rdx"], [131, "movzx eax, word ptr [rax]"], [132, "movzx eax, ax"], [133, "shl eax, 0Ah"], [134, "and eax, 0FFC00h"], [135, "mov edx, eax"], [136, "mov rax, [rbp+var_8]"], [137, "lea rcx, [rax+rax]"], [138, "mov rax, [rbp+var_38]"], [139, "add rax, rcx"], [140, "movzx eax, word ptr [rax]"], [141, "movzx eax, ax"], [142, "and eax, 3FFh"], [143, "or eax, edx"], [144, "add eax, 10000h"], [145, "mov [rbp+var_18], eax"], [146, "cmp [rbp+var_28], 0"], [147, "jz short loc_409DF9"], [148, "mov eax, [rbp+var_18]"], [149, "shr eax, 12h"], [150, "or eax, 0FFFFFFF0h"], [151, "mov ecx, eax"], [152, "mov rdx, [rbp+var_28]"], [153, "mov rax, [rbp+var_10]"], [154, "add rax, rdx"], [155, "mov edx, ecx"], [156, "mov [rax], dl"], [157, "add [rbp+var_10], 1"], [158, "cmp [rbp+var_28], 0"], [159, "jz short loc_409E22"], [160, "mov eax, [rbp+var_18]"], [161, "shr eax, 0Ch"], [162, "and eax, 3Fh"], [163, "or eax, 0FFFFFF80h"], [164, "mov ecx, eax"], [165, "mov rdx, [rbp+var_28]"], [166, "mov rax, [rbp+var_10]"], [167, "add rax, rdx"], [168, "mov edx, ecx"], [169, "mov [rax], dl"], [170, "add [rbp+var_10], 1"], [171, "cmp [rbp+var_28], 0"], [172, "jz short loc_409E4B"], [173, "mov eax, [rbp+var_18]"], [174, "shr eax, 6"], [175, "and eax, 3Fh"], [176, "or eax, 0FFFFFF80h"], [177, "mov ecx, eax"], [178, "mov rdx, [rbp+var_28]"], [179, "mov rax, [rbp+var_10]"], [180, "add rax, rdx"], [181, "mov edx, ecx"], [182, "mov [rax], dl"], [183, "add [rbp+var_10], 1"], [184, "cmp [rbp+var_28], 0"], [185, "jz short loc_409E71"], [186, "mov eax, [rbp+var_18]"], [187, "and eax, 3Fh"], [188, "or eax, 0FFFFFF80h"], [189, "mov ecx, eax"], [190, "mov rdx, [rbp+var_28]"], [191, "mov rax, [rbp+var_10]"], [192, "add rax, rdx"], [193, "mov edx, ecx"], [194, "mov [rax], dl"], [195, "add [rbp+var_10], 1"], [196, "jmp loc_409F64"], [197, "mov rax, [rbp+var_8]"], [198, "lea rdx, [rax+rax]"], [199, "mov rax, [rbp+var_38]"], [200, "add rax, rdx"], [201, "movzx eax, word ptr [rax]"], [202, "movzx eax, ax"], [203, "and eax, 0DC00h"], [204, "cmp eax, 0DC00h"], [205, "jnz short loc_409EA5"], [206, "add [rbp+var_14], 1"], [207, "jmp loc_409F64"], [208, "add [rbp+var_14], 1"], [209, "jmp loc_409F64"], [210, "mov rax, [rbp+var_30]"], [211, "sub rax, 3"], [212, "cmp [rbp+var_10], rax"], [213, "jbe short loc_409EC4"], [214, "mov [rbp+var_28], 0"], [215, "cmp [rbp+var_28], 0"], [216, "jz short loc_409EF5"], [217, "mov rax, [rbp+var_8]"], [218, "lea rdx, [rax+rax]"], [219, "mov rax, [rbp+var_38]"], [220, "add rax, rdx"], [221, "movzx eax, word ptr [rax]"], [222, "shr ax, 0Ch"], [223, "or eax, 0FFFFFFE0h"], [224, "mov ecx, eax"], [225, "mov rdx, [rbp+var_28]"], [226, "mov rax, [rbp+var_10]"], [227, "add rax, rdx"], [228, "mov edx, ecx"], [229, "mov [rax], dl"], [230, "add [rbp+var_10], 1"], [231, "cmp [rbp+var_28], 0"], [232, "jz short loc_409F2C"], [233, "mov rax, [rbp+var_8]"], [234, "lea rdx, [rax+rax]"], [235, "mov rax, [rbp+var_38]"], [236, "add rax, rdx"], [237, "movzx eax, word ptr [rax]"], [238, "shr ax, 6"], [239, "and eax, 3Fh"], [240, "mov edx, eax"], [241, "mov rcx, [rbp+var_28]"], [242, "mov rax, [rbp+var_10]"], [243, "add rax, rcx"], [244, "or edx, 0FFFFFF80h"], [245, "mov [rax], dl"], [246, "add [rbp+var_10], 1"], [247, "cmp [rbp+var_28], 0"], [248, "jz short loc_409F5F"], [249, "mov rax, [rbp+var_8]"], [250, "lea rdx, [rax+rax]"], [251, "mov rax, [rbp+var_38]"], [252, "add rax, rdx"], [253, "movzx eax, word ptr [rax]"], [254, "and eax, 3Fh"], [255, "mov edx, eax"], [256, "mov rcx, [rbp+var_28]"], [257, "mov rax, [rbp+var_10]"], [258, "add rax, rcx"], [259, "or edx, 0FFFFFF80h"], [260, "mov [rax], dl"], [261, "add [rbp+var_10], 1"], [262, "add [rbp+var_8], 1"], [263, "mov rax, [rbp+var_8]"], [264, "cmp rax, [rbp+var_40]"], [265, "jb loc_409BE0"], [266, "cmp [rbp+var_50], 0"], [267, "jz short loc_409F87"], [268, "mov rax, [rbp+var_50]"], [269, "mov edx, [rbp+var_14]"], [270, "mov [rax], edx"], [271, "mov rax, [rbp+var_10]"], [272, "pop rbp"], [273, "retn"]], "data_dep": [[12, 262], [12, 10], [13, 78], [13, 181], [13, 82], [13, 194], [13, 198], [13, 63], [13, 13], [13, 156], [13, 12], [13, 259], [13, 30], [13, 245], [13, 110], [13, 96], [13, 244], [13, 77], [13, 193], [13, 229], [13, 62], [13, 89], [13, 169], [13, 34], [13, 155], [13, 182], [13, 38], [13, 168], [13, 135], [13, 260], [13, 228], [14, 4], [15, 14], [15, 13], [16, 78], [16, 194], [16, 156], [16, 245], [16, 63], [16, 229], [16, 169], [16, 34], [16, 182], [16, 15], [16, 260], [17, 16], [18, 17], [19, 3], [20, 19], [21, 35], [21, 20], [21, 261], [21, 9], [21, 79], [21, 195], [22, 21], [24, 2], [24, 48], [24, 23], [24, 125], [24, 214], [25, 24], [26, 262], [26, 10], [27, 13], [27, 260], [27, 245], [27, 78], [27, 194], [27, 63], [27, 26], [27, 156], [27, 229], [27, 169], [27, 34], [27, 182], [28, 4], [29, 27], [29, 28], [30, 260], [30, 78], [30, 194], [30, 63], [30, 156], [30, 245], [30, 229], [30, 169], [30, 34], [30, 182], [30, 29], [31, 48], [31, 23], [31, 125], [31, 214], [31, 2], [32, 195], [32, 35], [32, 261], [32, 9], [32, 79], [33, 32], [33, 31], [34, 30], [34, 33], [35, 195], [35, 35], [35, 261], [35, 9], [35, 79], [37, 262], [37, 10], [38, 260], [38, 78], [38, 194], [38, 63], [38, 13], [38, 156], [38, 245], [38, 229], [38, 169], [38, 34], [38, 182], [38, 37], [39, 4], [40, 39], [40, 38], [41, 260], [41, 245], [41, 78], [41, 194], [41, 63], [41, 40], [41, 156], [41, 229], [41, 169], [41, 34], [41, 182], [42, 41], [43, 42], [44, 3], [45, 44], [46, 79], [46, 195], [46, 45], [46, 35], [46, 261], [46, 9], [47, 46], [49, 23], [49, 125], [49, 214], [49, 2], [49, 48], [50, 49], [51, 262], [51, 10], [52, 51], [52, 260], [52, 245], [52, 78], [52, 194], [52, 63], [52, 156], [52, 229], [52, 169], [52, 34], [52, 182], [52, 38], [53, 4], [54, 53], [54, 52], [55, 182], [55, 260], [55, 245], [55, 78], [55, 194], [55, 54], [55, 63], [55, 156], [55, 169], [55, 34], [55, 229], [56, 55], [57, 56], [58, 57], [59, 2], [59, 48], [59, 23], [59, 125], [59, 214], [60, 261], [60, 9], [60, 35], [60, 79], [60, 195], [61, 60], [61, 59], [62, 58], [63, 61], [63, 62], [64, 79], [64, 195], [64, 261], [64, 9], [64, 35], [65, 125], [65, 48], [65, 2], [65, 214], [65, 23], [66, 65], [67, 262], [67, 10], [68, 260], [68, 245], [68, 78], [68, 194], [68, 63], [68, 156], [68, 169], [68, 34], [68, 229], [68, 67], [68, 62], [68, 182], [68, 38], [69, 4], [70, 68], [70, 69], [71, 260], [71, 78], [71, 194], [71, 63], [71, 156], [71, 245], [71, 229], [71, 169], [71, 34], [71, 70], [71, 182], [72, 71], [73, 72], [74, 48], [74, 214], [74, 23], [74, 125], [74, 2], [75, 64], [76, 75], [76, 74], [77, 73], [78, 77], [78, 76], [79, 64], [81, 262], [81, 10], [82, 38], [82, 260], [82, 245], [82, 78], [82, 194], [82, 63], [82, 156], [82, 81], [82, 229], [82, 169], [82, 34], [82, 182], [83, 4], [84, 83], [84, 82], [85, 84], [85, 182], [85, 260], [85, 245], [85, 78], [85, 194], [85, 63], [85, 156], [85, 169], [85, 34], [85, 229], [86, 85], [87, 86], [88, 10], [88, 262], [89, 63], [89, 156], [89, 169], [89, 34], [89, 229], [89, 182], [89, 260], [89, 88], [89, 245], [89, 78], [89, 82], [89, 194], [90, 4], [91, 90], [91, 89], [92, 245], [92, 78], [92, 194], [92, 63], [92, 156], [92, 91], [92, 229], [92, 169], [92, 34], [92, 182], [92, 260], [93, 92], [94, 93], [95, 262], [95, 10], [96, 95], [96, 229], [96, 89], [96, 182], [96, 260], [96, 245], [96, 78], [96, 194], [96, 63], [96, 156], [96, 169], [96, 34], [97, 4], [98, 97], [98, 96], [99, 229], [99, 98], [99, 182], [99, 260], [99, 245], [99, 78], [99, 194], [99, 63], [99, 156], [99, 169], [99, 34], [100, 99], [101, 100], [102, 101], [103, 102], [104, 5], [105, 104], [106, 105], [106, 262], [106, 10], [107, 106], [108, 262], [108, 10], [109, 108], [110, 109], [110, 229], [110, 182], [110, 260], [110, 245], [110, 78], [110, 96], [110, 194], [110, 63], [110, 156], [110, 169], [110, 34], [111, 4], [112, 111], [112, 110], [113, 156], [113, 229], [113, 169], [113, 34], [113, 182], [113, 112], [113, 260], [113, 245], [113, 78], [113, 194], [113, 63], [114, 113], [115, 114], [116, 115], [117, 116], [118, 206], [118, 8], [118, 208], [118, 118], [120, 10], [120, 262], [121, 3], [122, 121], [123, 79], [123, 195], [123, 9], [123, 35], [123, 122], [123, 261], [124, 123], [126, 120], [127, 126], [128, 260], [128, 245], [128, 110], [128, 78], [128, 194], [128, 63], [128, 156], [128, 169], [128, 34], [128, 127], [128, 229], [128, 182], [129, 4], [130, 128], [130, 129], [131, 182], [131, 130], [131, 260], [131, 245], [131, 78], [131, 194], [131, 63], [131, 156], [131, 169], [131, 34], [131, 229], [132, 131], [133, 132], [134, 133], [135, 134], [136, 120], [137, 229], [137, 224], [137, 182], [137, 74], [137, 177], [137, 256], [137, 260], [137, 241], [137, 245], [137, 78], [137, 194], [137, 189], [137, 63], [137, 31], [137, 58], [137, 156], [137, 151], [137, 169], [137, 34], [137, 137], [137, 164], [137, 136], [138, 4], [139, 138], [139, 137], [140, 229], [140, 182], [140, 139], [140, 260], [140, 245], [140, 78], [140, 194], [140, 63], [140, 156], [140, 169], [140, 34], [141, 140], [142, 141], [143, 135], [143, 142], [144, 143], [145, 144], [146, 48], [146, 2], [146, 214], [146, 23], [146, 125], [147, 146], [148, 145], [149, 148], [150, 149], [151, 150], [152, 48], [152, 2], [152, 214], [152, 23], [152, 125], [153, 79], [153, 195], [153, 9], [153, 35], [153, 261], [154, 153], [154, 152], [155, 151], [156, 154], [156, 155], [157, 35], [157, 261], [157, 79], [157, 195], [157, 9], [158, 23], [158, 125], [158, 48], [158, 2], [158, 214], [159, 158], [160, 145], [161, 160], [162, 161], [163, 162], [164, 163], [165, 48], [165, 2], [165, 214], [165, 23], [165, 125], [166, 157], [167, 166], [167, 165], [168, 164], [169, 167], [169, 168], [170, 157], [171, 125], [171, 48], [171, 2], [171, 214], [171, 23], [172, 171], [173, 145], [174, 173], [175, 174], [176, 175], [177, 176], [178, 2], [178, 214], [178, 23], [178, 125], [178, 48], [179, 170], [180, 179], [180, 178], [181, 177], [182, 181], [182, 180], [183, 170], [184, 48], [184, 2], [184, 214], [184, 23], [184, 125], [185, 184], [186, 145], [187, 186], [188, 187], [189, 188], [190, 48], [190, 2], [190, 214], [190, 23], [190, 125], [191, 183], [192, 191], [192, 190], [193, 189], [194, 193], [194, 192], [195, 183], [197, 262], [197, 10], [198, 78], [198, 96], [198, 194], [198, 63], [198, 197], [198, 156], [198, 169], [198, 34], [198, 229], [198, 182], [198, 260], [198, 245], [199, 4], [200, 199], [200, 198], [201, 260], [201, 245], [201, 78], [201, 194], [201, 63], [201, 156], [201, 169], [201, 34], [201, 229], [201, 182], [201, 200], [202, 201], [203, 202], [204, 203], [205, 204], [206, 118], [206, 206], [206, 208], [206, 8], [208, 118], [208, 8], [208, 208], [208, 206], [210, 3], [211, 210], [212, 35], [212, 211], [212, 261], [212, 9], [212, 79], [212, 195], [213, 212], [215, 23], [215, 125], [215, 48], [215, 2], [215, 214], [216, 215], [217, 262], [217, 10], [218, 78], [218, 194], [218, 156], [218, 245], [218, 217], [218, 82], [218, 63], [218, 169], [218, 34], [218, 182], [218, 229], [218, 260], [218, 89], [219, 4], [220, 219], [220, 218], [221, 229], [221, 78], [221, 194], [221, 260], [221, 156], [221, 245], [221, 63], [221, 220], [221, 169], [221, 34], [221, 182], [222, 221], [223, 222], [224, 223], [225, 48], [225, 2], [225, 214], [225, 23], [225, 125], [226, 79], [226, 195], [226, 9], [226, 35], [226, 261], [227, 226], [227, 225], [228, 224], [229, 228], [229, 227], [230, 35], [230, 261], [230, 79], [230, 195], [230, 9], [231, 2], [231, 48], [231, 23], [231, 125], [231, 214], [232, 231], [233, 262], [233, 10], [234, 260], [234, 245], [234, 78], [234, 82], [234, 194], [234, 63], [234, 156], [234, 169], [234, 34], [234, 229], [234, 233], [234, 89], [234, 228], [234, 182], [235, 4], [236, 235], [236, 234], [237, 78], [237, 194], [237, 260], [237, 156], [237, 236], [237, 245], [237, 63], [237, 169], [237, 34], [237, 182], [237, 229], [238, 237], [239, 238], [240, 239], [241, 48], [241, 214], [241, 23], [241, 125], [241, 2], [242, 230], [243, 242], [243, 241], [244, 240], [245, 244], [245, 243], [246, 230], [247, 2], [247, 48], [247, 214], [247, 23], [247, 125], [248, 247], [249, 262], [249, 10], [250, 260], [250, 245], [250, 249], [250, 244], [250, 82], [250, 63], [250, 156], [250, 169], [250, 34], [250, 229], [250, 89], [250, 228], [250, 182], [250, 78], [250, 194], [251, 4], [252, 251], [252, 250], [253, 194], [253, 156], [253, 245], [253, 63], [253, 169], [253, 34], [253, 182], [253, 252], [253, 229], [253, 260], [253, 78], [254, 253], [255, 254], [256, 2], [256, 48], [256, 23], [256, 125], [256, 214], [257, 246], [258, 257], [258, 256], [259, 255], [260, 259], [260, 258], [261, 246], [262, 120], [262, 262], [262, 10], [263, 262], [263, 10], [264, 263], [264, 5], [265, 264], [266, 7], [267, 266], [268, 7], [269, 118], [269, 206], [269, 208], [269, 8], [270, 269], [270, 268], [271, 261], [271, 9], [271, 79], [271, 195], [271, 35], [272, 0], [273, 271]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b_f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.jsonl.gz", "strip_func_name": "sub_409BA8", "query": "\n\n\nunsigned __int64 __fastcall sub_409BA8(__int64 a1, __int64 a2, __int64 a3, unsigned __int64 a4, __int64 a5, _DWORD *a6)\n{\nunsigned int v8; // [rsp+38h] [rbp-18h]\nint v9; // [rsp+3Ch] [rbp-14h]\nunsigned __int64 v10; // [rsp+40h] [rbp-10h]\nunsigned __int64 v11; // [rsp+40h] [rbp-10h]\nunsigned __int64 v12; // [rsp+40h] [rbp-10h]\nunsigned __int64 v13; // [rsp+40h] [rbp-10h]\nunsigned __int64 v14; // [rsp+40h] [rbp-10h]\nunsigned __int64 v15; // [rsp+40h] [rbp-10h]\nunsigned __int64 v16; // [rsp+40h] [rbp-10h]\nunsigned __int64 i; // [rsp+48h] [rbp-8h]\n\nv9 = 0;\nv10 = 0LL;\nfor ( i = 0LL; i < a4; ++i )\n{\nif ( *(_WORD *)(2 * i + a3) > 0x7Fu )\n{\nif ( *(_WORD *)(2 * i + a3) > 0x7FFu )\n{\nif ( *(_WORD *)(2 * i + a3) <= 0xD7FFu || *(_WORD *)(2 * i + a3) > 0xDFFFu )\n{\nif ( v10 > a2 - 3 )\na1 = 0LL;\nif ( a1 )\n*(_BYTE *)(a1 + v10) = (*(_WORD *)(2 * i + a3) >> 12) | 0xE0;\nv15 = v10 + 1;\nif ( a1 )\n*(_BYTE *)(a1 + v15) = (*(_WORD *)(2 * i + a3) >> 6) & 0x3F | 0x80;\nv16 = v15 + 1;\nif ( a1 )\n*(_BYTE *)(a1 + v16) = *(_WORD *)(2 * i + a3) & 0x3F | 0x80;\nv10 = v16 + 1;\n}\nelse if ( (*(_WORD *)(2 * i + a3) & 0xDC00) == 55296 )\n{\nif ( i != a4 - 1 && (*(_WORD *)(2 * (i + 1) + a3) & 0xDC00) == 56320 )\n{\n++i;\nif ( v10 > a2 - 4 )\na1 = 0LL;\nv8 = ((*(unsigned __int16 *)(2 * i - 2 + a3) << 10) & 0xFFC00 | *(_WORD *)(2 * i + a3) & 0x3FF) + 0x10000;\nif ( a1 )\n*(_BYTE *)(a1 + v10) = (v8 >> 18) | 0xF0;\nv12 = v10 + 1;\nif ( a1 )\n*(_BYTE *)(a1 + v12) = (v8 >> 12) & 0x3F | 0x80;\nv13 = v12 + 1;\nif ( a1 )\n*(_BYTE *)(a1 + v13) = (v8 >> 6) & 0x3F | 0x80;\nv14 = v13 + 1;\nif ( a1 )\n*(_BYTE *)(a1 + v14) = v8 & 0x3F | 0x80;\nv10 = v14 + 1;\n}\nelse\n{\n++v9;\n}\n}\nelse\n{\n++v9;\n}\n}\nelse\n{\nif ( v10 > a2 - 2 )\na1 = 0LL;\nif ( a1 )\n*(_BYTE *)(a1 + v10) = (*(_WORD *)(2 * i + a3) >> 6) | 0xC0;\nv11 = v10 + 1;\nif ( a1 )\n*(_BYTE *)(a1 + v11) = *(_WORD *)(2 * i + a3) & 0x3F | 0x80;\nv10 = v11 + 1;\n}\n}\nelse\n{\nif ( v10 > a2 - 1 )\na1 = 0LL;\nif ( a1 )\n*(_BYTE *)(a1 + v10) = *(_WORD *)(2 * i + a3);\n++v10;\n}\n}\nif ( a6 )\n*a6 = v9;\nreturn v10;\n}\n\n\n\nQ:[a3,a4,a1,a2,a6,a5,v8,v9,v11,i,sub_409BA8,]", "hints": "[]", "response": "{'a3': 'src', 'a4': 'src_len', 'a1': 'dst', 'a2': 'dst_len', 'a6': 'errp', 'a5': 'flags', 'v8': 'c', 'v9': 'error', 'v11': 'dpose', 'i': 'spos', 'sub_409BA8': 'utf16_to_utf8'}"}
[ [ 0.7825131416320801, 0.7422831654548645, 0.7393333911895752, 0.7387730479240417, 0.7379525303840637, 0.7331070899963379, 0.7310124635696411, 0.722251296043396, 0.7167291045188904, 0.7121884822845459, 0.7095258235931396, 0.707480788230896, 0.7043397426605225, 0.7015032768249512, 0.6994432806968689, 0.6960388422012329, 0.6956316232681274, 0.6947900056838989, 0.6938944458961487, 0.6933960318565369 ], [ 65971, 116679, 200448, 259940, 258962, 64525, 242460, 185989, 261574, 226300, 15071, 90267, 28939, 1603, 164285, 102705, 21666, 76610, 133565, 154243 ] ]
print_version
8a3caaf560f077ea7095200c6c4fa2e55b295209b7cd6faf2bfe6facbda406f0
nxp-archive
openil_sja1105-tool
NA
void print_version() { char buf[256]; sja1105_lib_get_version(buf); printf("libsja1105 version: %s\n", buf); sja1105_lib_get_build_date(buf); printf("libsja1105 build date: %s\n", buf); printf("sja1105-tool version: %s\n", VERSION); printf("sja1105-tool build date: %s\n", __DATE__ " " __TIME__); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40ECCF", "function_addr": 4254927, "binary_name": "8a3caaf560f077ea7095200c6c4fa2e55b295209b7cd6faf2bfe6facbda406f0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 110h"], [3, "mov rax, fs:28h"], [4, "mov [rbp+var_8], rax"], [5, "xor eax, eax"], [6, "lea rax, [rbp+var_110]"], [7, "mov rdi, rax"], [8, "call _sja1105_lib_get_version"], [9, "lea rax, [rbp+var_110]"], [10, "mov rsi, rax"], [11, "mov edi, offset aLibsja1105Vers"], [12, "mov eax, 0"], [13, "call _printf"], [14, "lea rax, [rbp+var_110]"], [15, "mov rdi, rax"], [16, "call _sja1105_lib_get_build_date"], [17, "lea rax, [rbp+var_110]"], [18, "mov rsi, rax"], [19, "mov edi, offset aLibsja1105Buil"], [20, "mov eax, 0"], [21, "call _printf"], [22, "mov esi, offset aOpenilV0320170"], [23, "mov edi, offset aSja1105ToolVer"], [24, "mov eax, 0"], [25, "call _printf"], [26, "mov esi, offset aJun32023235817"], [27, "mov edi, offset aSja1105ToolBui"], [28, "mov eax, 0"], [29, "call _printf"], [30, "nop"], [31, "mov rax, [rbp+var_8]"], [32, "sub rax, fs:28h"], [33, "jz short locret_40ED76"], [34, "call ___stack_chk_fail"], [35, "leave"], [36, "retn"]], "data_dep": [[4, 3], [6, 5], [7, 6], [9, 8], [10, 9], [14, 13], [15, 14], [17, 16], [18, 17], [31, 4], [32, 31], [33, 32], [36, 32]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8a3caaf560f077ea7095200c6c4fa2e55b295209b7cd6faf2bfe6facbda406f0_8a3caaf560f077ea7095200c6c4fa2e55b295209b7cd6faf2bfe6facbda406f0.jsonl.gz", "strip_func_name": "sub_40ECCF", "query": "\n\n\nunsigned __int64 sub_40ECCF()\n{\nchar v1[264]; // [rsp+0h] [rbp-110h] BYREF\nunsigned __int64 v2; // [rsp+108h] [rbp-8h]\n\nv2 = __readfsqword(0x28u);\nsja1105_lib_get_version();\nprintf(\"libsja1105 version: %s\\n\", v1);\nsja1105_lib_get_build_date();\nprintf(\"libsja1105 build date: %s\\n\", v1);\nprintf(\"sja1105-tool version: %s\\n\", \"OpenIL-v0.3-201707\");\nprintf(\"sja1105-tool build date: %s\\n\", \"Jun 3 2023 23:58:17\");\nreturn v2 - __readfsqword(0x28u);\n}\n\n\n\nQ:[v1,sub_40ECCF,]", "hints": "[]", "response": "{'v1': 'buf', 'sub_40ECCF': 'print_version'}"}
[ [ 0.8072155117988586, 0.8012493848800659, 0.782702624797821, 0.7628508806228638, 0.7609484195709229, 0.7551476955413818, 0.7523819208145142, 0.7496787905693054, 0.7489492297172546, 0.7484277486801147, 0.7324853539466858, 0.7276062965393066, 0.725451648235321, 0.7252018451690674, 0.7197088003158569, 0.7168189287185669, 0.7141798734664917, 0.7140442132949829, 0.712875485420227, 0.7104514837265015 ], [ 182702, 69697, 251920, 162129, 161356, 660, 183412, 222359, 225829, 30705, 170361, 119738, 113042, 27300, 36925, 91518, 45128, 228375, 189667, 85741 ] ]
vector_push
6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172
noporpoise
seq-align
NA
static void vector_push(size_t **ptr, size_t *len, size_t *cap, size_t x) { if(!*ptr || *len >= *cap) { if(!*cap) { *cap = 16; } else { while(*len >= *cap) { *cap *= 2; }} *ptr = realloc(*ptr, *cap * sizeof(size_t)); } (*ptr)[(*len)++] = x; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4077DA", "function_addr": 4224986, "binary_name": "6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_10], rsi"], [5, "mov [rbp+var_18], rdx"], [6, "mov [rbp+var_20], rcx"], [7, "mov rax, [rbp+var_8]"], [8, "mov rax, [rax]"], [9, "test rax, rax"], [10, "jz short loc_407811"], [11, "mov rax, [rbp+var_10]"], [12, "mov rdx, [rax]"], [13, "mov rax, [rbp+var_18]"], [14, "mov rax, [rax]"], [15, "cmp rdx, rax"], [16, "jb short loc_407877"], [17, "mov rax, [rbp+var_18]"], [18, "mov rax, [rax]"], [19, "test rax, rax"], [20, "jnz short loc_40783C"], [21, "mov rax, [rbp+var_18]"], [22, "mov qword ptr [rax], 10h"], [23, "jmp short loc_40784F"], [24, "mov rax, [rbp+var_18]"], [25, "mov rax, [rax]"], [26, "lea rdx, [rax+rax]"], [27, "mov rax, [rbp+var_18]"], [28, "mov [rax], rdx"], [29, "mov rax, [rbp+var_10]"], [30, "mov rdx, [rax]"], [31, "mov rax, [rbp+var_18]"], [32, "mov rax, [rax]"], [33, "cmp rdx, rax"], [34, "jnb short loc_40782A"], [35, "mov rax, [rbp+var_18]"], [36, "mov rax, [rax]"], [37, "lea rdx, ds:0[rax*8]"], [38, "mov rax, [rbp+var_8]"], [39, "mov rax, [rax]"], [40, "mov rsi, rdx"], [41, "mov rdi, rax"], [42, "call _realloc"], [43, "mov rdx, [rbp+var_8]"], [44, "mov [rdx], rax"], [45, "mov rax, [rbp+var_8]"], [46, "mov rsi, [rax]"], [47, "mov rax, [rbp+var_10]"], [48, "mov rax, [rax]"], [49, "lea rcx, [rax+1]"], [50, "mov rdx, [rbp+var_10]"], [51, "mov [rdx], rcx"], [52, "shl rax, 3"], [53, "lea rdx, [rsi+rax]"], [54, "mov rax, [rbp+var_20]"], [55, "mov [rdx], rax"], [56, "nop"], [57, "leave"], [58, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 8], [10, 9], [11, 4], [12, 11], [13, 5], [14, 13], [15, 14], [15, 12], [16, 15], [17, 5], [18, 17], [19, 18], [20, 19], [21, 5], [22, 21], [24, 5], [25, 24], [25, 28], [26, 30], [26, 25], [26, 28], [27, 5], [28, 27], [28, 26], [29, 4], [30, 29], [30, 28], [31, 5], [32, 31], [32, 28], [33, 30], [33, 32], [34, 33], [35, 5], [36, 22], [36, 35], [36, 44], [36, 28], [37, 12], [37, 30], [38, 3], [39, 44], [39, 28], [39, 22], [39, 38], [40, 37], [41, 39], [43, 3], [44, 42], [44, 43], [45, 3], [46, 45], [46, 22], [46, 51], [46, 44], [46, 28], [46, 55], [47, 4], [48, 47], [48, 22], [48, 51], [48, 44], [48, 28], [48, 55], [49, 55], [49, 48], [49, 22], [49, 44], [49, 28], [49, 51], [50, 4], [51, 50], [51, 49], [52, 48], [53, 50], [53, 52], [53, 51], [54, 6], [55, 54], [55, 53], [58, 54]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172_6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172.jsonl.gz", "strip_func_name": "sub_4077DA", "query": "\n\n\n__int64 __fastcall sub_4077DA(void **a1, _QWORD *a2, _QWORD *a3, __int64 a4)\n{\nchar *v4; // rsi\n__int64 v5; // rax\nchar *v6; // rdx\n__int64 result; // rax\n\nif ( !*a1 || *a2 >= *a3 )\n{\nif ( *a3 )\n{\nwhile ( *a2 >= *a3 )\n*a3 *= 2LL;\n}\nelse\n{\n*a3 = 16LL;\n}\n*a1 = realloc(*a1, 8LL * *a3);\n}\nv4 = (char *)*a1;\nv5 = (*a2)++;\nv6 = &v4[8 * v5];\nresult = a4;\n*(_QWORD *)v6 = a4;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,v6,sub_4077DA,]", "hints": "[]", "response": "{'a3': 'cap', 'a4': 'x', 'a1': 'ptr', 'a2': 'len', 'v6': 'cap', 'sub_4077DA': 'vector_push'}"}
[ [ 0.7729668021202087, 0.7695806622505188, 0.7614623308181763, 0.7453025579452515, 0.7414053678512573, 0.7396117448806763, 0.7378237843513489, 0.7344814538955688, 0.7318764925003052, 0.7276574969291687, 0.7273305058479309, 0.7246895432472229, 0.7228294014930725, 0.7181685566902161, 0.717485249042511, 0.7156151533126831, 0.7143154740333557, 0.7119380831718445, 0.710437536239624, 0.7098669409751892 ], [ 129639, 18939, 169138, 197091, 236497, 204835, 21983, 68096, 32730, 180238, 53782, 192760, 196534, 180871, 142950, 132549, 261705, 7564, 114444, 152496 ] ]
strlower
9d9fa801a1b6327f0e5880b461e2c7b292c48dd93acc788daa7bd7c2ac7fcc1b
corellium
preloader-m1
NA
static void strlower(char *dst, const char *src) { while(*src) *(dst++) = tolower(*(src++)); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4011F2", "function_addr": 4198898, "binary_name": "9d9fa801a1b6327f0e5880b461e2c7b292c48dd93acc788daa7bd7c2ac7fcc1b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_10], rsi"], [5, "jmp short loc_40122F"], [6, "mov rax, [rbp+var_10]"], [7, "lea rdx, [rax+1]"], [8, "mov [rbp+var_10], rdx"], [9, "movzx eax, byte ptr [rax]"], [10, "movsx eax, al"], [11, "mov edi, eax"], [12, "call _tolower"], [13, "mov ecx, eax"], [14, "mov rax, [rbp+var_8]"], [15, "lea rdx, [rax+1]"], [16, "mov [rbp+var_8], rdx"], [17, "mov edx, ecx"], [18, "mov [rax], dl"], [19, "mov rax, [rbp+var_10]"], [20, "movzx eax, byte ptr [rax]"], [21, "test al, al"], [22, "jnz short loc_401204"], [23, "nop"], [24, "nop"], [25, "leave"], [26, "retn"]], "data_dep": [[6, 8], [6, 4], [7, 17], [7, 6], [7, 18], [8, 7], [9, 6], [9, 18], [10, 9], [11, 10], [13, 12], [14, 16], [14, 3], [15, 14], [15, 7], [15, 18], [16, 15], [17, 13], [18, 17], [18, 14], [19, 8], [19, 4], [20, 19], [20, 18], [21, 20], [22, 21], [26, 21]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9d9fa801a1b6327f0e5880b461e2c7b292c48dd93acc788daa7bd7c2ac7fcc1b_9d9fa801a1b6327f0e5880b461e2c7b292c48dd93acc788daa7bd7c2ac7fcc1b.jsonl.gz", "strip_func_name": "sub_4011F2", "query": "\n\n\n__int64 __fastcall sub_4011F2(_BYTE *a1, unsigned __int8 *a2)\n{\nunsigned __int8 *v2; // rax\nchar v3; // cl\n_BYTE *v4; // rax\n__int64 result; // rax\n\nwhile ( 1 )\n{\nresult = *a2;\nif ( !(_BYTE)result )\nbreak;\nv2 = a2++;\nv3 = tolower((char)*v2);\nv4 = a1++;\n*v4 = v3;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_4011F2,]", "hints": "[]", "response": "{'a1': 'dst', 'a2': 'src', 'sub_4011F2': 'strlower'}"}
[ [ 0.8462408781051636, 0.837005078792572, 0.8163253664970398, 0.8101573586463928, 0.8027414083480835, 0.7992502450942993, 0.7936597466468811, 0.7904531359672546, 0.7900140285491943, 0.7874819040298462, 0.7861606478691101, 0.7853521108627319, 0.7832916975021362, 0.7809603810310364, 0.7713459730148315, 0.7710833549499512, 0.7687880992889404, 0.7653510570526123, 0.7649822235107422, 0.7624739408493042 ], [ 104515, 87812, 5731, 109770, 215787, 14360, 145740, 121190, 173747, 45090, 131092, 167770, 10783, 187157, 118127, 17627, 261073, 127853, 80273, 124108 ] ]
write_temp_file
a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c
coreboot
vboot
NA
static vb2_error_t write_temp_file(const uint8_t *data, uint32_t data_size, char **path_out) { int fd; ssize_t write_rv; vb2_error_t rv; char *path; mode_t umask_save; #if defined(__FreeBSD__) #define P_tmpdir "/tmp" #endif *path_out = NULL; path = strdup(P_tmpdir "/vb2_flashrom.XXXXXX"); /* Set the umask before mkstemp for security considerations. */ umask_save = umask(077); fd = mkstemp(path); umask(umask_save); if (fd < 0) { rv = VB2_ERROR_WRITE_FILE_OPEN; goto fail; } while (data && data_size > 0) { write_rv = write(fd, data, data_size); if (write_rv < 0) { close(fd); unlink(path); rv = VB2_ERROR_WRITE_FILE_DATA; goto fail; } data_size -= write_rv; data += write_rv; } close(fd); *path_out = path; return VB2_SUCCESS; fail: free(path); return rv; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_422E41", "function_addr": 4337217, "binary_name": "a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+n+4], rdi"], [4, "mov dword ptr [rbp+n], esi"], [5, "mov [rbp+var_38], rdx"], [6, "mov rax, [rbp+var_38]"], [7, "mov qword ptr [rax], 0"], [8, "lea rdi, aTmpVb2Flashrom"], [9, "call _strdup"], [10, "mov [rbp+template], rax"], [11, "mov edi, 3Fh "], [12, "call _umask"], [13, "mov [rbp+mask], eax"], [14, "mov rax, [rbp+template]"], [15, "mov rdi, rax"], [16, "call _mkstemp64"], [17, "mov [rbp+fd], eax"], [18, "mov eax, [rbp+mask]"], [19, "mov edi, eax"], [20, "call _umask"], [21, "cmp [rbp+fd], 0"], [22, "jns short loc_422EF1"], [23, "mov [rbp+var_4], 20010005h"], [24, "jmp short loc_422F1A"], [25, "mov edx, dword ptr [rbp+n]"], [26, "mov rcx, [rbp+n+4]"], [27, "mov eax, [rbp+fd]"], [28, "mov rsi, rcx"], [29, "mov edi, eax"], [30, "call _write"], [31, "mov [rbp+var_20], rax"], [32, "cmp [rbp+var_20], 0"], [33, "jns short loc_422EE2"], [34, "mov eax, [rbp+fd]"], [35, "mov edi, eax"], [36, "call _close"], [37, "mov rax, [rbp+template]"], [38, "mov rdi, rax"], [39, "call _unlink"], [40, "mov [rbp+var_4], 20010006h"], [41, "jmp short loc_422F1A"], [42, "mov rax, [rbp+var_20]"], [43, "sub dword ptr [rbp+n], eax"], [44, "mov rax, [rbp+var_20]"], [45, "add [rbp+n+4], rax"], [46, "cmp [rbp+n+4], 0"], [47, "jz short loc_422EFE"], [48, "cmp dword ptr [rbp+n], 0"], [49, "jnz short loc_422EA4"], [50, "mov eax, [rbp+fd]"], [51, "mov edi, eax"], [52, "call _close"], [53, "mov rax, [rbp+var_38]"], [54, "mov rdx, [rbp+template]"], [55, "mov [rax], rdx"], [56, "mov eax, 0"], [57, "jmp short locret_422F29"], [58, "mov rax, [rbp+template]"], [59, "mov rdi, rax"], [60, "call _free"], [61, "mov eax, [rbp+var_4]"], [62, "leave"], [63, "retn"]], "data_dep": [[6, 5], [7, 6], [10, 9], [13, 12], [14, 10], [15, 14], [17, 16], [18, 13], [19, 18], [21, 17], [22, 21], [25, 4], [25, 43], [26, 45], [26, 3], [27, 17], [28, 26], [29, 27], [31, 30], [32, 31], [33, 32], [34, 17], [35, 34], [37, 10], [38, 37], [42, 31], [43, 43], [43, 42], [43, 4], [44, 31], [45, 3], [45, 45], [45, 44], [46, 45], [46, 3], [47, 46], [48, 4], [48, 43], [49, 48], [50, 17], [51, 50], [53, 5], [54, 10], [55, 53], [55, 54], [58, 10], [59, 58], [61, 23], [61, 40], [63, 61], [63, 56]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c_a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c.jsonl.gz", "strip_func_name": "sub_422E41", "query": "\n\n\n__int64 __fastcall sub_422E41(char *a1, unsigned int a2, char **a3)\n{\n__int64 result; // rax\nssize_t v7; // [rsp+20h] [rbp-20h]\nint fd; // [rsp+28h] [rbp-18h]\n__mode_t mask; // [rsp+2Ch] [rbp-14h]\nchar *templatea; // [rsp+30h] [rbp-10h]\nunsigned int v11; // [rsp+3Ch] [rbp-4h]\n\n*a3 = 0LL;\ntemplatea = strdup(\"/tmp/vb2_flashrom.XXXXXX\");\nmask = umask(0x3Fu);\nfd = mkstemp64(templatea);\numask(mask);\nif ( fd >= 0 )\n{\nwhile ( a1 && a2 )\n{\nv7 = write(fd, a1, a2);\nif ( v7 < 0 )\n{\nclose(fd);\nunlink(templatea);\nv11 = 536936454;\ngoto LABEL_9;\n}\na2 -= v7;\na1 += v7;\n}\nclose(fd);\n*a3 = templatea;\nresult = 0LL;\n}\nelse\n{\nv11 = 536936453;\nLABEL_9:\nfree(templatea);\nresult = v11;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v7,mask,templatea,v11,sub_422E41,]", "hints": "[]", "response": "{'a3': 'path_out', 'a1': 'data', 'a2': 'data_size', 'v7': 'write_rv', 'mask': 'umask_save', 'templatea': 'path', 'v11': 'rv', 'sub_422E41': 'write_temp_file'}"}
[ [ 0.8197846412658691, 0.8127024173736572, 0.7720233201980591, 0.7609506845474243, 0.7595517635345459, 0.7590279579162598, 0.7581998109817505, 0.7562135457992554, 0.7545303106307983, 0.7515233755111694, 0.7466791868209839, 0.7357558608055115, 0.7228280901908875, 0.7226042747497559, 0.7142203450202942, 0.7109288573265076, 0.7104085087776184, 0.707768440246582, 0.70550537109375, 0.7013903856277466 ], [ 240642, 52967, 102370, 258720, 161705, 23224, 220473, 69368, 5549, 28415, 208231, 41314, 87314, 119199, 94287, 5666, 28128, 127927, 229814, 154604 ] ]
get_objtype
3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4
sezero
mikmod
NA
static int get_objtype(FILE *f, int ofs, int type) { char sig[16]; _retry: memset(sig, 0, sizeof(sig)); fseek(f, ofs, SEEK_SET); fread(sig, 16, 1, f); if (type == UMUSIC_IT) { if (memcmp(sig, "IMPM", 4) == 0) return UMUSIC_IT; return -1; } if (type == UMUSIC_XM) { if (memcmp(sig, "Extended Module:", 16) != 0) return -1; fread(sig, 16, 1, f); if (sig[0] != ' ') return -1; fread(sig, 16, 1, f); if (sig[5] != 0x1a) return -1; return UMUSIC_XM; } if (type == UMUSIC_MP2) { unsigned char *p = (unsigned char *)sig; unsigned short u = ((p[0] << 8) | p[1]) & 0xFFFE; if (u == 0xFFFC || u == 0xFFF4) return UMUSIC_MP2; return -1; } if (type == UMUSIC_WAV) { if (memcmp(sig, "RIFF", 4) == 0 && memcmp(&sig[8], "WAVE", 4) == 0) return UMUSIC_WAV; return -1; } fseek(f, ofs + 44, SEEK_SET); fread(sig, 4, 1, f); if (type == UMUSIC_S3M) { if (memcmp(sig, "SCRM", 4) == 0) return UMUSIC_S3M; /*return -1;*/ /* SpaceMarines.umx and Starseek.umx from Return to NaPali * report as "s3m" whereas the actual music format is "it" */ type = UMUSIC_IT; goto _retry; } fseek(f, ofs + 1080, SEEK_SET); fread(sig, 4, 1, f); if (type == UMUSIC_MOD) { if (memcmp(sig, "M.K.", 4) == 0 || memcmp(sig, "M!K!", 4) == 0) return UMUSIC_MOD; return -1; } return -1; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013DA", "function_addr": 4199386, "binary_name": "3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+var_2C], esi"], [5, "mov [rbp+var_30], edx"], [6, "lea rax, [rbp+s]"], [7, "mov edx, 10h"], [8, "mov esi, 0"], [9, "mov rdi, rax"], [10, "call _memset"], [11, "mov eax, [rbp+var_2C]"], [12, "movsxd rcx, eax"], [13, "mov rax, [rbp+stream]"], [14, "mov edx, 0"], [15, "mov rsi, rcx"], [16, "mov rdi, rax"], [17, "call _fseek"], [18, "mov rdx, [rbp+stream]"], [19, "lea rax, [rbp+s]"], [20, "mov rcx, rdx"], [21, "mov edx, 1"], [22, "mov esi, 10h"], [23, "mov rdi, rax"], [24, "call _fread"], [25, "cmp [rbp+var_30], 0"], [26, "jnz short loc_40146D"], [27, "lea rax, [rbp+s]"], [28, "mov edx, 4"], [29, "mov esi, offset aImpm"], [30, "mov rdi, rax"], [31, "call _memcmp"], [32, "test eax, eax"], [33, "jnz short loc_401463"], [34, "mov eax, 0"], [35, "jmp locret_4016A4"], [36, "mov eax, 0FFFFFFFFh"], [37, "jmp locret_4016A4"], [38, "cmp [rbp+var_30], 2"], [39, "jnz loc_401503"], [40, "lea rax, [rbp+s]"], [41, "mov edx, 10h"], [42, "mov esi, offset aExtendedModule"], [43, "mov rdi, rax"], [44, "call _memcmp"], [45, "test eax, eax"], [46, "jz short loc_40149B"], [47, "mov eax, 0FFFFFFFFh"], [48, "jmp locret_4016A4"], [49, "mov rdx, [rbp+stream]"], [50, "lea rax, [rbp+s]"], [51, "mov rcx, rdx"], [52, "mov edx, 1"], [53, "mov esi, 10h"], [54, "mov rdi, rax"], [55, "call _fread"], [56, "movzx eax, [rbp+s]"], [57, "cmp al, 20h "], [58, "jz short loc_4014CA"], [59, "mov eax, 0FFFFFFFFh"], [60, "jmp locret_4016A4"], [61, "mov rdx, [rbp+stream]"], [62, "lea rax, [rbp+s]"], [63, "mov rcx, rdx"], [64, "mov edx, 1"], [65, "mov esi, 10h"], [66, "mov rdi, rax"], [67, "call _fread"], [68, "movzx eax, [rbp+var_1B]"], [69, "cmp al, 1Ah"], [70, "jz short loc_4014F9"], [71, "mov eax, 0FFFFFFFFh"], [72, "jmp locret_4016A4"], [73, "mov eax, 2"], [74, "jmp locret_4016A4"], [75, "cmp [rbp+var_30], 5"], [76, "jnz short loc_401559"], [77, "lea rax, [rbp+s]"], [78, "mov [rbp+var_8], rax"], [79, "mov rax, [rbp+var_8]"], [80, "movzx eax, byte ptr [rax]"], [81, "movzx eax, al"], [82, "shl eax, 8"], [83, "mov edx, eax"], [84, "mov rax, [rbp+var_8]"], [85, "add rax, 1"], [86, "movzx eax, byte ptr [rax]"], [87, "movzx eax, al"], [88, "or eax, edx"], [89, "and eax, 0FFFFFFFEh"], [90, "mov [rbp+var_A], ax"], [91, "cmp [rbp+var_A], 0FFFCh"], [92, "jz short loc_401545"], [93, "cmp [rbp+var_A], 0FFF4h"], [94, "jnz short loc_40154F"], [95, "mov eax, 5"], [96, "jmp locret_4016A4"], [97, "mov eax, 0FFFFFFFFh"], [98, "jmp locret_4016A4"], [99, "cmp [rbp+var_30], 4"], [100, "jnz short loc_4015AB"], [101, "lea rax, [rbp+s]"], [102, "mov edx, 4"], [103, "mov esi, offset aRiff"], [104, "mov rdi, rax"], [105, "call _memcmp"], [106, "test eax, eax"], [107, "jnz short loc_4015A1"], [108, "lea rax, [rbp+s]"], [109, "add rax, 8"], [110, "mov edx, 4"], [111, "mov esi, offset aWave"], [112, "mov rdi, rax"], [113, "call _memcmp"], [114, "test eax, eax"], [115, "jnz short loc_4015A1"], [116, "mov eax, 4"], [117, "jmp locret_4016A4"], [118, "mov eax, 0FFFFFFFFh"], [119, "jmp locret_4016A4"], [120, "mov eax, [rbp+var_2C]"], [121, "add eax, 2Ch "], [122, "movsxd rcx, eax"], [123, "mov rax, [rbp+stream]"], [124, "mov edx, 0"], [125, "mov rsi, rcx"], [126, "mov rdi, rax"], [127, "call _fseek"], [128, "mov rdx, [rbp+stream]"], [129, "lea rax, [rbp+s]"], [130, "mov rcx, rdx"], [131, "mov edx, 1"], [132, "mov esi, 4"], [133, "mov rdi, rax"], [134, "call _fread"], [135, "cmp [rbp+var_30], 1"], [136, "jnz short loc_40161B"], [137, "lea rax, [rbp+s]"], [138, "mov edx, 4"], [139, "mov esi, offset aScrm"], [140, "mov rdi, rax"], [141, "call _memcmp"], [142, "test eax, eax"], [143, "jnz short loc_40160F"], [144, "mov eax, 1"], [145, "jmp locret_4016A4"], [146, "mov [rbp+var_30], 0"], [147, "jmp loc_4013EC"], [148, "mov eax, [rbp+var_2C]"], [149, "add eax, 438h"], [150, "movsxd rcx, eax"], [151, "mov rax, [rbp+stream]"], [152, "mov edx, 0"], [153, "mov rsi, rcx"], [154, "mov rdi, rax"], [155, "call _fseek"], [156, "mov rdx, [rbp+stream]"], [157, "lea rax, [rbp+s]"], [158, "mov rcx, rdx"], [159, "mov edx, 1"], [160, "mov esi, 4"], [161, "mov rdi, rax"], [162, "call _fread"], [163, "cmp [rbp+var_30], 3"], [164, "jnz short loc_40169F"], [165, "lea rax, [rbp+s]"], [166, "mov edx, 4"], [167, "mov esi, offset aMK"], [168, "mov rdi, rax"], [169, "call _memcmp"], [170, "test eax, eax"], [171, "jz short loc_401691"], [172, "lea rax, [rbp+s]"], [173, "mov edx, 4"], [174, "mov esi, offset aMK_0"], [175, "mov rdi, rax"], [176, "call _memcmp"], [177, "test eax, eax"], [178, "jnz short loc_401698"], [179, "mov eax, 3"], [180, "jmp short locret_4016A4"], [181, "mov eax, 0FFFFFFFFh"], [182, "jmp short locret_4016A4"], [183, "mov eax, 0FFFFFFFFh"], [184, "leave"], [185, "retn"]], "data_dep": [[6, 142], [9, 6], [11, 4], [12, 11], [13, 3], [15, 12], [16, 13], [18, 3], [19, 17], [20, 18], [23, 19], [25, 146], [25, 5], [26, 25], [27, 24], [30, 27], [32, 31], [33, 32], [38, 146], [38, 5], [39, 38], [40, 24], [43, 40], [45, 44], [46, 45], [49, 3], [50, 45], [51, 49], [54, 50], [57, 56], [58, 57], [61, 3], [62, 56], [63, 61], [66, 62], [69, 68], [70, 69], [75, 5], [75, 146], [76, 75], [77, 24], [78, 77], [79, 78], [80, 79], [81, 80], [82, 81], [83, 82], [84, 78], [85, 84], [86, 85], [87, 86], [88, 83], [88, 87], [89, 88], [90, 89], [91, 90], [92, 91], [93, 90], [94, 93], [99, 5], [99, 146], [100, 99], [101, 24], [104, 101], [106, 105], [107, 106], [108, 106], [109, 108], [112, 109], [114, 113], [115, 114], [120, 4], [121, 120], [122, 121], [123, 3], [125, 122], [126, 123], [128, 3], [129, 127], [130, 128], [133, 129], [135, 5], [135, 146], [136, 135], [137, 134], [140, 137], [142, 141], [143, 142], [148, 4], [149, 148], [150, 149], [151, 3], [153, 150], [154, 151], [156, 3], [157, 155], [158, 156], [161, 157], [163, 5], [163, 146], [164, 163], [165, 162], [168, 165], [170, 169], [171, 170], [172, 170], [175, 172], [177, 176], [178, 177], [185, 59], [185, 144], [185, 34], [185, 116], [185, 73], [185, 36], [185, 95], [185, 97], [185, 118], [185, 47], [185, 179], [185, 181], [185, 71], [185, 183]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4_3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.jsonl.gz", "strip_func_name": "sub_4013DA", "query": "\n\n\n__int64 __fastcall sub_4013DA(FILE *a1, int a2, int a3)\n{\n__int64 result; // rax\nunsigned __int16 s[2]; // [rsp+10h] [rbp-20h] BYREF\nchar v6; // [rsp+15h] [rbp-1Bh]\n__int64 v7; // [rsp+18h] [rbp-18h] BYREF\n__int16 v8; // [rsp+26h] [rbp-Ah]\nunsigned __int16 *v9; // [rsp+28h] [rbp-8h]\n\nwhile ( 1 )\n{\nmemset(s, 0, 0x10uLL);\nfseek(a1, a2, 0);\nfread(s, 0x10uLL, 1uLL, a1);\nswitch ( a3 )\n{\ncase 0:\nif ( !memcmp(s, \"IMPM\", 4uLL) )\nresult = 0LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\ncase 2:\nif ( memcmp(s, \"Extended Module:\", 0x10uLL) )\nreturn 0xFFFFFFFFLL;\nfread(s, 0x10uLL, 1uLL, a1);\nif ( LOBYTE(s[0]) != 32 )\nreturn 0xFFFFFFFFLL;\nfread(s, 0x10uLL, 1uLL, a1);\nif ( v6 == 26 )\nresult = 2LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\ncase 5:\nv9 = s;\nv8 = _byteswap_ushort(s[0]) & 0xFFFE;\nif ( v8 == -4 || v8 == -12 )\nresult = 5LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\ncase 4:\nif ( !memcmp(s, \"RIFF\", 4uLL) && !memcmp(&v7, \"WAVE\", 4uLL) )\nresult = 4LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\nfseek(a1, a2 + 44, 0);\nfread(s, 4uLL, 1uLL, a1);\nif ( a3 != 1 )\nbreak;\nif ( !memcmp(s, \"SCRM\", 4uLL) )\nreturn 1LL;\na3 = 0;\n}\nfseek(a1, a2 + 1080, 0);\nfread(s, 4uLL, 1uLL, a1);\nif ( a3 != 3 )\nreturn 0xFFFFFFFFLL;\nif ( !memcmp(s, \"M.K.\", 4uLL) || !memcmp(s, \"M!K!\", 4uLL) )\nreturn 3LL;\nreturn 0xFFFFFFFFLL;\n}\n\n\n\nQ:[a3,a1,a2,s,v8,v9,sub_4013DA,]", "hints": "[]", "response": "{'a3': 'type', 'a1': 'f', 'a2': 'ofs', 's': 'sig', 'v8': 'u', 'v9': 'p', 'sub_4013DA': 'get_objtype'}"}
[ [ 0.8027123212814331, 0.7916880249977112, 0.7710919976234436, 0.7679703235626221, 0.7581008076667786, 0.7453572154045105, 0.7341840267181396, 0.7262503504753113, 0.7247181534767151, 0.7243297100067139, 0.7103381156921387, 0.7094733119010925, 0.7072256207466125, 0.7053971290588379, 0.70421302318573, 0.703567624092102, 0.6984587907791138, 0.6979368925094604, 0.6973391175270081, 0.6972998380661011 ], [ 15102, 236245, 11216, 4440, 119779, 226396, 179881, 92569, 11015, 251898, 60701, 246409, 5005, 256638, 222913, 122951, 166504, 132030, 172188, 249401 ] ]
free_function_decl
b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97
marcobambini
gravity
NA
static void free_function_decl (gvisitor_t *self, gnode_function_decl_t *node) { CHECK_REFCOUNT(node); if (node->symtable) symboltable_free(node->symtable); if (node->identifier) mem_free((void *)node->identifier); if (node->params) { gnode_array_each(node->params, {free_variable(self, (gnode_var_t *)val);}); gnode_array_free(node->params); } if (node->block) visit((gnode_t *)node->block); if (node->uplist) { gtype_array_each(node->uplist, {mem_free(val);}, gupvalue_t*); gnode_array_free(node->uplist); } mem_free((gnode_t*)node); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42449D", "function_addr": 4342941, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov rax, [rbp+var_40]"], [6, "mov eax, [rax+4]"], [7, "test eax, eax"], [8, "jz short loc_4244CE"], [9, "mov rax, [rbp+var_40]"], [10, "mov eax, [rax+4]"], [11, "lea edx, [rax-1]"], [12, "mov rax, [rbp+var_40]"], [13, "mov [rax+4], edx"], [14, "jmp locret_4246DF"], [15, "mov rax, [rbp+var_40]"], [16, "mov rax, [rax+58h]"], [17, "test rax, rax"], [18, "jz short loc_4244EB"], [19, "mov rax, [rbp+var_40]"], [20, "mov rax, [rax+58h]"], [21, "mov rdi, rax"], [22, "call sub_4028A6"], [23, "mov rax, [rbp+var_40]"], [24, "mov rax, [rax+60h]"], [25, "test rax, rax"], [26, "jz short loc_424508"], [27, "mov rax, [rbp+var_40]"], [28, "mov rax, [rax+60h]"], [29, "mov rdi, rax"], [30, "call _free"], [31, "mov rax, [rbp+var_40]"], [32, "mov rax, [rax+68h]"], [33, "test rax, rax"], [34, "jz loc_4245D3"], [35, "mov rax, [rbp+var_40]"], [36, "mov rax, [rax+68h]"], [37, "test rax, rax"], [38, "jz short loc_424533"], [39, "mov rax, [rbp+var_40]"], [40, "mov rax, [rax+68h]"], [41, "mov rax, [rax]"], [42, "jmp short loc_424538"], [43, "mov eax, 0"], [44, "mov [rbp+var_18], rax"], [45, "mov [rbp+var_8], 0"], [46, "jmp short loc_424594"], [47, "mov rax, [rbp+var_40]"], [48, "mov rax, [rax+68h]"], [49, "mov rax, [rax]"], [50, "cmp [rbp+var_8], rax"], [51, "jnb short loc_424573"], [52, "mov rax, [rbp+var_40]"], [53, "mov rax, [rax+68h]"], [54, "mov rdx, [rax+10h]"], [55, "mov rax, [rbp+var_8]"], [56, "shl rax, 3"], [57, "add rax, rdx"], [58, "mov rax, [rax]"], [59, "jmp short loc_424578"], [60, "mov eax, 0"], [61, "mov [rbp+var_20], rax"], [62, "mov rdx, [rbp+var_20]"], [63, "mov rax, [rbp+var_38]"], [64, "mov rsi, rdx"], [65, "mov rdi, rax"], [66, "call sub_424403"], [67, "add [rbp+var_8], 1"], [68, "mov rax, [rbp+var_8]"], [69, "cmp rax, [rbp+var_18]"], [70, "jb short loc_424546"], [71, "mov rax, [rbp+var_40]"], [72, "mov rax, [rax+68h]"], [73, "mov rax, [rax+10h]"], [74, "test rax, rax"], [75, "jz short loc_4245C3"], [76, "mov rax, [rbp+var_40]"], [77, "mov rax, [rax+68h]"], [78, "mov rax, [rax+10h]"], [79, "mov rdi, rax"], [80, "call _free"], [81, "mov rax, [rbp+var_40]"], [82, "mov rax, [rax+68h]"], [83, "mov rdi, rax"], [84, "call _free"], [85, "mov rax, [rbp+var_40]"], [86, "mov rax, [rax+70h]"], [87, "test rax, rax"], [88, "jz short loc_4245F7"], [89, "mov rax, [rbp+var_40]"], [90, "mov rdx, [rax+70h]"], [91, "mov rax, [rbp+var_38]"], [92, "mov rsi, rdx"], [93, "mov rdi, rax"], [94, "call sub_402F7D"], [95, "mov rax, [rbp+var_40]"], [96, "mov rax, [rax+80h]"], [97, "test rax, rax"], [98, "jz loc_4246D3"], [99, "mov rax, [rbp+var_40]"], [100, "mov rax, [rax+80h]"], [101, "test rax, rax"], [102, "jz short loc_42462B"], [103, "mov rax, [rbp+var_40]"], [104, "mov rax, [rax+80h]"], [105, "mov rax, [rax]"], [106, "jmp short loc_424630"], [107, "mov eax, 0"], [108, "mov [rbp+var_28], rax"], [109, "mov [rbp+var_10], 0"], [110, "jmp short loc_42468B"], [111, "mov rax, [rbp+var_40]"], [112, "mov rax, [rax+80h]"], [113, "mov rax, [rax]"], [114, "cmp [rbp+var_10], rax"], [115, "jnb short loc_424671"], [116, "mov rax, [rbp+var_40]"], [117, "mov rax, [rax+80h]"], [118, "mov rdx, [rax+10h]"], [119, "mov rax, [rbp+var_10]"], [120, "shl rax, 3"], [121, "add rax, rdx"], [122, "mov rax, [rax]"], [123, "jmp short loc_424676"], [124, "mov eax, 0"], [125, "mov [rbp+ptr], rax"], [126, "mov rax, [rbp+ptr]"], [127, "mov rdi, rax"], [128, "call _free"], [129, "add [rbp+var_10], 1"], [130, "mov rax, [rbp+var_10]"], [131, "cmp rax, [rbp+var_28]"], [132, "jb short loc_42463E"], [133, "mov rax, [rbp+var_40]"], [134, "mov rax, [rax+80h]"], [135, "mov rax, [rax+10h]"], [136, "test rax, rax"], [137, "jz short loc_4246C0"], [138, "mov rax, [rbp+var_40]"], [139, "mov rax, [rax+80h]"], [140, "mov rax, [rax+10h]"], [141, "mov rdi, rax"], [142, "call _free"], [143, "mov rax, [rbp+var_40]"], [144, "mov rax, [rax+80h]"], [145, "mov rdi, rax"], [146, "call _free"], [147, "mov rax, [rbp+var_40]"], [148, "mov rdi, rax"], [149, "call _free"], [150, "leave"], [151, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [8, 7], [9, 4], [10, 9], [11, 10], [12, 4], [13, 12], [13, 11], [15, 4], [16, 15], [17, 16], [18, 17], [19, 4], [20, 19], [21, 20], [23, 4], [24, 23], [25, 24], [26, 25], [27, 4], [28, 27], [29, 28], [31, 4], [32, 31], [33, 32], [34, 33], [35, 4], [36, 35], [37, 36], [38, 37], [39, 4], [40, 39], [41, 40], [44, 41], [44, 43], [47, 4], [48, 47], [49, 48], [50, 45], [50, 49], [50, 67], [51, 50], [52, 4], [53, 52], [54, 53], [55, 45], [55, 67], [56, 55], [57, 54], [57, 56], [58, 57], [61, 58], [61, 60], [62, 61], [63, 3], [64, 62], [65, 63], [67, 45], [67, 67], [68, 45], [68, 67], [69, 44], [69, 68], [70, 69], [71, 4], [72, 71], [73, 72], [74, 73], [75, 74], [76, 4], [77, 76], [78, 77], [79, 78], [81, 4], [82, 81], [83, 82], [85, 4], [86, 85], [87, 86], [88, 87], [89, 4], [90, 89], [91, 3], [92, 90], [93, 91], [95, 4], [96, 95], [97, 96], [98, 97], [99, 4], [100, 99], [101, 100], [102, 101], [103, 4], [104, 103], [105, 104], [108, 105], [108, 107], [111, 4], [112, 111], [113, 112], [114, 109], [114, 129], [114, 113], [115, 114], [116, 4], [117, 116], [118, 117], [119, 109], [119, 129], [120, 119], [121, 118], [121, 120], [122, 121], [125, 122], [125, 124], [126, 125], [127, 126], [129, 109], [129, 129], [130, 109], [130, 129], [131, 108], [131, 130], [132, 131], [133, 4], [134, 133], [135, 134], [136, 135], [137, 136], [138, 4], [139, 138], [140, 139], [141, 140], [143, 4], [144, 143], [145, 144], [147, 4], [148, 147], [151, 12], [151, 149]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_42449D", "query": "\n\n\nvoid __fastcall sub_42449D(__int64 a1, __int64 a2)\n{\n__int64 v2; // rax\nvoid *v3; // rax\nunsigned __int64 v4; // [rsp+18h] [rbp-28h]\nunsigned __int64 v5; // [rsp+28h] [rbp-18h]\nunsigned __int64 j; // [rsp+30h] [rbp-10h]\nunsigned __int64 i; // [rsp+38h] [rbp-8h]\n\nif ( *(_DWORD *)(a2 + 4) )\n{\n--*(_DWORD *)(a2 + 4);\n}\nelse\n{\nif ( *(_QWORD *)(a2 + 88) )\nsub_4028A6(*(void ***)(a2 + 88));\nif ( *(_QWORD *)(a2 + 96) )\nfree(*(void **)(a2 + 96));\nif ( *(_QWORD *)(a2 + 104) )\n{\nv5 = **(_QWORD **)(a2 + 104);\nfor ( i = 0LL; i < v5; ++i )\n{\nif ( i >= **(_QWORD **)(a2 + 104) )\nv2 = 0LL;\nelse\nv2 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a2 + 104) + 16LL) + 8 * i);\nsub_424403(a1, v2);\n}\nif ( *(_QWORD *)(*(_QWORD *)(a2 + 104) + 16LL) )\nfree(*(void **)(*(_QWORD *)(a2 + 104) + 16LL));\nfree(*(void **)(a2 + 104));\n}\nif ( *(_QWORD *)(a2 + 112) )\nsub_402F7D(a1, *(unsigned int **)(a2 + 112));\nif ( *(_QWORD *)(a2 + 128) )\n{\nv4 = **(_QWORD **)(a2 + 128);\nfor ( j = 0LL; j < v4; ++j )\n{\nif ( j >= **(_QWORD **)(a2 + 128) )\nv3 = 0LL;\nelse\nv3 = *(void **)(*(_QWORD *)(*(_QWORD *)(a2 + 128) + 16LL) + 8 * j);\nfree(v3);\n}\nif ( *(_QWORD *)(*(_QWORD *)(a2 + 128) + 16LL) )\nfree(*(void **)(*(_QWORD *)(a2 + 128) + 16LL));\nfree(*(void **)(a2 + 128));\n}\nfree((void *)a2);\n}\n}\n\n\n\nQ:[a1,a2,v4,v5,j,i,sub_42449D,sub_4028A6,sub_424403,sub_402F7D,]", "hints": "[]", "response": "{'a1': 'self', 'a2': 'node', 'v4': '_len_0', 'v5': '_len', 'j': '_i_0', 'i': '_i', 'sub_42449D': 'free_function_decl', 'sub_4028A6': 'symboltable_free', 'sub_424403': 'free_variable', 'sub_402F7D': 'gvisit'}"}
[ [ 0.8357312679290771, 0.7463952898979187, 0.7317832112312317, 0.7294946908950806, 0.7158269882202148, 0.7002888321876526, 0.6961686015129089, 0.6948319673538208, 0.6920784115791321, 0.6901987791061401, 0.688985288143158, 0.6871984601020813, 0.6862067580223083, 0.6844080090522766, 0.6817219257354736, 0.6807063221931458, 0.6789993643760681, 0.6782791614532471, 0.6732697486877441, 0.6724899411201477 ], [ 178444, 129859, 260250, 188771, 263618, 10325, 251997, 26514, 75620, 97475, 213480, 141171, 96076, 116833, 189031, 110646, 80967, 34712, 191946, 29425 ] ]
Q_streq
a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040
ec-
Quake3e
NA
qboolean Q_streq( const char *s1, const char *s2 ) { int c1, c2; do { c1 = *s1++; c2 = *s2++; if ( c1 != c2 ) { return qfalse; } } while ( c1 != '\0' ); return qtrue; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_44E56A", "function_addr": 4515178, "binary_name": "a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_20], rsi"], [4, "mov rax, [rbp+var_18]"], [5, "lea rdx, [rax+1]"], [6, "mov [rbp+var_18], rdx"], [7, "movzx eax, byte ptr [rax]"], [8, "movsx eax, al"], [9, "mov [rbp+var_4], eax"], [10, "mov rax, [rbp+var_20]"], [11, "lea rdx, [rax+1]"], [12, "mov [rbp+var_20], rdx"], [13, "movzx eax, byte ptr [rax]"], [14, "movsx eax, al"], [15, "mov [rbp+var_8], eax"], [16, "mov eax, [rbp+var_4]"], [17, "cmp eax, [rbp+var_8]"], [18, "jz short loc_44E5AF"], [19, "mov eax, 0"], [20, "jmp short loc_44E5BA"], [21, "cmp [rbp+var_4], 0"], [22, "jnz short loc_44E576"], [23, "mov eax, 1"], [24, "pop rbp"], [25, "retn"]], "data_dep": [[4, 6], [4, 2], [5, 4], [5, 11], [6, 5], [7, 4], [8, 7], [9, 8], [10, 3], [10, 12], [11, 5], [11, 10], [12, 11], [13, 10], [14, 13], [15, 14], [16, 9], [17, 15], [17, 16], [18, 17], [21, 9], [22, 21], [24, 0], [25, 23], [25, 19]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040_a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.jsonl.gz", "strip_func_name": "sub_44E56A", "query": "\n\n\n__int64 __fastcall sub_44E56A(char *a1, char *a2)\n{\nchar *v2; // rax\nchar *v3; // rax\nint v7; // [rsp+1Ch] [rbp-4h]\n\ndo\n{\nv2 = a1++;\nv7 = *v2;\nv3 = a2++;\nif ( v7 != *v3 )\nreturn 0LL;\n}\nwhile ( v7 );\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,v7,sub_44E56A,]", "hints": "[]", "response": "{'a1': 's1', 'a2': 's2', 'v7': 'c1', 'sub_44E56A': 'Q_streq'}"}
[ [ 0.8176825046539307, 0.7928357720375061, 0.7896502017974854, 0.7868227362632751, 0.7861624956130981, 0.7820478677749634, 0.7760269641876221, 0.7736755609512329, 0.7724182605743408, 0.7713938355445862, 0.7708194255828857, 0.7706289887428284, 0.7670990824699402, 0.7660582065582275, 0.7659949064254761, 0.7647477388381958, 0.7619526982307434, 0.7616733312606812, 0.7600469589233398, 0.7509562373161316 ], [ 33717, 30188, 67473, 261914, 20811, 100536, 139546, 32433, 122925, 178146, 90773, 26339, 89164, 219765, 189347, 63575, 121391, 59739, 228989, 191474 ] ]
write_pidfile
1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88
tj
mon
NA
void write_pidfile(const char *file, pid_t pid) { char buf[32] = {0}; snprintf(buf, 32, "%d", pid); int fd = open(file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); if (fd < 0) perror("open()"); write(fd, buf, 32); close(fd); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401409", "function_addr": 4199433, "binary_name": "1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+file], rdi"], [4, "mov [rbp+var_3C], esi"], [5, "mov qword ptr [rbp+s], 0"], [6, "mov [rbp+var_28], 0"], [7, "mov [rbp+var_20], 0"], [8, "mov [rbp+var_18], 0"], [9, "mov edx, [rbp+var_3C]"], [10, "lea rax, [rbp+s]"], [11, "mov ecx, edx"], [12, "mov edx, offset aD"], [13, "mov esi, 20h "], [14, "mov rdi, rax"], [15, "mov eax, 0"], [16, "call _snprintf"], [17, "mov rax, [rbp+file]"], [18, "mov edx, 180h"], [19, "mov esi, 41h "], [20, "mov rdi, rax"], [21, "mov eax, 0"], [22, "call _open"], [23, "mov [rbp+fd], eax"], [24, "cmp [rbp+fd], 0"], [25, "jns short loc_401486"], [26, "mov edi, offset s"], [27, "call _perror"], [28, "lea rcx, [rbp+s]"], [29, "mov eax, [rbp+fd]"], [30, "mov edx, 20h "], [31, "mov rsi, rcx"], [32, "mov edi, eax"], [33, "call _write"], [34, "mov eax, [rbp+fd]"], [35, "mov edi, eax"], [36, "call _close"], [37, "nop"], [38, "leave"], [39, "retn"]], "data_dep": [[9, 4], [10, 5], [11, 9], [14, 10], [17, 3], [20, 17], [23, 22], [24, 23], [25, 24], [28, 5], [28, 11], [29, 23], [31, 28], [32, 29], [34, 23], [35, 34], [39, 36]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88_1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88.jsonl.gz", "strip_func_name": "sub_401409", "query": "\n\n\nint __fastcall sub_401409(const char *a1, unsigned int a2)\n{\nchar s[8]; // [rsp+10h] [rbp-30h] BYREF\n__int64 v4; // [rsp+18h] [rbp-28h]\n__int64 v5; // [rsp+20h] [rbp-20h]\n__int64 v6; // [rsp+28h] [rbp-18h]\nint fd; // [rsp+3Ch] [rbp-4h]\n\n*(_QWORD *)s = 0LL;\nv4 = 0LL;\nv5 = 0LL;\nv6 = 0LL;\nsnprintf(s, 0x20uLL, \"%d\", a2);\nfd = open(a1, 65, 384LL);\nif ( fd < 0 )\nperror(\"open()\");\nwrite(fd, s, 0x20uLL);\nreturn close(fd);\n}\n\n\n\nQ:[a1,a2,s,sub_401409,]", "hints": "[]", "response": "{'a1': 'file', 'a2': 'pid', 's': 'buf', 'sub_401409': 'write_pidfile'}"}
[ [ 0.8405622243881226, 0.8405275344848633, 0.8052468299865723, 0.7806118726730347, 0.7805413603782654, 0.770013153553009, 0.7658881545066833, 0.765494167804718, 0.7628870606422424, 0.760638415813446, 0.7589027285575867, 0.7586866617202759, 0.7528082132339478, 0.7515465021133423, 0.7507994174957275, 0.7483953237533569, 0.7429392337799072, 0.7416596412658691, 0.7405869960784912, 0.7380004525184631 ], [ 81157, 84713, 128640, 28211, 2299, 28273, 207738, 116877, 121128, 132876, 140134, 203666, 90982, 189946, 97011, 26875, 222576, 184103, 162461, 190435 ] ]
is_newline
b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97
marcobambini
gravity
NA
static inline bool is_newline (gravity_lexer_t *lexer, int c) { // CR: Carriage Return, U+000D (UTF-8 in hex: 0D) // LF: Line Feed, U+000A (UTF-8 in hex: 0A) // CR+LF: CR (U+000D) followed by LF (U+000A) (UTF-8 in hex: 0D0A) // LF if (c == 0x0A) return true; // CR+LF or CR if (c == 0x0D) { if (PEEK_CURRENT == 0x0A) {NEXT;} return true; } // UTF-8 cases https://en.wikipedia.org/wiki/Newline#Unicode // NEL: Next Line, U+0085 (UTF-8 in hex: C285) if ((c == 0xC2) && (PEEK_CURRENT == 0x85)) { NEXT; return true; } // LS: Line Separator, U+2028 (UTF-8 in hex: E280A8) if ((c == 0xE2) && (PEEK_CURRENT == 0x80) && (PEEK_NEXT == 0xA8)) { NEXT; NEXT; return true; } // and probably more not handled here return false; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41EDE1", "function_addr": 4320737, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_C], esi"], [4, "cmp [rbp+var_C], 0Ah"], [5, "jnz short loc_41EDF9"], [6, "mov eax, 1"], [7, "jmp short loc_41EE58"], [8, "cmp [rbp+var_C], 0Dh"], [9, "jnz short loc_41EE53"], [10, "mov rax, [rbp+var_8]"], [11, "mov rdx, [rax]"], [12, "mov rax, [rbp+var_8]"], [13, "mov eax, [rax+8]"], [14, "mov eax, eax"], [15, "add rax, rdx"], [16, "movzx eax, byte ptr [rax]"], [17, "cmp al, 0Ah"], [18, "jnz short loc_41EE4C"], [19, "mov rax, [rbp+var_8]"], [20, "mov eax, [rax+8]"], [21, "lea edx, [rax+1]"], [22, "mov rax, [rbp+var_8]"], [23, "mov [rax+8], edx"], [24, "mov rax, [rbp+var_8]"], [25, "mov eax, [rax+0Ch]"], [26, "lea edx, [rax+1]"], [27, "mov rax, [rbp+var_8]"], [28, "mov [rax+0Ch], edx"], [29, "mov rax, [rbp+var_8]"], [30, "mov eax, [rax+18h]"], [31, "lea edx, [rax+1]"], [32, "mov rax, [rbp+var_8]"], [33, "mov [rax+18h], edx"], [34, "mov eax, 1"], [35, "jmp short loc_41EE58"], [36, "mov eax, 0"], [37, "pop rbp"], [38, "retn"]], "data_dep": [[4, 3], [5, 4], [8, 3], [9, 8], [10, 2], [11, 10], [12, 2], [13, 12], [14, 13], [15, 11], [15, 14], [16, 15], [17, 16], [18, 17], [19, 2], [20, 19], [21, 11], [21, 20], [22, 2], [23, 22], [23, 21], [24, 2], [25, 23], [25, 24], [26, 21], [26, 23], [26, 25], [27, 2], [28, 27], [28, 26], [29, 2], [30, 29], [30, 28], [31, 26], [31, 28], [31, 30], [32, 2], [33, 32], [33, 31], [37, 0], [38, 34], [38, 6], [38, 36]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_41EDE1", "query": "\n\n\n__int64 __fastcall sub_41EDE1(__int64 a1, int a2)\n{\nif ( a2 == 10 )\nreturn 1LL;\nif ( a2 != 13 )\nreturn 0LL;\nif ( *(_BYTE *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8)) == 10 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 24);\n}\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,sub_41EDE1,]", "hints": "[]", "response": "{'a1': 'lexer', 'a2': 'c', 'sub_41EDE1': 'is_newline'}"}
[ [ 0.844123363494873, 0.7923170328140259, 0.770888090133667, 0.7705284953117371, 0.7377934455871582, 0.6997362375259399, 0.6925138235092163, 0.6919937133789062, 0.6879609227180481, 0.6865284442901611, 0.6836137771606445, 0.6757092475891113, 0.6750866770744324, 0.6656648516654968, 0.6655731797218323, 0.665221095085144, 0.6650504469871521, 0.6639388799667358, 0.663716733455658, 0.6594704389572144 ], [ 125692, 153170, 31256, 223901, 2738, 120528, 223657, 104970, 208943, 252166, 94738, 235204, 38531, 85445, 15982, 174972, 65370, 70948, 24857, 264215 ] ]
establish_signal_handlers
7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e
OpenIPC
mini
NA
void establish_signal_handlers (void) { struct sigaction exit_action, ign_action; /* Set up the structure to specify the exit action. */ exit_action.sa_handler = deadly_handler; sigemptyset (&exit_action.sa_mask); exit_action.sa_flags = 0; /* Set up the structure to specify the ignore action. */ ign_action.sa_handler = SIG_IGN; sigemptyset (&ign_action.sa_mask); ign_action.sa_flags = 0; sigaction (SIGTERM, &exit_action, NULL); sigaction (SIGINT, &ign_action, NULL); sigaction (SIGHUP, &ign_action, NULL); sigaction (SIGALRM, &ign_action, NULL); sigaction (SIGUSR1, &ign_action, NULL); sigaction (SIGUSR2, &ign_action, NULL); sigaction (SIGPIPE, &ign_action, NULL); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405507", "function_addr": 4216071, "binary_name": "7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 140h"], [3, "mov [rbp+var_A0], offset sub_4054D4"], [4, "lea rax, [rbp+var_A0]"], [5, "add rax, 8"], [6, "mov rdi, rax"], [7, "call _sigemptyset"], [8, "mov [rbp+var_18], 0"], [9, "mov [rbp+var_140], 1"], [10, "lea rax, [rbp+var_140]"], [11, "add rax, 8"], [12, "mov rdi, rax"], [13, "call _sigemptyset"], [14, "mov [rbp+var_B8], 0"], [15, "lea rax, [rbp+var_A0]"], [16, "mov edx, 0"], [17, "mov rsi, rax"], [18, "mov edi, 0Fh"], [19, "call _sigaction"], [20, "lea rax, [rbp+var_140]"], [21, "mov edx, 0"], [22, "mov rsi, rax"], [23, "mov edi, 2"], [24, "call _sigaction"], [25, "lea rax, [rbp+var_140]"], [26, "mov edx, 0"], [27, "mov rsi, rax"], [28, "mov edi, 1"], [29, "call _sigaction"], [30, "lea rax, [rbp+var_140]"], [31, "mov edx, 0"], [32, "mov rsi, rax"], [33, "mov edi, 0Eh"], [34, "call _sigaction"], [35, "lea rax, [rbp+var_140]"], [36, "mov edx, 0"], [37, "mov rsi, rax"], [38, "mov edi, 0Ah"], [39, "call _sigaction"], [40, "lea rax, [rbp+var_140]"], [41, "mov edx, 0"], [42, "mov rsi, rax"], [43, "mov edi, 0Ch"], [44, "call _sigaction"], [45, "lea rax, [rbp+var_140]"], [46, "mov edx, 0"], [47, "mov rsi, rax"], [48, "mov edi, 0Dh"], [49, "call _sigaction"], [50, "nop"], [51, "leave"], [52, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [10, 9], [10, 7], [11, 10], [12, 11], [15, 13], [15, 3], [17, 15], [20, 19], [20, 9], [22, 20], [25, 9], [25, 24], [27, 25], [30, 9], [30, 29], [32, 30], [35, 34], [35, 9], [37, 35], [40, 9], [40, 39], [42, 40], [45, 9], [45, 44], [47, 45], [52, 49]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e_7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.jsonl.gz", "strip_func_name": "sub_405507", "query": "\n\n\nint sub_405507()\n{\nstruct sigaction v1; // [rsp+0h] [rbp-140h] BYREF\nstruct sigaction v2; // [rsp+A0h] [rbp-A0h] BYREF\n\nv2.sa_handler = (__sighandler_t)sub_4054D4;\nsigemptyset(&v2.sa_mask);\nv2.sa_flags = 0;\nv1.sa_handler = (__sighandler_t)1;\nsigemptyset(&v1.sa_mask);\nv1.sa_flags = 0;\nsigaction(15, &v2, 0LL);\nsigaction(2, &v1, 0LL);\nsigaction(1, &v1, 0LL);\nsigaction(14, &v1, 0LL);\nsigaction(10, &v1, 0LL);\nsigaction(12, &v1, 0LL);\nreturn sigaction(13, &v1, 0LL);\n}\n\n\n\nQ:[v1,v2,sub_405507,sub_4054D4,]", "hints": "[]", "response": "{'v1': 'ign_action', 'v2': 'exit_action', 'sub_405507': 'establish_signal_handlers', 'sub_4054D4': 'deadly_handler'}"}
[ [ 0.8911988735198975, 0.8823337554931641, 0.8800406455993652, 0.8775516748428345, 0.8761890530586243, 0.8610086441040039, 0.8596805334091187, 0.8584505319595337, 0.8572152256965637, 0.8545759916305542, 0.8534405827522278, 0.8519462943077087, 0.8515607118606567, 0.8513383865356445, 0.8505063652992249, 0.8463702201843262, 0.8439111113548279, 0.835745096206665, 0.8347921371459961, 0.8320745229721069 ], [ 249264, 38459, 71538, 49977, 9085, 184328, 204017, 192212, 173715, 184413, 37356, 129461, 106238, 236654, 70999, 116383, 202356, 151394, 111822, 210826 ] ]
mat_create
443b05cf5e6b0d769636a3ab272e98de151c25a2632e1f372d19ee46d760d75d
caisah
Sedgewick-algorithms-in-c-exercises-and-examples
NA
mat mat_create(int rows, int cols) { mat m = malloc(sizeof(mat)); int i; m->rows = rows; m->cols = cols; m->item = malloc(rows*sizeof(Item*)); for (i = 0; i < rows; i++) m->item[i] = malloc(cols*sizeof(Item)); return m; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40149B", "function_addr": 4199579, "binary_name": "443b05cf5e6b0d769636a3ab272e98de151c25a2632e1f372d19ee46d760d75d.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 28h"], [4, "mov [rbp+var_24], edi"], [5, "mov [rbp+var_28], esi"], [6, "mov edi, 8"], [7, "call _malloc"], [8, "mov [rbp+var_20], rax"], [9, "mov rax, [rbp+var_20]"], [10, "mov edx, [rbp+var_24]"], [11, "mov [rax+8], edx"], [12, "mov rax, [rbp+var_20]"], [13, "mov edx, [rbp+var_28]"], [14, "mov [rax+0Ch], edx"], [15, "mov eax, [rbp+var_24]"], [16, "cdqe"], [17, "shl rax, 3"], [18, "mov rdi, rax"], [19, "call _malloc"], [20, "mov rdx, rax"], [21, "mov rax, [rbp+var_20]"], [22, "mov [rax], rdx"], [23, "mov [rbp+var_14], 0"], [24, "jmp short loc_40151D"], [25, "mov eax, [rbp+var_28]"], [26, "cdqe"], [27, "shl rax, 2"], [28, "mov rdx, [rbp+var_20]"], [29, "mov rcx, [rdx]"], [30, "mov edx, [rbp+var_14]"], [31, "movsxd rdx, edx"], [32, "shl rdx, 3"], [33, "lea rbx, [rcx+rdx]"], [34, "mov rdi, rax"], [35, "call _malloc"], [36, "mov [rbx], rax"], [37, "add [rbp+var_14], 1"], [38, "mov eax, [rbp+var_14]"], [39, "cmp eax, [rbp+var_24]"], [40, "jl short loc_4014F0"], [41, "mov rax, [rbp+var_20]"], [42, "mov rbx, [rbp+var_8]"], [43, "leave"], [44, "retn"]], "data_dep": [[8, 7], [9, 8], [10, 4], [11, 10], [11, 9], [12, 8], [13, 5], [14, 13], [14, 12], [15, 4], [17, 15], [18, 17], [20, 19], [21, 8], [22, 20], [22, 21], [25, 5], [27, 25], [28, 8], [29, 14], [29, 22], [29, 28], [29, 36], [29, 11], [30, 23], [30, 37], [31, 30], [32, 31], [33, 36], [33, 11], [33, 14], [33, 29], [33, 22], [33, 33], [34, 27], [36, 33], [36, 35], [37, 23], [37, 37], [38, 23], [38, 37], [39, 38], [39, 4], [40, 39], [41, 8], [44, 41]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/443b05cf5e6b0d769636a3ab272e98de151c25a2632e1f372d19ee46d760d75d_443b05cf5e6b0d769636a3ab272e98de151c25a2632e1f372d19ee46d760d75d.jsonl.gz", "strip_func_name": "sub_40149B", "query": "\n\n\n_DWORD *__fastcall sub_40149B(int a1, int a2)\n{\nvoid **v2; // rbx\n_DWORD *v4; // [rsp+10h] [rbp-20h]\nint i; // [rsp+1Ch] [rbp-14h]\n\nv4 = malloc(8uLL);\nv4[2] = a1;\nv4[3] = a2;\n*(_QWORD *)v4 = malloc(8LL * a1);\nfor ( i = 0; i < a1; ++i )\n{\nv2 = (void **)(*(_QWORD *)v4 + 8LL * i);\n*v2 = malloc(4LL * a2);\n}\nreturn v4;\n}\n\n\n\nQ:[a1,a2,v4,sub_40149B,]", "hints": "[]", "response": "{'a1': 'rows', 'a2': 'cols', 'v4': 'm', 'sub_40149B': 'mat_create'}"}
[ [ 0.8679542541503906, 0.8575387597084045, 0.8507456183433533, 0.8403225541114807, 0.8139146566390991, 0.8059660792350769, 0.798061728477478, 0.7963356971740723, 0.7952059507369995, 0.7936846017837524, 0.7877860069274902, 0.7833311557769775, 0.7826263904571533, 0.7810021042823792, 0.779752254486084, 0.779501736164093, 0.7640818357467651, 0.7636483907699585, 0.7619576454162598, 0.7586579322814941 ], [ 100755, 52454, 251851, 38023, 161682, 51648, 202556, 48586, 166943, 190306, 142630, 45844, 199172, 224502, 40572, 18428, 27664, 168636, 217566, 44679 ] ]
gz_open
4a26162d52baa49e02bcf6b75ffa2f7a6e8bdc4994017d29e9af644edca214c3
Logitech
squeezeplay
NA
local gzFile gz_open (path, mode, fd) const char *path; const char *mode; int fd; { int err; int level = Z_DEFAULT_COMPRESSION; /* compression level */ int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ char *p = (char*)mode; gz_stream *s; char fmode[80]; /* copy of mode, without the compression level */ char *m = fmode; if (!path || !mode) return Z_NULL; s = (gz_stream *)ALLOC(sizeof(gz_stream)); if (!s) return Z_NULL; s->stream.zalloc = (alloc_func)0; s->stream.zfree = (free_func)0; s->stream.opaque = (voidpf)0; s->stream.next_in = s->inbuf = Z_NULL; s->stream.next_out = s->outbuf = Z_NULL; s->stream.avail_in = s->stream.avail_out = 0; s->file = NULL; s->z_err = Z_OK; s->z_eof = 0; s->in = 0; s->out = 0; s->back = EOF; s->crc = crc32(0L, Z_NULL, 0); s->msg = NULL; s->transparent = 0; s->path = (char*)ALLOC(strlen(path)+1); if (s->path == NULL) { return destroy(s), (gzFile)Z_NULL; } strcpy(s->path, path); /* do this early for debugging */ s->mode = '\0'; do { if (*p == 'r') s->mode = 'r'; if (*p == 'w' || *p == 'a') s->mode = 'w'; if (*p >= '0' && *p <= '9') { level = *p - '0'; } else if (*p == 'f') { strategy = Z_FILTERED; } else if (*p == 'h') { strategy = Z_HUFFMAN_ONLY; } else if (*p == 'R') { strategy = Z_RLE; } else { *m++ = *p; /* copy the mode */ } } while (*p++ && m != fmode + sizeof(fmode)); if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; if (s->mode == 'w') { #ifdef NO_GZCOMPRESS err = Z_STREAM_ERROR; #else err = deflateInit2(&(s->stream), level, Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); /* windowBits is passed < 0 to suppress zlib header */ s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); #endif if (err != Z_OK || s->outbuf == Z_NULL) { return destroy(s), (gzFile)Z_NULL; } } else { s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); err = inflateInit2(&(s->stream), -MAX_WBITS); /* windowBits is passed < 0 to tell that there is no zlib header. * Note that in this case inflate *requires* an extra "dummy" byte * after the compressed stream in order to complete decompression and * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are * present after the compressed stream. */ if (err != Z_OK || s->inbuf == Z_NULL) { return destroy(s), (gzFile)Z_NULL; } } s->stream.avail_out = Z_BUFSIZE; errno = 0; s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); if (s->file == NULL) { return destroy(s), (gzFile)Z_NULL; } if (s->mode == 'w') { /* Write a very simple .gz header: */ fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); s->start = 10L; /* We use 10L instead of ftell(s->file) to because ftell causes an * fflush on some systems. This version of the library doesn't use * start anyway in write mode, so this initialization is not * necessary. */ } else { check_header(s); /* skip the .gz header */ s->start = ftell(s->file) - s->stream.avail_in; } return (gzFile)s; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402257", "function_addr": 4203095, "binary_name": "4a26162d52baa49e02bcf6b75ffa2f7a6e8bdc4994017d29e9af644edca214c3.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+s], rdi"], [4, "mov [rbp+var_90], rsi"], [5, "mov [rbp+fd], edx"], [6, "mov [rbp+var_4], 0FFFFFFFFh"], [7, "mov [rbp+var_8], 0"], [8, "mov rax, [rbp+var_90]"], [9, "mov [rbp+var_10], rax"], [10, "lea rax, [rbp+modes]"], [11, "mov [rbp+var_18], rax"], [12, "cmp [rbp+s], 0"], [13, "jz short loc_4022AB"], [14, "cmp [rbp+var_90], 0"], [15, "jnz short loc_4022B5"], [16, "mov eax, 0"], [17, "jmp locret_402766"], [18, "mov edi, 0D0h"], [19, "call _malloc"], [20, "mov [rbp+var_20], rax"], [21, "cmp [rbp+var_20], 0"], [22, "jnz short loc_4022D4"], [23, "mov eax, 0"], [24, "jmp locret_402766"], [25, "mov rax, [rbp+var_20]"], [26, "mov qword ptr [rax+40h], 0"], [27, "mov rax, [rbp+var_20]"], [28, "mov qword ptr [rax+48h], 0"], [29, "mov rax, [rbp+var_20]"], [30, "mov qword ptr [rax+50h], 0"], [31, "mov rax, [rbp+var_20]"], [32, "mov qword ptr [rax+80h], 0"], [33, "mov rax, [rbp+var_20]"], [34, "mov qword ptr [rax], 0"], [35, "mov rax, [rbp+var_20]"], [36, "mov qword ptr [rax+88h], 0"], [37, "mov rax, [rbp+var_20]"], [38, "mov qword ptr [rax+18h], 0"], [39, "mov rax, [rbp+var_20]"], [40, "mov dword ptr [rax+20h], 0"], [41, "mov rax, [rbp+var_20]"], [42, "mov edx, [rax+20h]"], [43, "mov rax, [rbp+var_20]"], [44, "mov [rax+8], edx"], [45, "mov rax, [rbp+var_20]"], [46, "mov qword ptr [rax+78h], 0"], [47, "mov rax, [rbp+var_20]"], [48, "mov dword ptr [rax+70h], 0"], [49, "mov rax, [rbp+var_20]"], [50, "mov dword ptr [rax+74h], 0"], [51, "mov rax, [rbp+var_20]"], [52, "mov qword ptr [rax+0B8h], 0"], [53, "mov rax, [rbp+var_20]"], [54, "mov qword ptr [rax+0C0h], 0"], [55, "mov rax, [rbp+var_20]"], [56, "mov dword ptr [rax+0C8h], 0FFFFFFFFh"], [57, "mov edx, 0"], [58, "mov esi, 0"], [59, "mov edi, 0"], [60, "call sub_410619"], [61, "mov rdx, [rbp+var_20]"], [62, "mov [rdx+90h], rax"], [63, "mov rax, [rbp+var_20]"], [64, "mov qword ptr [rax+98h], 0"], [65, "mov rax, [rbp+var_20]"], [66, "mov dword ptr [rax+0A8h], 0"], [67, "mov rax, [rbp+s]"], [68, "mov rdi, rax"], [69, "call _strlen"], [70, "add rax, 1"], [71, "mov rdi, rax"], [72, "call _malloc"], [73, "mov rdx, rax"], [74, "mov rax, [rbp+var_20]"], [75, "mov [rax+0A0h], rdx"], [76, "mov rax, [rbp+var_20]"], [77, "mov rax, [rax+0A0h]"], [78, "test rax, rax"], [79, "jnz short loc_40241F"], [80, "mov rax, [rbp+var_20]"], [81, "mov rdi, rax"], [82, "call sub_402C0C"], [83, "mov eax, 0"], [84, "jmp locret_402766"], [85, "mov rax, [rbp+var_20]"], [86, "mov rax, [rax+0A0h]"], [87, "mov rdx, [rbp+s]"], [88, "mov rsi, rdx"], [89, "mov rdi, rax"], [90, "call _strcpy"], [91, "mov rax, [rbp+var_20]"], [92, "mov byte ptr [rax+0ACh], 0"], [93, "mov rax, [rbp+var_10]"], [94, "movzx eax, byte ptr [rax]"], [95, "cmp al, 72h "], [96, "jnz short loc_40245D"], [97, "mov rax, [rbp+var_20]"], [98, "mov byte ptr [rax+0ACh], 72h "], [99, "mov rax, [rbp+var_10]"], [100, "movzx eax, byte ptr [rax]"], [101, "cmp al, 77h "], [102, "jz short loc_402473"], [103, "mov rax, [rbp+var_10]"], [104, "movzx eax, byte ptr [rax]"], [105, "cmp al, 61h "], [106, "jnz short loc_40247E"], [107, "mov rax, [rbp+var_20]"], [108, "mov byte ptr [rax+0ACh], 77h "], [109, "mov rax, [rbp+var_10]"], [110, "movzx eax, byte ptr [rax]"], [111, "cmp al, 2Fh "], [112, "jle short loc_4024A6"], [113, "mov rax, [rbp+var_10]"], [114, "movzx eax, byte ptr [rax]"], [115, "cmp al, 39h "], [116, "jg short loc_4024A6"], [117, "mov rax, [rbp+var_10]"], [118, "movzx eax, byte ptr [rax]"], [119, "movsx eax, al"], [120, "sub eax, 30h "], [121, "mov [rbp+var_4], eax"], [122, "jmp short loc_4024F7"], [123, "mov rax, [rbp+var_10]"], [124, "movzx eax, byte ptr [rax]"], [125, "cmp al, 66h "], [126, "jnz short loc_4024BA"], [127, "mov [rbp+var_8], 1"], [128, "jmp short loc_4024F7"], [129, "mov rax, [rbp+var_10]"], [130, "movzx eax, byte ptr [rax]"], [131, "cmp al, 68h "], [132, "jnz short loc_4024CE"], [133, "mov [rbp+var_8], 2"], [134, "jmp short loc_4024F7"], [135, "mov rax, [rbp+var_10]"], [136, "movzx eax, byte ptr [rax]"], [137, "cmp al, 52h "], [138, "jnz short loc_4024E2"], [139, "mov [rbp+var_8], 3"], [140, "jmp short loc_4024F7"], [141, "mov rax, [rbp+var_18]"], [142, "lea rdx, [rax+1]"], [143, "mov [rbp+var_18], rdx"], [144, "mov rdx, [rbp+var_10]"], [145, "movzx edx, byte ptr [rdx]"], [146, "mov [rax], dl"], [147, "mov rax, [rbp+var_10]"], [148, "lea rdx, [rax+1]"], [149, "mov [rbp+var_10], rdx"], [150, "movzx eax, byte ptr [rax]"], [151, "test al, al"], [152, "jz short loc_40251C"], [153, "lea rax, [rbp+modes]"], [154, "add rax, 50h "], [155, "cmp [rbp+var_18], rax"], [156, "jnz loc_402447"], [157, "mov rax, [rbp+var_20]"], [158, "movzx eax, byte ptr [rax+0ACh]"], [159, "test al, al"], [160, "jnz short loc_402541"], [161, "mov rax, [rbp+var_20]"], [162, "mov rdi, rax"], [163, "call sub_402C0C"], [164, "mov eax, 0"], [165, "jmp locret_402766"], [166, "mov rax, [rbp+var_20]"], [167, "movzx eax, byte ptr [rax+0ACh]"], [168, "cmp al, 77h "], [169, "jnz loc_4025E2"], [170, "mov rax, [rbp+var_20]"], [171, "mov edx, [rbp+var_8]"], [172, "mov esi, [rbp+var_4]"], [173, "push 70h "], [174, "push offset a123"], [175, "mov r9d, edx"], [176, "mov r8d, 8"], [177, "mov ecx, 0FFFFFFF1h"], [178, "mov edx, 8"], [179, "mov rdi, rax"], [180, "call sub_4041C6"], [181, "add rsp, 10h"], [182, "mov [rbp+var_24], eax"], [183, "mov edi, 4000h"], [184, "call _malloc"], [185, "mov rdx, rax"], [186, "mov rax, [rbp+var_20]"], [187, "mov [rax+88h], rdx"], [188, "mov rax, [rbp+var_20]"], [189, "mov rdx, [rax+88h]"], [190, "mov rax, [rbp+var_20]"], [191, "mov [rax+18h], rdx"], [192, "cmp [rbp+var_24], 0"], [193, "jnz short loc_4025CC"], [194, "mov rax, [rbp+var_20]"], [195, "mov rax, [rax+88h]"], [196, "test rax, rax"], [197, "jnz loc_402656"], [198, "mov rax, [rbp+var_20]"], [199, "mov rdi, rax"], [200, "call sub_402C0C"], [201, "mov eax, 0"], [202, "jmp locret_402766"], [203, "mov edi, 4000h"], [204, "call _malloc"], [205, "mov rdx, rax"], [206, "mov rax, [rbp+var_20]"], [207, "mov [rax+80h], rdx"], [208, "mov rax, [rbp+var_20]"], [209, "mov rdx, [rax+80h]"], [210, "mov rax, [rbp+var_20]"], [211, "mov [rax], rdx"], [212, "mov rax, [rbp+var_20]"], [213, "mov ecx, 70h "], [214, "mov edx, offset a123"], [215, "mov esi, 0FFFFFFF1h"], [216, "mov rdi, rax"], [217, "call sub_40C135"], [218, "mov [rbp+var_24], eax"], [219, "cmp [rbp+var_24], 0"], [220, "jnz short loc_402640"], [221, "mov rax, [rbp+var_20]"], [222, "mov rax, [rax+80h]"], [223, "test rax, rax"], [224, "jnz short loc_402656"], [225, "mov rax, [rbp+var_20]"], [226, "mov rdi, rax"], [227, "call sub_402C0C"], [228, "mov eax, 0"], [229, "jmp locret_402766"], [230, "mov rax, [rbp+var_20]"], [231, "mov dword ptr [rax+20h], 4000h"], [232, "call ___errno_location"], [233, "mov dword ptr [rax], 0"], [234, "cmp [rbp+fd], 0"], [235, "jns short loc_40268D"], [236, "lea rdx, [rbp+modes]"], [237, "mov rax, [rbp+s]"], [238, "mov rsi, rdx"], [239, "mov rdi, rax"], [240, "call _fopen"], [241, "jmp short loc_4026A1"], [242, "lea rdx, [rbp+modes]"], [243, "mov eax, [rbp+fd]"], [244, "mov rsi, rdx"], [245, "mov edi, eax"], [246, "call _fdopen"], [247, "mov rdx, [rbp+var_20]"], [248, "mov [rdx+78h], rax"], [249, "mov rax, [rbp+var_20]"], [250, "mov rax, [rax+78h]"], [251, "test rax, rax"], [252, "jnz short loc_4026CC"], [253, "mov rax, [rbp+var_20]"], [254, "mov rdi, rax"], [255, "call sub_402C0C"], [256, "mov eax, 0"], [257, "jmp locret_402766"], [258, "mov rax, [rbp+var_20]"], [259, "movzx eax, byte ptr [rax+0ACh]"], [260, "cmp al, 77h "], [261, "jnz short loc_40272C"], [262, "mov ecx, 8Bh"], [263, "mov edx, 1Fh"], [264, "mov rax, [rbp+var_20]"], [265, "mov rax, [rax+78h]"], [266, "push 3"], [267, "push 0"], [268, "push 0"], [269, "push 0"], [270, "push 0"], [271, "push 0"], [272, "mov r9d, 0"], [273, "mov r8d, 8"], [274, "mov esi, offset aCCCCCCCCCC"], [275, "mov rdi, rax"], [276, "mov eax, 0"], [277, "call _fprintf"], [278, "add rsp, 30h"], [279, "mov rax, [rbp+var_20]"], [280, "mov qword ptr [rax+0B0h], 0Ah"], [281, "jmp short loc_402762"], [282, "mov rax, [rbp+var_20]"], [283, "mov rdi, rax"], [284, "call sub_402975"], [285, "mov rax, [rbp+var_20]"], [286, "mov rax, [rax+78h]"], [287, "mov rdi, rax"], [288, "call _ftell"], [289, "mov rdx, [rbp+var_20]"], [290, "mov edx, [rdx+8]"], [291, "mov ecx, edx"], [292, "sub rax, rcx"], [293, "mov rdx, rax"], [294, "mov rax, [rbp+var_20]"], [295, "mov [rax+0B0h], rdx"], [296, "mov rax, [rbp+var_20]"], [297, "leave"], [298, "retn"]], "data_dep": [[8, 4], [9, 8], [10, 8], [11, 10], [12, 3], [13, 12], [14, 4], [15, 14], [20, 19], [21, 20], [22, 21], [25, 20], [26, 25], [27, 20], [28, 27], [29, 20], [30, 29], [31, 20], [32, 31], [33, 20], [34, 33], [35, 20], [36, 35], [37, 20], [38, 37], [39, 20], [40, 39], [41, 20], [42, 41], [42, 40], [43, 20], [44, 42], [44, 43], [45, 20], [46, 45], [47, 20], [48, 47], [49, 20], [50, 49], [51, 20], [52, 51], [53, 20], [54, 53], [55, 20], [56, 55], [61, 20], [62, 60], [62, 61], [63, 20], [64, 63], [65, 20], [66, 65], [67, 3], [68, 67], [70, 69], [71, 70], [73, 72], [74, 20], [75, 74], [75, 73], [76, 20], [77, 76], [77, 75], [78, 77], [79, 78], [80, 20], [81, 80], [85, 20], [86, 40], [86, 26], [86, 44], [86, 30], [86, 48], [86, 34], [86, 85], [86, 62], [86, 66], [86, 75], [86, 52], [86, 38], [86, 56], [86, 28], [86, 46], [86, 32], [86, 92], [86, 64], [86, 50], [86, 36], [86, 54], [87, 3], [88, 87], [89, 86], [91, 20], [92, 91], [93, 149], [93, 9], [94, 30], [94, 34], [94, 146], [94, 108], [94, 62], [94, 98], [94, 48], [94, 66], [94, 75], [94, 52], [94, 38], [94, 56], [94, 28], [94, 46], [94, 32], [94, 93], [94, 92], [94, 64], [94, 50], [94, 36], [94, 54], [94, 40], [94, 26], [94, 44], [95, 94], [96, 95], [97, 20], [98, 97], [99, 149], [99, 9], [100, 92], [100, 64], [100, 50], [100, 36], [100, 54], [100, 40], [100, 26], [100, 44], [100, 30], [100, 34], [100, 146], [100, 99], [100, 108], [100, 62], [100, 98], [100, 48], [100, 66], [100, 75], [100, 52], [100, 38], [100, 56], [100, 28], [100, 46], [100, 32], [101, 100], [102, 101], [103, 149], [103, 9], [104, 62], [104, 98], [104, 48], [104, 66], [104, 75], [104, 52], [104, 38], [104, 56], [104, 28], [104, 46], [104, 32], [104, 92], [104, 64], [104, 50], [104, 36], [104, 54], [104, 40], [104, 26], [104, 44], [104, 30], [104, 34], [104, 146], [104, 108], [104, 103], [105, 104], [106, 105], [107, 20], [108, 107], [109, 149], [109, 9], [110, 38], [110, 109], [110, 108], [110, 98], [110, 66], [110, 75], [110, 52], [110, 56], [110, 28], [110, 46], [110, 32], [110, 50], [110, 36], [110, 92], [110, 64], [110, 54], [110, 40], [110, 26], [110, 44], [110, 62], [110, 30], [110, 48], [110, 34], [110, 146], [111, 110], [112, 111], [113, 149], [113, 9], [114, 92], [114, 64], [114, 54], [114, 40], [114, 26], [114, 44], [114, 62], [114, 30], [114, 48], [114, 34], [114, 146], [114, 113], [114, 108], [114, 98], [114, 66], [114, 75], [114, 52], [114, 38], [114, 56], [114, 28], [114, 46], [114, 32], [114, 50], [114, 36], [115, 114], [116, 115], [117, 149], [117, 9], [118, 108], [118, 117], [118, 98], [118, 66], [118, 75], [118, 52], [118, 38], [118, 56], [118, 28], [118, 46], [118, 32], [118, 36], [118, 92], [118, 64], [118, 50], [118, 54], [118, 40], [118, 26], [118, 44], [118, 62], [118, 30], [118, 48], [118, 34], [118, 146], [119, 118], [120, 119], [121, 120], [123, 149], [123, 9], [124, 40], [124, 26], [124, 44], [124, 62], [124, 30], [124, 48], [124, 34], [124, 146], [124, 123], [124, 108], [124, 98], [124, 66], [124, 75], [124, 52], [124, 38], [124, 56], [124, 28], [124, 46], [124, 32], [124, 50], [124, 36], [124, 92], [124, 64], [124, 54], [125, 124], [126, 125], [129, 149], [129, 9], [130, 92], [130, 64], [130, 50], [130, 36], [130, 54], [130, 40], [130, 26], [130, 44], [130, 30], [130, 34], [130, 146], [130, 108], [130, 62], [130, 98], [130, 48], [130, 66], [130, 75], [130, 52], [130, 38], [130, 56], [130, 28], [130, 46], [130, 32], [130, 129], [131, 130], [132, 131], [135, 149], [135, 9], [136, 32], [136, 50], [136, 135], [136, 36], [136, 92], [136, 54], [136, 40], [136, 26], [136, 44], [136, 62], [136, 30], [136, 48], [136, 34], [136, 146], [136, 38], [136, 108], [136, 98], [136, 66], [136, 75], [136, 52], [136, 56], [136, 28], [136, 46], [136, 64], [137, 136], [138, 137], [141, 11], [141, 143], [142, 62], [142, 98], [142, 66], [142, 75], [142, 52], [142, 38], [142, 56], [142, 28], [142, 46], [142, 32], [142, 148], [142, 92], [142, 87], [142, 64], [142, 50], [142, 36], [142, 54], [142, 40], [142, 26], [142, 44], [142, 30], [142, 48], [142, 34], [142, 146], [142, 141], [142, 108], [143, 142], [144, 149], [144, 9], [145, 108], [145, 98], [145, 66], [145, 75], [145, 52], [145, 38], [145, 56], [145, 28], [145, 46], [145, 32], [145, 50], [145, 144], [145, 36], [145, 92], [145, 64], [145, 54], [145, 40], [145, 26], [145, 44], [145, 62], [145, 30], [145, 48], [145, 34], [145, 146], [146, 141], [146, 145], [147, 149], [147, 9], [148, 145], [148, 108], [148, 98], [148, 66], [148, 75], [148, 56], [148, 28], [148, 46], [148, 64], [148, 32], [148, 50], [148, 36], [148, 148], [148, 38], [148, 26], [148, 147], [148, 92], [148, 87], [148, 54], [148, 40], [148, 44], [148, 62], [148, 30], [148, 48], [148, 34], [148, 52], [148, 146], [149, 148], [150, 75], [150, 52], [150, 38], [150, 56], [150, 28], [150, 46], [150, 32], [150, 50], [150, 36], [150, 92], [150, 64], [150, 54], [150, 40], [150, 26], [150, 44], [150, 62], [150, 147], [150, 30], [150, 48], [150, 34], [150, 146], [150, 108], [150, 98], [150, 66], [151, 150], [152, 151], [153, 151], [154, 153], [155, 143], [155, 11], [155, 154], [156, 155], [157, 20], [158, 28], [158, 46], [158, 32], [158, 36], [158, 157], [158, 92], [158, 64], [158, 50], [158, 54], [158, 40], [158, 26], [158, 44], [158, 62], [158, 30], [158, 48], [158, 34], [158, 146], [158, 108], [158, 98], [158, 66], [158, 75], [158, 52], [158, 38], [158, 56], [159, 158], [160, 159], [161, 20], [162, 161], [166, 20], [167, 146], [167, 38], [167, 108], [167, 98], [167, 66], [167, 75], [167, 52], [167, 56], [167, 28], [167, 46], [167, 64], [167, 32], [167, 50], [167, 36], [167, 166], [167, 92], [167, 54], [167, 40], [167, 26], [167, 44], [167, 62], [167, 30], [167, 48], [167, 34], [168, 167], [169, 168], [170, 20], [171, 133], [171, 7], [171, 127], [171, 139], [172, 6], [172, 121], [175, 171], [179, 170], [181, 2], [182, 180], [185, 184], [186, 20], [187, 186], [187, 185], [188, 20], [189, 188], [189, 187], [190, 20], [191, 190], [191, 189], [192, 182], [193, 192], [194, 20], [195, 54], [195, 44], [195, 62], [195, 30], [195, 48], [195, 66], [195, 187], [195, 34], [195, 52], [195, 146], [195, 38], [195, 108], [195, 98], [195, 75], [195, 191], [195, 56], [195, 28], [195, 46], [195, 64], [195, 194], [195, 32], [195, 50], [195, 36], [195, 40], [195, 26], [195, 92], [196, 195], [197, 196], [198, 20], [199, 198], [205, 204], [206, 20], [207, 206], [207, 205], [208, 20], [209, 208], [209, 207], [210, 20], [211, 210], [211, 209], [212, 20], [216, 212], [218, 217], [219, 218], [220, 219], [221, 20], [222, 44], [222, 62], [222, 30], [222, 48], [222, 66], [222, 34], [222, 52], [222, 146], [222, 38], [222, 28], [222, 108], [222, 98], [222, 75], [222, 56], [222, 92], [222, 46], [222, 64], [222, 32], [222, 50], [222, 36], [222, 54], [222, 40], [222, 26], [222, 221], [222, 207], [222, 211], [223, 222], [224, 223], [225, 20], [226, 225], [230, 20], [231, 230], [233, 232], [234, 5], [235, 234], [236, 189], [236, 214], [237, 3], [238, 236], [239, 237], [242, 189], [242, 214], [243, 5], [244, 242], [245, 243], [247, 20], [248, 240], [248, 247], [248, 246], [249, 20], [250, 249], [250, 248], [250, 46], [251, 250], [252, 251], [253, 20], [254, 253], [258, 20], [259, 233], [259, 98], [259, 75], [259, 191], [259, 56], [259, 92], [259, 46], [259, 64], [259, 32], [259, 50], [259, 36], [259, 54], [259, 40], [259, 26], [259, 231], [259, 258], [259, 207], [259, 211], [259, 44], [259, 62], [259, 30], [259, 48], [259, 66], [259, 187], [259, 34], [259, 52], [259, 146], [259, 38], [259, 248], [259, 28], [259, 108], [260, 259], [261, 260], [264, 20], [265, 280], [265, 28], [265, 108], [265, 233], [265, 98], [265, 191], [265, 56], [265, 92], [265, 46], [265, 64], [265, 32], [265, 50], [265, 36], [265, 54], [265, 40], [265, 26], [265, 264], [265, 30], [265, 231], [265, 248], [265, 207], [265, 211], [265, 44], [265, 62], [265, 48], [265, 66], [265, 75], [265, 187], [265, 34], [265, 52], [265, 146], [265, 38], [275, 265], [278, 181], [278, 2], [279, 20], [280, 279], [282, 20], [283, 282], [285, 20], [286, 92], [286, 46], [286, 64], [286, 32], [286, 50], [286, 36], [286, 54], [286, 40], [286, 26], [286, 30], [286, 146], [286, 231], [286, 248], [286, 207], [286, 211], [286, 44], [286, 62], [286, 48], [286, 295], [286, 66], [286, 75], [286, 187], [286, 34], [286, 52], [286, 191], [286, 38], [286, 285], [286, 56], [286, 28], [286, 108], [286, 233], [286, 98], [287, 286], [289, 20], [290, 207], [290, 108], [290, 211], [290, 62], [290, 48], [290, 66], [290, 75], [290, 187], [290, 34], [290, 52], [290, 191], [290, 38], [290, 56], [290, 289], [290, 28], [290, 32], [290, 233], [290, 98], [290, 92], [290, 231], [290, 46], [290, 64], [290, 50], [290, 36], [290, 54], [290, 40], [290, 26], [290, 44], [290, 30], [290, 295], [290, 146], [290, 248], [291, 290], [292, 288], [292, 291], [293, 292], [294, 20], [295, 294], [295, 293], [296, 20], [298, 201], [298, 164], [298, 23], [298, 256], [298, 228], [298, 83], [298, 296], [298, 16]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a26162d52baa49e02bcf6b75ffa2f7a6e8bdc4994017d29e9af644edca214c3_4a26162d52baa49e02bcf6b75ffa2f7a6e8bdc4994017d29e9af644edca214c3.jsonl.gz", "strip_func_name": "sub_402257", "query": "\n\n\nunsigned int *__fastcall sub_402257(const char *a1, char *a2, int a3)\n{\nsize_t v4; // rax\nvoid *v5; // rdx\nchar *v6; // rax\nchar *v7; // rax\nvoid *v8; // rax\nvoid *v9; // rax\nFILE *v10; // rax\n__int64 v11; // rax\nchar modes[80]; // [rsp+20h] [rbp-80h] BYREF\n__int64 v14; // [rsp+70h] [rbp-30h] BYREF\nint v15; // [rsp+7Ch] [rbp-24h]\nunsigned int *v16; // [rsp+80h] [rbp-20h]\nchar *v17; // [rsp+88h] [rbp-18h]\nchar *v18; // [rsp+90h] [rbp-10h]\nint v19; // [rsp+98h] [rbp-8h]\nint v20; // [rsp+9Ch] [rbp-4h]\n\nv20 = -1;\nv19 = 0;\nv18 = a2;\nv17 = modes;\nif ( !a1 || !a2 )\nreturn 0LL;\nv16 = (unsigned int *)malloc(0xD0uLL);\nif ( !v16 )\nreturn 0LL;\n*((_QWORD *)v16 + 8) = 0LL;\n*((_QWORD *)v16 + 9) = 0LL;\n*((_QWORD *)v16 + 10) = 0LL;\n*((_QWORD *)v16 + 16) = 0LL;\n*(_QWORD *)v16 = 0LL;\n*((_QWORD *)v16 + 17) = 0LL;\n*((_QWORD *)v16 + 3) = 0LL;\nv16[8] = 0;\nv16[2] = v16[8];\n*((_QWORD *)v16 + 15) = 0LL;\nv16[28] = 0;\nv16[29] = 0;\n*((_QWORD *)v16 + 23) = 0LL;\n*((_QWORD *)v16 + 24) = 0LL;\nv16[50] = -1;\n*((_QWORD *)v16 + 18) = sub_410619(0LL, 0LL, 0LL);\n*((_QWORD *)v16 + 19) = 0LL;\nv16[42] = 0;\nv4 = strlen(a1);\nv5 = malloc(v4 + 1);\n*((_QWORD *)v16 + 20) = v5;\nif ( !*((_QWORD *)v16 + 20) )\ngoto LABEL_38;\nstrcpy(*((char **)v16 + 20), a1);\n*((_BYTE *)v16 + 172) = 0;\ndo\n{\nif ( *v18 == 114 )\n*((_BYTE *)v16 + 172) = 114;\nif ( *v18 == 119 || *v18 == 97 )\n*((_BYTE *)v16 + 172) = 119;\nif ( *v18 <= 47 || *v18 > 57 )\n{\nswitch ( *v18 )\n{\ncase 'f':\nv19 = 1;\nbreak;\ncase 'h':\nv19 = 2;\nbreak;\ncase 'R':\nv19 = 3;\nbreak;\ndefault:\nv6 = v17++;\n*v6 = *v18;\nbreak;\n}\n}\nelse\n{\nv20 = *v18 - 48;\n}\nv7 = v18++;\n}\nwhile ( *v7 && v17 != (char *)&v14 );\nif ( !*((_BYTE *)v16 + 172) )\ngoto LABEL_38;\nif ( *((_BYTE *)v16 + 172) == 119 )\n{\nv15 = sub_4041C6((_DWORD)v16, v20, 8, -15, 8, v19, (__int64)\"1.2.3\", 112);\nv8 = malloc(0x4000uLL);\n*((_QWORD *)v16 + 17) = v8;\n*((_QWORD *)v16 + 3) = *((_QWORD *)v16 + 17);\nif ( v15 || !*((_QWORD *)v16 + 17) )\n{\nLABEL_38:\nsub_402C0C(v16);\nreturn 0LL;\n}\n}\nelse\n{\nv9 = malloc(0x4000uLL);\n*((_QWORD *)v16 + 16) = v9;\n*(_QWORD *)v16 = *((_QWORD *)v16 + 16);\nv15 = sub_40C135(v16, 4294967281LL, \"1.2.3\", 112LL);\nif ( v15 || !*((_QWORD *)v16 + 16) )\ngoto LABEL_38;\n}\nv16[8] = 0x4000;\n*__errno_location() = 0;\nif ( a3 >= 0 )\nv10 = fdopen(a3, modes);\nelse\nv10 = fopen(a1, modes);\n*((_QWORD *)v16 + 15) = v10;\nif ( !*((_QWORD *)v16 + 15) )\ngoto LABEL_38;\nif ( *((_BYTE *)v16 + 172) == 119 )\n{\nfprintf(*((FILE **)v16 + 15), \"%c%c%c%c%c%c%c%c%c%c\", 31LL, 139LL, 8LL, 0LL, 0LL, 0LL, 0LL, 0LL, 0LL, 3LL);\n*((_QWORD *)v16 + 22) = 10LL;\n}\nelse\n{\nsub_402975(v16);\nv11 = ftell(*((FILE **)v16 + 15));\n*((_QWORD *)v16 + 22) = v11 - v16[2];\n}\nreturn v16;\n}\n\n\n\nQ:[a3,a1,a2,v5,modes,v15,v16,v17,v18,v19,v20,sub_402257,sub_410619,sub_4041C6,sub_402C0C,sub_40C135,sub_402975,]", "hints": "[]", "response": "{'a3': 'fd', 'a1': 'path', 'a2': 'mode', 'v5': 'fd', 'modes': 'fmode', 'v15': 'err', 'v16': 's', 'v17': 'm', 'v18': 'p', 'v19': 'strategy', 'v20': 'level', 'sub_402257': 'gz_open', 'sub_410619': 'crc32', 'sub_4041C6': 'deflateInit2_', 'sub_402C0C': 'destroy', 'sub_40C135': 'inflateInit2_', 'sub_402975': 'check_header'}"}
[ [ 0.7329728603363037, 0.732327938079834, 0.7269959449768066, 0.7266248464584351, 0.7255690693855286, 0.7201279997825623, 0.7112398147583008, 0.7107473611831665, 0.7105748653411865, 0.710441529750824, 0.7098366022109985, 0.707001268863678, 0.7055175304412842, 0.7052328586578369, 0.6980529427528381, 0.6971196532249451, 0.6966769099235535, 0.6965855360031128, 0.6938708424568176, 0.6927600502967834 ], [ 221492, 127933, 41621, 36522, 67094, 138490, 52685, 242194, 243448, 32361, 83539, 7615, 137330, 24500, 98959, 38971, 99047, 234175, 31850, 186049 ] ]
create_dir
b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817
chenall
grubutils
NA
void create_dir (char *path) { char *p; p = path; if (p[0] == '/') p++; for (; *p; p++) { if ((*p == '/') || (*p == '\\')) { char c; c = *p; *p = 0; #ifdef WIN32 mkdir (path); #else mkdir (path, 0777); #endif *p = c; } } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4060B3", "function_addr": 4219059, "binary_name": "b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+path], rdi"], [4, "mov rax, [rbp+path]"], [5, "mov [rbp+var_8], rax"], [6, "mov rax, [rbp+var_8]"], [7, "movzx eax, byte ptr [rax]"], [8, "cmp al, 2Fh "], [9, "jnz short loc_406120"], [10, "add [rbp+var_8], 1"], [11, "jmp short loc_406120"], [12, "mov rax, [rbp+var_8]"], [13, "movzx eax, byte ptr [rax]"], [14, "cmp al, 2Fh "], [15, "jz short loc_4060EF"], [16, "mov rax, [rbp+var_8]"], [17, "movzx eax, byte ptr [rax]"], [18, "cmp al, 5Ch "], [19, "jnz short loc_40611B"], [20, "mov rax, [rbp+var_8]"], [21, "movzx eax, byte ptr [rax]"], [22, "mov [rbp+var_9], al"], [23, "mov rax, [rbp+var_8]"], [24, "mov byte ptr [rax], 0"], [25, "mov rax, [rbp+path]"], [26, "mov esi, 1FFh"], [27, "mov rdi, rax"], [28, "call _mkdir"], [29, "mov rax, [rbp+var_8]"], [30, "movzx edx, [rbp+var_9]"], [31, "mov [rax], dl"], [32, "add [rbp+var_8], 1"], [33, "mov rax, [rbp+var_8]"], [34, "movzx eax, byte ptr [rax]"], [35, "test al, al"], [36, "jnz short loc_4060D9"], [37, "nop"], [38, "nop"], [39, "leave"], [40, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 5], [12, 10], [12, 5], [12, 32], [13, 31], [13, 12], [13, 24], [14, 13], [15, 14], [16, 32], [16, 10], [16, 5], [17, 24], [17, 16], [17, 31], [18, 17], [19, 18], [20, 5], [20, 32], [20, 10], [21, 31], [21, 24], [21, 20], [22, 21], [23, 10], [23, 5], [23, 32], [24, 23], [25, 3], [27, 25], [29, 32], [29, 10], [29, 5], [30, 22], [31, 29], [31, 30], [32, 5], [32, 32], [32, 10], [33, 5], [33, 32], [33, 10], [34, 31], [34, 24], [34, 33], [35, 34], [36, 35], [40, 35]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817_b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.jsonl.gz", "strip_func_name": "sub_4060B3", "query": "\n\n\n__int64 __fastcall sub_4060B3(const char *a1)\n{\n__int64 result; // rax\nchar v2; // [rsp+17h] [rbp-9h]\nchar *v3; // [rsp+18h] [rbp-8h]\n\nv3 = (char *)a1;\nif ( *a1 == 47 )\nv3 = (char *)(a1 + 1);\nwhile ( 1 )\n{\nresult = (unsigned __int8)*v3;\nif ( !(_BYTE)result )\nbreak;\nif ( *v3 == 47 || *v3 == 92 )\n{\nv2 = *v3;\n*v3 = 0;\nmkdir(a1, 0x1FFu);\n*v3 = v2;\n}\n++v3;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v2,v3,sub_4060B3,]", "hints": "[]", "response": "{'a1': 'path', 'v2': 'c', 'v3': 'p', 'sub_4060B3': 'create_dir'}"}
[ [ 0.8068350553512573, 0.7824428081512451, 0.7754587531089783, 0.7700124979019165, 0.76996910572052, 0.7673718333244324, 0.7657783031463623, 0.7635219097137451, 0.7593749165534973, 0.7561293840408325, 0.7558570504188538, 0.7515723705291748, 0.7454096674919128, 0.7410107851028442, 0.7399431467056274, 0.7336100339889526, 0.7335605025291443, 0.7321532368659973, 0.727253794670105, 0.7272161245346069 ], [ 199132, 3191, 202809, 263232, 174056, 101677, 15713, 210486, 20284, 150191, 48777, 47139, 111793, 226069, 197313, 205529, 163373, 190018, 168913, 179556 ] ]
netlink_close
bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62
ncopa
pingu
NA
static void netlink_close(struct ev_loop *loop, struct netlink_fd *fd) { if (fd->fd >= 0) { if (loop != NULL) ev_io_stop(loop, &fd->io); close(fd->fd); fd->fd = 0; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407E52", "function_addr": 4226642, "binary_name": "bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_10], rsi"], [5, "mov rax, [rbp+var_10]"], [6, "mov eax, [rax]"], [7, "test eax, eax"], [8, "js short loc_407EA1"], [9, "cmp [rbp+var_8], 0"], [10, "jz short loc_407E8A"], [11, "mov rax, [rbp+var_10]"], [12, "lea rdx, [rax+8]"], [13, "mov rax, [rbp+var_8]"], [14, "mov rsi, rdx"], [15, "mov rdi, rax"], [16, "call _ev_io_stop"], [17, "mov rax, [rbp+var_10]"], [18, "mov eax, [rax]"], [19, "mov edi, eax"], [20, "call _close"], [21, "mov rax, [rbp+var_10]"], [22, "mov dword ptr [rax], 0"], [23, "nop"], [24, "leave"], [25, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [8, 7], [9, 3], [10, 9], [11, 4], [12, 11], [13, 3], [14, 12], [15, 13], [17, 4], [18, 17], [19, 18], [21, 4], [22, 21], [25, 21], [25, 7]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62_bbf4fd34a1479faeba7f018ea496cd01e0b532574e364040d6ff27ec9550ed62.jsonl.gz", "strip_func_name": "sub_407E52", "query": "\n\n\nint *__fastcall sub_407E52(__int64 a1, int *a2)\n{\nint *result; // rax\n\nresult = (int *)(unsigned int)*a2;\nif ( (int)result >= 0 )\n{\nif ( a1 )\nev_io_stop();\nclose(*a2);\nresult = a2;\n*a2 = 0;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_407E52,]", "hints": "[]", "response": "{'a1': 'loop', 'a2': 'fd', 'sub_407E52': 'netlink_close'}"}
[ [ 0.8026187419891357, 0.7708439826965332, 0.7666831612586975, 0.7631975412368774, 0.7583431005477905, 0.7481861114501953, 0.7467055916786194, 0.7326927185058594, 0.7239704728126526, 0.7080957889556885, 0.7033860683441162, 0.6928433179855347, 0.6928305625915527, 0.6914756298065186, 0.6909072399139404, 0.6897643804550171, 0.6893399357795715, 0.6892204284667969, 0.6876446008682251, 0.6868334412574768 ], [ 18769, 110189, 139397, 216099, 205923, 246946, 101585, 158005, 192721, 169107, 141559, 188049, 196914, 197385, 37678, 217035, 37633, 221380, 42308, 43532 ] ]
nano_sleep
89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6
Tachone
Tachftp
NA
void nano_sleep(double seconds) { time_t secs = (time_t)seconds; // 整数部分 double fractional = seconds - (double)secs; // 小数部分 struct timespec ts; ts.tv_sec = secs; ts.tv_nsec = (long)(fractional * (double)1000000000); int ret; do { ret = nanosleep(&ts, &ts); } while (ret == -1 && errno == EINTR); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403E16", "function_addr": 4210198, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "movsd [rbp+var_38], xmm0"], [4, "movsd xmm0, [rbp+var_38]"], [5, "cvttsd2si rax, xmm0"], [6, "mov [rbp+var_8], rax"], [7, "pxor xmm1, xmm1"], [8, "cvtsi2sd xmm1, [rbp+var_8]"], [9, "movsd xmm0, [rbp+var_38]"], [10, "subsd xmm0, xmm1"], [11, "movsd [rbp+var_10], xmm0"], [12, "mov rax, [rbp+var_8]"], [13, "mov [rbp+requested_time.tv_sec], rax"], [14, "movsd xmm1, [rbp+var_10]"], [15, "movsd xmm0, cs:qword_409B88"], [16, "mulsd xmm0, xmm1"], [17, "cvttsd2si rax, xmm0"], [18, "mov [rbp+requested_time.tv_nsec], rax"], [19, "lea rdx, [rbp+requested_time]"], [20, "lea rax, [rbp+requested_time]"], [21, "mov rsi, rdx"], [22, "mov rdi, rax"], [23, "call _nanosleep"], [24, "mov [rbp+var_14], eax"], [25, "cmp [rbp+var_14], 0FFFFFFFFh"], [26, "jnz short loc_403E93"], [27, "call ___errno_location"], [28, "mov eax, [rax]"], [29, "cmp eax, 4"], [30, "jz short loc_403E6B"], [31, "nop"], [32, "leave"], [33, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [8, 6], [8, 7], [9, 3], [10, 9], [10, 8], [11, 10], [12, 6], [13, 12], [14, 11], [16, 15], [16, 14], [17, 12], [17, 16], [18, 17], [19, 19], [20, 17], [20, 28], [21, 19], [22, 20], [24, 23], [25, 24], [26, 25], [28, 27], [29, 28], [30, 29], [33, 23], [33, 28]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6_89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.jsonl.gz", "strip_func_name": "sub_403E16", "query": "\n\n\nint __fastcall sub_403E16(double a1)\n{\nint result; // eax\nstruct timespec requested_time; // [rsp+10h] [rbp-30h] BYREF\nint v3; // [rsp+2Ch] [rbp-14h]\ndouble v4; // [rsp+30h] [rbp-10h]\n__time_t v5; // [rsp+38h] [rbp-8h]\n\nv5 = (unsigned int)(int)a1;\nv4 = a1 - (double)(int)a1;\nrequested_time.tv_sec = v5;\nrequested_time.tv_nsec = (unsigned int)(int)(1000000000.0 * v4);\ndo\n{\nresult = nanosleep(&requested_time, &requested_time);\nv3 = result;\nif ( result != -1 )\nbreak;\nresult = *__errno_location();\n}\nwhile ( result == 4 );\nreturn result;\n}\n\n\n\nQ:[a1,requested_time,v4,v5,sub_403E16,]", "hints": "[]", "response": "{'a1': 'seconds', 'requested_time': 'ts', 'v4': 'fractional', 'v5': 'secs', 'sub_403E16': 'nano_sleep'}"}
[ [ 0.7947250008583069, 0.7752015590667725, 0.7736228108406067, 0.7146407961845398, 0.690480649471283, 0.6809360384941101, 0.6638898253440857, 0.6599299907684326, 0.6553780436515808, 0.6526535749435425, 0.6521668434143066, 0.6510231494903564, 0.6490809917449951, 0.6488739848136902, 0.6378639340400696, 0.6332846879959106, 0.6332321166992188, 0.6273147463798523, 0.6234330534934998, 0.6222580671310425 ], [ 150988, 1688, 12389, 135518, 52226, 30599, 570, 207702, 60786, 144268, 173717, 235546, 253854, 177217, 248932, 25122, 184515, 103773, 254654, 163619 ] ]
metadata_size
a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0
sysml
minipython
NA
chk_t metadata_size(struct shfs_hdr_common *hdr_common, struct shfs_hdr_config *hdr_config) { uint64_t chunksize; chk_t htable_size_chks; chk_t ret = 0; chunksize = SHFS_CHUNKSIZE(hdr_common); htable_size_chks = SHFS_HTABLE_SIZE_CHUNKS(hdr_config, chunksize); ret += 1; /* chunk0 (common hdr) */ ret += 1; /* chunk1 (config hdr) */ ret += htable_size_chks; /* hash table chunks */ if (hdr_config->htable_bak_ref) ret += htable_size_chks; /* backup hash table */ return ret; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40396D", "function_addr": 4209005, "binary_name": "a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_8], 0"], [5, "mov rax, [rbp+var_28]"], [6, "movzx eax, byte ptr [rax+38h]"], [7, "cmp al, 1"], [8, "jnz short loc_4039A6"], [9, "mov rax, [rbp+var_28]"], [10, "mov edx, [rax+39h]"], [11, "mov rax, [rbp+var_28]"], [12, "movzx eax, byte ptr [rax+4Dh]"], [13, "movzx eax, al"], [14, "imul eax, edx"], [15, "mov eax, eax"], [16, "jmp short loc_4039AF"], [17, "mov rax, [rbp+var_28]"], [18, "mov eax, [rax+39h]"], [19, "mov eax, eax"], [20, "mov [rbp+var_10], rax"], [21, "mov rax, [rbp+var_30]"], [22, "mov edx, [rax+16h]"], [23, "mov rax, [rbp+var_30]"], [24, "mov eax, [rax+12h]"], [25, "imul eax, edx"], [26, "mov edx, eax"], [27, "mov rax, [rbp+var_10]"], [28, "shr rax, 8"], [29, "add rax, rdx"], [30, "sub rax, 1"], [31, "mov rdx, [rbp+var_10]"], [32, "mov rcx, rdx"], [33, "shr rcx, 8"], [34, "mov edx, 0"], [35, "div rcx"], [36, "mov [rbp+var_18], rax"], [37, "add [rbp+var_8], 1"], [38, "add [rbp+var_8], 1"], [39, "mov rax, [rbp+var_18]"], [40, "add [rbp+var_8], rax"], [41, "mov rax, [rbp+var_30]"], [42, "mov rax, [rax+8]"], [43, "test rax, rax"], [44, "jz short loc_403A13"], [45, "mov rax, [rbp+var_18]"], [46, "add [rbp+var_8], rax"], [47, "mov rax, [rbp+var_8]"], [48, "pop rbp"], [49, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 6], [8, 7], [9, 2], [10, 9], [11, 2], [12, 11], [13, 12], [14, 10], [14, 13], [15, 14], [17, 2], [18, 17], [19, 18], [20, 19], [20, 15], [21, 3], [22, 21], [23, 3], [24, 23], [25, 22], [25, 24], [26, 25], [27, 20], [28, 27], [29, 26], [29, 28], [30, 29], [31, 20], [32, 31], [33, 32], [35, 33], [36, 30], [37, 4], [38, 37], [39, 36], [40, 38], [40, 39], [41, 3], [42, 41], [43, 42], [44, 43], [45, 36], [46, 45], [46, 40], [47, 40], [47, 46], [48, 0], [49, 47]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0_a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0.jsonl.gz", "strip_func_name": "sub_40396D", "query": "\n\n\nunsigned __int64 __fastcall sub_40396D(__int64 a1, __int64 a2)\n{\nunsigned __int64 v2; // rax\nunsigned __int64 v4; // [rsp+18h] [rbp-18h]\nunsigned __int64 v5; // [rsp+28h] [rbp-8h]\n\nif ( *(_BYTE *)(a1 + 56) == 1 )\nv2 = *(_DWORD *)(a1 + 57) * (unsigned int)*(unsigned __int8 *)(a1 + 77);\nelse\nv2 = *(unsigned int *)(a1 + 57);\nv4 = ((unsigned int)(*(_DWORD *)(a2 + 22) * *(_DWORD *)(a2 + 18)) + (v2 >> 8) - 1) / (v2 >> 8);\nv5 = v4 + 2;\nif ( *(_QWORD *)(a2 + 8) )\nv5 += v4;\nreturn v5;\n}\n\n\n\nQ:[a1,a2,v4,sub_40396D,]", "hints": "[]", "response": "{'a1': 'hdr_common', 'a2': 'hdr_config', 'v4': 'htable_size_chks', 'sub_40396D': 'metadata_size'}"}
[ [ 0.7184624671936035, 0.711159348487854, 0.7037846446037292, 0.6896620392799377, 0.6884957551956177, 0.6810599565505981, 0.6762278079986572, 0.6739281415939331, 0.6700197458267212, 0.668450653553009, 0.6664579510688782, 0.6644444465637207, 0.6641044020652771, 0.6576478481292725, 0.6568389534950256, 0.6567801237106323, 0.654675304889679, 0.6532993316650391, 0.6496937274932861, 0.6484123468399048 ], [ 56319, 72794, 248770, 199159, 155066, 21543, 210685, 105989, 65126, 91739, 138521, 97080, 257054, 88044, 139645, 140602, 204675, 112963, 148127, 103140 ] ]
try_connect
ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9
google
neper
NA
static int try_connect(int s, const struct sockaddr *addr, socklen_t addr_len) { for (;;) { int ret = connect(s, addr, addr_len); if (ret == -1 && (errno == EINTR || errno == EALREADY)) continue; if (ret == -1 && errno == EISCONN) return 0; return ret; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_406840", "function_addr": 4220992, "binary_name": "ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+addr], rsi"], [5, "mov [rbp+len], edx"], [6, "mov rcx, [rbp+addr]"], [7, "mov edx, [rbp+len]"], [8, "mov eax, [rbp+fd]"], [9, "mov rsi, rcx"], [10, "mov edi, eax"], [11, "call _connect"], [12, "mov [rbp+var_4], eax"], [13, "cmp [rbp+var_4], 0FFFFFFFFh"], [14, "jnz short loc_406889"], [15, "call ___errno_location"], [16, "mov eax, [rax]"], [17, "cmp eax, 4"], [18, "jz short loc_406852"], [19, "call ___errno_location"], [20, "mov eax, [rax]"], [21, "cmp eax, 72h "], [22, "jnz short loc_406889"], [23, "jmp short loc_406852"], [24, "cmp [rbp+var_4], 0FFFFFFFFh"], [25, "jnz short loc_4068A2"], [26, "call ___errno_location"], [27, "mov eax, [rax]"], [28, "cmp eax, 6Ah "], [29, "jnz short loc_4068A2"], [30, "mov eax, 0"], [31, "jmp short locret_4068A5"], [32, "mov eax, [rbp+var_4]"], [33, "leave"], [34, "retn"]], "data_dep": [[6, 4], [7, 5], [8, 3], [9, 6], [10, 8], [12, 11], [13, 12], [14, 13], [16, 15], [17, 16], [18, 17], [20, 19], [21, 20], [22, 21], [24, 12], [25, 24], [27, 26], [28, 27], [29, 28], [32, 12], [34, 30], [34, 32]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9_ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.jsonl.gz", "strip_func_name": "sub_406840", "query": "\n\n\n__int64 __fastcall sub_406840(int a1, const struct sockaddr *a2, socklen_t a3)\n{\n__int64 result; // rax\nunsigned int v5; // [rsp+1Ch] [rbp-4h]\n\ndo\nv5 = connect(a1, a2, a3);\nwhile ( v5 == -1 && (*__errno_location() == 4 || *__errno_location() == 114) );\nif ( v5 == -1 && *__errno_location() == 106 )\nresult = 0LL;\nelse\nresult = v5;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_406840,]", "hints": "[]", "response": "{'a3': 'addr_len', 'a1': 's', 'a2': 'addr', 'sub_406840': 'try_connect'}"}
[ [ 0.8910091519355774, 0.8286914825439453, 0.8242689371109009, 0.818670392036438, 0.8164692521095276, 0.7811212539672852, 0.7770666480064392, 0.7760689854621887, 0.7744472026824951, 0.76901775598526, 0.7638381123542786, 0.7637847661972046, 0.7601501941680908, 0.758294939994812, 0.7577643990516663, 0.7494667768478394, 0.7493085861206055, 0.7471086978912354, 0.7465550899505615, 0.7427504658699036 ], [ 222521, 19860, 49256, 222140, 129005, 129606, 150560, 153804, 246151, 51985, 67216, 29443, 89612, 153395, 51523, 211163, 195467, 104419, 263513, 113497 ] ]
strreplace
afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4
michael-lazar
hn-gopher
NA
void strreplace(char *str, char from, char to) { while (*str) { if (*str == from) *str = to; str++; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40725A", "function_addr": 4223578, "binary_name": "afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov ecx, esi"], [4, "mov eax, edx"], [5, "mov edx, ecx"], [6, "mov [rbp+var_C], dl"], [7, "mov [rbp+var_10], al"], [8, "jmp short loc_40728B"], [9, "mov rax, [rbp+var_8]"], [10, "movzx eax, byte ptr [rax]"], [11, "cmp [rbp+var_C], al"], [12, "jnz short loc_407286"], [13, "mov rax, [rbp+var_8]"], [14, "movzx edx, [rbp+var_10]"], [15, "mov [rax], dl"], [16, "add [rbp+var_8], 1"], [17, "mov rax, [rbp+var_8]"], [18, "movzx eax, byte ptr [rax]"], [19, "test al, al"], [20, "jnz short loc_407270"], [21, "nop"], [22, "nop"], [23, "pop rbp"], [24, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [9, 2], [9, 16], [10, 9], [10, 15], [11, 10], [11, 6], [12, 11], [13, 2], [13, 16], [14, 7], [15, 14], [15, 13], [16, 16], [16, 2], [17, 2], [17, 16], [18, 17], [18, 15], [19, 18], [20, 19], [23, 0], [24, 19]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4_afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.jsonl.gz", "strip_func_name": "sub_40725A", "query": "\n\n\n__int64 __fastcall sub_40725A(_BYTE *a1, char a2, char a3)\n{\n__int64 result; // rax\n\nwhile ( 1 )\n{\nresult = (unsigned __int8)*a1;\nif ( !(_BYTE)result )\nbreak;\nif ( a2 == *a1 )\n*a1 = a3;\n++a1;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_40725A,]", "hints": "[]", "response": "{'a3': 'to', 'a1': 'str', 'a2': 'from', 'sub_40725A': 'strreplace'}"}
[ [ 0.7563166618347168, 0.7561486959457397, 0.7488538026809692, 0.7394008040428162, 0.7393878698348999, 0.7381376028060913, 0.7346126437187195, 0.7333637475967407, 0.731783390045166, 0.7293436527252197, 0.7293402552604675, 0.7273750305175781, 0.724785327911377, 0.7237035036087036, 0.722159206867218, 0.720679521560669, 0.7204193472862244, 0.7164138555526733, 0.7162091732025146, 0.7153567671775818 ], [ 19274, 9041, 202331, 153971, 263838, 92015, 127412, 264106, 85695, 82592, 232950, 123634, 187205, 6112, 15421, 132437, 51582, 16953, 108415, 17294 ] ]
destroy_map
8e54b9327a785ddec9542c4e806305e774a10a46bc1e2b094d53b7c5d2a9cefe
marcomorain
garcon
NA
void destroy_map(struct map_t** map) { struct map_node_t* node; struct map_node_t* next_node; for (node = (*map)->head; node != NULL; node = next_node) { free(node->key); if ((*map)->free_func && node->value) { (*(*map)->free_func)(node->value); } next_node = node->next; free(node); node = NULL; } free(*map); *map = NULL; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40996A", "function_addr": 4233578, "binary_name": "8e54b9327a785ddec9542c4e806305e774a10a46bc1e2b094d53b7c5d2a9cefe.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, [rbp+var_18]"], [5, "mov rax, [rax]"], [6, "mov rax, [rax]"], [7, "mov [rbp+ptr], rax"], [8, "jmp short loc_4099F2"], [9, "mov rax, [rbp+ptr]"], [10, "mov rax, [rax]"], [11, "mov rdi, rax"], [12, "call _free"], [13, "mov rax, [rbp+var_18]"], [14, "mov rax, [rax]"], [15, "mov rax, [rax+18h]"], [16, "test rax, rax"], [17, "jz short loc_4099CA"], [18, "mov rax, [rbp+ptr]"], [19, "mov rax, [rax+8]"], [20, "test rax, rax"], [21, "jz short loc_4099CA"], [22, "mov rax, [rbp+var_18]"], [23, "mov rax, [rax]"], [24, "mov rdx, [rax+18h]"], [25, "mov rax, [rbp+ptr]"], [26, "mov rax, [rax+8]"], [27, "mov rdi, rax"], [28, "call rdx"], [29, "mov rax, [rbp+ptr]"], [30, "mov rax, [rax+10h]"], [31, "mov [rbp+var_10], rax"], [32, "mov rax, [rbp+ptr]"], [33, "mov rdi, rax"], [34, "call _free"], [35, "mov [rbp+ptr], 0"], [36, "mov rax, [rbp+var_10]"], [37, "mov [rbp+ptr], rax"], [38, "cmp [rbp+ptr], 0"], [39, "jnz short loc_409986"], [40, "mov rax, [rbp+var_18]"], [41, "mov rax, [rax]"], [42, "mov rdi, rax"], [43, "call _free"], [44, "mov rax, [rbp+var_18]"], [45, "mov qword ptr [rax], 0"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [9, 7], [9, 37], [10, 9], [11, 10], [13, 3], [14, 13], [15, 14], [16, 15], [17, 16], [18, 7], [18, 37], [19, 18], [20, 19], [21, 20], [22, 3], [23, 22], [24, 23], [25, 7], [25, 37], [26, 25], [27, 26], [28, 24], [29, 7], [29, 37], [30, 29], [31, 30], [32, 37], [32, 7], [33, 32], [36, 31], [37, 36], [38, 7], [38, 37], [39, 38], [40, 3], [41, 40], [42, 41], [44, 3], [45, 44], [48, 44]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8e54b9327a785ddec9542c4e806305e774a10a46bc1e2b094d53b7c5d2a9cefe_8e54b9327a785ddec9542c4e806305e774a10a46bc1e2b094d53b7c5d2a9cefe.jsonl.gz", "strip_func_name": "sub_40996A", "query": "\n\n\nvoid **__fastcall sub_40996A(void **a1)\n{\nvoid **result; // rax\nvoid **v2; // [rsp+10h] [rbp-10h]\nvoid **ptr; // [rsp+18h] [rbp-8h]\n\nfor ( ptr = *(void ***)*a1; ptr; ptr = v2 )\n{\nfree(*ptr);\nif ( *((_QWORD *)*a1 + 3) && ptr[1] )\n(*((void (__fastcall **)(void *))*a1 + 3))(ptr[1]);\nv2 = (void **)ptr[2];\nfree(ptr);\n}\nfree(*a1);\nresult = a1;\n*a1 = 0LL;\nreturn result;\n}\n\n\n\nQ:[a1,v2,ptr,sub_40996A,]", "hints": "[]", "response": "{'a1': 'map', 'v2': 'next_node', 'ptr': 'node', 'sub_40996A': 'destroy_map'}"}
[ [ 0.7420048713684082, 0.734618067741394, 0.724612832069397, 0.7070825695991516, 0.7065224647521973, 0.7033025026321411, 0.7010700702667236, 0.6980085372924805, 0.6972140073776245, 0.6968424320220947, 0.6957738995552063, 0.6950764060020447, 0.6948346495628357, 0.6939781904220581, 0.6939435005187988, 0.6892604231834412, 0.6889277696609497, 0.6885924935340881, 0.6868366003036499, 0.6841268539428711 ], [ 239758, 121124, 191582, 154129, 196453, 14763, 207761, 136217, 256238, 21375, 111464, 63624, 25543, 160119, 223044, 117552, 102293, 92109, 16903, 150073 ] ]
udp_broadcast
e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c
evilpan
Airkiss
NA
int udp_broadcast(unsigned char random, int port) { int fd; int enabled = 1; int err; struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_BROADCAST; addr.sin_port = htons(port); fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { LOG_TRACE("Error to create socket, reason: %s", strerror(errno)); return 1; } err = setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char *) &enabled, sizeof(enabled)); if(err == -1) { close(fd); return 1; } LOG_TRACE("Sending random to broadcast.."); int i; useconds_t usecs = 1000*20; for(i=0;i<50;i++) { sendto(fd, (unsigned char *)&random, 1, 0, (struct sockaddr*)&addr, sizeof(struct sockaddr)); usleep(usecs); } close(fd); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402840", "function_addr": 4204608, "binary_name": "e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov eax, edi"], [4, "mov [rbp+var_38], esi"], [5, "mov [rbp+buf], al"], [6, "mov [rbp+optval], 1"], [7, "mov [rbp+addr.sa_family], 2"], [8, "mov dword ptr [rbp+addr.sa_data+2], 0FFFFFFFFh"], [9, "mov eax, [rbp+var_38]"], [10, "movzx eax, ax"], [11, "shl eax, 8"], [12, "mov edx, eax"], [13, "mov eax, [rbp+var_38]"], [14, "shr ax, 8"], [15, "or eax, edx"], [16, "mov word ptr [rbp+addr.sa_data], ax"], [17, "mov edx, 0"], [18, "mov esi, 2"], [19, "mov edi, 2"], [20, "call _socket"], [21, "mov [rbp+fd], eax"], [22, "cmp [rbp+fd], 0"], [23, "jns short loc_4028CD"], [24, "call ___errno_location"], [25, "mov eax, [rax]"], [26, "mov edi, eax"], [27, "call _strerror"], [28, "mov rdx, rax"], [29, "mov rax, cs:stdout"], [30, "mov esi, offset aErrorToCreateS"], [31, "mov rdi, rax"], [32, "mov eax, 0"], [33, "call _fprintf"], [34, "mov eax, 1"], [35, "jmp locret_40297E"], [36, "lea rdx, [rbp+optval]"], [37, "mov eax, [rbp+fd]"], [38, "mov r8d, 4"], [39, "mov rcx, rdx"], [40, "mov edx, 6"], [41, "mov esi, 1"], [42, "mov edi, eax"], [43, "call _setsockopt"], [44, "mov [rbp+var_C], eax"], [45, "cmp [rbp+var_C], 0FFFFFFFFh"], [46, "jnz short loc_402908"], [47, "mov eax, [rbp+fd]"], [48, "mov edi, eax"], [49, "call _close"], [50, "mov eax, 1"], [51, "jmp short locret_40297E"], [52, "mov rax, cs:stdout"], [53, "mov rcx, rax"], [54, "mov edx, 1Eh"], [55, "mov esi, 1"], [56, "mov edi, offset aSendingRandomT"], [57, "call _fwrite"], [58, "mov [rbp+useconds], 4E20h"], [59, "mov [rbp+var_4], 0"], [60, "jmp short loc_402969"], [61, "lea rdx, [rbp+addr]"], [62, "lea rsi, [rbp+buf]"], [63, "mov eax, [rbp+fd]"], [64, "mov r9d, 10h"], [65, "mov r8, rdx"], [66, "mov ecx, 0"], [67, "mov edx, 1"], [68, "mov edi, eax"], [69, "call _sendto"], [70, "mov eax, [rbp+useconds]"], [71, "mov edi, eax"], [72, "call _usleep"], [73, "add [rbp+var_4], 1"], [74, "cmp [rbp+var_4], 31h "], [75, "jle short loc_402936"], [76, "mov eax, [rbp+fd]"], [77, "mov edi, eax"], [78, "call _close"], [79, "mov eax, 0"], [80, "leave"], [81, "retn"]], "data_dep": [[5, 3], [9, 4], [10, 9], [11, 10], [12, 11], [13, 4], [14, 13], [15, 14], [15, 12], [16, 15], [21, 20], [22, 21], [23, 22], [25, 24], [26, 25], [28, 27], [31, 29], [36, 6], [36, 17], [37, 21], [39, 36], [42, 37], [44, 43], [45, 44], [46, 45], [47, 21], [48, 47], [53, 52], [61, 67], [61, 54], [62, 62], [62, 55], [62, 5], [63, 21], [65, 61], [68, 63], [70, 58], [71, 70], [73, 59], [73, 73], [74, 73], [74, 59], [75, 74], [76, 21], [77, 76], [81, 50], [81, 34], [81, 79]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c_e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c.jsonl.gz", "strip_func_name": "sub_402840", "query": "\n\n\n__int64 __fastcall sub_402840(char a1, unsigned __int16 a2)\n{\nint *v2; // rax\nchar *v3; // rax\n__int64 result; // rax\nchar buf[4]; // [rsp+Ch] [rbp-34h] BYREF\nstruct sockaddr addr; // [rsp+10h] [rbp-30h] BYREF\nint optval; // [rsp+2Ch] [rbp-14h] BYREF\n__useconds_t useconds; // [rsp+30h] [rbp-10h]\nint v9; // [rsp+34h] [rbp-Ch]\nint fd; // [rsp+38h] [rbp-8h]\nint i; // [rsp+3Ch] [rbp-4h]\n\nbuf[0] = a1;\noptval = 1;\naddr.sa_family = 2;\n*(_DWORD *)&addr.sa_data[2] = -1;\n*(_WORD *)addr.sa_data = (a2 << 8) | HIBYTE(a2);\nfd = socket(2, 2, 0);\nif ( fd >= 0 )\n{\nv9 = setsockopt(fd, 1, 6, &optval, 4u);\nif ( v9 == -1 )\n{\nclose(fd);\nresult = 1LL;\n}\nelse\n{\nfwrite(\"Sending random to broadcast..\\n\", 1uLL, 0x1EuLL, stdout);\nuseconds = 20000;\nfor ( i = 0; i <= 49; ++i )\n{\nsendto(fd, buf, 1uLL, 0, &addr, 0x10u);\nusleep(useconds);\n}\nclose(fd);\nresult = 0LL;\n}\n}\nelse\n{\nv2 = __errno_location();\nv3 = strerror(*v2);\nfprintf(stdout, \"Error to create socket, reason: %s\\n\", v3);\nresult = 1LL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,buf,optval,useconds,v9,sub_402840,]", "hints": "[]", "response": "{'a1': 'random', 'a2': 'port', 'buf': 'randoma', 'optval': 'enabled', 'useconds': 'usecs', 'v9': 'err', 'sub_402840': 'udp_broadcast'}"}
[ [ 0.8200260400772095, 0.8095775842666626, 0.7906268835067749, 0.7888102531433105, 0.7778137922286987, 0.7729946374893188, 0.7703896760940552, 0.7610949873924255, 0.7589194774627686, 0.757326066493988, 0.7550535202026367, 0.7511656880378723, 0.7458338737487793, 0.7422940731048584, 0.7417517900466919, 0.7413667440414429, 0.7368841767311096, 0.731684148311615, 0.7301557064056396, 0.7287757396697998 ], [ 178708, 28397, 44361, 46524, 10232, 184161, 55930, 145167, 213036, 31529, 215917, 15281, 39581, 46506, 239176, 234834, 21248, 158838, 102415, 185968 ] ]
connect_timeout
89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6
Tachone
Tachftp
NA
int connect_timeout(int fd, struct sockaddr_in *addr, unsigned int wait_seconds) { int ret; socklen_t addrlen = sizeof(struct sockaddr_in); if (wait_seconds > 0) activate_nonblock(fd); ret = connect(fd, (struct sockaddr*)addr, addrlen); if (ret < 0 && errno == EINPROGRESS) { //printf("AAAAA\n"); fd_set connect_fdset; struct timeval timeout; FD_ZERO(&connect_fdset); FD_SET(fd, &connect_fdset); timeout.tv_sec = wait_seconds; timeout.tv_usec = 0; do { /* 一量连接建立,套接字就可写 */ ret = select(fd + 1, NULL, &connect_fdset, NULL, &timeout); } while (ret < 0 && errno == EINTR); if (ret == 0) { ret = -1; errno = ETIMEDOUT; } else if (ret < 0) return -1; else if (ret == 1) { //printf("BBBBB\n"); /* ret返回为1,可能有两种情况,一种是连接建立成功,一种是套接字产生错误,*/ /* 此时错误信息不会保存至errno变量中,因此,需要调用getsockopt来获取。 */ int err; socklen_t socklen = sizeof(err); int sockoptret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &socklen); if (sockoptret == -1) { return -1; } if (err == 0) { //printf("DDDDDDD\n"); ret = 0; } else { //printf("CCCCCC\n"); errno = err; ret = -1; } } } if (wait_seconds > 0) { deactivate_nonblock(fd); } return ret; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40340E", "function_addr": 4207630, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0D0h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+addr], rsi"], [5, "mov [rbp+var_C8], edx"], [6, "mov [rbp+len], 10h"], [7, "cmp [rbp+var_C8], 0"], [8, "jz short loc_403449"], [9, "mov eax, [rbp+fd]"], [10, "mov edi, eax"], [11, "call sub_402F8F"], [12, "mov edx, [rbp+len]"], [13, "mov rcx, [rbp+addr]"], [14, "mov eax, [rbp+fd]"], [15, "mov rsi, rcx"], [16, "mov edi, eax"], [17, "call _connect"], [18, "mov [rbp+var_4], eax"], [19, "cmp [rbp+var_4], 0"], [20, "jns loc_4035C9"], [21, "call ___errno_location"], [22, "mov eax, [rax]"], [23, "cmp eax, 73h "], [24, "jnz loc_4035C9"], [25, "mov eax, 0"], [26, "mov ecx, 10h"], [27, "lea rdx, [rbp+writefds]"], [28, "mov rdi, rdx"], [29, "cld"], [30, "rep stosq"], [31, "mov eax, edi"], [32, "mov edx, ecx"], [33, "mov [rbp+var_C], edx"], [34, "mov [rbp+var_10], eax"], [35, "mov eax, [rbp+fd]"], [36, "lea edx, [rax+3Fh]"], [37, "test eax, eax"], [38, "cmovs eax, edx"], [39, "sar eax, 6"], [40, "mov esi, eax"], [41, "movsxd rax, esi"], [42, "mov rdi, [rbp+rax*8+writefds.fds_bits]"], [43, "mov eax, [rbp+fd]"], [44, "cdq"], [45, "shr edx, 1Ah"], [46, "add eax, edx"], [47, "and eax, 3Fh"], [48, "sub eax, edx"], [49, "mov edx, 1"], [50, "mov ecx, eax"], [51, "shl rdx, cl"], [52, "mov rax, rdx"], [53, "or rdi, rax"], [54, "mov rdx, rdi"], [55, "movsxd rax, esi"], [56, "mov [rbp+rax*8+writefds.fds_bits], rdx"], [57, "mov eax, [rbp+var_C8]"], [58, "mov [rbp+timeout.tv_sec], rax"], [59, "mov [rbp+timeout.tv_usec], 0"], [60, "mov eax, [rbp+fd]"], [61, "lea edi, [rax+1]"], [62, "lea rdx, [rbp+timeout]"], [63, "lea rax, [rbp+writefds]"], [64, "mov r8, rdx"], [65, "mov ecx, 0"], [66, "mov rdx, rax"], [67, "mov esi, 0"], [68, "call _select"], [69, "mov [rbp+var_4], eax"], [70, "cmp [rbp+var_4], 0"], [71, "jns short loc_40353F"], [72, "call ___errno_location"], [73, "mov eax, [rax]"], [74, "cmp eax, 4"], [75, "jz short loc_403501"], [76, "cmp [rbp+var_4], 0"], [77, "jnz short loc_403559"], [78, "mov [rbp+var_4], 0FFFFFFFFh"], [79, "call ___errno_location"], [80, "mov dword ptr [rax], 6Eh "], [81, "jmp short loc_4035C9"], [82, "cmp [rbp+var_4], 0"], [83, "jns short loc_403566"], [84, "mov eax, 0FFFFFFFFh"], [85, "jmp short locret_4035E2"], [86, "cmp [rbp+var_4], 1"], [87, "jnz short loc_4035C9"], [88, "mov [rbp+optlen], 4"], [89, "lea rcx, [rbp+optlen]"], [90, "lea rdx, [rbp+optval]"], [91, "mov eax, [rbp+fd]"], [92, "mov r8, rcx"], [93, "mov rcx, rdx"], [94, "mov edx, 4"], [95, "mov esi, 1"], [96, "mov edi, eax"], [97, "call _getsockopt"], [98, "mov [rbp+var_14], eax"], [99, "cmp [rbp+var_14], 0FFFFFFFFh"], [100, "jnz short loc_4035A8"], [101, "mov eax, 0FFFFFFFFh"], [102, "jmp short locret_4035E2"], [103, "mov eax, [rbp+optval]"], [104, "test eax, eax"], [105, "jnz short loc_4035B8"], [106, "mov [rbp+var_4], 0"], [107, "jmp short loc_4035C9"], [108, "call ___errno_location"], [109, "mov edx, [rbp+optval]"], [110, "mov [rax], edx"], [111, "mov [rbp+var_4], 0FFFFFFFFh"], [112, "cmp [rbp+var_C8], 0"], [113, "jz short loc_4035DF"], [114, "mov eax, [rbp+fd]"], [115, "mov edi, eax"], [116, "call sub_403009"], [117, "mov eax, [rbp+var_4]"], [118, "leave"], [119, "retn"]], "data_dep": [[7, 5], [8, 7], [9, 3], [10, 9], [12, 6], [13, 4], [14, 3], [15, 13], [16, 14], [18, 17], [19, 18], [20, 19], [22, 21], [23, 22], [24, 23], [27, 12], [28, 27], [31, 28], [32, 26], [33, 32], [34, 31], [35, 3], [36, 35], [36, 32], [37, 35], [38, 36], [38, 37], [39, 38], [40, 39], [41, 40], [42, 41], [43, 3], [45, 36], [46, 43], [46, 45], [47, 46], [48, 45], [48, 47], [50, 48], [51, 50], [51, 49], [52, 51], [53, 52], [53, 42], [54, 53], [55, 40], [56, 55], [56, 54], [57, 5], [58, 57], [60, 3], [61, 61], [61, 60], [61, 53], [62, 66], [62, 54], [63, 60], [64, 62], [66, 63], [69, 68], [70, 69], [71, 70], [73, 72], [74, 73], [75, 74], [76, 69], [77, 76], [80, 79], [82, 69], [83, 82], [86, 69], [87, 86], [89, 65], [89, 88], [90, 66], [91, 3], [92, 89], [93, 90], [96, 91], [98, 97], [99, 98], [100, 99], [104, 103], [105, 104], [110, 109], [110, 108], [112, 5], [113, 112], [114, 3], [115, 114], [117, 69], [117, 78], [117, 18], [117, 111], [117, 106], [119, 84], [119, 117], [119, 101]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6_89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.jsonl.gz", "strip_func_name": "sub_40340E", "query": "\n\n\n__int64 __fastcall sub_40340E(int a1, const struct sockaddr *a2, unsigned int a3)\n{\nfd_set writefds; // [rsp+10h] [rbp-C0h] BYREF\n__int64 v6; // [rsp+90h] [rbp-40h] BYREF\nsocklen_t optlen; // [rsp+98h] [rbp-38h] BYREF\nint optval; // [rsp+9Ch] [rbp-34h] BYREF\nstruct timeval timeout; // [rsp+A0h] [rbp-30h] BYREF\nint v10; // [rsp+BCh] [rbp-14h]\nunsigned int v11; // [rsp+C0h] [rbp-10h]\nint v12; // [rsp+C4h] [rbp-Ch]\nsocklen_t len; // [rsp+C8h] [rbp-8h]\nint v14; // [rsp+CCh] [rbp-4h]\n\nlen = 16;\nif ( a3 )\nsub_402F8F(a1);\nv14 = connect(a1, a2, len);\nif ( v14 < 0 && *__errno_location() == 115 )\n{\nmemset(&writefds, 0, sizeof(writefds));\nv12 = 0;\nv11 = (unsigned int)&v6;\nwritefds.fds_bits[a1 / 64] |= 1LL << (a1 % 64);\ntimeout.tv_sec = a3;\ntimeout.tv_usec = 0LL;\ndo\nv14 = select(a1 + 1, 0LL, &writefds, 0LL, &timeout);\nwhile ( v14 < 0 && *__errno_location() == 4 );\nif ( v14 )\n{\nif ( v14 < 0 )\nreturn 0xFFFFFFFFLL;\nif ( v14 == 1 )\n{\noptlen = 4;\nv10 = getsockopt(a1, 1, 4, &optval, &optlen);\nif ( v10 == -1 )\nreturn 0xFFFFFFFFLL;\nif ( optval )\n{\n*__errno_location() = optval;\nv14 = -1;\n}\nelse\n{\nv14 = 0;\n}\n}\n}\nelse\n{\nv14 = -1;\n*__errno_location() = 110;\n}\n}\nif ( a3 )\nsub_403009(a1);\nreturn (unsigned int)v14;\n}\n\n\n\nQ:[a3,a1,a2,writefds,optlen,optval,v10,v11,v12,len,sub_40340E,sub_402F8F,sub_403009,]", "hints": "[]", "response": "{'a3': 'wait_seconds', 'a1': 'fd', 'a2': 'addr', 'writefds': 'connect_fdset', 'optlen': 'socklen', 'optval': 'err', 'v10': 'sockoptret', 'v11': '__d1', 'v12': '__d0', 'len': 'addrlen', 'sub_40340E': 'connect_timeout', 'sub_402F8F': 'activate_nonblock', 'sub_403009': 'deactivate_nonblock'}"}
[ [ 0.821851909160614, 0.8018225431442261, 0.7799853682518005, 0.7730041742324829, 0.7430222630500793, 0.7380104660987854, 0.7362613677978516, 0.7272515296936035, 0.7229049205780029, 0.7223731875419617, 0.7194908261299133, 0.7143224477767944, 0.7134308815002441, 0.7098449468612671, 0.7087214589118958, 0.7046260833740234, 0.7045910358428955, 0.698218822479248, 0.6978276371955872, 0.697773814201355 ], [ 71473, 154192, 131207, 172276, 253436, 190663, 87609, 76532, 94289, 64764, 252460, 49263, 155383, 34339, 33425, 87204, 235452, 123820, 244510, 194363 ] ]
ZSTD_decodeLiteralsHeader
d1bba2e5a8fdaa9a286a0e4efde17262e64ef955324775409b553931391a7444
powturbo
TurboPFor-Integer-Compression
NA
FORCE_NOINLINE size_t ZSTD_decodeLiteralsHeader(ZSTD_DCtx* dctx, void const* src, size_t srcSize) { RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, ""); { BYTE const* istart = (BYTE const*)src; symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3); if (litEncType == set_compressed) { RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3"); { size_t lhSize, litSize, litCSize; U32 const lhlCode = (istart[0] >> 2) & 3; U32 const lhc = MEM_readLE32(istart); switch(lhlCode) { case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */ /* 2 - 2 - 10 - 10 */ lhSize = 3; litSize = (lhc >> 4) & 0x3FF; litCSize = (lhc >> 14) & 0x3FF; break; case 2: /* 2 - 2 - 14 - 14 */ lhSize = 4; litSize = (lhc >> 4) & 0x3FFF; litCSize = lhc >> 18; break; case 3: /* 2 - 2 - 18 - 18 */ lhSize = 5; litSize = (lhc >> 4) & 0x3FFFF; litCSize = (lhc >> 22) + ((size_t)istart[4] << 10); break; } RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, ""); #ifndef HUF_FORCE_DECOMPRESS_X2 return HUF_readDTableX1_wksp_bmi2( dctx->entropy.hufTable, istart+lhSize, litCSize, dctx->workspace, sizeof(dctx->workspace), dctx->bmi2); #else return HUF_readDTableX2_wksp( dctx->entropy.hufTable, istart+lhSize, litCSize, dctx->workspace, sizeof(dctx->workspace)); #endif } } } return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405D82", "function_addr": 4218242, "binary_name": "d1bba2e5a8fdaa9a286a0e4efde17262e64ef955324775409b553931391a7444.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+var_48], rdx"], [6, "cmp [rbp+var_48], 2"], [7, "ja short loc_405DA9"], [8, "mov rax, 0FFFFFFFFFFFFFFECh"], [9, "jmp locret_405F11"], [10, "mov rax, [rbp+var_40]"], [11, "mov [rbp+var_20], rax"], [12, "mov rax, [rbp+var_20]"], [13, "movzx eax, byte ptr [rax]"], [14, "movzx eax, al"], [15, "and eax, 3"], [16, "mov [rbp+var_24], eax"], [17, "cmp [rbp+var_24], 2"], [18, "jnz loc_405F0C"], [19, "cmp [rbp+var_48], 4"], [20, "ja short loc_405DDE"], [21, "mov rax, 0FFFFFFFFFFFFFFECh"], [22, "jmp locret_405F11"], [23, "mov rax, [rbp+var_20]"], [24, "movzx eax, byte ptr [rax]"], [25, "shr al, 2"], [26, "movzx eax, al"], [27, "and eax, 3"], [28, "mov [rbp+var_28], eax"], [29, "mov rax, [rbp+var_20]"], [30, "mov rdi, rax"], [31, "call sub_405AD8"], [32, "mov [rbp+var_2C], eax"], [33, "cmp [rbp+var_28], 2"], [34, "jz short loc_405E38"], [35, "cmp [rbp+var_28], 3"], [36, "jz short loc_405E5F"], [37, "mov [rbp+var_8], 3"], [38, "mov eax, [rbp+var_2C]"], [39, "shr eax, 4"], [40, "mov eax, eax"], [41, "and eax, 3FFh"], [42, "mov [rbp+var_10], rax"], [43, "mov eax, [rbp+var_2C]"], [44, "shr eax, 0Eh"], [45, "mov eax, eax"], [46, "and eax, 3FFh"], [47, "mov [rbp+var_18], rax"], [48, "jmp short loc_405E9A"], [49, "mov [rbp+var_8], 4"], [50, "mov eax, [rbp+var_2C]"], [51, "shr eax, 4"], [52, "mov eax, eax"], [53, "and eax, 3FFFh"], [54, "mov [rbp+var_10], rax"], [55, "mov eax, [rbp+var_2C]"], [56, "shr eax, 12h"], [57, "mov eax, eax"], [58, "mov [rbp+var_18], rax"], [59, "jmp short loc_405E9A"], [60, "mov [rbp+var_8], 5"], [61, "mov eax, [rbp+var_2C]"], [62, "shr eax, 4"], [63, "mov eax, eax"], [64, "and eax, 3FFFFh"], [65, "mov [rbp+var_10], rax"], [66, "mov eax, [rbp+var_2C]"], [67, "shr eax, 16h"], [68, "mov edx, eax"], [69, "mov rax, [rbp+var_20]"], [70, "add rax, 4"], [71, "movzx eax, byte ptr [rax]"], [72, "movzx eax, al"], [73, "shl rax, 0Ah"], [74, "add rax, rdx"], [75, "mov [rbp+var_18], rax"], [76, "nop"], [77, "cmp [rbp+var_10], 20000h"], [78, "jbe short loc_405EAD"], [79, "mov rax, 0FFFFFFFFFFFFFFECh"], [80, "jmp short locret_405F11"], [81, "mov rdx, [rbp+var_18]"], [82, "mov rax, [rbp+var_8]"], [83, "add rax, rdx"], [84, "cmp [rbp+var_48], rax"], [85, "jnb short loc_405EC7"], [86, "mov rax, 0FFFFFFFFFFFFFFECh"], [87, "jmp short locret_405F11"], [88, "mov rax, [rbp+var_38]"], [89, "mov ecx, [rax+75D8h]"], [90, "mov rax, [rbp+var_38]"], [91, "lea rdx, [rax+6ABCh]"], [92, "mov rsi, [rbp+var_20]"], [93, "mov rax, [rbp+var_8]"], [94, "add rsi, rax"], [95, "mov rax, [rbp+var_38]"], [96, "lea rdi, [rax+2838h]"], [97, "mov rax, [rbp+var_18]"], [98, "mov r9d, ecx"], [99, "mov r8d, 0A00h"], [100, "mov rcx, rdx"], [101, "mov rdx, rax"], [102, "call sub_4088C5"], [103, "jmp short locret_405F11"], [104, "mov eax, 0"], [105, "leave"], [106, "retn"]], "data_dep": [[6, 5], [7, 6], [10, 4], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 16], [18, 17], [19, 5], [20, 19], [23, 11], [24, 23], [25, 24], [26, 25], [27, 26], [28, 27], [29, 11], [30, 29], [32, 31], [33, 28], [34, 33], [35, 28], [36, 35], [38, 32], [39, 38], [40, 39], [41, 40], [42, 41], [43, 32], [44, 43], [45, 44], [46, 45], [47, 46], [50, 32], [51, 50], [52, 51], [53, 52], [54, 53], [55, 32], [56, 55], [57, 56], [58, 57], [61, 32], [62, 61], [63, 62], [64, 63], [65, 64], [66, 32], [67, 66], [68, 67], [69, 11], [70, 69], [71, 70], [72, 71], [73, 72], [74, 73], [74, 68], [75, 74], [77, 54], [77, 65], [77, 42], [78, 77], [81, 75], [81, 47], [81, 58], [82, 49], [82, 37], [82, 60], [83, 82], [83, 81], [84, 83], [84, 5], [85, 84], [88, 3], [89, 88], [90, 3], [91, 81], [91, 90], [92, 11], [93, 49], [93, 60], [93, 37], [94, 93], [94, 92], [95, 3], [96, 95], [96, 30], [97, 47], [97, 58], [97, 75], [98, 89], [100, 91], [101, 97], [106, 86], [106, 79], [106, 8], [106, 102], [106, 104], [106, 21]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d1bba2e5a8fdaa9a286a0e4efde17262e64ef955324775409b553931391a7444_d1bba2e5a8fdaa9a286a0e4efde17262e64ef955324775409b553931391a7444.jsonl.gz", "strip_func_name": "sub_405D82", "query": "\n\n\n__int64 __fastcall sub_405D82(__int64 a1, __int64 a2, unsigned __int64 a3)\n{\nunsigned int v5; // [rsp+24h] [rbp-2Ch]\nint v6; // [rsp+28h] [rbp-28h]\nunsigned __int64 v7; // [rsp+38h] [rbp-18h]\nunsigned __int64 v8; // [rsp+40h] [rbp-10h]\n__int64 v9; // [rsp+48h] [rbp-8h]\n\nif ( a3 <= 2 )\nreturn -20LL;\nif ( (*(_BYTE *)a2 & 3) != 2 )\nreturn 0LL;\nif ( a3 <= 4 )\nreturn -20LL;\nv6 = (*(_BYTE *)a2 >> 2) & 3;\nv5 = sub_405AD8((unsigned int *)a2);\nif ( v6 == 2 )\n{\nv9 = 4LL;\nv8 = (v5 >> 4) & 0x3FFF;\nv7 = v5 >> 18;\n}\nelse if ( v6 == 3 )\n{\nv9 = 5LL;\nv8 = (v5 >> 4) & 0x3FFFF;\nv7 = (v5 >> 22) + ((unsigned __int64)*(unsigned __int8 *)(a2 + 4) << 10);\n}\nelse\n{\nv9 = 3LL;\nv8 = (v5 >> 4) & 0x3FF;\nv7 = (v5 >> 14) & 0x3FF;\n}\nif ( v8 > 0x20000 )\nreturn -20LL;\nif ( a3 >= v7 + v9 )\nreturn sub_4088C5(a1 + 10296, v9 + a2, v7, a1 + 27324, 2560LL, *(unsigned int *)(a1 + 30168));\nreturn -20LL;\n}\n\n\n\nQ:[a3,a1,a2,v5,v6,v7,v8,v9,sub_405D82,sub_405AD8,sub_4088C5,]", "hints": "[]", "response": "{'a3': 'srcSize', 'a1': 'dctx', 'a2': 'src', 'v5': 'lhc', 'v6': 'lhlCode', 'v7': 'litCSize', 'v8': 'litSize', 'v9': 'lhSize', 'sub_405D82': 'ZSTD_decodeLiteralsHeader', 'sub_405AD8': 'MEM_readLE32', 'sub_4088C5': 'HUF_readDTableX1_wksp_bmi2'}"}
[ [ 0.7883474230766296, 0.7867298722267151, 0.777596116065979, 0.7767194509506226, 0.7763664722442627, 0.7757347822189331, 0.7542964220046997, 0.7462853193283081, 0.7458267211914062, 0.7453016042709351, 0.7448307275772095, 0.7440792322158813, 0.7437139749526978, 0.7347778677940369, 0.7268106341362, 0.7206884026527405, 0.7077420949935913, 0.701429009437561, 0.701237678527832, 0.7000771164894104 ], [ 8727, 141708, 152556, 142292, 103948, 21347, 62397, 129485, 99688, 47385, 144980, 75259, 5342, 73779, 246367, 179092, 226874, 85604, 149922, 186336 ] ]
htu21d_deinit
1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0
hepingood
htu21d
NA
uint8_t htu21d_deinit(htu21d_handle_t *handle) { uint8_t res; if (handle == NULL) /* check handle */ { return 2; /* return error */ } if (handle->inited != 1) /* check handle initialization */ { return 3; /* return error */ } res = a_htu21d_write(handle, HTU21D_COMMAND_SOFT_RESET, NULL, 0); /* soft reset */ if (res != 0) /* check the result */ { handle->debug_print("htu21d: soft reset failed.\n"); /* soft reset failed */ return 4; /* return error */ } handle->delay_ms(15); /* delay 15 ms */ if (handle->iic_deinit() != 0) /* iic deinit */ { handle->debug_print("htu21d: iic deinit failed.\n"); /* iic deinit failed */ return 1; /* return error */ } handle->inited = 0; /* flag close */ return 0; /* success return 0 */ }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402A35", "function_addr": 4205109, "binary_name": "1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "cmp [rbp+var_18], 0"], [5, "jnz short loc_402A52"], [6, "mov eax, 2"], [7, "jmp locret_402AEC"], [8, "mov rax, [rbp+var_18]"], [9, "movzx eax, byte ptr [rax+4Ah]"], [10, "cmp al, 1"], [11, "jz short loc_402A68"], [12, "mov eax, 3"], [13, "jmp locret_402AEC"], [14, "mov rax, [rbp+var_18]"], [15, "mov ecx, 0"], [16, "mov edx, 0"], [17, "mov esi, 0FEh"], [18, "mov rdi, rax"], [19, "call sub_401286"], [20, "mov [rbp+var_1], al"], [21, "cmp [rbp+var_1], 0"], [22, "jz short loc_402AA7"], [23, "mov rax, [rbp+var_18]"], [24, "mov rdx, [rax+40h]"], [25, "mov edi, offset aHtu21dSoftRese"], [26, "mov eax, 0"], [27, "call rdx"], [28, "mov eax, 4"], [29, "jmp short locret_402AEC"], [30, "mov rax, [rbp+var_18]"], [31, "mov rax, [rax+38h]"], [32, "mov edi, 0Fh"], [33, "call rax"], [34, "mov rax, [rbp+var_18]"], [35, "mov rax, [rax+8]"], [36, "call rax"], [37, "test al, al"], [38, "jz short loc_402ADF"], [39, "mov rax, [rbp+var_18]"], [40, "mov rdx, [rax+40h]"], [41, "mov edi, offset aHtu21dIicDeini_0"], [42, "mov eax, 0"], [43, "call rdx"], [44, "mov eax, 1"], [45, "jmp short locret_402AEC"], [46, "mov rax, [rbp+var_18]"], [47, "mov byte ptr [rax+4Ah], 0"], [48, "mov eax, 0"], [49, "leave"], [50, "retn"]], "data_dep": [[4, 3], [5, 4], [8, 3], [9, 8], [10, 9], [11, 10], [14, 3], [18, 14], [20, 19], [21, 20], [22, 21], [23, 3], [24, 23], [27, 24], [30, 3], [31, 30], [33, 31], [34, 3], [35, 34], [36, 35], [37, 36], [38, 37], [39, 3], [40, 39], [43, 40], [46, 3], [47, 46], [50, 6], [50, 12], [50, 48], [50, 44], [50, 28]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0_1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0.jsonl.gz", "strip_func_name": "sub_402A35", "query": "\n\n\n__int64 __fastcall sub_402A35(__int64 a1)\n{\n__int64 result; // rax\n\nif ( !a1 )\nreturn 2LL;\nif ( *(_BYTE *)(a1 + 74) != 1 )\nreturn 3LL;\nif ( sub_401286(a1, 0xFEu, 0LL, 0) )\n{\n(*(void (__fastcall **)(const char *))(a1 + 64))(\"htu21d: soft reset failed.\\n\");\nresult = 4LL;\n}\nelse\n{\n(*(void (__fastcall **)(__int64))(a1 + 56))(15LL);\nif ( (*(unsigned __int8 (**)(void))(a1 + 8))() )\n{\n(*(void (__fastcall **)(const char *))(a1 + 64))(\"htu21d: iic deinit failed.\\n\");\nresult = 1LL;\n}\nelse\n{\n*(_BYTE *)(a1 + 74) = 0;\nresult = 0LL;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_402A35,sub_401286,]", "hints": "[]", "response": "{'a1': 'handle', 'sub_402A35': 'htu21d_deinit', 'sub_401286': 'a_htu21d_write'}"}
[ [ 0.8331687450408936, 0.8302950263023376, 0.827911376953125, 0.8162023425102234, 0.8049156665802002, 0.8035714626312256, 0.8029593825340271, 0.7866737842559814, 0.7830957174301147, 0.7817996740341187, 0.7790482044219971, 0.7763659954071045, 0.7754085659980774, 0.7663236260414124, 0.7596337795257568, 0.7586319446563721, 0.7568814754486084, 0.7536224126815796, 0.748720109462738, 0.7443804740905762 ], [ 254812, 154444, 196181, 131900, 21501, 60618, 112760, 18308, 92665, 189742, 199182, 263833, 71045, 209124, 226280, 57363, 163391, 254668, 42247, 54006 ] ]
buffer_read
4ddab09c3171a036d85094692f061d974b675b9746960b9924a14426d37b827a
aws
s2n-tls
NA
static int buffer_read(void *io_context, uint8_t *buf, uint32_t len) { struct s2n_stuffer *in_buf; int n_read, n_avail; if (buf == NULL) { return 0; } in_buf = (struct s2n_stuffer *) io_context; if (in_buf == NULL) { errno = EINVAL; return -1; } /* read the number of bytes requested or less if it isn't available */ n_avail = s2n_stuffer_data_available(in_buf); n_read = (len < n_avail) ? len : n_avail; if (n_read == 0) { errno = EAGAIN; return -1; } s2n_stuffer_read_bytes(in_buf, buf, n_read); return n_read; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40E9E3", "function_addr": 4254179, "binary_name": "4ddab09c3171a036d85094692f061d974b675b9746960b9924a14426d37b827a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov rax, fs:28h"], [7, "mov [rbp+var_8], rax"], [8, "xor eax, eax"], [9, "cmp [rbp+var_30], 0"], [10, "jnz short loc_40EA13"], [11, "mov eax, 0"], [12, "jmp short loc_40EA87"], [13, "mov rax, [rbp+var_28]"], [14, "mov [rbp+var_10], rax"], [15, "cmp [rbp+var_10], 0"], [16, "jnz short loc_40EA34"], [17, "call ___errno_location"], [18, "mov dword ptr [rax], 16h"], [19, "mov eax, 0FFFFFFFFh"], [20, "jmp short loc_40EA87"], [21, "mov rax, [rbp+var_10]"], [22, "mov edx, [rax+1Ch]"], [23, "mov rax, [rbp+var_10]"], [24, "mov ecx, [rax+18h]"], [25, "mov eax, edx"], [26, "sub eax, ecx"], [27, "mov [rbp+var_18], eax"], [28, "mov eax, [rbp+var_18]"], [29, "cmp [rbp+var_34], eax"], [30, "cmovbe eax, [rbp+var_34]"], [31, "mov [rbp+var_14], eax"], [32, "cmp [rbp+var_14], 0"], [33, "jnz short loc_40EA6E"], [34, "call ___errno_location"], [35, "mov dword ptr [rax], 0Bh"], [36, "mov eax, 0FFFFFFFFh"], [37, "jmp short loc_40EA87"], [38, "mov edx, [rbp+var_14]"], [39, "mov rcx, [rbp+var_30]"], [40, "mov rax, [rbp+var_10]"], [41, "mov rsi, rcx"], [42, "mov rdi, rax"], [43, "call sub_417344"], [44, "mov eax, [rbp+var_14]"], [45, "mov rsi, [rbp+var_8]"], [46, "sub rsi, fs:28h"], [47, "jz short locret_40EA9B"], [48, "call ___stack_chk_fail"], [49, "leave"], [50, "retn"]], "data_dep": [[7, 6], [9, 4], [10, 9], [13, 3], [14, 13], [15, 14], [16, 15], [18, 17], [21, 14], [22, 21], [23, 14], [24, 23], [25, 22], [26, 24], [26, 25], [27, 26], [28, 27], [29, 28], [29, 5], [30, 5], [30, 29], [31, 30], [32, 31], [33, 32], [35, 34], [38, 31], [39, 4], [40, 14], [41, 39], [42, 40], [44, 31], [45, 7], [46, 45], [47, 46], [50, 36], [50, 11], [50, 44], [50, 19]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4ddab09c3171a036d85094692f061d974b675b9746960b9924a14426d37b827a_4ddab09c3171a036d85094692f061d974b675b9746960b9924a14426d37b827a.jsonl.gz", "strip_func_name": "sub_40E9E3", "query": "\n\n\n__int64 __fastcall sub_40E9E3(__int64 a1, __int64 a2, unsigned int a3)\n{\n__int64 result; // rax\nunsigned int v4; // eax\nunsigned int v5; // [rsp+2Ch] [rbp-14h]\n\nif ( !a2 )\nreturn 0LL;\nif ( a1 )\n{\nv4 = *(_DWORD *)(a1 + 28) - *(_DWORD *)(a1 + 24);\nif ( a3 <= v4 )\nv4 = a3;\nv5 = v4;\nif ( v4 )\n{\nsub_417344(a1, a2, v4);\nresult = v5;\n}\nelse\n{\n*__errno_location() = 11;\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\n*__errno_location() = 22;\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v4,v5,sub_40E9E3,sub_417344,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 'io_context', 'a2': 'buf', 'v4': 'result', 'v5': 'n_read', 'sub_40E9E3': 'buffer_read', 'sub_417344': 's2n_stuffer_read_bytes'}"}
[ [ 0.7870882749557495, 0.7761814594268799, 0.7680146098136902, 0.7599281668663025, 0.7548242807388306, 0.746715784072876, 0.7347984910011292, 0.7344400882720947, 0.7319384813308716, 0.731282114982605, 0.7305510640144348, 0.7264976501464844, 0.721278190612793, 0.720778226852417, 0.7201441526412964, 0.719962477684021, 0.708285927772522, 0.7056323289871216, 0.7054774165153503, 0.7045353651046753 ], [ 175616, 55568, 151531, 54412, 88415, 178511, 88091, 57765, 129322, 143508, 42841, 120486, 106570, 10219, 230946, 137868, 133130, 113040, 235699, 176079 ] ]
gtnm
418d51dde1419e9530a62b81d2c28d1e3a0180b41dc717a19543f7ab5777225c
EtchedPixels
FUZIX
NA
int gtnm(void) { int s, val, c; /* read and convert an integer from the standard input */ /* return the terminating character */ /* blanks, tabs, and newlines are ignored */ s = 1; val = 0; while ((c = getc(finput)) != EOF) { if (isdigit(c)) { val = val * 10 + c - '0'; } else if (c == '-') s = -1; else break; } *pmem++ = s * val; if (pmem > &mem[MEMSIZE]) error("out of space"); return (c); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40757C", "function_addr": 4224380, "binary_name": "418d51dde1419e9530a62b81d2c28d1e3a0180b41dc717a19543f7ab5777225c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_4], 1"], [4, "mov [rbp+var_8], 0"], [5, "jmp short loc_4075DE"], [6, "call ___ctype_b_loc"], [7, "mov rdx, [rax]"], [8, "mov eax, [rbp+var_C]"], [9, "cdqe"], [10, "add rax, rax"], [11, "add rax, rdx"], [12, "movzx eax, word ptr [rax]"], [13, "movzx eax, ax"], [14, "and eax, 800h"], [15, "test eax, eax"], [16, "jz short loc_4075D1"], [17, "mov edx, [rbp+var_8]"], [18, "mov eax, edx"], [19, "shl eax, 2"], [20, "add eax, edx"], [21, "add eax, eax"], [22, "mov edx, eax"], [23, "mov eax, [rbp+var_C]"], [24, "add eax, edx"], [25, "sub eax, 30h "], [26, "mov [rbp+var_8], eax"], [27, "jmp short loc_4075DE"], [28, "cmp [rbp+var_C], 2Dh "], [29, "jnz short loc_4075F8"], [30, "mov [rbp+var_4], 0FFFFFFFFh"], [31, "mov rax, cs:stream"], [32, "mov rdi, rax"], [33, "call _getc"], [34, "mov [rbp+var_C], eax"], [35, "cmp [rbp+var_C], 0FFFFFFFFh"], [36, "jnz short loc_407594"], [37, "jmp short loc_4075F9"], [38, "nop"], [39, "mov rax, cs:off_40B0D8"], [40, "lea rdx, [rax+4]"], [41, "mov cs:off_40B0D8, rdx"], [42, "mov edx, [rbp+var_4]"], [43, "imul edx, [rbp+var_8]"], [44, "mov [rax], edx"], [45, "mov rax, cs:off_40B0D8"], [46, "cmp rax, offset qword_423060"], [47, "jbe short loc_407632"], [48, "mov edi, offset aOutOfSpace"], [49, "mov eax, 0"], [50, "call error"], [51, "mov eax, [rbp+var_C]"], [52, "leave"], [53, "retn"]], "data_dep": [[7, 6], [8, 34], [10, 8], [11, 7], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 26], [17, 4], [18, 17], [19, 18], [20, 17], [20, 19], [21, 20], [22, 21], [23, 34], [24, 23], [24, 22], [25, 24], [26, 25], [28, 34], [29, 28], [32, 31], [34, 33], [35, 34], [36, 35], [40, 7], [40, 22], [40, 39], [41, 40], [42, 3], [42, 30], [43, 42], [43, 26], [43, 4], [44, 39], [44, 43], [45, 41], [46, 45], [46, 41], [47, 46], [47, 41], [51, 34], [53, 51]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/418d51dde1419e9530a62b81d2c28d1e3a0180b41dc717a19543f7ab5777225c_418d51dde1419e9530a62b81d2c28d1e3a0180b41dc717a19543f7ab5777225c.jsonl.gz", "strip_func_name": "sub_40757C", "query": "\n\n\n__int64 sub_40757C()\n{\n_DWORD *v0; // rax\nunsigned int v2; // [rsp+4h] [rbp-Ch]\nint v3; // [rsp+8h] [rbp-8h]\nint v4; // [rsp+Ch] [rbp-4h]\n\nv4 = 1;\nv3 = 0;\nwhile ( 1 )\n{\nv2 = getc(stream);\nif ( v2 == -1 )\nbreak;\nif ( ((*__ctype_b_loc())[v2] & 0x800) != 0 )\n{\nv3 = 10 * v3 + v2 - 48;\n}\nelse\n{\nif ( v2 != 45 )\nbreak;\nv4 = -1;\n}\n}\nv0 = off_40B0D8;\noff_40B0D8 = (char *)off_40B0D8 + 4;\n*v0 = v3 * v4;\nif ( off_40B0D8 > qword_423060 )\nerror(\"out of space\");\nreturn v2;\n}\n\n\n\nQ:[v2,v3,v4,sub_40757C,]", "hints": "[]", "response": "{'v2': 'c', 'v3': 'val', 'v4': 's', 'sub_40757C': 'gtnm'}"}
[ [ 0.7280124425888062, 0.7278791666030884, 0.7272855043411255, 0.713372528553009, 0.7127190232276917, 0.7125526666641235, 0.7057603597640991, 0.7033042907714844, 0.7029724717140198, 0.7002303600311279, 0.6998471021652222, 0.695459246635437, 0.6949840784072876, 0.6947115659713745, 0.6936789155006409, 0.693638265132904, 0.6858929991722107, 0.6819779872894287, 0.6782827377319336, 0.6771974563598633 ], [ 199027, 247856, 188820, 239951, 100335, 208436, 69795, 113444, 236935, 104524, 111669, 34009, 156537, 188074, 260844, 13379, 78647, 183758, 20847, 178845 ] ]
write_patch_config
56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b
peterbjornx
patchtools_pub
NA
void write_patch_config( const patch_hdr_t *hdr, const patch_body_t *body, const char *filename, const char *msram_fn, uint32_t key_seed ) { FILE *file; int i; file = fopen(filename, "w"); if ( !file ) { perror( "Could not open patch config output file" ); exit( EXIT_FAILURE ); } fprintf( file, "header_ver 0x%08X\n", hdr->header_ver ); fprintf( file, "update_rev 0x%08X\n", hdr->update_rev ); fprintf( file, "date_bcd 0x%08X\n", hdr->date_bcd ); fprintf( file, "proc_sig 0x%08X\n", hdr->proc_sig ); fprintf( file, "checksum 0x%08X\n", hdr->checksum ); fprintf( file, "loader_rev 0x%08X\n", hdr->loader_ver ); fprintf( file, "proc_flags 0x%08X\n", hdr->proc_flags ); fprintf( file, "data_size 0x%08X\n", hdr->data_size ); fprintf( file, "total_size 0x%08X\n", hdr->total_size ); fprintf( file, "key_seed 0x%08X\n", key_seed ); fprintf( file, "msram_file %s\n" , msram_fn ); for ( i = 0; i < PATCH_CR_OP_COUNT; i++ ) { fprintf( file, "write_creg 0x%03X 0x%08X 0x%08X\n", body->cr_ops[i].address, body->cr_ops[i].mask, body->cr_ops[i].value); } fclose( file ); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402CBD", "function_addr": 4205757, "binary_name": "56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+filename], rdx"], [6, "mov [rbp+var_30], rcx"], [7, "mov [rbp+var_34], r8d"], [8, "mov rax, [rbp+filename]"], [9, "mov esi, offset modes"], [10, "mov rdi, rax"], [11, "call _fopen"], [12, "mov [rbp+stream], rax"], [13, "cmp [rbp+stream], 0"], [14, "jnz short loc_402D09"], [15, "mov edi, offset aCouldNotOpenPa"], [16, "call _perror"], [17, "mov edi, 1"], [18, "call _exit"], [19, "mov rax, [rbp+var_18]"], [20, "mov edx, [rax]"], [21, "mov rax, [rbp+stream]"], [22, "mov esi, offset aHeaderVer0x08x"], [23, "mov rdi, rax"], [24, "mov eax, 0"], [25, "call _fprintf"], [26, "mov rax, [rbp+var_18]"], [27, "mov edx, [rax+4]"], [28, "mov rax, [rbp+stream]"], [29, "mov esi, offset aUpdateRev0x08x"], [30, "mov rdi, rax"], [31, "mov eax, 0"], [32, "call _fprintf"], [33, "mov rax, [rbp+var_18]"], [34, "mov edx, [rax+8]"], [35, "mov rax, [rbp+stream]"], [36, "mov esi, offset aDateBcd0x08x"], [37, "mov rdi, rax"], [38, "mov eax, 0"], [39, "call _fprintf"], [40, "mov rax, [rbp+var_18]"], [41, "mov edx, [rax+0Ch]"], [42, "mov rax, [rbp+stream]"], [43, "mov esi, offset aProcSig0x08x"], [44, "mov rdi, rax"], [45, "mov eax, 0"], [46, "call _fprintf"], [47, "mov rax, [rbp+var_18]"], [48, "mov edx, [rax+10h]"], [49, "mov rax, [rbp+stream]"], [50, "mov esi, offset aChecksum0x08x"], [51, "mov rdi, rax"], [52, "mov eax, 0"], [53, "call _fprintf"], [54, "mov rax, [rbp+var_18]"], [55, "mov edx, [rax+14h]"], [56, "mov rax, [rbp+stream]"], [57, "mov esi, offset aLoaderRev0x08x"], [58, "mov rdi, rax"], [59, "mov eax, 0"], [60, "call _fprintf"], [61, "mov rax, [rbp+var_18]"], [62, "mov edx, [rax+18h]"], [63, "mov rax, [rbp+stream]"], [64, "mov esi, offset aProcFlags0x08x"], [65, "mov rdi, rax"], [66, "mov eax, 0"], [67, "call _fprintf"], [68, "mov rax, [rbp+var_18]"], [69, "mov edx, [rax+1Ch]"], [70, "mov rax, [rbp+stream]"], [71, "mov esi, offset aDataSize0x08x"], [72, "mov rdi, rax"], [73, "mov eax, 0"], [74, "call _fprintf"], [75, "mov rax, [rbp+var_18]"], [76, "mov edx, [rax+20h]"], [77, "mov rax, [rbp+stream]"], [78, "mov esi, offset aTotalSize0x08x"], [79, "mov rdi, rax"], [80, "mov eax, 0"], [81, "call _fprintf"], [82, "mov edx, [rbp+var_34]"], [83, "mov rax, [rbp+stream]"], [84, "mov esi, offset aKeySeed0x08x_0"], [85, "mov rdi, rax"], [86, "mov eax, 0"], [87, "call _fprintf"], [88, "mov rdx, [rbp+var_30]"], [89, "mov rax, [rbp+stream]"], [90, "mov esi, offset aMsramFileS"], [91, "mov rdi, rax"], [92, "mov eax, 0"], [93, "call _fprintf"], [94, "mov [rbp+var_4], 0"], [95, "jmp short loc_402EB0"], [96, "mov rdx, [rbp+var_20]"], [97, "mov eax, [rbp+var_4]"], [98, "cdqe"], [99, "add rax, 2Ah "], [100, "shl rax, 4"], [101, "add rax, rdx"], [102, "add rax, 8"], [103, "mov esi, [rax]"], [104, "mov rdx, [rbp+var_20]"], [105, "mov eax, [rbp+var_4]"], [106, "cdqe"], [107, "add rax, 2Ah "], [108, "shl rax, 4"], [109, "add rax, rdx"], [110, "add rax, 4"], [111, "mov ecx, [rax]"], [112, "mov rdx, [rbp+var_20]"], [113, "mov eax, [rbp+var_4]"], [114, "cdqe"], [115, "add rax, 2Ah "], [116, "shl rax, 4"], [117, "add rax, rdx"], [118, "mov edx, [rax]"], [119, "mov rax, [rbp+stream]"], [120, "mov r8d, esi"], [121, "mov esi, offset aWriteCreg0x03x"], [122, "mov rdi, rax"], [123, "mov eax, 0"], [124, "call _fprintf"], [125, "add [rbp+var_4], 1"], [126, "cmp [rbp+var_4], 0Fh"], [127, "jle short loc_402E49"], [128, "mov rax, [rbp+stream]"], [129, "mov rdi, rax"], [130, "call _fclose"], [131, "nop"], [132, "leave"], [133, "retn"]], "data_dep": [[8, 5], [10, 8], [12, 11], [13, 12], [14, 13], [19, 3], [20, 19], [21, 12], [23, 21], [26, 3], [27, 26], [28, 12], [30, 28], [33, 3], [34, 33], [35, 12], [37, 35], [40, 3], [41, 40], [42, 12], [44, 42], [47, 3], [48, 47], [49, 12], [51, 49], [54, 3], [55, 54], [56, 12], [58, 56], [61, 3], [62, 61], [63, 12], [65, 63], [68, 3], [69, 68], [70, 12], [72, 70], [75, 3], [76, 75], [77, 12], [79, 77], [82, 7], [83, 12], [85, 83], [88, 6], [89, 12], [91, 89], [96, 4], [97, 94], [97, 125], [99, 97], [100, 99], [101, 96], [101, 100], [102, 101], [103, 102], [104, 4], [105, 125], [105, 94], [107, 105], [108, 107], [109, 104], [109, 108], [110, 109], [111, 110], [112, 4], [113, 94], [113, 125], [115, 113], [116, 115], [117, 112], [117, 116], [118, 117], [119, 12], [120, 103], [122, 119], [125, 125], [125, 94], [126, 94], [126, 125], [127, 126], [128, 12], [129, 128], [133, 130]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b_56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.jsonl.gz", "strip_func_name": "sub_402CBD", "query": "\n\n\nint __fastcall sub_402CBD(unsigned int *a1, __int64 a2, const char *a3, const char *a4, unsigned int a5)\n{\nFILE *stream; // [rsp+30h] [rbp-10h]\nint i; // [rsp+3Ch] [rbp-4h]\n\nstream = fopen(a3, \"w\");\nif ( !stream )\n{\nperror(\"Could not open patch config output file\");\nexit(1);\n}\nfprintf(stream, \"header_ver 0x%08X\\n\", *a1);\nfprintf(stream, \"update_rev 0x%08X\\n\", a1[1]);\nfprintf(stream, \"date_bcd 0x%08X\\n\", a1[2]);\nfprintf(stream, \"proc_sig 0x%08X\\n\", a1[3]);\nfprintf(stream, \"checksum 0x%08X\\n\", a1[4]);\nfprintf(stream, \"loader_rev 0x%08X\\n\", a1[5]);\nfprintf(stream, \"proc_flags 0x%08X\\n\", a1[6]);\nfprintf(stream, \"data_size 0x%08X\\n\", a1[7]);\nfprintf(stream, \"total_size 0x%08X\\n\", a1[8]);\nfprintf(stream, \"key_seed 0x%08X\\n\", a5);\nfprintf(stream, \"msram_file %s\\n\", a4);\nfor ( i = 0; i <= 15; ++i )\nfprintf(\nstream,\n\"write_creg 0x%03X 0x%08X 0x%08X\\n\",\n*(unsigned int *)(a2 + 16 * (i + 42LL)),\n*(unsigned int *)(a2 + 16 * (i + 42LL) + 4),\n*(unsigned int *)(a2 + 16 * (i + 42LL) + 8));\nreturn fclose(stream);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,stream,sub_402CBD,]", "hints": "[]", "response": "{'a3': 'filename', 'a4': 'msram_fn', 'a1': 'hdr', 'a2': 'body', 'a5': 'key_seed', 'stream': 'file', 'sub_402CBD': 'write_patch_config'}"}
[ [ 0.7981619834899902, 0.769187867641449, 0.7497258186340332, 0.7471838593482971, 0.7466413974761963, 0.7424954175949097, 0.7253713607788086, 0.7162408828735352, 0.7138296961784363, 0.7118053436279297, 0.708177387714386, 0.7063539028167725, 0.7063539028167725, 0.7057619690895081, 0.7055882811546326, 0.7054814696311951, 0.7035843729972839, 0.7028452157974243, 0.7022197842597961, 0.7021886706352234 ], [ 169158, 233742, 160341, 182262, 248548, 31111, 2835, 250022, 264138, 159586, 159294, 12451, 110966, 16142, 4557, 26474, 222008, 33431, 179963, 14622 ] ]
m_reverse
7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807
arendst
Tasmota
NA
static int m_reverse(bvm *vm) { int argc = be_top(vm); buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ check_ptr(vm, &attr); int32_t idx = 0; /* start from index 0 */ int32_t len = attr.len; /* entire len */ int32_t grouplen = 1; /* default to 1-byte group */ if (argc >= 2 && be_isint(vm, 2)) { idx = be_toint(vm, 2); if (idx < 0) { idx = 0; } /* railguards */ if (idx > attr.len) { idx = attr.len; } } if (argc >= 3 && be_isint(vm, 3)) { len = be_toint(vm, 3); if (len < 0) { len = attr.len - idx; } /* negative len means */ } if (idx + len >= attr.len) { len = attr.len - idx; } // truncate len to multiple of grouplen if (argc >= 4 && be_isint(vm, 4)) { grouplen = be_toint(vm, 4); if (grouplen <= 0) { grouplen = 1; } } len = len - (len % grouplen); // apply reverse if (len > 0) { if (grouplen == 1) { /* fast version if simple byte inversion */ for (int32_t i = idx, j = idx + len -1; i < j; i++, j--) { uint8_t temp = attr.bufptr[i]; attr.bufptr[i] = attr.bufptr[j]; attr.bufptr[j] = temp; } } else { for (int32_t i = idx, j = idx + len - grouplen; i < j; i += grouplen, j -= grouplen) { for (int32_t k = 0; k < grouplen; k++) { uint8_t temp = attr.bufptr[i+k]; attr.bufptr[i+k] = attr.bufptr[j+k]; attr.bufptr[j+k] = temp; } } } } be_pushvalue(vm, 1); /* push bytes object */ be_return(vm); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41772D", "function_addr": 4290349, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_58], rdi"], [4, "mov rax, [rbp+var_58]"], [5, "mov rdi, rax"], [6, "call be_top"], [7, "mov [rbp+var_24], eax"], [8, "lea rax, [rbp+var_50]"], [9, "mov rcx, [rbp+var_58]"], [10, "mov edx, 0"], [11, "mov rsi, rcx"], [12, "mov rdi, rax"], [13, "call bytes_check_data"], [14, "lea rdx, [rbp+var_50]"], [15, "mov rax, [rbp+var_58]"], [16, "mov rsi, rdx"], [17, "mov rdi, rax"], [18, "call sub_415FEE"], [19, "mov [rbp+var_4], 0"], [20, "mov eax, [rbp+var_4C]"], [21, "mov [rbp+var_8], eax"], [22, "mov [rbp+var_C], 1"], [23, "cmp [rbp+var_24], 1"], [24, "jle short loc_4177D1"], [25, "mov rax, [rbp+var_58]"], [26, "mov esi, 2"], [27, "mov rdi, rax"], [28, "call be_isint"], [29, "test al, al"], [30, "jz short loc_4177D1"], [31, "mov rax, [rbp+var_58]"], [32, "mov esi, 2"], [33, "mov rdi, rax"], [34, "call be_toint"], [35, "mov [rbp+var_4], eax"], [36, "cmp [rbp+var_4], 0"], [37, "jns short loc_4177C3"], [38, "mov [rbp+var_4], 0"], [39, "mov eax, [rbp+var_4C]"], [40, "cmp [rbp+var_4], eax"], [41, "jle short loc_4177D1"], [42, "mov eax, [rbp+var_4C]"], [43, "mov [rbp+var_4], eax"], [44, "cmp [rbp+var_24], 2"], [45, "jle short loc_41780F"], [46, "mov rax, [rbp+var_58]"], [47, "mov esi, 3"], [48, "mov rdi, rax"], [49, "call be_isint"], [50, "test al, al"], [51, "jz short loc_41780F"], [52, "mov rax, [rbp+var_58]"], [53, "mov esi, 3"], [54, "mov rdi, rax"], [55, "call be_toint"], [56, "mov [rbp+var_8], eax"], [57, "cmp [rbp+var_8], 0"], [58, "jns short loc_41780F"], [59, "mov eax, [rbp+var_4C]"], [60, "sub eax, [rbp+var_4]"], [61, "mov [rbp+var_8], eax"], [62, "mov edx, [rbp+var_4]"], [63, "mov eax, [rbp+var_8]"], [64, "add edx, eax"], [65, "mov eax, [rbp+var_4C]"], [66, "cmp edx, eax"], [67, "jl short loc_417827"], [68, "mov eax, [rbp+var_4C]"], [69, "sub eax, [rbp+var_4]"], [70, "mov [rbp+var_8], eax"], [71, "cmp [rbp+var_24], 3"], [72, "jle short loc_417863"], [73, "mov rax, [rbp+var_58]"], [74, "mov esi, 4"], [75, "mov rdi, rax"], [76, "call be_isint"], [77, "test al, al"], [78, "jz short loc_417863"], [79, "mov rax, [rbp+var_58]"], [80, "mov esi, 4"], [81, "mov rdi, rax"], [82, "call be_toint"], [83, "mov [rbp+var_C], eax"], [84, "cmp [rbp+var_C], 0"], [85, "jg short loc_417863"], [86, "mov [rbp+var_C], 1"], [87, "mov eax, [rbp+var_8]"], [88, "cdq"], [89, "idiv [rbp+var_C]"], [90, "mov eax, edx"], [91, "sub [rbp+var_8], eax"], [92, "cmp [rbp+var_8], 0"], [93, "jle loc_417981"], [94, "cmp [rbp+var_C], 1"], [95, "jnz short loc_4178EC"], [96, "mov eax, [rbp+var_4]"], [97, "mov [rbp+var_10], eax"], [98, "mov edx, [rbp+var_4]"], [99, "mov eax, [rbp+var_8]"], [100, "add eax, edx"], [101, "sub eax, 1"], [102, "mov [rbp+var_14], eax"], [103, "jmp short loc_4178DF"], [104, "mov rdx, [rbp+var_48]"], [105, "mov eax, [rbp+var_10]"], [106, "cdqe"], [107, "add rax, rdx"], [108, "movzx eax, byte ptr [rax]"], [109, "mov [rbp+var_26], al"], [110, "mov rdx, [rbp+var_48]"], [111, "mov eax, [rbp+var_14]"], [112, "cdqe"], [113, "add rax, rdx"], [114, "mov rcx, [rbp+var_48]"], [115, "mov edx, [rbp+var_10]"], [116, "movsxd rdx, edx"], [117, "add rdx, rcx"], [118, "movzx eax, byte ptr [rax]"], [119, "mov [rdx], al"], [120, "mov rdx, [rbp+var_48]"], [121, "mov eax, [rbp+var_14]"], [122, "cdqe"], [123, "add rdx, rax"], [124, "movzx eax, [rbp+var_26]"], [125, "mov [rdx], al"], [126, "add [rbp+var_10], 1"], [127, "sub [rbp+var_14], 1"], [128, "mov eax, [rbp+var_10]"], [129, "cmp eax, [rbp+var_14]"], [130, "jl short loc_417895"], [131, "jmp loc_417981"], [132, "mov eax, [rbp+var_4]"], [133, "mov [rbp+var_18], eax"], [134, "mov edx, [rbp+var_4]"], [135, "mov eax, [rbp+var_8]"], [136, "add eax, edx"], [137, "sub eax, [rbp+var_C]"], [138, "mov [rbp+var_1C], eax"], [139, "jmp short loc_417979"], [140, "mov [rbp+var_20], 0"], [141, "jmp short loc_417965"], [142, "mov rdx, [rbp+var_48]"], [143, "mov ecx, [rbp+var_18]"], [144, "mov eax, [rbp+var_20]"], [145, "add eax, ecx"], [146, "cdqe"], [147, "add rax, rdx"], [148, "movzx eax, byte ptr [rax]"], [149, "mov [rbp+var_25], al"], [150, "mov rdx, [rbp+var_48]"], [151, "mov ecx, [rbp+var_1C]"], [152, "mov eax, [rbp+var_20]"], [153, "add eax, ecx"], [154, "cdqe"], [155, "add rax, rdx"], [156, "mov rcx, [rbp+var_48]"], [157, "mov esi, [rbp+var_18]"], [158, "mov edx, [rbp+var_20]"], [159, "add edx, esi"], [160, "movsxd rdx, edx"], [161, "add rdx, rcx"], [162, "movzx eax, byte ptr [rax]"], [163, "mov [rdx], al"], [164, "mov rdx, [rbp+var_48]"], [165, "mov ecx, [rbp+var_1C]"], [166, "mov eax, [rbp+var_20]"], [167, "add eax, ecx"], [168, "cdqe"], [169, "add rdx, rax"], [170, "movzx eax, [rbp+var_25]"], [171, "mov [rdx], al"], [172, "add [rbp+var_20], 1"], [173, "mov eax, [rbp+var_20]"], [174, "cmp eax, [rbp+var_C]"], [175, "jl short loc_41790B"], [176, "mov eax, [rbp+var_C]"], [177, "add [rbp+var_18], eax"], [178, "mov eax, [rbp+var_C]"], [179, "sub [rbp+var_1C], eax"], [180, "mov eax, [rbp+var_18]"], [181, "cmp eax, [rbp+var_1C]"], [182, "jl short loc_417902"], [183, "mov rax, [rbp+var_58]"], [184, "mov esi, 1"], [185, "mov rdi, rax"], [186, "call be_pushvalue"], [187, "mov rax, [rbp+var_58]"], [188, "mov rdi, rax"], [189, "call be_returnvalue"], [190, "leave"], [191, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 6], [9, 3], [11, 9], [12, 8], [14, 10], [15, 3], [16, 14], [17, 15], [21, 20], [23, 7], [24, 23], [25, 3], [27, 25], [29, 28], [30, 29], [31, 3], [33, 31], [35, 34], [36, 35], [37, 36], [40, 38], [40, 35], [40, 39], [41, 40], [43, 42], [44, 7], [45, 44], [46, 3], [48, 46], [50, 49], [51, 50], [52, 3], [54, 52], [56, 55], [57, 56], [58, 57], [60, 19], [60, 59], [60, 43], [60, 38], [60, 35], [61, 60], [62, 35], [62, 19], [62, 43], [62, 38], [63, 61], [63, 56], [63, 21], [64, 62], [64, 63], [66, 64], [66, 65], [67, 66], [69, 35], [69, 19], [69, 68], [69, 43], [69, 38], [70, 69], [71, 7], [72, 71], [73, 3], [75, 73], [77, 76], [78, 77], [79, 3], [81, 79], [83, 82], [84, 83], [85, 84], [87, 61], [87, 70], [87, 56], [87, 21], [89, 22], [89, 86], [89, 83], [90, 64], [91, 61], [91, 70], [91, 56], [91, 90], [91, 21], [92, 91], [93, 92], [94, 89], [95, 94], [96, 35], [96, 19], [96, 43], [96, 38], [97, 96], [98, 43], [98, 38], [98, 35], [98, 19], [99, 91], [100, 98], [100, 99], [101, 100], [102, 101], [105, 97], [105, 126], [107, 104], [107, 105], [108, 107], [108, 125], [108, 119], [109, 108], [111, 127], [111, 102], [113, 110], [113, 111], [115, 126], [115, 97], [116, 115], [117, 114], [117, 116], [118, 113], [118, 119], [118, 125], [119, 118], [119, 117], [121, 127], [121, 102], [123, 121], [123, 120], [124, 109], [125, 123], [125, 124], [126, 126], [126, 97], [127, 127], [127, 102], [128, 126], [128, 97], [129, 128], [129, 127], [129, 102], [130, 129], [132, 43], [132, 38], [132, 35], [132, 19], [133, 132], [134, 43], [134, 38], [134, 35], [134, 19], [135, 91], [136, 135], [136, 134], [137, 89], [137, 136], [138, 137], [143, 133], [143, 177], [144, 172], [144, 140], [145, 144], [145, 143], [147, 142], [147, 145], [148, 147], [148, 163], [148, 171], [149, 148], [151, 138], [151, 179], [152, 140], [152, 172], [153, 152], [153, 151], [155, 153], [155, 150], [157, 177], [157, 133], [158, 172], [158, 140], [159, 157], [159, 158], [160, 159], [161, 156], [161, 160], [162, 163], [162, 171], [162, 155], [163, 161], [163, 162], [165, 138], [165, 179], [166, 172], [166, 140], [167, 166], [167, 165], [169, 167], [169, 164], [170, 149], [171, 170], [171, 169], [172, 140], [172, 172], [173, 140], [173, 172], [174, 89], [174, 173], [175, 174], [176, 89], [177, 176], [177, 177], [177, 133], [178, 89], [179, 178], [179, 138], [179, 179], [180, 177], [180, 133], [181, 180], [181, 138], [181, 179], [182, 181], [183, 3], [185, 183], [187, 3], [188, 187], [191, 189]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_41772D", "query": "\n\n\n__int64 __fastcall sub_41772D(__int64 a1)\n{\n__int64 v2; // [rsp+10h] [rbp-50h] BYREF\n__int64 v3; // [rsp+18h] [rbp-48h]\nchar v4; // [rsp+3Ah] [rbp-26h]\nchar v5; // [rsp+3Bh] [rbp-25h]\nint v6; // [rsp+3Ch] [rbp-24h]\nint k; // [rsp+40h] [rbp-20h]\nint j; // [rsp+44h] [rbp-1Ch]\nint v9; // [rsp+48h] [rbp-18h]\nint i; // [rsp+4Ch] [rbp-14h]\nint v11; // [rsp+50h] [rbp-10h]\nint v12; // [rsp+54h] [rbp-Ch]\nint v13; // [rsp+58h] [rbp-8h]\nint v14; // [rsp+5Ch] [rbp-4h]\n\nv6 = be_top(a1);\nbytes_check_data(&v2, a1, 0);\nsub_415FEE(a1, (__int64)&v2);\nv14 = 0;\nv13 = HIDWORD(v2);\nv12 = 1;\nif ( v6 > 1 && be_isint(a1, 2u) )\n{\nv14 = be_toint(a1, 2u);\nif ( v14 < 0 )\nv14 = 0;\nif ( v14 > SHIDWORD(v2) )\nv14 = HIDWORD(v2);\n}\nif ( v6 > 2 && be_isint(a1, 3u) )\n{\nv13 = be_toint(a1, 3u);\nif ( v13 < 0 )\nv13 = HIDWORD(v2) - v14;\n}\nif ( v13 + v14 >= SHIDWORD(v2) )\nv13 = HIDWORD(v2) - v14;\nif ( v6 > 3 && be_isint(a1, 4u) )\n{\nv12 = be_toint(a1, 4u);\nif ( v12 <= 0 )\nv12 = 1;\n}\nv13 -= v13 % v12;\nif ( v13 > 0 )\n{\nif ( v12 == 1 )\n{\nv11 = v14;\nfor ( i = v14 + v13 - 1; v11 < i; --i )\n{\nv4 = *(_BYTE *)(v3 + v11);\n*(_BYTE *)(v3 + v11) = *(_BYTE *)(v3 + i);\n*(_BYTE *)(i + v3) = v4;\n++v11;\n}\n}\nelse\n{\nv9 = v14;\nfor ( j = v14 + v13 - v12; v9 < j; j -= v12 )\n{\nfor ( k = 0; k < v12; ++k )\n{\nv5 = *(_BYTE *)(v3 + v9 + k);\n*(_BYTE *)(v3 + v9 + k) = *(_BYTE *)(v3 + j + k);\n*(_BYTE *)(j + k + v3) = v5;\n}\nv9 += v12;\n}\n}\n}\nbe_pushvalue(a1, 1u);\nreturn be_returnvalue(a1);\n}\n\n\n\nQ:[a1,v2,v4,v5,v6,j,v9,v12,v13,v14,sub_41772D,sub_415FEE,]", "hints": "[]", "response": "{'a1': 'vm', 'v2': 'attr', 'v4': 'temp', 'v5': 'temp_0', 'v6': 'argc', 'j': 'j_0', 'v9': 'i_0', 'v12': 'grouplen', 'v13': 'len', 'v14': 'idx', 'sub_41772D': 'm_reverse', 'sub_415FEE': 'check_ptr'}"}
[ [ 0.7934823632240295, 0.7904587388038635, 0.7890818119049072, 0.7847621440887451, 0.7791025638580322, 0.7766784429550171, 0.7473871111869812, 0.7426490187644958, 0.7403129935264587, 0.7298327088356018, 0.7272236943244934, 0.7271208763122559, 0.7270243167877197, 0.7250144481658936, 0.7200160622596741, 0.7132388949394226, 0.7112948894500732, 0.7112948894500732, 0.7089661955833435, 0.7072716951370239 ], [ 211764, 97883, 96823, 176247, 132252, 142544, 103923, 150375, 230276, 250966, 90753, 196103, 6376, 204670, 132614, 259240, 257376, 192503, 6655, 64280 ] ]
cnhash_strhf
78e3213daa9cd89b12701806ff7b794ae52a75900eef6225b97007f2efa79aa2
cnlohr
cnovr
NA
intptr_t cnhash_strhf( const void * key, void * opaque ) { //SDBM (public domain) http://www.cse.yorku.ca/~oz/hash.html char * str = (char*)key; intptr_t hash = 0; int c; while ( (c = *str++ ) ) hash = c + (hash << 6) + (hash << 16) - hash; if( !hash ) return 1; return hash; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401EB3", "function_addr": 4202163, "binary_name": "78e3213daa9cd89b12701806ff7b794ae52a75900eef6225b97007f2efa79aa2.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov rax, [rbp+var_28]"], [5, "mov [rbp+var_8], rax"], [6, "mov [rbp+var_10], 0"], [7, "jmp short loc_401EF5"], [8, "mov eax, [rbp+var_14]"], [9, "movsxd rdx, eax"], [10, "mov rax, [rbp+var_10]"], [11, "shl rax, 6"], [12, "add rdx, rax"], [13, "mov rax, [rbp+var_10]"], [14, "shl rax, 10h"], [15, "add rax, rdx"], [16, "sub rax, [rbp+var_10]"], [17, "mov [rbp+var_10], rax"], [18, "mov rax, [rbp+var_8]"], [19, "lea rdx, [rax+1]"], [20, "mov [rbp+var_8], rdx"], [21, "movzx eax, byte ptr [rax]"], [22, "movsx eax, al"], [23, "mov [rbp+var_14], eax"], [24, "cmp [rbp+var_14], 0"], [25, "jnz short loc_401ED1"], [26, "cmp [rbp+var_10], 0"], [27, "jnz short loc_401F1E"], [28, "mov eax, 1"], [29, "jmp short loc_401F22"], [30, "mov rax, [rbp+var_10]"], [31, "pop rbp"], [32, "retn"]], "data_dep": [[4, 2], [5, 4], [8, 23], [9, 8], [10, 6], [10, 17], [11, 10], [12, 9], [12, 11], [13, 17], [13, 6], [14, 13], [15, 14], [15, 12], [16, 6], [16, 15], [16, 17], [17, 16], [18, 20], [18, 5], [19, 12], [19, 18], [20, 19], [21, 18], [22, 21], [23, 22], [24, 23], [25, 24], [26, 17], [26, 6], [27, 26], [30, 6], [30, 17], [31, 0], [32, 30], [32, 28]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/78e3213daa9cd89b12701806ff7b794ae52a75900eef6225b97007f2efa79aa2_78e3213daa9cd89b12701806ff7b794ae52a75900eef6225b97007f2efa79aa2.jsonl.gz", "strip_func_name": "sub_401EB3", "query": "\n\n\n__int64 __fastcall sub_401EB3(_BYTE *a1)\n{\n_BYTE *v1; // rax\n__int64 result; // rax\n__int64 i; // [rsp+20h] [rbp-10h]\n\nfor ( i = 0LL; ; i = (i << 6) + (char)*v1 + (i << 16) - i )\n{\nv1 = a1++;\nif ( !*v1 )\nbreak;\n}\nif ( i )\nresult = i;\nelse\nresult = 1LL;\nreturn result;\n}\n\n\n\nQ:[a1,i,sub_401EB3,]", "hints": "[]", "response": "{'a1': 'key', 'i': 'hash', 'sub_401EB3': 'cnhash_strhf'}"}
[ [ 0.7799964547157288, 0.7551425099372864, 0.7460652589797974, 0.7345218658447266, 0.7305120825767517, 0.729930579662323, 0.7283833622932434, 0.7272326350212097, 0.7242360711097717, 0.7167923450469971, 0.7132564783096313, 0.7085378170013428, 0.7069038152694702, 0.7027013301849365, 0.7018567323684692, 0.701221227645874, 0.7005585432052612, 0.6990611553192139, 0.6987113952636719, 0.6969789862632751 ], [ 66514, 68803, 58694, 156919, 89713, 59550, 185274, 108522, 98968, 31069, 196517, 138153, 60481, 206996, 226468, 249594, 160106, 6932, 61635, 251374 ] ]
print_opcode
aa6ca2733ca7f7e8f15bcc8e7ed2536155bc1755509a20a23303a780bbf8d2ae
sergev
vak-opensource
NA
void print_opcode(int addr, int cmd) { char *m; int arg; printf("%04x: %02x %02x\t", addr, cmd >> 8 & 0xff, cmd & 0xff); switch (cmd) { case 0x0000: printf("nop"); goto done; case 0x0001: printf("reset"); goto done; case 0x0008: printf("return"); goto done; case 0x0009: printf("retfie"); goto done; case 0x000a: printf("callw"); goto done; case 0x000b: printf("brw"); goto done; case 0x0010: printf("moviw\t++fsr0"); goto done; case 0x0011: printf("moviw\t--fsr0"); goto done; case 0x0012: printf("moviw\tfsr0++"); goto done; case 0x0013: printf("moviw\tfsr0--"); goto done; case 0x0014: printf("moviw\t++fsr1"); goto done; case 0x0015: printf("moviw\t--fsr1"); goto done; case 0x0016: printf("moviw\tfsr1++"); goto done; case 0x0017: printf("moviw\tfsr1--"); goto done; case 0x0060: printf("reset"); goto done; case 0x0062: printf("option"); goto done; case 0x0063: printf("sleep"); goto done; case 0x0064: printf("clrwdt"); goto done; case 0x0065: printf("tris\t5"); goto done; case 0x0066: printf("tris\t6"); goto done; case 0x0067: printf("tris\t7"); goto done; case 0x0100: case 0x0101: case 0x0102: case 0x0103: printf("clrw"); goto done; } switch (cmd >> 8) { case 0x00: if (cmd & 0x80) { m = "movwf"; goto fop; } if ((cmd & 0xe0) == 0x20) { printf("movlb\t%s", litfmt(cmd & 0x1f)); break; } goto unknown; case 0x01: m = "clrf"; goto fop; case 0x02: m = "subwf"; goto fop; case 0x03: m = "decf"; goto fop; case 0x04: m = "iorwf"; goto fop; case 0x05: m = "andwf"; goto fop; case 0x06: m = "xorwf"; goto fop; case 0x07: m = "addwf"; goto fop; case 0x08: m = "movf"; goto fop; case 0x09: m = "comf"; goto fop; case 0x0a: m = "incf"; goto fop; case 0x0b: m = "decfsz"; goto fop; case 0x0c: m = "rrf"; goto fop; case 0x0d: m = "rlf"; goto fop; case 0x0e: m = "swapf"; goto fop; case 0x0f: m = "incfsz"; goto fop; case 0x35: m = "lslf"; goto fop; case 0x36: m = "lsrf"; goto fop; case 0x37: m = "asrf"; goto fop; case 0x3b: m = "subwfb"; goto fop; case 0x3d: m = "addwfc"; goto fop; fop: printf("%s\t%s", m, litfmt(cmd & 0x7f)); if (! (cmd & 0x80)) printf(", w"); break; case 0x10: case 0x11: case 0x12: case 0x13: m = "bcf "; goto bitop; case 0x14: case 0x15: case 0x16: case 0x17: m = "bsf "; goto bitop; case 0x18: case 0x19: case 0x1a: case 0x1b: m = "btfsc"; goto bitop; case 0x1c: case 0x1d: case 0x1e: case 0x1f: m = "btfss"; goto bitop; bitop: printf("%s\t%s, %d", m, litfmt(cmd & 0x7f), (cmd >> 7) & 7); break; case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: m = "call"; goto gotoop; case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: m = "goto"; goto gotoop; gotoop: printf("%s\t%s", m, litfmt(cmd & 0x7ff)); break; case 0x32: case 0x33: arg = (short)(cmd << 7) >> 7; if (arg >= 0) printf("bra\t$+%s", litfmt(arg)); else printf("bra\t$-%s", litfmt(-arg)); break; case 0x30: m = "movlw"; goto kop; case 0x34: m = "retlw"; goto kop; case 0x38: m = "iorlw"; goto kop; case 0x39: m = "andlw"; goto kop; case 0x3a: m = "xorlw"; goto kop; case 0x3c: m = "sublw"; goto kop; case 0x3e: m = "addlw"; goto kop; kop: printf("%s\t%s", m, litfmt(cmd & 0xff)); break; case 0x31: if (cmd & 0x80) { printf("movlp\t%s", litfmt(cmd & 0x7f)); } else { printf("addfsr\tfsr%d, %s", (cmd >> 6) & 1, litfmt(cmd & 0x3f)); } break; case 0x3f: if (cmd & 0x80) { printf("movwi\t%s[fsr%d]", litfmt(cmd & 0x3f), (cmd >> 6) & 1); } else { printf("moviw\t%s[fsr%d]", litfmt(cmd & 0x3f), (cmd >> 6) & 1); } break; default: unknown: printf("?"); break; } done: printf("\n"); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4017A6", "function_addr": 4200358, "binary_name": "aa6ca2733ca7f7e8f15bcc8e7ed2536155bc1755509a20a23303a780bbf8d2ae.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 28h"], [4, "mov [rbp+var_24], edi"], [5, "mov [rbp+var_28], esi"], [6, "mov eax, [rbp+var_28]"], [7, "movzx ecx, al"], [8, "mov eax, [rbp+var_28]"], [9, "sar eax, 8"], [10, "movzx edx, al"], [11, "mov eax, [rbp+var_24]"], [12, "mov esi, eax"], [13, "mov edi, offset a04x02x02x"], [14, "mov eax, 0"], [15, "call _printf"], [16, "cmp [rbp+var_28], 67h "], [17, "jg short loc_4017FF"], [18, "cmp [rbp+var_28], 0"], [19, "js def_4017FD"], [20, "cmp [rbp+var_28], 67h"], [21, "ja def_4017FD"], [22, "mov eax, [rbp+var_28]"], [23, "mov rax, ds:jpt_4017FD[rax*8]"], [24, "jmp rax"], [25, "mov eax, [rbp+var_28]"], [26, "sub eax, 100h"], [27, "cmp eax, 3"], [28, "ja def_4017FD"], [29, "jmp loc_4019B9"], [30, "mov edi, offset aNop"], [31, "mov eax, 0"], [32, "call _printf"], [33, "jmp loc_401D95"], [34, "mov edi, offset aReset"], [35, "mov eax, 0"], [36, "call _printf"], [37, "jmp loc_401D95"], [38, "mov edi, offset aReturn"], [39, "mov eax, 0"], [40, "call _printf"], [41, "jmp loc_401D95"], [42, "mov edi, offset aRetfie"], [43, "mov eax, 0"], [44, "call _printf"], [45, "jmp loc_401D95"], [46, "mov edi, offset aCallw"], [47, "mov eax, 0"], [48, "call _printf"], [49, "jmp loc_401D95"], [50, "mov edi, offset aBrw"], [51, "mov eax, 0"], [52, "call _printf"], [53, "jmp loc_401D95"], [54, "mov edi, offset aMoviwFsr0"], [55, "mov eax, 0"], [56, "call _printf"], [57, "jmp loc_401D95"], [58, "mov edi, offset aMoviwFsr0_0"], [59, "mov eax, 0"], [60, "call _printf"], [61, "jmp loc_401D95"], [62, "mov edi, offset aMoviwFsr0_1"], [63, "mov eax, 0"], [64, "call _printf"], [65, "jmp loc_401D95"], [66, "mov edi, offset aMoviwFsr0_2"], [67, "mov eax, 0"], [68, "call _printf"], [69, "jmp loc_401D95"], [70, "mov edi, offset aMoviwFsr1"], [71, "mov eax, 0"], [72, "call _printf"], [73, "jmp loc_401D95"], [74, "mov edi, offset aMoviwFsr1_0"], [75, "mov eax, 0"], [76, "call _printf"], [77, "jmp loc_401D95"], [78, "mov edi, offset aMoviwFsr1_1"], [79, "mov eax, 0"], [80, "call _printf"], [81, "jmp loc_401D95"], [82, "mov edi, offset aMoviwFsr1_2"], [83, "mov eax, 0"], [84, "call _printf"], [85, "jmp loc_401D95"], [86, "mov edi, offset aReset"], [87, "mov eax, 0"], [88, "call _printf"], [89, "jmp loc_401D95"], [90, "mov edi, offset aOption"], [91, "mov eax, 0"], [92, "call _printf"], [93, "jmp loc_401D95"], [94, "mov edi, offset aSleep"], [95, "mov eax, 0"], [96, "call _printf"], [97, "jmp loc_401D95"], [98, "mov edi, offset aClrwdt"], [99, "mov eax, 0"], [100, "call _printf"], [101, "jmp loc_401D95"], [102, "mov edi, offset aTris5"], [103, "mov eax, 0"], [104, "call _printf"], [105, "jmp loc_401D95"], [106, "mov edi, offset aTris6"], [107, "mov eax, 0"], [108, "call _printf"], [109, "jmp loc_401D95"], [110, "mov edi, offset aTris7"], [111, "mov eax, 0"], [112, "call _printf"], [113, "jmp loc_401D95"], [114, "mov edi, offset aClrw"], [115, "mov eax, 0"], [116, "call _printf"], [117, "jmp loc_401D95"], [118, "mov eax, [rbp+var_28]"], [119, "sar eax, 8"], [120, "cmp eax, 3Fh"], [121, "ja def_4019E6"], [122, "mov eax, eax"], [123, "mov rax, ds:jpt_4019E6[rax*8]"], [124, "jmp rax"], [125, "mov eax, [rbp+var_28]"], [126, "and eax, 80h"], [127, "test eax, eax"], [128, "jz short loc_401A01"], [129, "mov [rbp+var_18], offset aMovwf"], [130, "jmp loc_401B12"], [131, "mov eax, [rbp+var_28]"], [132, "and eax, 0E0h"], [133, "cmp eax, 20h "], [134, "jnz loc_401D87"], [135, "mov eax, [rbp+var_28]"], [136, "and eax, 1Fh"], [137, "mov edi, eax"], [138, "call sub_401750"], [139, "mov rsi, rax"], [140, "mov edi, offset aMovlbS"], [141, "mov eax, 0"], [142, "call _printf"], [143, "jmp loc_401D95"], [144, "mov [rbp+var_18], offset aClrf"], [145, "jmp loc_401B12"], [146, "mov [rbp+var_18], offset aSubwf"], [147, "jmp loc_401B12"], [148, "mov [rbp+var_18], offset aDecf"], [149, "jmp loc_401B12"], [150, "mov [rbp+var_18], offset aIorwf"], [151, "jmp loc_401B12"], [152, "mov [rbp+var_18], offset aAndwf"], [153, "jmp loc_401B12"], [154, "mov [rbp+var_18], offset aXorwf"], [155, "jmp loc_401B12"], [156, "mov [rbp+var_18], offset aAddwf"], [157, "jmp loc_401B12"], [158, "mov [rbp+var_18], offset aMovf"], [159, "jmp short loc_401B12"], [160, "mov [rbp+var_18], offset aComf"], [161, "jmp short loc_401B12"], [162, "mov [rbp+var_18], offset aIncf"], [163, "jmp short loc_401B12"], [164, "mov [rbp+var_18], offset aDecfsz"], [165, "jmp short loc_401B12"], [166, "mov [rbp+var_18], offset aRrf"], [167, "jmp short loc_401B12"], [168, "mov [rbp+var_18], offset aRlf"], [169, "jmp short loc_401B12"], [170, "mov [rbp+var_18], offset aSwapf"], [171, "jmp short loc_401B12"], [172, "mov [rbp+var_18], offset aIncfsz"], [173, "jmp short loc_401B12"], [174, "mov [rbp+var_18], offset aLslf"], [175, "jmp short loc_401B12"], [176, "mov [rbp+var_18], offset aLsrf"], [177, "jmp short loc_401B12"], [178, "mov [rbp+var_18], offset aAsrf"], [179, "jmp short loc_401B12"], [180, "mov [rbp+var_18], offset aSubwfb"], [181, "jmp short loc_401B12"], [182, "mov [rbp+var_18], offset aAddwfc"], [183, "nop"], [184, "mov eax, [rbp+var_28]"], [185, "and eax, 7Fh"], [186, "mov edi, eax"], [187, "call sub_401750"], [188, "mov rdx, rax"], [189, "mov rax, [rbp+var_18]"], [190, "mov rsi, rax"], [191, "mov edi, offset aSS"], [192, "mov eax, 0"], [193, "call _printf"], [194, "mov eax, [rbp+var_28]"], [195, "and eax, 80h"], [196, "test eax, eax"], [197, "jnz loc_401D94"], [198, "mov edi, offset aW"], [199, "mov eax, 0"], [200, "call _printf"], [201, "jmp loc_401D94"], [202, "mov [rbp+var_18], offset aBcf"], [203, "jmp short loc_401B83"], [204, "mov [rbp+var_18], offset aBsf"], [205, "jmp short loc_401B83"], [206, "mov [rbp+var_18], offset aBtfsc"], [207, "jmp short loc_401B83"], [208, "mov [rbp+var_18], offset aBtfss"], [209, "nop"], [210, "mov eax, [rbp+var_28]"], [211, "sar eax, 7"], [212, "and eax, 7"], [213, "mov ebx, eax"], [214, "mov eax, [rbp+var_28]"], [215, "and eax, 7Fh"], [216, "mov edi, eax"], [217, "call sub_401750"], [218, "mov rdx, rax"], [219, "mov rax, [rbp+var_18]"], [220, "mov ecx, ebx"], [221, "mov rsi, rax"], [222, "mov edi, offset aSSD"], [223, "mov eax, 0"], [224, "call _printf"], [225, "jmp loc_401D95"], [226, "mov [rbp+var_18], offset aCall"], [227, "jmp short loc_401BCE"], [228, "mov [rbp+var_18], offset aGoto"], [229, "nop"], [230, "mov eax, [rbp+var_28]"], [231, "and eax, 7FFh"], [232, "mov edi, eax"], [233, "call sub_401750"], [234, "mov rdx, rax"], [235, "mov rax, [rbp+var_18]"], [236, "mov rsi, rax"], [237, "mov edi, offset aSS"], [238, "mov eax, 0"], [239, "call _printf"], [240, "jmp loc_401D95"], [241, "mov eax, [rbp+var_28]"], [242, "shl eax, 7"], [243, "sar ax, 7"], [244, "cwde"], [245, "mov [rbp+var_1C], eax"], [246, "cmp [rbp+var_1C], 0"], [247, "js short loc_401C30"], [248, "mov eax, [rbp+var_1C]"], [249, "mov edi, eax"], [250, "call sub_401750"], [251, "mov rsi, rax"], [252, "mov edi, offset aBraS"], [253, "mov eax, 0"], [254, "call _printf"], [255, "jmp loc_401D95"], [256, "mov eax, [rbp+var_1C]"], [257, "neg eax"], [258, "mov edi, eax"], [259, "call sub_401750"], [260, "mov rsi, rax"], [261, "mov edi, offset aBraS_0"], [262, "mov eax, 0"], [263, "call _printf"], [264, "jmp loc_401D95"], [265, "mov [rbp+var_18], offset aMovlw"], [266, "jmp short loc_401C98"], [267, "mov [rbp+var_18], offset aRetlw"], [268, "jmp short loc_401C98"], [269, "mov [rbp+var_18], offset aIorlw"], [270, "jmp short loc_401C98"], [271, "mov [rbp+var_18], offset aAndlw"], [272, "jmp short loc_401C98"], [273, "mov [rbp+var_18], offset aXorlw"], [274, "jmp short loc_401C98"], [275, "mov [rbp+var_18], offset aSublw"], [276, "jmp short loc_401C98"], [277, "mov [rbp+var_18], offset aAddlw"], [278, "nop"], [279, "mov eax, [rbp+var_28]"], [280, "movzx eax, al"], [281, "mov edi, eax"], [282, "call sub_401750"], [283, "mov rdx, rax"], [284, "mov rax, [rbp+var_18]"], [285, "mov rsi, rax"], [286, "mov edi, offset aSS"], [287, "mov eax, 0"], [288, "call _printf"], [289, "jmp loc_401D95"], [290, "mov eax, [rbp+var_28]"], [291, "and eax, 80h"], [292, "test eax, eax"], [293, "jz short loc_401CF3"], [294, "mov eax, [rbp+var_28]"], [295, "and eax, 7Fh"], [296, "mov edi, eax"], [297, "call sub_401750"], [298, "mov rsi, rax"], [299, "mov edi, offset aMovlpS"], [300, "mov eax, 0"], [301, "call _printf"], [302, "jmp loc_401D95"], [303, "mov eax, [rbp+var_28]"], [304, "and eax, 3Fh"], [305, "mov edi, eax"], [306, "call sub_401750"], [307, "mov rdx, rax"], [308, "mov eax, [rbp+var_28]"], [309, "sar eax, 6"], [310, "and eax, 1"], [311, "mov esi, eax"], [312, "mov edi, offset aAddfsrFsrDS"], [313, "mov eax, 0"], [314, "call _printf"], [315, "jmp short loc_401D95"], [316, "mov eax, [rbp+var_28]"], [317, "and eax, 80h"], [318, "test eax, eax"], [319, "jz short loc_401D59"], [320, "mov eax, [rbp+var_28]"], [321, "sar eax, 6"], [322, "and eax, 1"], [323, "mov ebx, eax"], [324, "mov eax, [rbp+var_28]"], [325, "and eax, 3Fh"], [326, "mov edi, eax"], [327, "call sub_401750"], [328, "mov edx, ebx"], [329, "mov rsi, rax"], [330, "mov edi, offset aMovwiSFsrD"], [331, "mov eax, 0"], [332, "call _printf"], [333, "jmp short loc_401D95"], [334, "mov eax, [rbp+var_28]"], [335, "sar eax, 6"], [336, "and eax, 1"], [337, "mov ebx, eax"], [338, "mov eax, [rbp+var_28]"], [339, "and eax, 3Fh"], [340, "mov edi, eax"], [341, "call sub_401750"], [342, "mov edx, ebx"], [343, "mov rsi, rax"], [344, "mov edi, offset aMoviwSFsrD"], [345, "mov eax, 0"], [346, "call _printf"], [347, "jmp short loc_401D95"], [348, "nop"], [349, "mov edi, 3Fh "], [350, "call _putchar"], [351, "jmp short loc_401D95"], [352, "nop"], [353, "mov edi, 0Ah"], [354, "call _putchar"], [355, "nop"], [356, "mov rbx, [rbp+var_8]"], [357, "leave"], [358, "retn"]], "data_dep": [[6, 5], [7, 6], [8, 5], [9, 8], [10, 9], [11, 4], [12, 11], [16, 5], [17, 16], [18, 5], [19, 18], [20, 5], [21, 20], [22, 5], [24, 23], [25, 5], [26, 25], [27, 26], [28, 27], [118, 5], [119, 118], [120, 119], [121, 120], [122, 119], [124, 123], [125, 5], [126, 125], [127, 126], [128, 127], [131, 5], [132, 131], [133, 132], [134, 133], [135, 5], [136, 135], [137, 136], [139, 138], [184, 5], [185, 184], [186, 185], [188, 187], [189, 146], [189, 164], [189, 148], [189, 166], [189, 150], [189, 168], [189, 152], [189, 182], [189, 154], [189, 129], [189, 170], [189, 172], [189, 156], [189, 174], [189, 158], [189, 176], [189, 160], [189, 178], [189, 144], [189, 162], [189, 180], [190, 189], [194, 5], [195, 194], [196, 195], [197, 196], [210, 5], [211, 210], [212, 211], [213, 212], [214, 5], [215, 214], [216, 215], [218, 217], [219, 202], [219, 204], [219, 206], [219, 208], [220, 213], [221, 219], [230, 5], [231, 230], [232, 231], [234, 233], [235, 226], [235, 228], [236, 235], [241, 5], [242, 241], [243, 242], [245, 243], [246, 245], [247, 246], [248, 245], [249, 248], [251, 250], [256, 245], [257, 256], [258, 257], [260, 259], [279, 5], [280, 279], [281, 280], [283, 282], [284, 269], [284, 271], [284, 273], [284, 275], [284, 277], [284, 265], [284, 267], [285, 284], [290, 5], [291, 290], [292, 291], [293, 292], [294, 5], [295, 294], [296, 295], [298, 297], [303, 5], [304, 303], [305, 304], [307, 306], [308, 5], [309, 308], [310, 309], [311, 310], [316, 5], [317, 316], [318, 317], [319, 318], [320, 5], [321, 320], [322, 321], [323, 322], [324, 5], [325, 324], [326, 325], [328, 323], [329, 327], [334, 5], [335, 334], [336, 335], [337, 336], [338, 5], [339, 338], [340, 339], [342, 337], [343, 341], [358, 354]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/aa6ca2733ca7f7e8f15bcc8e7ed2536155bc1755509a20a23303a780bbf8d2ae_aa6ca2733ca7f7e8f15bcc8e7ed2536155bc1755509a20a23303a780bbf8d2ae.jsonl.gz", "strip_func_name": "sub_4017A6", "query": "\n\n\nint __fastcall sub_4017A6(unsigned int a1, int a2)\n{\nchar *v2; // rax\nchar *v3; // rax\nchar *v4; // rax\nchar *v5; // rax\nchar *v6; // rax\nchar *v7; // rax\nchar *v8; // rax\nchar *v9; // rax\nchar *v10; // rax\nchar *v11; // rax\nint v13; // [rsp+14h] [rbp-1Ch]\nconst char *v14; // [rsp+18h] [rbp-18h]\nconst char *v15; // [rsp+18h] [rbp-18h]\nconst char *v16; // [rsp+18h] [rbp-18h]\nconst char *v17; // [rsp+18h] [rbp-18h]\n\nprintf(\"%04x: %02x %02x\\t\", a1, BYTE1(a2), (unsigned __int8)a2);\nif ( a2 > 103 )\n{\nif ( (unsigned int)(a2 - 256) <= 3 )\n{\nprintf(\"clrw\");\nreturn putchar(10);\n}\ngoto LABEL_26;\n}\nif ( a2 < 0 )\n{\nLABEL_26:\nswitch ( a2 >> 8 )\n{\ncase 0:\nif ( (a2 & 0x80) != 0 )\n{\nv14 = \"movwf\";\ngoto LABEL_51;\n}\nif ( (a2 & 0xE0) != 32 )\ngoto LABEL_78;\nv2 = sub_401750(a2 & 0x1F);\nprintf(\"movlb\\t%s\", v2);\nreturn putchar(10);\ncase 1:\nv14 = \"clrf\";\ngoto LABEL_51;\ncase 2:\nv14 = \"subwf\";\ngoto LABEL_51;\ncase 3:\nv14 = \"decf\";\ngoto LABEL_51;\ncase 4:\nv14 = \"iorwf\";\ngoto LABEL_51;\ncase 5:\nv14 = \"andwf\";\ngoto LABEL_51;\ncase 6:\nv14 = \"xorwf\";\ngoto LABEL_51;\ncase 7:\nv14 = \"addwf\";\ngoto LABEL_51;\ncase 8:\nv14 = \"movf\";\ngoto LABEL_51;\ncase 9:\nv14 = \"comf\";\ngoto LABEL_51;\ncase 10:\nv14 = \"incf\";\ngoto LABEL_51;\ncase 11:\nv14 = \"decfsz\";\ngoto LABEL_51;\ncase 12:\nv14 = \"rrf\";\ngoto LABEL_51;\ncase 13:\nv14 = \"rlf\";\ngoto LABEL_51;\ncase 14:\nv14 = \"swapf\";\ngoto LABEL_51;\ncase 15:\nv14 = \"incfsz\";\ngoto LABEL_51;\ncase 16:\ncase 17:\ncase 18:\ncase 19:\nv15 = \"bcf \";\ngoto LABEL_57;\ncase 20:\ncase 21:\ncase 22:\ncase 23:\nv15 = \"bsf \";\ngoto LABEL_57;\ncase 24:\ncase 25:\ncase 26:\ncase 27:\nv15 = \"btfsc\";\ngoto LABEL_57;\ncase 28:\ncase 29:\ncase 30:\ncase 31:\nv15 = \"btfss\";\nLABEL_57:\nv4 = sub_401750(a2 & 0x7F);\nprintf(\"%s\\t%s, %d\", v15, v4, (a2 >> 7) & 7);\nreturn putchar(10);\ncase 32:\ncase 33:\ncase 34:\ncase 35:\ncase 36:\ncase 37:\ncase 38:\ncase 39:\nv16 = \"call\";\ngoto LABEL_60;\ncase 40:\ncase 41:\ncase 42:\ncase 43:\ncase 44:\ncase 45:\ncase 46:\ncase 47:\nv16 = \"goto\";\nLABEL_60:\nv5 = sub_401750(a2 & 0x7FF);\nprintf(\"%s\\t%s\", v16, v5);\nreturn putchar(10);\ncase 48:\nv17 = \"movlw\";\ngoto LABEL_71;\ncase 49:\nif ( (a2 & 0x80) != 0 )\n{\nv9 = sub_401750(a2 & 0x7F);\nprintf(\"movlp\\t%s\", v9);\n}\nelse\n{\nv10 = sub_401750(a2 & 0x3F);\nprintf(\"addfsr\\tfsr%d, %s\", (a2 >> 6) & 1, v10);\n}\nreturn putchar(10);\ncase 50:\ncase 51:\nv13 = (__int16)((_WORD)a2 << 7) >> 7;\nif ( v13 < 0 )\n{\nv7 = sub_401750(-v13);\nprintf(\"bra\\t$-%s\", v7);\n}\nelse\n{\nv6 = sub_401750(v13);\nprintf(\"bra\\t$+%s\", v6);\n}\nreturn putchar(10);\ncase 52:\nv17 = \"retlw\";\ngoto LABEL_71;\ncase 53:\nv14 = \"lslf\";\ngoto LABEL_51;\ncase 54:\nv14 = \"lsrf\";\ngoto LABEL_51;\ncase 55:\nv14 = \"asrf\";\ngoto LABEL_51;\ncase 56:\nv17 = \"iorlw\";\ngoto LABEL_71;\ncase 57:\nv17 = \"andlw\";\ngoto LABEL_71;\ncase 58:\nv17 = \"xorlw\";\ngoto LABEL_71;\ncase 59:\nv14 = \"subwfb\";\ngoto LABEL_51;\ncase 60:\nv17 = \"sublw\";\ngoto LABEL_71;\ncase 61:\nv14 = \"addwfc\";\nLABEL_51:\nv3 = sub_401750(a2 & 0x7F);\nprintf(\"%s\\t%s\", v14, v3);\nif ( (a2 & 0x80) == 0 )\nprintf(\", w\");\nbreak;\ncase 62:\nv17 = \"addlw\";\nLABEL_71:\nv8 = sub_401750((unsigned __int8)a2);\nprintf(\"%s\\t%s\", v17, v8);\nbreak;\ncase 63:\nv11 = sub_401750(a2 & 0x3F);\nif ( (a2 & 0x80) != 0 )\nprintf(\"movwi\\t%s[fsr%d]\", v11, (a2 >> 6) & 1);\nelse\nprintf(\"moviw\\t%s[fsr%d]\", v11, (a2 >> 6) & 1);\nbreak;\ndefault:\nLABEL_78:\nputchar(63);\nbreak;\n}\nreturn putchar(10);\n}\nswitch ( a2 )\n{\ncase 0:\nprintf(\"nop\");\nbreak;\ncase 1:\ncase 96:\nprintf(\"reset\");\nbreak;\ncase 8:\nprintf(\"return\");\nbreak;\ncase 9:\nprintf(\"retfie\");\nbreak;\ncase 10:\nprintf(\"callw\");\nbreak;\ncase 11:\nprintf(\"brw\");\nbreak;\ncase 16:\nprintf(\"moviw\\t++fsr0\");\nbreak;\ncase 17:\nprintf(\"moviw\\t--fsr0\");\nbreak;\ncase 18:\nprintf(\"moviw\\tfsr0++\");\nbreak;\ncase 19:\nprintf(\"moviw\\tfsr0--\");\nbreak;\ncase 20:\nprintf(\"moviw\\t++fsr1\");\nbreak;\ncase 21:\nprintf(\"moviw\\t--fsr1\");\nbreak;\ncase 22:\nprintf(\"moviw\\tfsr1++\");\nbreak;\ncase 23:\nprintf(\"moviw\\tfsr1--\");\nbreak;\ncase 98:\nprintf(\"option\");\nbreak;\ncase 99:\nprintf(\"sleep\");\nbreak;\ncase 100:\nprintf(\"clrwdt\");\nbreak;\ncase 101:\nprintf(\"tris\\t5\");\nbreak;\ncase 102:\nprintf(\"tris\\t6\");\nbreak;\ncase 103:\nprintf(\"tris\\t7\");\nbreak;\ndefault:\ngoto LABEL_26;\n}\nreturn putchar(10);\n}\n\n\n\nQ:[a1,a2,v13,v15,sub_4017A6,sub_401750,]", "hints": "[]", "response": "{'a1': 'addr', 'a2': 'cmd', 'v13': 'arg', 'v15': 'mb', 'sub_4017A6': 'print_opcode', 'sub_401750': 'litfmt'}"}
[ [ 0.8989278078079224, 0.8854870796203613, 0.8211970329284668, 0.8197852373123169, 0.8147355318069458, 0.805162250995636, 0.7982733249664307, 0.798225462436676, 0.7934750318527222, 0.7915326356887817, 0.7895163297653198, 0.7886958718299866, 0.7859185934066772, 0.7804575562477112, 0.7761632800102234, 0.7760821580886841, 0.7755484580993652, 0.7739435434341431, 0.7632156014442444, 0.7611871957778931 ], [ 223507, 138023, 73157, 161339, 5360, 16727, 70342, 75176, 52886, 203426, 30874, 168997, 216518, 34716, 132307, 57187, 229748, 133076, 157508, 193663 ] ]
mem_copy
b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817
chenall
grubutils
NA
void mem_copy (uchar *d, uchar *s, int size) { int dir = 1; if (s == d) return; if (s < d) { s += size - 1; d += size - 1; dir = -1; } while (size) { *d = *s; s += dir; d += dir; size--; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402A88", "function_addr": 4205192, "binary_name": "b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_20], rsi"], [4, "mov [rbp+var_24], edx"], [5, "mov [rbp+var_4], 1"], [6, "mov rax, [rbp+var_20]"], [7, "cmp rax, [rbp+var_18]"], [8, "jz short loc_402B00"], [9, "mov rax, [rbp+var_20]"], [10, "cmp rax, [rbp+var_18]"], [11, "jnb short loc_402AF8"], [12, "mov eax, [rbp+var_24]"], [13, "cdqe"], [14, "sub rax, 1"], [15, "add [rbp+var_20], rax"], [16, "mov eax, [rbp+var_24]"], [17, "cdqe"], [18, "sub rax, 1"], [19, "add [rbp+var_18], rax"], [20, "mov [rbp+var_4], 0FFFFFFFFh"], [21, "jmp short loc_402AF8"], [22, "mov rax, [rbp+var_20]"], [23, "movzx edx, byte ptr [rax]"], [24, "mov rax, [rbp+var_18]"], [25, "mov [rax], dl"], [26, "mov eax, [rbp+var_4]"], [27, "cdqe"], [28, "add [rbp+var_20], rax"], [29, "mov eax, [rbp+var_4]"], [30, "cdqe"], [31, "add [rbp+var_18], rax"], [32, "sub [rbp+var_24], 1"], [33, "cmp [rbp+var_24], 0"], [34, "jnz short loc_402AD5"], [35, "jmp short loc_402B01"], [36, "nop"], [37, "pop rbp"], [38, "retn"]], "data_dep": [[6, 3], [7, 6], [7, 2], [8, 7], [9, 3], [10, 9], [10, 2], [11, 10], [12, 4], [14, 12], [15, 14], [15, 3], [16, 4], [18, 16], [19, 18], [19, 2], [22, 28], [22, 3], [22, 15], [23, 22], [23, 25], [24, 2], [24, 19], [24, 31], [25, 23], [25, 24], [26, 5], [26, 20], [28, 3], [28, 15], [28, 26], [28, 28], [29, 20], [29, 5], [31, 29], [31, 19], [31, 31], [31, 2], [32, 32], [32, 4], [33, 32], [33, 4], [34, 33], [37, 0], [38, 29], [38, 9], [38, 6], [38, 18]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817_b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.jsonl.gz", "strip_func_name": "sub_402A88", "query": "\n\n\n__int64 __fastcall sub_402A88(_BYTE *a1, _BYTE *a2, int a3)\n{\n__int64 result; // rax\nint v4; // [rsp+0h] [rbp-24h]\n_BYTE *v5; // [rsp+4h] [rbp-20h]\n_BYTE *v6; // [rsp+Ch] [rbp-18h]\nint v7; // [rsp+20h] [rbp-4h]\n\nv6 = a1;\nv5 = a2;\nv4 = a3;\nv7 = 1;\nresult = (__int64)a2;\nif ( a2 != a1 )\n{\nresult = (__int64)a2;\nif ( a2 < a1 )\n{\nv5 = &a2[a3 - 1];\nresult = a3 - 1LL;\nv6 = &a1[result];\nv7 = -1;\n}\nwhile ( v4 )\n{\n*v6 = *v5;\nv5 += v7;\nresult = v7;\nv6 += v7;\n--v4;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v4,v5,v6,v7,sub_402A88,]", "hints": "[]", "response": "{'a3': 'size', 'a1': 'd', 'a2': 's', 'v4': 'sizea', 'v5': 'sa', 'v6': 'da', 'v7': 'dir', 'sub_402A88': 'mem_copy'}"}
[ [ 0.8131027817726135, 0.767565131187439, 0.767323911190033, 0.7654064893722534, 0.7562729120254517, 0.7496531009674072, 0.7486441135406494, 0.7450610399246216, 0.7424872517585754, 0.7402149438858032, 0.7393028140068054, 0.7357892990112305, 0.7295411229133606, 0.7259125709533691, 0.7254981398582458, 0.7244727611541748, 0.72065269947052, 0.7183889150619507, 0.7171986103057861, 0.7164794206619263 ], [ 229816, 1473, 15454, 112709, 260789, 123051, 74724, 145395, 261737, 146232, 94426, 113705, 2496, 72896, 236238, 88741, 236774, 191221, 91022, 41438 ] ]
parse_config_line
0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6
kieselsteini
cgo
NA
void parse_config_line(const char *line) { char token[1024]; char bkey[128]; char *value = NULL; int i, j; while (*line == ' ' || *line == '\t') line++; for (i = 0; *line && *line != ' ' && *line != '\t'; line++) if (i < sizeof(token) - 1) token[i++] = *line; token[i] = 0; if (! strcmp(token, "start_uri")) value = &config.start_uri[0]; else if (! strcmp(token, "cmd_text")) value = &config.cmd_text[0]; else if (! strcmp(token, "cmd_browser")) value = &config.cmd_browser[0]; else if (! strcmp(token, "cmd_image")) value = &config.cmd_image[0]; else if (! strcmp(token, "cmd_player")) value = &config.cmd_player[0]; else if (! strcmp(token, "color_prompt")) value = &config.color_prompt[0]; else if (! strcmp(token, "color_selector")) value = &config.color_selector[0]; else if (! strcmp(token, "verbose")) value = &config.verbose[0]; else { for (j = 0; j < NUM_BOOKMARKS; j++) { snprintf(bkey, sizeof(bkey), "bookmark%d", j+1); if (! strcmp(token, bkey)) { value = &bookmarks[j][0]; break; } } if (! value) return; }; while (*line == ' ' || *line == '\t') line++; for (i = 0; *line; line++) if (i < 512-1) value[i++] = *line; for (i--; i > 0 && (value[i] == ' ' || value[i] == '\t'); i--) ; value[++i] = 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40140C", "function_addr": 4199436, "binary_name": "0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 4A0h"], [3, "mov [rbp+var_498], rdi"], [4, "mov [rbp+var_8], 0"], [5, "jmp short loc_401430"], [6, "add [rbp+var_498], 1"], [7, "mov rax, [rbp+var_498]"], [8, "movzx eax, byte ptr [rax]"], [9, "cmp al, 20h "], [10, "jz short loc_401428"], [11, "mov rax, [rbp+var_498]"], [12, "movzx eax, byte ptr [rax]"], [13, "cmp al, 9"], [14, "jz short loc_401428"], [15, "mov [rbp+var_C], 0"], [16, "jmp short loc_401483"], [17, "mov eax, [rbp+var_C]"], [18, "cmp eax, 3FEh"], [19, "ja short loc_40147B"], [20, "mov eax, [rbp+var_C]"], [21, "lea edx, [rax+1]"], [22, "mov [rbp+var_C], edx"], [23, "mov rdx, [rbp+var_498]"], [24, "movzx edx, byte ptr [rdx]"], [25, "cdqe"], [26, "mov [rbp+rax+s1], dl"], [27, "add [rbp+var_498], 1"], [28, "mov rax, [rbp+var_498]"], [29, "movzx eax, byte ptr [rax]"], [30, "test al, al"], [31, "jz short loc_4014AD"], [32, "mov rax, [rbp+var_498]"], [33, "movzx eax, byte ptr [rax]"], [34, "cmp al, 20h "], [35, "jz short loc_4014AD"], [36, "mov rax, [rbp+var_498]"], [37, "movzx eax, byte ptr [rax]"], [38, "cmp al, 9"], [39, "jnz short loc_401455"], [40, "mov eax, [rbp+var_C]"], [41, "cdqe"], [42, "mov [rbp+rax+s1], 0"], [43, "lea rax, [rbp+s1]"], [44, "mov esi, offset aStartUri"], [45, "mov rdi, rax"], [46, "call _strcmp"], [47, "test eax, eax"], [48, "jnz short loc_4014DF"], [49, "mov [rbp+var_8], offset s"], [50, "jmp loc_401662"], [51, "lea rax, [rbp+s1]"], [52, "mov esi, offset aCmdText"], [53, "mov rdi, rax"], [54, "call _strcmp"], [55, "test eax, eax"], [56, "jnz short loc_401504"], [57, "mov [rbp+var_8], offset byte_40A940"], [58, "jmp loc_401662"], [59, "lea rax, [rbp+s1]"], [60, "mov esi, offset aCmdBrowser"], [61, "mov rdi, rax"], [62, "call _strcmp"], [63, "test eax, eax"], [64, "jnz short loc_401529"], [65, "mov [rbp+var_8], offset byte_40AD40"], [66, "jmp loc_401662"], [67, "lea rax, [rbp+s1]"], [68, "mov esi, offset aCmdImage"], [69, "mov rdi, rax"], [70, "call _strcmp"], [71, "test eax, eax"], [72, "jnz short loc_40154E"], [73, "mov [rbp+var_8], offset byte_40AB40"], [74, "jmp loc_401662"], [75, "lea rax, [rbp+s1]"], [76, "mov esi, offset aCmdPlayer"], [77, "mov rdi, rax"], [78, "call _strcmp"], [79, "test eax, eax"], [80, "jnz short loc_401573"], [81, "mov [rbp+var_8], offset byte_40AF40"], [82, "jmp loc_401662"], [83, "lea rax, [rbp+s1]"], [84, "mov esi, offset aColorPrompt"], [85, "mov rdi, rax"], [86, "call _strcmp"], [87, "test eax, eax"], [88, "jnz short loc_401598"], [89, "mov [rbp+var_8], offset byte_40B140"], [90, "jmp loc_401662"], [91, "lea rax, [rbp+s1]"], [92, "mov esi, offset aColorSelector"], [93, "mov rdi, rax"], [94, "call _strcmp"], [95, "test eax, eax"], [96, "jnz short loc_4015BD"], [97, "mov [rbp+var_8], offset byte_40B340"], [98, "jmp loc_401662"], [99, "lea rax, [rbp+s1]"], [100, "mov esi, offset aVerbose"], [101, "mov rdi, rax"], [102, "call _strcmp"], [103, "test eax, eax"], [104, "jnz short loc_4015E2"], [105, "mov [rbp+var_8], offset byte_40B540"], [106, "jmp loc_401662"], [107, "mov [rbp+var_10], 0"], [108, "jmp short loc_401647"], [109, "mov eax, [rbp+var_10]"], [110, "lea edx, [rax+1]"], [111, "lea rax, [rbp+s]"], [112, "mov ecx, edx"], [113, "mov edx, offset format"], [114, "mov esi, 80h"], [115, "mov rdi, rax"], [116, "mov eax, 0"], [117, "call _snprintf"], [118, "lea rdx, [rbp+s]"], [119, "lea rax, [rbp+s1]"], [120, "mov rsi, rdx"], [121, "mov rdi, rax"], [122, "call _strcmp"], [123, "test eax, eax"], [124, "jnz short loc_401643"], [125, "mov eax, [rbp+var_10]"], [126, "cdqe"], [127, "shl rax, 9"], [128, "add rax, 407F40h"], [129, "mov [rbp+var_8], rax"], [130, "jmp short loc_40164D"], [131, "add [rbp+var_10], 1"], [132, "cmp [rbp+var_10], 13h"], [133, "jle short loc_4015EB"], [134, "cmp [rbp+var_8], 0"], [135, "jz loc_401713"], [136, "jmp short loc_401662"], [137, "add [rbp+var_498], 1"], [138, "mov rax, [rbp+var_498]"], [139, "movzx eax, byte ptr [rax]"], [140, "cmp al, 20h "], [141, "jz short loc_40165A"], [142, "mov rax, [rbp+var_498]"], [143, "movzx eax, byte ptr [rax]"], [144, "cmp al, 9"], [145, "jz short loc_40165A"], [146, "mov [rbp+var_C], 0"], [147, "jmp short loc_4016B7"], [148, "cmp [rbp+var_C], 1FEh"], [149, "jg short loc_4016AF"], [150, "mov eax, [rbp+var_C]"], [151, "lea edx, [rax+1]"], [152, "mov [rbp+var_C], edx"], [153, "movsxd rdx, eax"], [154, "mov rax, [rbp+var_8]"], [155, "add rdx, rax"], [156, "mov rax, [rbp+var_498]"], [157, "movzx eax, byte ptr [rax]"], [158, "mov [rdx], al"], [159, "add [rbp+var_498], 1"], [160, "mov rax, [rbp+var_498]"], [161, "movzx eax, byte ptr [rax]"], [162, "test al, al"], [163, "jnz short loc_401687"], [164, "sub [rbp+var_C], 1"], [165, "jmp short loc_4016CF"], [166, "sub [rbp+var_C], 1"], [167, "cmp [rbp+var_C], 0"], [168, "jle short loc_4016FD"], [169, "mov eax, [rbp+var_C]"], [170, "movsxd rdx, eax"], [171, "mov rax, [rbp+var_8]"], [172, "add rax, rdx"], [173, "movzx eax, byte ptr [rax]"], [174, "cmp al, 20h "], [175, "jz short loc_4016CB"], [176, "mov eax, [rbp+var_C]"], [177, "movsxd rdx, eax"], [178, "mov rax, [rbp+var_8]"], [179, "add rax, rdx"], [180, "movzx eax, byte ptr [rax]"], [181, "cmp al, 9"], [182, "jz short loc_4016CB"], [183, "add [rbp+var_C], 1"], [184, "mov eax, [rbp+var_C]"], [185, "movsxd rdx, eax"], [186, "mov rax, [rbp+var_8]"], [187, "add rax, rdx"], [188, "mov byte ptr [rax], 0"], [189, "jmp short locret_401714"], [190, "nop"], [191, "leave"], [192, "retn"]], "data_dep": [[6, 6], [6, 3], [7, 3], [7, 6], [8, 7], [9, 8], [10, 9], [11, 6], [11, 3], [12, 11], [13, 12], [14, 13], [17, 22], [17, 15], [18, 17], [19, 18], [20, 22], [20, 15], [21, 20], [21, 24], [22, 21], [23, 27], [23, 6], [23, 3], [24, 23], [26, 20], [26, 24], [27, 6], [27, 3], [27, 27], [28, 3], [28, 27], [28, 6], [29, 28], [30, 29], [31, 30], [32, 3], [32, 27], [32, 6], [33, 32], [34, 33], [35, 34], [36, 6], [36, 27], [36, 3], [37, 36], [38, 37], [39, 38], [40, 22], [40, 15], [42, 40], [43, 40], [45, 43], [47, 46], [48, 47], [51, 47], [53, 51], [55, 54], [56, 55], [59, 55], [61, 59], [63, 62], [64, 63], [67, 63], [69, 67], [71, 70], [72, 71], [75, 71], [77, 75], [79, 78], [80, 79], [83, 79], [85, 83], [87, 86], [88, 87], [91, 87], [93, 91], [95, 94], [96, 95], [99, 95], [101, 99], [103, 102], [104, 103], [109, 131], [109, 107], [110, 24], [110, 109], [110, 118], [111, 109], [112, 110], [115, 111], [118, 113], [119, 117], [120, 118], [121, 119], [123, 122], [124, 123], [125, 107], [125, 131], [127, 125], [128, 127], [129, 128], [131, 131], [131, 107], [132, 107], [132, 131], [133, 132], [134, 4], [134, 129], [135, 134], [137, 3], [137, 137], [137, 27], [137, 6], [138, 137], [138, 27], [138, 6], [138, 3], [139, 138], [140, 139], [141, 140], [142, 137], [142, 27], [142, 6], [142, 3], [143, 142], [144, 143], [145, 144], [148, 152], [148, 146], [149, 148], [150, 152], [150, 146], [151, 155], [151, 150], [151, 24], [151, 118], [151, 158], [152, 151], [153, 150], [154, 81], [154, 65], [154, 129], [154, 49], [154, 97], [154, 105], [154, 89], [154, 73], [154, 57], [154, 4], [155, 153], [155, 154], [156, 137], [156, 27], [156, 159], [156, 6], [156, 3], [157, 156], [157, 158], [158, 155], [158, 157], [159, 137], [159, 27], [159, 159], [159, 6], [159, 3], [160, 137], [160, 27], [160, 159], [160, 6], [160, 3], [161, 158], [161, 160], [162, 161], [163, 162], [164, 146], [164, 152], [166, 164], [166, 166], [167, 164], [167, 166], [168, 167], [169, 164], [169, 166], [170, 169], [171, 81], [171, 65], [171, 129], [171, 49], [171, 97], [171, 57], [171, 105], [171, 89], [171, 73], [171, 4], [172, 170], [172, 171], [173, 172], [173, 158], [174, 173], [175, 174], [176, 164], [176, 166], [177, 176], [178, 4], [178, 97], [178, 81], [178, 65], [178, 129], [178, 49], [178, 57], [178, 105], [178, 89], [178, 73], [179, 178], [179, 177], [180, 179], [180, 158], [181, 180], [182, 181], [183, 164], [183, 166], [184, 183], [185, 184], [186, 97], [186, 81], [186, 65], [186, 129], [186, 49], [186, 73], [186, 57], [186, 105], [186, 89], [186, 4], [187, 185], [187, 186], [188, 187], [192, 128], [192, 103], [192, 123], [192, 187]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6_0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6.jsonl.gz", "strip_func_name": "sub_40140C", "query": "\n\n\nint __fastcall sub_40140C(char *a1)\n{\nint v1; // eax\nchar *v2; // rax\nint v3; // eax\nchar s[128]; // [rsp+10h] [rbp-490h] BYREF\nchar s1[1024]; // [rsp+90h] [rbp-410h] BYREF\nint i; // [rsp+490h] [rbp-10h]\nunsigned int v9; // [rsp+494h] [rbp-Ch]\nchar *v10; // [rsp+498h] [rbp-8h]\n\nv10 = 0LL;\nwhile ( *a1 == 32 || *a1 == 9 )\n++a1;\nv9 = 0;\nwhile ( *a1 && *a1 != 32 && *a1 != 9 )\n{\nif ( v9 <= 0x3FE )\n{\nv1 = v9++;\ns1[v1] = *a1;\n}\n++a1;\n}\ns1[v9] = 0;\nif ( !strcmp(s1, \"start_uri\") )\n{\nv10 = ::s;\nLABEL_36:\nwhile ( *a1 == 32 || *a1 == 9 )\n++a1;\nv9 = 0;\nwhile ( *a1 )\n{\nif ( (int)v9 <= 510 )\n{\nv3 = v9++;\nv10[v3] = *a1;\n}\n++a1;\n}\n--v9;\nwhile ( (int)v9 > 0 && (v10[v9] == 32 || v10[v9] == 9) )\n--v9;\nv2 = &v10[++v9];\n*v2 = 0;\nreturn (int)v2;\n}\nif ( !strcmp(s1, \"cmd_text\") )\n{\nv10 = byte_40A940;\ngoto LABEL_36;\n}\nif ( !strcmp(s1, \"cmd_browser\") )\n{\nv10 = byte_40AD40;\ngoto LABEL_36;\n}\nif ( !strcmp(s1, \"cmd_image\") )\n{\nv10 = byte_40AB40;\ngoto LABEL_36;\n}\nif ( !strcmp(s1, \"cmd_player\") )\n{\nv10 = byte_40AF40;\ngoto LABEL_36;\n}\nif ( !strcmp(s1, \"color_prompt\") )\n{\nv10 = byte_40B140;\ngoto LABEL_36;\n}\nif ( !strcmp(s1, \"color_selector\") )\n{\nv10 = byte_40B340;\ngoto LABEL_36;\n}\nLODWORD(v2) = strcmp(s1, \"verbose\");\nif ( !(_DWORD)v2 )\n{\nv10 = byte_40B540;\ngoto LABEL_36;\n}\nfor ( i = 0; i <= 19; ++i )\n{\nsnprintf(s, 0x80uLL, \"bookmark%d\", (unsigned int)(i + 1));\nLODWORD(v2) = strcmp(s1, s);\nif ( !(_DWORD)v2 )\n{\nLODWORD(v2) = (i << 9) + 4226880;\nv10 = (char *)(((__int64)i << 9) + 4226880);\nbreak;\n}\n}\nif ( v10 )\ngoto LABEL_36;\nreturn (int)v2;\n}\n\n\n\nQ:[a1,s,s1,v10,sub_40140C,]", "hints": "[]", "response": "{'a1': 'line', 's': 'bkey', 's1': 'token', 'v10': 'value', 'sub_40140C': 'parse_config_line'}"}
[ [ 0.7774611115455627, 0.7446709275245667, 0.7340047955513, 0.7338610887527466, 0.7320618629455566, 0.726137638092041, 0.7256603240966797, 0.724353015422821, 0.7242521643638611, 0.7220351099967957, 0.7159041166305542, 0.7148303985595703, 0.7126274108886719, 0.7059571743011475, 0.7047522068023682, 0.701445996761322, 0.7012099623680115, 0.7007085680961609, 0.7005292177200317, 0.6972404718399048 ], [ 187923, 19254, 103281, 154134, 113516, 139613, 84542, 37149, 129404, 96239, 214472, 7225, 254834, 132626, 139618, 168297, 196945, 118297, 112302, 69466 ] ]
print_escaped_path
f6e0a3b322a49538ad5181564e84f0ca5105cd29f28fbe932ee3c146ebf967c1
BPI-SINOVOIP
BPI-M2U-bsp
NA
static void print_escaped_path(char *path) { if (isdigit(*path)) { printf("__"); } for (; *path != '\0'; ++path) { printf("%c", isalnum(*path) ? *path : '_'); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4011A2", "function_addr": 4198818, "binary_name": "f6e0a3b322a49538ad5181564e84f0ca5105cd29f28fbe932ee3c146ebf967c1.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "call ___ctype_b_loc"], [5, "mov rdx, [rax]"], [6, "mov rax, [rbp+var_8]"], [7, "movzx eax, byte ptr [rax]"], [8, "movsx rax, al"], [9, "add rax, rax"], [10, "add rax, rdx"], [11, "movzx eax, word ptr [rax]"], [12, "movzx eax, ax"], [13, "and eax, 800h"], [14, "test eax, eax"], [15, "jz short loc_40122A"], [16, "mov edi, offset format"], [17, "mov eax, 0"], [18, "call _printf"], [19, "jmp short loc_40122A"], [20, "call ___ctype_b_loc"], [21, "mov rdx, [rax]"], [22, "mov rax, [rbp+var_8]"], [23, "movzx eax, byte ptr [rax]"], [24, "movsx rax, al"], [25, "add rax, rax"], [26, "add rax, rdx"], [27, "movzx eax, word ptr [rax]"], [28, "movzx eax, ax"], [29, "and eax, 8"], [30, "test eax, eax"], [31, "jz short loc_401219"], [32, "mov rax, [rbp+var_8]"], [33, "movzx eax, byte ptr [rax]"], [34, "movsx eax, al"], [35, "jmp short loc_40121E"], [36, "mov eax, 5Fh "], [37, "mov edi, eax"], [38, "call _putchar"], [39, "add [rbp+var_8], 1"], [40, "mov rax, [rbp+var_8]"], [41, "movzx eax, byte ptr [rax]"], [42, "test al, al"], [43, "jnz short loc_4011E7"], [44, "nop"], [45, "nop"], [46, "leave"], [47, "retn"]], "data_dep": [[5, 4], [6, 3], [7, 6], [8, 7], [9, 8], [10, 9], [10, 5], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [21, 20], [22, 3], [22, 39], [23, 22], [24, 23], [25, 24], [26, 21], [26, 25], [27, 26], [28, 27], [29, 28], [30, 29], [31, 30], [32, 3], [32, 39], [33, 32], [34, 33], [37, 36], [37, 34], [39, 39], [39, 3], [40, 3], [40, 39], [41, 40], [42, 41], [43, 42], [47, 42]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f6e0a3b322a49538ad5181564e84f0ca5105cd29f28fbe932ee3c146ebf967c1_f6e0a3b322a49538ad5181564e84f0ca5105cd29f28fbe932ee3c146ebf967c1.jsonl.gz", "strip_func_name": "sub_4011A2", "query": "\n\n\n__int64 __fastcall sub_4011A2(char *a1)\n{\nint v1; // eax\n__int64 result; // rax\nchar *v3; // [rsp+8h] [rbp-8h]\n\nv3 = a1;\nif ( ((*__ctype_b_loc())[*a1] & 0x800) != 0 )\nprintf(\"__\");\nwhile ( 1 )\n{\nresult = (unsigned __int8)*v3;\nif ( !(_BYTE)result )\nbreak;\nif ( ((*__ctype_b_loc())[*v3] & 8) != 0 )\nv1 = *v3;\nelse\nv1 = 95;\nputchar(v1);\n++v3;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v3,sub_4011A2,]", "hints": "[]", "response": "{'a1': 'path', 'v3': 'patha', 'sub_4011A2': 'print_escaped_path'}"}
[ [ 0.7644532322883606, 0.7599542140960693, 0.7545425295829773, 0.7517780661582947, 0.7486231327056885, 0.7476133108139038, 0.7468634843826294, 0.7460441589355469, 0.7420859932899475, 0.740780234336853, 0.7407609820365906, 0.7364392280578613, 0.7290748357772827, 0.7284125089645386, 0.727378785610199, 0.7273149490356445, 0.7272768020629883, 0.7193095088005066, 0.7109780311584473, 0.7057108283042908 ], [ 75202, 224596, 26333, 141711, 245370, 33101, 127153, 181006, 121044, 210270, 21665, 174171, 182044, 164236, 61487, 216654, 168785, 230705, 179556, 167628 ] ]
get_date
2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567
solusipse
fiche
NA
static void get_date(char *buf) { struct tm curtime; time_t ltime; ltime=time(&ltime); localtime_r(&ltime, &curtime); // Save data to provided buffer if (asctime_r(&curtime, buf) == 0) { // Couldn't get date, setting first byte of the // buffer to zero so it won't be displayed buf[0] = 0; return; } // Remove newline char buf[strlen(buf)-1] = 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40190D", "function_addr": 4200717, "binary_name": "2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+buf], rdi"], [4, "lea rax, [rbp+timer]"], [5, "mov rdi, rax"], [6, "call _time"], [7, "mov [rbp+timer], rax"], [8, "lea rdx, [rbp+tp]"], [9, "lea rax, [rbp+timer]"], [10, "mov rsi, rdx"], [11, "mov rdi, rax"], [12, "call _localtime_r"], [13, "mov rdx, [rbp+buf]"], [14, "lea rax, [rbp+tp]"], [15, "mov rsi, rdx"], [16, "mov rdi, rax"], [17, "call _asctime_r"], [18, "test rax, rax"], [19, "jnz short loc_40195D"], [20, "mov rax, [rbp+buf]"], [21, "mov byte ptr [rax], 0"], [22, "jmp short locret_401977"], [23, "mov rax, [rbp+buf]"], [24, "mov rdi, rax"], [25, "call _strlen"], [26, "lea rdx, [rax-1]"], [27, "mov rax, [rbp+buf]"], [28, "add rax, rdx"], [29, "mov byte ptr [rax], 0"], [30, "leave"], [31, "retn"]], "data_dep": [[5, 4], [7, 6], [9, 7], [9, 6], [10, 8], [11, 9], [13, 3], [14, 12], [15, 13], [16, 14], [18, 17], [19, 18], [20, 3], [21, 20], [23, 3], [24, 23], [26, 13], [26, 25], [27, 3], [28, 27], [28, 26], [29, 28], [31, 20], [31, 28]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567_2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.jsonl.gz", "strip_func_name": "sub_40190D", "query": "\n\n\nchar *__fastcall sub_40190D(char *a1)\n{\nchar *result; // rax\ntime_t timer; // [rsp+18h] [rbp-48h] BYREF\nstruct tm tp; // [rsp+20h] [rbp-40h] BYREF\n\ntimer = time(&timer);\nlocaltime_r(&timer, &tp);\nif ( asctime_r(&tp, a1) )\n{\nresult = &a1[strlen(a1) - 1];\n*result = 0;\n}\nelse\n{\nresult = a1;\n*a1 = 0;\n}\nreturn result;\n}\n\n\n\nQ:[a1,timer,tp,sub_40190D,]", "hints": "[]", "response": "{'a1': 'buf', 'timer': 'ltime', 'tp': 'curtime', 'sub_40190D': 'get_date'}"}
[ [ 0.7523924112319946, 0.7412826418876648, 0.738243818283081, 0.7235859632492065, 0.7138248682022095, 0.7134056091308594, 0.7092173099517822, 0.7089557647705078, 0.7054611444473267, 0.7018356323242188, 0.7016170024871826, 0.7001827359199524, 0.7001394629478455, 0.6970270872116089, 0.6948783993721008, 0.6941424012184143, 0.6925689578056335, 0.6915813088417053, 0.688943088054657, 0.6879974603652954 ], [ 7591, 143319, 104361, 86869, 73392, 62944, 181295, 178435, 52354, 47320, 109961, 30022, 67563, 64196, 15632, 249186, 54705, 111793, 8971, 146754 ] ]
str_to_num
3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413
emikulic
darkhttpd
NA
static int str_to_num(const char *str, long long *num) { char *endptr; long long n; errno = 0; n = strtoll(str, &endptr, 10); if (*endptr != '\0') return 0; if (n == LLONG_MIN && errno == ERANGE) return 0; if (n == LLONG_MAX && errno == ERANGE) return 0; if (num != NULL) *num = n; return 1; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407F71", "function_addr": 4226929, "binary_name": "3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r15"], [3, "push r14"], [4, "push r13"], [5, "push r12"], [6, "push rbx"], [7, "sub rsp, 68h"], [8, "mov [rbp+nptr], rdi"], [9, "mov [rbp+var_90], rsi"], [10, "lea rbx, [rbp+var_70]"], [11, "mov r15, rbx"], [12, "cmp cs:__asan_option_detect_stack_use_after_return, 0"], [13, "jz short loc_407FB2"], [14, "mov edi, 40h "], [15, "call ___asan_stack_malloc_0"], [16, "test rax, rax"], [17, "jz short loc_407FB2"], [18, "mov rbx, rax"], [19, "lea rax, [rbx+40h]"], [20, "mov r14, rax"], [21, "mov qword ptr [rbx], 41B58AB3h"], [22, "mov qword ptr [rbx+8], offset a132811Endptr10"], [23, "mov qword ptr [rbx+10h], offset sub_407F71"], [24, "mov r12, rbx"], [25, "shr r12, 3"], [26, "mov dword ptr [r12+7FFF8000h], 0F1F1F1F1h"], [27, "mov dword ptr [r12+7FFF8004h], 0F3F3F300h"], [28, "call ___errno_location"], [29, "mov r13, rax"], [30, "mov rax, r13"], [31, "test r13, r13"], [32, "jz short loc_40800A"], [33, "mov rdx, rax"], [34, "and edx, 3"], [35, "test rdx, rdx"], [36, "jz short loc_408017"], [37, "mov rsi, rax"], [38, "mov edi, offset off_433A00"], [39, "call ___ubsan_handle_type_mismatch_v1"], [40, "mov rax, r13"], [41, "mov rdx, rax"], [42, "shr rdx, 3"], [43, "add rdx, 7FFF8000h"], [44, "movzx edx, byte ptr [rdx]"], [45, "test dl, dl"], [46, "setnz sil"], [47, "mov rcx, rax"], [48, "and ecx, 7"], [49, "add ecx, 3"], [50, "cmp cl, dl"], [51, "setnl dl"], [52, "and edx, esi"], [53, "test dl, dl"], [54, "jz short loc_40804D"], [55, "mov rdi, rax"], [56, "call ___asan_report_store4"], [57, "mov dword ptr [r13+0], 0"], [58, "cmp [rbp+nptr], 0"], [59, "jnz short loc_408069"], [60, "mov edi, offset off_446600"], [61, "call ___ubsan_handle_nonnull_arg"], [62, "lea rcx, [r14-20h]"], [63, "mov rax, [rbp+nptr]"], [64, "mov edx, 0Ah"], [65, "mov rsi, rcx"], [66, "mov rdi, rax"], [67, "call _strtoll"], [68, "mov [rbp+var_78], rax"], [69, "lea rax, [r14-20h]"], [70, "mov rdx, rax"], [71, "shr rdx, 3"], [72, "add rdx, 7FFF8000h"], [73, "movzx edx, byte ptr [rdx]"], [74, "test dl, dl"], [75, "jz short loc_4080A9"], [76, "mov rdi, rax"], [77, "call ___asan_report_load8"], [78, "mov r13, [r14-20h]"], [79, "test r13, r13"], [80, "jnz short loc_4080C1"], [81, "mov esi, 0"], [82, "mov edi, offset off_433A40"], [83, "call ___ubsan_handle_type_mismatch_v1"], [84, "mov rax, r13"], [85, "mov rdx, rax"], [86, "shr rdx, 3"], [87, "add rdx, 7FFF8000h"], [88, "movzx edx, byte ptr [rdx]"], [89, "test dl, dl"], [90, "setnz cl"], [91, "mov rsi, rax"], [92, "and esi, 7"], [93, "cmp sil, dl"], [94, "setnl dl"], [95, "and edx, ecx"], [96, "test dl, dl"], [97, "jz short loc_4080F4"], [98, "mov rdi, rax"], [99, "call ___asan_report_load1"], [100, "movzx eax, byte ptr [r13+0]"], [101, "test al, al"], [102, "jz short loc_408107"], [103, "mov eax, 0"], [104, "jmp loc_408270"], [105, "mov rax, 8000000000000000h"], [106, "cmp [rbp+var_78], rax"], [107, "jnz short loc_408188"], [108, "call ___errno_location"], [109, "mov r13, rax"], [110, "mov rax, r13"], [111, "test r13, r13"], [112, "jz short loc_408132"], [113, "mov rdx, rax"], [114, "and edx, 3"], [115, "test rdx, rdx"], [116, "jz short loc_40813F"], [117, "mov rsi, rax"], [118, "mov edi, offset off_433A80"], [119, "call ___ubsan_handle_type_mismatch_v1"], [120, "mov rax, r13"], [121, "mov rdx, rax"], [122, "shr rdx, 3"], [123, "add rdx, 7FFF8000h"], [124, "movzx edx, byte ptr [rdx]"], [125, "test dl, dl"], [126, "setnz sil"], [127, "mov rcx, rax"], [128, "and ecx, 7"], [129, "add ecx, 3"], [130, "cmp cl, dl"], [131, "setnl dl"], [132, "and edx, esi"], [133, "test dl, dl"], [134, "jz short loc_408175"], [135, "mov rdi, rax"], [136, "call ___asan_report_load4"], [137, "mov eax, [r13+0]"], [138, "cmp eax, 22h "], [139, "jnz short loc_408188"], [140, "mov eax, 0"], [141, "jmp loc_408270"], [142, "mov rax, 7FFFFFFFFFFFFFFFh"], [143, "cmp [rbp+var_78], rax"], [144, "jnz short loc_408206"], [145, "call ___errno_location"], [146, "mov r13, rax"], [147, "mov rax, r13"], [148, "test r13, r13"], [149, "jz short loc_4081B3"], [150, "mov rdx, rax"], [151, "and edx, 3"], [152, "test rdx, rdx"], [153, "jz short loc_4081C0"], [154, "mov rsi, rax"], [155, "mov edi, offset off_433AC0"], [156, "call ___ubsan_handle_type_mismatch_v1"], [157, "mov rax, r13"], [158, "mov rdx, rax"], [159, "shr rdx, 3"], [160, "add rdx, 7FFF8000h"], [161, "movzx edx, byte ptr [rdx]"], [162, "test dl, dl"], [163, "setnz sil"], [164, "mov rcx, rax"], [165, "and ecx, 7"], [166, "add ecx, 3"], [167, "cmp cl, dl"], [168, "setnl dl"], [169, "and edx, esi"], [170, "test dl, dl"], [171, "jz short loc_4081F6"], [172, "mov rdi, rax"], [173, "call ___asan_report_load4"], [174, "mov eax, [r13+0]"], [175, "cmp eax, 22h "], [176, "jnz short loc_408206"], [177, "mov eax, 0"], [178, "jmp short loc_408270"], [179, "cmp [rbp+var_90], 0"], [180, "jz short loc_40826B"], [181, "mov rax, [rbp+var_90]"], [182, "cmp [rbp+var_90], 0"], [183, "jz short loc_40822C"], [184, "mov rdx, rax"], [185, "and edx, 7"], [186, "test rdx, rdx"], [187, "jz short loc_408239"], [188, "mov rsi, rax"], [189, "mov edi, offset off_433B40"], [190, "call ___ubsan_handle_type_mismatch_v1"], [191, "mov rax, [rbp+var_90]"], [192, "mov rdx, rax"], [193, "shr rdx, 3"], [194, "add rdx, 7FFF8000h"], [195, "movzx edx, byte ptr [rdx]"], [196, "test dl, dl"], [197, "jz short loc_40825D"], [198, "mov rdi, rax"], [199, "call ___asan_report_store8"], [200, "mov rax, [rbp+var_90]"], [201, "mov rdx, [rbp+var_78]"], [202, "mov [rax], rdx"], [203, "mov eax, 1"], [204, "mov edx, eax"], [205, "cmp r15, rbx"], [206, "jz short loc_408299"], [207, "mov qword ptr [rbx], 45E0360Eh"], [208, "mov rax, 0F5F5F5F5F5F5F5F5h"], [209, "mov [r12+7FFF8000h], rax"], [210, "mov rax, [rbx+38h]"], [211, "mov byte ptr [rax], 0"], [212, "jmp short loc_4082A5"], [213, "mov qword ptr [r12+7FFF8000h], 0"], [214, "mov eax, edx"], [215, "add rsp, 68h"], [216, "pop rbx"], [217, "pop r12"], [218, "pop r13"], [219, "pop r14"], [220, "pop r15"], [221, "pop rbp"], [222, "retn"]], "data_dep": [[11, 10], [13, 12], [16, 15], [17, 16], [18, 16], [19, 18], [19, 10], [19, 16], [20, 19], [21, 18], [21, 10], [22, 10], [22, 18], [23, 10], [23, 18], [24, 10], [24, 18], [25, 24], [26, 25], [27, 25], [29, 28], [30, 29], [31, 29], [32, 31], [33, 30], [34, 33], [35, 34], [36, 35], [37, 30], [40, 31], [41, 40], [42, 41], [43, 42], [44, 22], [44, 26], [44, 21], [44, 23], [44, 43], [44, 27], [45, 44], [46, 45], [46, 37], [47, 40], [48, 47], [49, 48], [50, 45], [50, 49], [51, 50], [51, 45], [52, 51], [52, 46], [53, 52], [54, 53], [55, 40], [57, 31], [58, 8], [59, 58], [62, 26], [62, 21], [62, 23], [62, 57], [62, 20], [62, 27], [62, 22], [62, 49], [63, 8], [65, 62], [66, 63], [68, 67], [69, 22], [69, 26], [69, 67], [69, 21], [69, 23], [69, 27], [69, 57], [69, 20], [70, 69], [71, 70], [72, 71], [73, 26], [73, 21], [73, 23], [73, 27], [73, 57], [73, 72], [73, 22], [74, 73], [75, 74], [76, 69], [78, 22], [78, 26], [78, 21], [78, 23], [78, 27], [78, 57], [78, 20], [79, 78], [80, 79], [84, 79], [85, 84], [86, 85], [87, 86], [88, 22], [88, 26], [88, 21], [88, 23], [88, 87], [88, 27], [88, 57], [89, 88], [90, 62], [90, 89], [91, 84], [92, 91], [93, 92], [93, 89], [94, 89], [94, 93], [95, 90], [95, 94], [96, 95], [97, 96], [98, 84], [100, 21], [100, 23], [100, 27], [100, 57], [100, 22], [100, 79], [100, 26], [101, 100], [102, 101], [106, 68], [106, 105], [107, 106], [109, 108], [110, 109], [111, 109], [112, 111], [113, 110], [114, 113], [115, 114], [116, 115], [117, 110], [120, 111], [121, 120], [122, 121], [123, 122], [124, 26], [124, 21], [124, 23], [124, 27], [124, 57], [124, 123], [124, 22], [125, 124], [126, 117], [126, 92], [126, 125], [127, 120], [128, 127], [129, 128], [130, 125], [130, 129], [131, 125], [131, 130], [132, 126], [132, 131], [133, 132], [134, 133], [135, 120], [137, 111], [137, 26], [137, 21], [137, 23], [137, 27], [137, 57], [137, 22], [138, 137], [139, 138], [143, 142], [143, 68], [144, 143], [146, 145], [147, 146], [148, 146], [149, 148], [150, 147], [151, 150], [152, 151], [153, 152], [154, 147], [157, 148], [158, 157], [159, 158], [160, 159], [161, 22], [161, 26], [161, 21], [161, 57], [161, 23], [161, 160], [161, 27], [162, 161], [163, 154], [163, 126], [163, 92], [163, 162], [164, 157], [165, 164], [166, 165], [167, 166], [167, 162], [168, 162], [168, 167], [169, 163], [169, 168], [170, 169], [171, 170], [172, 157], [174, 23], [174, 27], [174, 148], [174, 22], [174, 26], [174, 21], [174, 57], [175, 174], [176, 175], [179, 9], [180, 179], [181, 9], [182, 9], [183, 182], [184, 181], [185, 184], [186, 185], [187, 186], [188, 181], [191, 9], [192, 191], [193, 192], [194, 193], [195, 27], [195, 22], [195, 26], [195, 21], [195, 57], [195, 194], [195, 23], [196, 195], [197, 196], [198, 191], [200, 9], [201, 68], [202, 200], [202, 201], [204, 103], [204, 203], [204, 177], [204, 140], [205, 10], [205, 18], [205, 11], [206, 205], [207, 10], [207, 18], [209, 25], [209, 208], [210, 209], [210, 10], [210, 18], [211, 210], [213, 25], [214, 204], [215, 7], [216, 6], [217, 5], [218, 4], [219, 3], [220, 2], [221, 0], [222, 214]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413_3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.jsonl.gz", "strip_func_name": "sub_407F71", "query": "\n\n\n__int64 __fastcall sub_407F71(const char *a1, __int64 *a2)\n{\nunsigned __int64 v2; // rbx\n__int64 v3; // rax\nunsigned __int64 v4; // r12\nint *v5; // rax\nunsigned __int64 v6; // r13\nunsigned __int64 v7; // r13\n__int64 result; // rax\nint *v9; // rax\nunsigned __int64 v10; // r13\nint *v11; // rax\nunsigned __int64 v12; // r13\n__int64 v13; // [rsp+18h] [rbp-78h]\nchar v14[112]; // [rsp+20h] [rbp-70h] BYREF\n\nv2 = (unsigned __int64)v14;\nif ( _asan_option_detect_stack_use_after_return )\n{\nv3 = __asan_stack_malloc_0();\nif ( v3 )\nv2 = v3;\n}\n*(_QWORD *)v2 = 1102416563LL;\n*(_QWORD *)(v2 + 8) = \"1 32 8 11 endptr:1005\";\n*(_QWORD *)(v2 + 16) = sub_407F71;\nv4 = v2 >> 3;\n*(_DWORD *)(v4 + 2147450880) = -235802127;\n*(_DWORD *)(v4 + 2147450884) = -202116352;\nv5 = __errno_location();\nv6 = (unsigned __int64)v5;\nif ( !v5 || ((unsigned __int8)v5 & 3) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v6 >> 3) + 0x7FFF8000) != 0 && (char)((v6 & 7) + 3) >= *(_BYTE *)((v6 >> 3) + 0x7FFF8000) )\n__asan_report_store4();\n*(_DWORD *)v6 = 0;\nif ( !a1 )\n__ubsan_handle_nonnull_arg();\nv13 = strtoll(a1, (char **)(v2 + 32), 10);\nif ( *(_BYTE *)(((v2 + 32) >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv7 = *(_QWORD *)(v2 + 32);\nif ( !v7 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v7 >> 3) + 0x7FFF8000) != 0 && (char)(v7 & 7) >= *(_BYTE *)((v7 >> 3) + 0x7FFF8000) )\n__asan_report_load1();\nif ( *(_BYTE *)v7 )\n{\nLODWORD(result) = 0;\n}\nelse\n{\nif ( v13 != 0x8000000000000000LL )\ngoto LABEL_33;\nv9 = __errno_location();\nv10 = (unsigned __int64)v9;\nif ( !v9 || ((unsigned __int8)v9 & 3) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v10 >> 3) + 0x7FFF8000) != 0 && (char)((v10 & 7) + 3) >= *(_BYTE *)((v10 >> 3) + 0x7FFF8000) )\n__asan_report_load4();\nif ( *(_DWORD *)v10 == 34 )\n{\nLODWORD(result) = 0;\n}\nelse\n{\nif ( v13 != 0x7FFFFFFFFFFFFFFFLL )\ngoto LABEL_35;\nLABEL_33:\nv11 = __errno_location();\nv12 = (unsigned __int64)v11;\nif ( !v11 || ((unsigned __int8)v11 & 3) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v12 >> 3) + 0x7FFF8000) != 0 && (char)((v12 & 7) + 3) >= *(_BYTE *)((v12 >> 3) + 0x7FFF8000) )\n__asan_report_load4();\nif ( *(_DWORD *)v12 == 34 )\n{\nLODWORD(result) = 0;\n}\nelse\n{\nLABEL_35:\nif ( a2 )\n{\nif ( ((unsigned __int8)a2 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)(((unsigned __int64)a2 >> 3) + 0x7FFF8000) )\n__asan_report_store8();\n*a2 = v13;\n}\nLODWORD(result) = 1;\n}\n}\n}\nif ( v14 == (char *)v2 )\n{\n*(_QWORD *)((v2 >> 3) + 0x7FFF8000) = 0LL;\n}\nelse\n{\n*(_QWORD *)v2 = 1172321806LL;\n*(_QWORD *)((v2 >> 3) + 0x7FFF8000) = 0xF5F5F5F5F5F5F5F5LL;\n**(_BYTE **)(v2 + 56) = 0;\n}\nreturn (unsigned int)result;\n}\n\n\n\nQ:[a1,a2,v13,sub_407F71,]", "hints": "[]", "response": "{'a1': 'str', 'a2': 'num', 'v13': 'n', 'sub_407F71': 'str_to_num'}"}
[ [ 0.7102835774421692, 0.7069501280784607, 0.7029368877410889, 0.699578046798706, 0.6828946471214294, 0.6807951927185059, 0.6740464568138123, 0.6739644408226013, 0.6701375246047974, 0.6561106443405151, 0.6525999307632446, 0.6435109376907349, 0.6428910493850708, 0.6375529170036316, 0.632706344127655, 0.6318198442459106, 0.6299115419387817, 0.6279261112213135, 0.6264738440513611, 0.6262006759643555 ], [ 10602, 254571, 117747, 213609, 14722, 187988, 92477, 123970, 80580, 27733, 199975, 55090, 84926, 53166, 37341, 261008, 97668, 12087, 182260, 254585 ] ]
dump_thrd_info
8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909
Xilinx
dma_ip_drivers
NA
static void dump_thrd_info(struct io_info *_info) { printf("q_name = %s\n", _info->q_name); printf("dir = %d\n", _info->dir); printf("mode = %d\n", _info->mode); printf("idx_cnt = %u\n", _info->idx_cnt); printf("idx_rngsz = %u\n", _info->idx_rngsz); printf("idx_tmr = %u\n", _info->idx_tmr); printf("pf = %x\n", _info->pf); printf("qid = %u\n", _info->qid); printf("fd = %d\n", _info->fd); printf("trig_mode = %s\n", _info->trig_mode); printf("q_ctrl = %u\n", _info->q_ctrl); printf("q_added = %u\n", _info->q_added); printf("q_started = %u\n", _info->q_started); printf("offset = 0x%lx\n", _info->offset); if (stm_mode) { printf("pipe_gl_max = %u\n", _info->pipe_gl_max); printf("pipe_flow_id = %u\n", _info->pipe_flow_id); printf("pipe_slr_id = %u\n", _info->pipe_slr_id); printf("pipe_tdest = %u\n", _info->pipe_tdest); } #if THREADS_SET_CPU_AFFINITY printf("cpu = %u\n", _info->cpu); #endif }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402CC5", "function_addr": 4205765, "binary_name": "8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, [rbp+var_8]"], [5, "add rax, 50h "], [6, "mov rsi, rax"], [7, "mov edi, offset aQNameS"], [8, "mov eax, 0"], [9, "call _printf"], [10, "mov rax, [rbp+var_8]"], [11, "mov eax, [rax+8Ch]"], [12, "mov esi, eax"], [13, "mov edi, offset aDirD"], [14, "mov eax, 0"], [15, "call _printf"], [16, "mov rax, [rbp+var_8]"], [17, "mov eax, [rax+88h]"], [18, "mov esi, eax"], [19, "mov edi, offset aModeD"], [20, "mov eax, 0"], [21, "call _printf"], [22, "mov rax, [rbp+var_8]"], [23, "mov eax, [rax+94h]"], [24, "mov esi, eax"], [25, "mov edi, offset aIdxCntU"], [26, "mov eax, 0"], [27, "call _printf"], [28, "mov rax, [rbp+var_8]"], [29, "mov eax, [rax+98h]"], [30, "mov esi, eax"], [31, "mov edi, offset aIdxRngszU"], [32, "mov eax, 0"], [33, "call _printf"], [34, "mov rax, [rbp+var_8]"], [35, "mov eax, [rax+90h]"], [36, "mov esi, eax"], [37, "mov edi, offset aIdxTmrU"], [38, "mov eax, 0"], [39, "call _printf"], [40, "mov rax, [rbp+var_8]"], [41, "mov eax, [rax+80h]"], [42, "mov esi, eax"], [43, "mov edi, offset aPfX"], [44, "mov eax, 0"], [45, "call _printf"], [46, "mov rax, [rbp+var_8]"], [47, "mov eax, [rax+84h]"], [48, "mov esi, eax"], [49, "mov edi, offset aQidU"], [50, "mov eax, 0"], [51, "call _printf"], [52, "mov rax, [rbp+var_8]"], [53, "mov eax, [rax+7Ch]"], [54, "mov esi, eax"], [55, "mov edi, offset aFdD"], [56, "mov eax, 0"], [57, "call _printf"], [58, "mov rax, [rbp+var_8]"], [59, "add rax, 64h "], [60, "mov rsi, rax"], [61, "mov edi, offset aTrigModeS"], [62, "mov eax, 0"], [63, "call _printf"], [64, "mov rax, [rbp+var_8]"], [65, "movzx eax, byte ptr [rax+6Eh]"], [66, "movzx eax, al"], [67, "mov esi, eax"], [68, "mov edi, offset aQCtrlU"], [69, "mov eax, 0"], [70, "call _printf"], [71, "mov rax, [rbp+var_8]"], [72, "mov eax, [rax+70h]"], [73, "mov esi, eax"], [74, "mov edi, offset aQAddedU"], [75, "mov eax, 0"], [76, "call _printf"], [77, "mov rax, [rbp+var_8]"], [78, "mov eax, [rax+74h]"], [79, "mov esi, eax"], [80, "mov edi, offset aQStartedU"], [81, "mov eax, 0"], [82, "call _printf"], [83, "mov rax, [rbp+var_8]"], [84, "mov rax, [rax+0D0h]"], [85, "mov rsi, rax"], [86, "mov edi, offset aOffset0xLx"], [87, "mov eax, 0"], [88, "call _printf"], [89, "mov eax, cs:dword_416524"], [90, "test eax, eax"], [91, "jz short loc_402EB9"], [92, "mov rax, [rbp+var_8]"], [93, "mov eax, [rax+0B0h]"], [94, "mov esi, eax"], [95, "mov edi, offset aPipeGlMaxU"], [96, "mov eax, 0"], [97, "call _printf"], [98, "mov rax, [rbp+var_8]"], [99, "mov eax, [rax+0B4h]"], [100, "mov esi, eax"], [101, "mov edi, offset aPipeFlowIdU"], [102, "mov eax, 0"], [103, "call _printf"], [104, "mov rax, [rbp+var_8]"], [105, "mov eax, [rax+0B8h]"], [106, "mov esi, eax"], [107, "mov edi, offset aPipeSlrIdU"], [108, "mov eax, 0"], [109, "call _printf"], [110, "mov rax, [rbp+var_8]"], [111, "mov eax, [rax+0BCh]"], [112, "mov esi, eax"], [113, "mov edi, offset aPipeTdestU"], [114, "mov eax, 0"], [115, "call _printf"], [116, "nop"], [117, "leave"], [118, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [10, 3], [11, 10], [12, 11], [16, 3], [17, 16], [18, 17], [22, 3], [23, 22], [24, 23], [28, 3], [29, 28], [30, 29], [34, 3], [35, 34], [36, 35], [40, 3], [41, 40], [42, 41], [46, 3], [47, 46], [48, 47], [52, 3], [53, 52], [54, 53], [58, 3], [59, 58], [60, 59], [64, 3], [65, 64], [66, 65], [67, 66], [71, 3], [72, 71], [73, 72], [77, 3], [78, 77], [79, 78], [83, 3], [84, 83], [85, 84], [90, 89], [91, 90], [92, 3], [93, 92], [94, 93], [98, 3], [99, 98], [100, 99], [104, 3], [105, 104], [106, 105], [110, 3], [111, 110], [112, 111], [118, 115], [118, 90]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909_8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909.jsonl.gz", "strip_func_name": "sub_402CC5", "query": "\n\n\nint __fastcall sub_402CC5(__int64 a1)\n{\nint result; // eax\n\nprintf(\"q_name = %s\\n\", (const char *)(a1 + 80));\nprintf(\"dir = %d\\n\", *(unsigned int *)(a1 + 140));\nprintf(\"mode = %d\\n\", *(unsigned int *)(a1 + 136));\nprintf(\"idx_cnt = %u\\n\", *(unsigned int *)(a1 + 148));\nprintf(\"idx_rngsz = %u\\n\", *(unsigned int *)(a1 + 152));\nprintf(\"idx_tmr = %u\\n\", *(unsigned int *)(a1 + 144));\nprintf(\"pf = %x\\n\", *(unsigned int *)(a1 + 128));\nprintf(\"qid = %u\\n\", *(unsigned int *)(a1 + 132));\nprintf(\"fd = %d\\n\", *(unsigned int *)(a1 + 124));\nprintf(\"trig_mode = %s\\n\", (const char *)(a1 + 100));\nprintf(\"q_ctrl = %u\\n\", *(unsigned __int8 *)(a1 + 110));\nprintf(\"q_added = %u\\n\", *(unsigned int *)(a1 + 112));\nprintf(\"q_started = %u\\n\", *(unsigned int *)(a1 + 116));\nprintf(\"offset = 0x%lx\\n\", *(_QWORD *)(a1 + 208));\nresult = dword_416524;\nif ( dword_416524 )\n{\nprintf(\"pipe_gl_max = %u\\n\", *(unsigned int *)(a1 + 176));\nprintf(\"pipe_flow_id = %u\\n\", *(unsigned int *)(a1 + 180));\nprintf(\"pipe_slr_id = %u\\n\", *(unsigned int *)(a1 + 184));\nresult = printf(\"pipe_tdest = %u\\n\", *(unsigned int *)(a1 + 188));\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_402CC5,]", "hints": "[]", "response": "{'a1': '_info', 'sub_402CC5': 'dump_thrd_info'}"}
[ [ 0.9022752046585083, 0.8943607807159424, 0.8933905363082886, 0.892217755317688, 0.8832030296325684, 0.8780467510223389, 0.8759876489639282, 0.868235170841217, 0.8603644371032715, 0.8493849039077759, 0.849284291267395, 0.848703920841217, 0.8481608629226685, 0.8476828932762146, 0.8458176851272583, 0.8379933834075928, 0.8334814310073853, 0.8310781121253967, 0.8275618553161621, 0.8217783570289612 ], [ 73756, 102978, 214624, 11139, 217118, 25668, 1591, 173666, 221334, 31736, 241568, 76876, 50614, 25927, 19201, 154207, 13979, 141693, 132466, 242933 ] ]
setnonblock
5c8629ef242aeed9dddcb82c11b9849317197e21e0824bea0bd5be74b1e6b408
andikleen
eproxy
NA
void setnonblock(int fd, int *cache) { int flags; if (!cache || *cache == -1) { flags = fcntl(fd, F_GETFL, 0); if (cache) *cache = flags; } else flags = *cache; fcntl(fd, F_SETFL, flags|O_NONBLOCK); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4014DA", "function_addr": 4199642, "binary_name": "5c8629ef242aeed9dddcb82c11b9849317197e21e0824bea0bd5be74b1e6b408.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+var_20], rsi"], [5, "cmp [rbp+var_20], 0"], [6, "jz short loc_4014FB"], [7, "mov rax, [rbp+var_20]"], [8, "mov eax, [rax]"], [9, "cmp eax, 0FFFFFFFFh"], [10, "jnz short loc_401529"], [11, "mov eax, [rbp+fd]"], [12, "mov edx, 0"], [13, "mov esi, 3"], [14, "mov edi, eax"], [15, "mov eax, 0"], [16, "call _fcntl"], [17, "mov [rbp+var_4], eax"], [18, "cmp [rbp+var_20], 0"], [19, "jz short loc_401532"], [20, "mov rax, [rbp+var_20]"], [21, "mov edx, [rbp+var_4]"], [22, "mov [rax], edx"], [23, "jmp short loc_401532"], [24, "mov rax, [rbp+var_20]"], [25, "mov eax, [rax]"], [26, "mov [rbp+var_4], eax"], [27, "mov eax, [rbp+var_4]"], [28, "or ah, 8"], [29, "mov edx, eax"], [30, "mov eax, [rbp+fd]"], [31, "mov esi, 4"], [32, "mov edi, eax"], [33, "mov eax, 0"], [34, "call _fcntl"], [35, "nop"], [36, "leave"], [37, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 4], [8, 7], [9, 8], [10, 9], [11, 3], [14, 11], [17, 16], [18, 4], [19, 18], [20, 4], [21, 17], [22, 20], [22, 21], [24, 4], [25, 24], [26, 25], [27, 17], [27, 26], [28, 27], [29, 28], [30, 3], [32, 30], [37, 34]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/5c8629ef242aeed9dddcb82c11b9849317197e21e0824bea0bd5be74b1e6b408_5c8629ef242aeed9dddcb82c11b9849317197e21e0824bea0bd5be74b1e6b408.jsonl.gz", "strip_func_name": "sub_4014DA", "query": "\n\n\nint __fastcall sub_4014DA(int a1, int *a2)\n{\nunsigned int v2; // eax\nint v4; // [rsp+1Ch] [rbp-4h]\n\nif ( a2 && *a2 != -1 )\n{\nv4 = *a2;\n}\nelse\n{\nv4 = fcntl(a1, 3, 0LL);\nif ( a2 )\n*a2 = v4;\n}\nv2 = v4;\nBYTE1(v2) = BYTE1(v4) | 8;\nreturn fcntl(a1, 4, v2);\n}\n\n\n\nQ:[a1,a2,v4,sub_4014DA,]", "hints": "[]", "response": "{'a1': 'fd', 'a2': 'cache', 'v4': 'flags', 'sub_4014DA': 'setnonblock'}"}
[ [ 0.7248135805130005, 0.7052874565124512, 0.6996089220046997, 0.694125771522522, 0.6931426525115967, 0.6840622425079346, 0.6833815574645996, 0.6833586692810059, 0.6822245121002197, 0.6795768141746521, 0.6780091524124146, 0.6720001697540283, 0.667700469493866, 0.6601656675338745, 0.6599512100219727, 0.6590832471847534, 0.6585119962692261, 0.6567378640174866, 0.6559146642684937, 0.65488201379776 ], [ 216099, 102627, 121976, 95904, 118143, 7369, 249905, 167190, 156929, 230781, 110189, 50682, 253000, 155496, 103284, 133053, 80323, 137800, 49746, 210027 ] ]
read_patch_config
56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b
peterbjornx
patchtools_pub
NA
void read_patch_config( patch_hdr_t *hdr, patch_body_t *body, const char *filename, char **msram_fnp, uint32_t *key_seed ) { int i; char *par_n, *par_v, *par_v2, *par_v3; char *msram_fn; uint32_t addr, mask, data; FILE *file; msram_fn = NULL; file = fopen(filename, "r"); if ( !file ) { perror( "Could not open patch config input file" ); exit( EXIT_FAILURE ); } i = 0; while ( fgets( line_buf, sizeof line_buf, file ) ) { par_n = strtok(line_buf, " "); if ( !par_n ) continue; par_v = strtok(NULL, " \n"); if ( !par_v ) { fprintf( stderr, "Config key without value: \"%s\"\n", par_n ); exit( EXIT_FAILURE ); } if ( strcmp( par_n, "header_ver" ) == 0 ) { hdr->header_ver = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "update_rev" ) == 0 ) { hdr->update_rev = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "date_bcd" ) == 0 ) { hdr->date_bcd = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "proc_sig" ) == 0 ) { hdr->proc_sig = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "checksum" ) == 0 ) { hdr->checksum = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "loader_rev" ) == 0 ) { hdr->loader_ver = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "proc_flags" ) == 0 ) { hdr->proc_flags = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "data_size" ) == 0 ) { hdr->data_size = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "total_size" ) == 0 ) { hdr->total_size = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "key_seed" ) == 0 ) { *key_seed = strtol( par_v, NULL, 0 ); } else if ( strcmp( par_n, "msram_file" ) == 0 ) { msram_fn = strdup( par_v ); } else if ( strcmp( par_n, "write_creg" ) == 0 ) { par_v2 = strtok(NULL, " \n"); par_v3 = strtok(NULL, " \n"); if ( !(par_v2 || par_v3) ){ fprintf( stderr, "Incomplete write_creg\n" ); exit( EXIT_FAILURE ); } addr = strtol( par_v, NULL, 0 ); mask = strtol( par_v2, NULL, 0 ); data = strtol( par_v3, NULL, 0 ); if ( addr & ~0x1FF ) { fprintf( stderr, "Invalid creg address: 0x%03X\n", addr ); exit( EXIT_FAILURE ); } if ( i >= PATCH_CR_OP_COUNT ) { fprintf( stderr, "Too many write_creg statements\n"); exit( EXIT_FAILURE ); } body->cr_ops[i].address = addr; body->cr_ops[i].mask = mask; body->cr_ops[i].value = data; i++; } else { fprintf( stderr, "Unknown config key \"%s\"\n", par_n ); exit( EXIT_FAILURE ); } } fclose( file ); *msram_fnp = msram_fn; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402EC5", "function_addr": 4206277, "binary_name": "56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "add rsp, 0FFFFFFFFFFFFFF80h"], [3, "mov [rbp+var_58], rdi"], [4, "mov [rbp+var_60], rsi"], [5, "mov [rbp+filename], rdx"], [6, "mov [rbp+var_70], rcx"], [7, "mov [rbp+var_78], r8"], [8, "mov [rbp+var_10], 0"], [9, "mov rax, [rbp+filename]"], [10, "mov esi, offset aR"], [11, "mov rdi, rax"], [12, "call _fopen"], [13, "mov [rbp+stream], rax"], [14, "cmp [rbp+stream], 0"], [15, "jnz short loc_402F19"], [16, "mov edi, offset aCouldNotOpenPa_0"], [17, "call _perror"], [18, "mov edi, 1"], [19, "call _exit"], [20, "mov [rbp+var_4], 0"], [21, "jmp loc_403387"], [22, "mov esi, offset asc_404B87"], [23, "mov edi, offset byte_40A940"], [24, "call _strtok"], [25, "mov [rbp+s1], rax"], [26, "cmp [rbp+s1], 0"], [27, "jnz short loc_402F44"], [28, "jmp loc_403387"], [29, "mov esi, offset asc_404B89"], [30, "mov edi, 0"], [31, "call _strtok"], [32, "mov [rbp+nptr], rax"], [33, "cmp [rbp+nptr], 0"], [34, "jnz short loc_402F85"], [35, "mov rax, cs:stderr"], [36, "mov rdx, [rbp+s1]"], [37, "mov esi, offset aConfigKeyWitho"], [38, "mov rdi, rax"], [39, "mov eax, 0"], [40, "call _fprintf"], [41, "mov edi, 1"], [42, "call _exit"], [43, "mov rax, [rbp+s1]"], [44, "mov esi, offset s2"], [45, "mov rdi, rax"], [46, "call _strcmp"], [47, "test eax, eax"], [48, "jnz short loc_402FBD"], [49, "mov rax, [rbp+nptr]"], [50, "mov edx, 0"], [51, "mov esi, 0"], [52, "mov rdi, rax"], [53, "call _strtol"], [54, "mov edx, eax"], [55, "mov rax, [rbp+var_58]"], [56, "mov [rax], edx"], [57, "jmp loc_403387"], [58, "mov rax, [rbp+s1]"], [59, "mov esi, offset aUpdateRev"], [60, "mov rdi, rax"], [61, "call _strcmp"], [62, "test eax, eax"], [63, "jnz short loc_402FF6"], [64, "mov rax, [rbp+nptr]"], [65, "mov edx, 0"], [66, "mov esi, 0"], [67, "mov rdi, rax"], [68, "call _strtol"], [69, "mov edx, eax"], [70, "mov rax, [rbp+var_58]"], [71, "mov [rax+4], edx"], [72, "jmp loc_403387"], [73, "mov rax, [rbp+s1]"], [74, "mov esi, offset aDateBcd"], [75, "mov rdi, rax"], [76, "call _strcmp"], [77, "test eax, eax"], [78, "jnz short loc_40302F"], [79, "mov rax, [rbp+nptr]"], [80, "mov edx, 0"], [81, "mov esi, 0"], [82, "mov rdi, rax"], [83, "call _strtol"], [84, "mov edx, eax"], [85, "mov rax, [rbp+var_58]"], [86, "mov [rax+8], edx"], [87, "jmp loc_403387"], [88, "mov rax, [rbp+s1]"], [89, "mov esi, offset aProcSig"], [90, "mov rdi, rax"], [91, "call _strcmp"], [92, "test eax, eax"], [93, "jnz short loc_403068"], [94, "mov rax, [rbp+nptr]"], [95, "mov edx, 0"], [96, "mov esi, 0"], [97, "mov rdi, rax"], [98, "call _strtol"], [99, "mov edx, eax"], [100, "mov rax, [rbp+var_58]"], [101, "mov [rax+0Ch], edx"], [102, "jmp loc_403387"], [103, "mov rax, [rbp+s1]"], [104, "mov esi, offset aChecksum"], [105, "mov rdi, rax"], [106, "call _strcmp"], [107, "test eax, eax"], [108, "jnz short loc_4030A1"], [109, "mov rax, [rbp+nptr]"], [110, "mov edx, 0"], [111, "mov esi, 0"], [112, "mov rdi, rax"], [113, "call _strtol"], [114, "mov edx, eax"], [115, "mov rax, [rbp+var_58]"], [116, "mov [rax+10h], edx"], [117, "jmp loc_403387"], [118, "mov rax, [rbp+s1]"], [119, "mov esi, offset aLoaderRev"], [120, "mov rdi, rax"], [121, "call _strcmp"], [122, "test eax, eax"], [123, "jnz short loc_4030DA"], [124, "mov rax, [rbp+nptr]"], [125, "mov edx, 0"], [126, "mov esi, 0"], [127, "mov rdi, rax"], [128, "call _strtol"], [129, "mov edx, eax"], [130, "mov rax, [rbp+var_58]"], [131, "mov [rax+14h], edx"], [132, "jmp loc_403387"], [133, "mov rax, [rbp+s1]"], [134, "mov esi, offset aProcFlags"], [135, "mov rdi, rax"], [136, "call _strcmp"], [137, "test eax, eax"], [138, "jnz short loc_403113"], [139, "mov rax, [rbp+nptr]"], [140, "mov edx, 0"], [141, "mov esi, 0"], [142, "mov rdi, rax"], [143, "call _strtol"], [144, "mov edx, eax"], [145, "mov rax, [rbp+var_58]"], [146, "mov [rax+18h], edx"], [147, "jmp loc_403387"], [148, "mov rax, [rbp+s1]"], [149, "mov esi, offset aDataSize"], [150, "mov rdi, rax"], [151, "call _strcmp"], [152, "test eax, eax"], [153, "jnz short loc_40314C"], [154, "mov rax, [rbp+nptr]"], [155, "mov edx, 0"], [156, "mov esi, 0"], [157, "mov rdi, rax"], [158, "call _strtol"], [159, "mov edx, eax"], [160, "mov rax, [rbp+var_58]"], [161, "mov [rax+1Ch], edx"], [162, "jmp loc_403387"], [163, "mov rax, [rbp+s1]"], [164, "mov esi, offset aTotalSize"], [165, "mov rdi, rax"], [166, "call _strcmp"], [167, "test eax, eax"], [168, "jnz short loc_403185"], [169, "mov rax, [rbp+nptr]"], [170, "mov edx, 0"], [171, "mov esi, 0"], [172, "mov rdi, rax"], [173, "call _strtol"], [174, "mov edx, eax"], [175, "mov rax, [rbp+var_58]"], [176, "mov [rax+20h], edx"], [177, "jmp loc_403387"], [178, "mov rax, [rbp+s1]"], [179, "mov esi, offset aKeySeed"], [180, "mov rdi, rax"], [181, "call _strcmp"], [182, "test eax, eax"], [183, "jnz short loc_4031BD"], [184, "mov rax, [rbp+nptr]"], [185, "mov edx, 0"], [186, "mov esi, 0"], [187, "mov rdi, rax"], [188, "call _strtol"], [189, "mov edx, eax"], [190, "mov rax, [rbp+var_78]"], [191, "mov [rax], edx"], [192, "jmp loc_403387"], [193, "mov rax, [rbp+s1]"], [194, "mov esi, offset aMsramFile"], [195, "mov rdi, rax"], [196, "call _strcmp"], [197, "test eax, eax"], [198, "jnz short loc_4031E7"], [199, "mov rax, [rbp+nptr]"], [200, "mov rdi, rax"], [201, "call _strdup"], [202, "mov [rbp+var_10], rax"], [203, "jmp loc_403387"], [204, "mov rax, [rbp+s1]"], [205, "mov esi, offset aWriteCreg"], [206, "mov rdi, rax"], [207, "call _strcmp"], [208, "test eax, eax"], [209, "jnz loc_403360"], [210, "mov esi, offset asc_404B89"], [211, "mov edi, 0"], [212, "call _strtok"], [213, "mov [rbp+var_30], rax"], [214, "mov esi, offset asc_404B89"], [215, "mov edi, 0"], [216, "call _strtok"], [217, "mov [rbp+var_38], rax"], [218, "cmp [rbp+var_30], 0"], [219, "jnz short loc_40325C"], [220, "cmp [rbp+var_38], 0"], [221, "jnz short loc_40325C"], [222, "mov rax, cs:stderr"], [223, "mov rcx, rax"], [224, "mov edx, 16h"], [225, "mov esi, 1"], [226, "mov edi, offset aIncompleteWrit"], [227, "call _fwrite"], [228, "mov edi, 1"], [229, "call _exit"], [230, "mov rax, [rbp+nptr]"], [231, "mov edx, 0"], [232, "mov esi, 0"], [233, "mov rdi, rax"], [234, "call _strtol"], [235, "mov [rbp+var_3C], eax"], [236, "mov rax, [rbp+var_30]"], [237, "mov edx, 0"], [238, "mov esi, 0"], [239, "mov rdi, rax"], [240, "call _strtol"], [241, "mov [rbp+var_40], eax"], [242, "mov rax, [rbp+var_38]"], [243, "mov edx, 0"], [244, "mov esi, 0"], [245, "mov rdi, rax"], [246, "call _strtol"], [247, "mov [rbp+var_44], eax"], [248, "mov eax, [rbp+var_3C]"], [249, "and eax, 0FFFFFE00h"], [250, "test eax, eax"], [251, "jz short loc_4032D9"], [252, "mov rax, cs:stderr"], [253, "mov edx, [rbp+var_3C]"], [254, "mov esi, offset aInvalidCregAdd"], [255, "mov rdi, rax"], [256, "mov eax, 0"], [257, "call _fprintf"], [258, "mov edi, 1"], [259, "call _exit"], [260, "cmp [rbp+var_4], 0Fh"], [261, "jle short loc_403307"], [262, "mov rax, cs:stderr"], [263, "mov rcx, rax"], [264, "mov edx, 1Fh"], [265, "mov esi, 1"], [266, "mov edi, offset aTooManyWriteCr"], [267, "call _fwrite"], [268, "mov edi, 1"], [269, "call _exit"], [270, "mov rdx, [rbp+var_60]"], [271, "mov eax, [rbp+var_4]"], [272, "cdqe"], [273, "add rax, 2Ah "], [274, "shl rax, 4"], [275, "add rdx, rax"], [276, "mov eax, [rbp+var_3C]"], [277, "mov [rdx], eax"], [278, "mov rdx, [rbp+var_60]"], [279, "mov eax, [rbp+var_4]"], [280, "cdqe"], [281, "add rax, 2Ah "], [282, "shl rax, 4"], [283, "add rax, rdx"], [284, "lea rdx, [rax+4]"], [285, "mov eax, [rbp+var_40]"], [286, "mov [rdx], eax"], [287, "mov rdx, [rbp+var_60]"], [288, "mov eax, [rbp+var_4]"], [289, "cdqe"], [290, "add rax, 2Ah "], [291, "shl rax, 4"], [292, "add rax, rdx"], [293, "lea rdx, [rax+8]"], [294, "mov eax, [rbp+var_44]"], [295, "mov [rdx], eax"], [296, "add [rbp+var_4], 1"], [297, "jmp short loc_403387"], [298, "mov rax, cs:stderr"], [299, "mov rdx, [rbp+s1]"], [300, "mov esi, offset aUnknownConfigK"], [301, "mov rdi, rax"], [302, "mov eax, 0"], [303, "call _fprintf"], [304, "mov edi, 1"], [305, "call _exit"], [306, "mov rax, [rbp+stream]"], [307, "mov rdx, rax"], [308, "mov esi, 1000h"], [309, "mov edi, offset byte_40A940"], [310, "call _fgets"], [311, "test rax, rax"], [312, "jnz loc_402F25"], [313, "mov rax, [rbp+stream]"], [314, "mov rdi, rax"], [315, "call _fclose"], [316, "mov rax, [rbp+var_70]"], [317, "mov rdx, [rbp+var_10]"], [318, "mov [rax], rdx"], [319, "nop"], [320, "leave"], [321, "retn"]], "data_dep": [[9, 5], [11, 9], [13, 12], [14, 13], [15, 14], [25, 24], [26, 25], [27, 26], [32, 31], [33, 32], [34, 33], [36, 25], [38, 35], [43, 25], [45, 43], [47, 46], [48, 47], [49, 32], [52, 49], [54, 53], [55, 3], [56, 55], [56, 54], [58, 25], [60, 58], [62, 61], [63, 62], [64, 32], [67, 64], [69, 68], [70, 3], [71, 69], [71, 70], [73, 25], [75, 73], [77, 76], [78, 77], [79, 32], [82, 79], [84, 83], [85, 3], [86, 85], [86, 84], [88, 25], [90, 88], [92, 91], [93, 92], [94, 32], [97, 94], [99, 98], [100, 3], [101, 99], [101, 100], [103, 25], [105, 103], [107, 106], [108, 107], [109, 32], [112, 109], [114, 113], [115, 3], [116, 115], [116, 114], [118, 25], [120, 118], [122, 121], [123, 122], [124, 32], [127, 124], [129, 128], [130, 3], [131, 129], [131, 130], [133, 25], [135, 133], [137, 136], [138, 137], [139, 32], [142, 139], [144, 143], [145, 3], [146, 145], [146, 144], [148, 25], [150, 148], [152, 151], [153, 152], [154, 32], [157, 154], [159, 158], [160, 3], [161, 159], [161, 160], [163, 25], [165, 163], [167, 166], [168, 167], [169, 32], [172, 169], [174, 173], [175, 3], [176, 175], [176, 174], [178, 25], [180, 178], [182, 181], [183, 182], [184, 32], [187, 184], [189, 188], [190, 7], [191, 189], [191, 190], [193, 25], [195, 193], [197, 196], [198, 197], [199, 32], [200, 199], [202, 201], [204, 25], [206, 204], [208, 207], [209, 208], [213, 212], [217, 216], [218, 213], [219, 218], [220, 217], [221, 220], [223, 222], [230, 32], [233, 230], [235, 234], [236, 213], [239, 236], [241, 240], [242, 217], [245, 242], [247, 246], [248, 235], [249, 248], [250, 249], [251, 250], [253, 235], [255, 252], [260, 20], [260, 296], [261, 260], [263, 262], [270, 4], [271, 20], [271, 296], [273, 271], [274, 273], [275, 270], [275, 274], [276, 235], [277, 276], [277, 275], [278, 4], [279, 20], [279, 296], [281, 279], [282, 281], [283, 278], [283, 282], [284, 283], [284, 278], [284, 277], [284, 71], [285, 241], [286, 284], [286, 285], [287, 4], [288, 20], [288, 296], [290, 288], [291, 290], [292, 287], [292, 291], [293, 86], [293, 287], [293, 286], [293, 292], [294, 247], [295, 294], [295, 293], [296, 20], [296, 296], [299, 25], [301, 298], [306, 13], [307, 306], [311, 310], [312, 311], [313, 13], [314, 313], [316, 6], [317, 8], [317, 202], [318, 317], [318, 316], [321, 316]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b_56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.jsonl.gz", "strip_func_name": "sub_402EC5", "query": "\n\n\nchar **__fastcall sub_402EC5(_DWORD *a1, __int64 a2, const char *a3, char **a4, _DWORD *a5)\n{\nchar **result; // rax\nint v8; // [rsp+3Ch] [rbp-44h]\nint v9; // [rsp+40h] [rbp-40h]\nunsigned int v10; // [rsp+44h] [rbp-3Ch]\nconst char *v11; // [rsp+48h] [rbp-38h]\nconst char *v12; // [rsp+50h] [rbp-30h]\nconst char *nptr; // [rsp+58h] [rbp-28h]\nconst char *s1; // [rsp+60h] [rbp-20h]\nFILE *stream; // [rsp+68h] [rbp-18h]\nchar *v16; // [rsp+70h] [rbp-10h]\nint v17; // [rsp+7Ch] [rbp-4h]\n\nv16 = 0LL;\nstream = fopen(a3, \"r\");\nif ( !stream )\n{\nperror(\"Could not open patch config input file\");\nexit(1);\n}\nv17 = 0;\nwhile ( fgets(byte_40A940, 4096, stream) )\n{\ns1 = strtok(byte_40A940, \" \");\nif ( s1 )\n{\nnptr = strtok(0LL, \" \\n\");\nif ( !nptr )\n{\nfprintf(stderr, \"Config key without value: \\\"%s\\\"\\n\", s1);\nexit(1);\n}\nif ( !strcmp(s1, \"header_ver\") )\n{\n*a1 = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"update_rev\") )\n{\na1[1] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"date_bcd\") )\n{\na1[2] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"proc_sig\") )\n{\na1[3] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"checksum\") )\n{\na1[4] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"loader_rev\") )\n{\na1[5] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"proc_flags\") )\n{\na1[6] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"data_size\") )\n{\na1[7] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"total_size\") )\n{\na1[8] = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"key_seed\") )\n{\n*a5 = strtol(nptr, 0LL, 0);\n}\nelse if ( !strcmp(s1, \"msram_file\") )\n{\nv16 = strdup(nptr);\n}\nelse\n{\nif ( strcmp(s1, \"write_creg\") )\n{\nfprintf(stderr, \"Unknown config key \\\"%s\\\"\\n\", s1);\nexit(1);\n}\nv12 = strtok(0LL, \" \\n\");\nv11 = strtok(0LL, \" \\n\");\nif ( !v12 && !v11 )\n{\nfwrite(\"Incomplete write_creg\\n\", 1uLL, 0x16uLL, stderr);\nexit(1);\n}\nv10 = strtol(nptr, 0LL, 0);\nv9 = strtol(v12, 0LL, 0);\nv8 = strtol(v11, 0LL, 0);\nif ( (v10 & 0xFFFFFE00) != 0 )\n{\nfprintf(stderr, \"Invalid creg address: 0x%03X\\n\", v10);\nexit(1);\n}\nif ( v17 > 15 )\n{\nfwrite(\"Too many write_creg statements\\n\", 1uLL, 0x1FuLL, stderr);\nexit(1);\n}\n*(_DWORD *)(16 * (v17 + 42LL) + a2) = v10;\n*(_DWORD *)(a2 + 16 * (v17 + 42LL) + 4) = v9;\n*(_DWORD *)(a2 + 16 * (v17++ + 42LL) + 8) = v8;\n}\n}\n}\nfclose(stream);\nresult = a4;\n*a4 = v16;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,v8,v9,v10,v11,v12,nptr,s1,stream,v16,sub_402EC5,]", "hints": "[]", "response": "{'a3': 'filename', 'a4': 'msram_fnp', 'a1': 'hdr', 'a2': 'body', 'a5': 'key_seed', 'v8': 'data', 'v9': 'mask', 'v10': 'addr', 'v11': 'par_v3', 'v12': 'par_v2', 'nptr': 'par_v', 's1': 'par_n', 'stream': 'file', 'v16': 'msram_fn', 'sub_402EC5': 'read_patch_config'}"}
[ [ 0.8121225833892822, 0.7839289903640747, 0.7698028683662415, 0.7492056488990784, 0.7492056488990784, 0.7488062381744385, 0.7414242029190063, 0.7378278374671936, 0.7351210117340088, 0.7286852598190308, 0.7270114421844482, 0.7265986204147339, 0.7225399613380432, 0.7193852663040161, 0.7176114916801453, 0.7175083160400391, 0.7173920273780823, 0.7137308716773987, 0.7123781442642212, 0.7118837237358093 ], [ 117735, 262965, 19177, 198623, 64551, 24038, 102308, 74546, 206920, 159984, 9175, 167713, 138493, 184256, 116317, 128401, 214996, 101605, 49592, 56499 ] ]
find_first_zero_bit
f7a8ad13590a7e4d3989db654ededc2ed1f253ab6c52713b3c2aeeead24a23b5
wbx-github
openadk
NA
static int find_first_zero_bit (unsigned int * addr, unsigned size) { unsigned lwsize; unsigned int *ap = (unsigned int *)addr; unsigned int mask; unsigned int longword, bit; unsigned int lwval; if (!size) return 0; /* Convert "size" to a whole number of longwords... */ lwsize = (size + BITS_PER_LONG - 1) >> 5; for (longword = 0; longword < lwsize; longword++, ap++) { if(*ap != 0xffffffff) { lwval = big_endian ? swap32(*ap) : *ap; for (bit = 0, mask = 1; bit < BITS_PER_LONG; bit++, mask <<= 1) { if ((lwval & mask) == 0) { return (longword*BITS_PER_LONG) + bit; } } } } return size; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40285D", "function_addr": 4204637, "binary_name": "f7a8ad13590a7e4d3989db654ededc2ed1f253ab6c52713b3c2aeeead24a23b5.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_2C], esi"], [5, "mov rax, [rbp+var_28]"], [6, "mov [rbp+var_8], rax"], [7, "cmp [rbp+var_2C], 0"], [8, "jnz short loc_402884"], [9, "mov eax, 0"], [10, "jmp locret_402912"], [11, "mov eax, [rbp+var_2C]"], [12, "add rax, 1Fh"], [13, "shr rax, 5"], [14, "mov [rbp+var_18], eax"], [15, "mov [rbp+var_10], 0"], [16, "jmp short loc_402907"], [17, "mov rax, [rbp+var_8]"], [18, "mov eax, [rax]"], [19, "cmp eax, 0FFFFFFFFh"], [20, "jz short loc_4028FE"], [21, "mov eax, cs:dword_409648"], [22, "test eax, eax"], [23, "jz short loc_4028BF"], [24, "mov rax, [rbp+var_8]"], [25, "mov eax, [rax]"], [26, "mov edi, eax"], [27, "call sub_401A54"], [28, "jmp short loc_4028C5"], [29, "mov rax, [rbp+var_8]"], [30, "mov eax, [rax]"], [31, "mov [rbp+var_1C], eax"], [32, "mov [rbp+var_14], 0"], [33, "mov [rbp+var_C], 1"], [34, "jmp short loc_4028F8"], [35, "mov eax, [rbp+var_1C]"], [36, "and eax, [rbp+var_C]"], [37, "test eax, eax"], [38, "jnz short loc_4028F1"], [39, "mov eax, [rbp+var_10]"], [40, "shl eax, 5"], [41, "mov edx, eax"], [42, "mov eax, [rbp+var_14]"], [43, "add eax, edx"], [44, "jmp short locret_402912"], [45, "add [rbp+var_14], 1"], [46, "shl [rbp+var_C], 1"], [47, "cmp [rbp+var_14], 1Fh"], [48, "jbe short loc_4028D8"], [49, "add [rbp+var_10], 1"], [50, "add [rbp+var_8], 4"], [51, "mov eax, [rbp+var_10]"], [52, "cmp eax, [rbp+var_18]"], [53, "jb short loc_40289B"], [54, "mov eax, [rbp+var_2C]"], [55, "leave"], [56, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [8, 7], [11, 4], [12, 11], [13, 12], [14, 13], [17, 6], [17, 50], [18, 17], [19, 18], [20, 19], [22, 21], [23, 22], [24, 50], [24, 6], [25, 24], [26, 25], [29, 50], [29, 6], [30, 29], [31, 30], [31, 27], [35, 31], [36, 46], [36, 33], [36, 35], [37, 36], [38, 37], [39, 49], [39, 15], [40, 39], [41, 40], [42, 45], [42, 32], [43, 42], [43, 41], [45, 45], [45, 32], [46, 33], [46, 46], [47, 45], [47, 32], [48, 47], [49, 49], [49, 15], [50, 6], [50, 50], [51, 49], [51, 15], [52, 51], [52, 14], [53, 52], [54, 4], [56, 43], [56, 9], [56, 54]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f7a8ad13590a7e4d3989db654ededc2ed1f253ab6c52713b3c2aeeead24a23b5_f7a8ad13590a7e4d3989db654ededc2ed1f253ab6c52713b3c2aeeead24a23b5.jsonl.gz", "strip_func_name": "sub_40285D", "query": "\n\n\n__int64 __fastcall sub_40285D(unsigned int *a1, unsigned int a2)\n{\nunsigned int v3; // eax\nunsigned int v4; // [rsp+1Ch] [rbp-14h]\nunsigned int i; // [rsp+20h] [rbp-10h]\nint v6; // [rsp+24h] [rbp-Ch]\n\nif ( !a2 )\nreturn 0LL;\nfor ( i = 0; i < (unsigned int)(((unsigned __int64)a2 + 31) >> 5); ++i )\n{\nif ( *a1 != -1 )\n{\nif ( dword_409648 )\nv3 = sub_401A54(*a1);\nelse\nv3 = *a1;\nv4 = 0;\nv6 = 1;\nwhile ( v4 <= 0x1F )\n{\nif ( (v6 & v3) == 0 )\nreturn 32 * i + v4;\n++v4;\nv6 *= 2;\n}\n}\n++a1;\n}\nreturn a2;\n}\n\n\n\nQ:[a1,a2,v4,i,v6,sub_40285D,sub_401A54,]", "hints": "[]", "response": "{'a1': 'addr', 'a2': 'size', 'v4': 'bit', 'i': 'longword', 'v6': 'mask', 'sub_40285D': 'find_first_zero_bit', 'sub_401A54': 'swap32'}"}
[ [ 0.806275486946106, 0.7783613204956055, 0.7730275988578796, 0.745048999786377, 0.7337884306907654, 0.7186312675476074, 0.7168822288513184, 0.7033040523529053, 0.7027692794799805, 0.7021000385284424, 0.7019021511077881, 0.6997412443161011, 0.6994502544403076, 0.6961514949798584, 0.6945978403091431, 0.6807795763015747, 0.6798524260520935, 0.6766371726989746, 0.676531970500946, 0.6735454797744751 ], [ 197897, 14223, 188579, 16846, 249011, 215033, 100095, 160081, 146347, 67504, 231664, 264490, 211253, 185595, 188573, 25797, 254570, 132346, 202079, 23688 ] ]
draw_line
97d575adf2eb45831d90b57b6bbcb4cafb66dc3e1c7676469c6b8e0b5afce876
tenox7
ttyplot
NA
static void draw_line(int x, int ph, int l1, int l2, cchar_t *c1, cchar_t *c2, cchar_t *hce, cchar_t *lce) { static cchar_t space = {.attr = A_REVERSE, .chars = {' ', '\0'}}; cchar_t c1r = *c1, c2r = *c2; c1r.attr |= A_REVERSE; c2r.attr |= A_REVERSE; if (l1 > l2) { mvvline_set(ph + 1 - l1, x, c1, l1 - l2); mvvline_set(ph + 1 - l2, x, &c2r, l2); } else if (l1 < l2) { mvvline_set(ph + 1 - l2, x, (c2 == hce || c2 == lce) ? &c2r : &space, l2 - l1); mvvline_set(ph + 1 - l1, x, &c2r, l1); } else { mvvline_set(ph + 1 - l2, x, &c2r, l2); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401781", "function_addr": 4200321, "binary_name": "97d575adf2eb45831d90b57b6bbcb4cafb66dc3e1c7676469c6b8e0b5afce876.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_4], edi"], [4, "mov [rbp+var_8], esi"], [5, "mov [rbp+var_C], edx"], [6, "mov dword ptr [rbp+var_14+4], ecx"], [7, "mov dword ptr [rbp+var_14], r8d"], [8, "mov [rbp+var_18], r9d"], [9, "mov eax, [rbp+var_C]"], [10, "cmp eax, dword ptr [rbp+var_14+4]"], [11, "jle loc_401834"], [12, "mov eax, [rbp+var_8]"], [13, "add eax, 1"], [14, "sub eax, [rbp+var_C]"], [15, "mov ecx, eax"], [16, "mov rax, cs:stdscr"], [17, "mov edx, [rbp+var_4]"], [18, "mov esi, ecx"], [19, "mov rdi, rax"], [20, "call _wmove"], [21, "cmp eax, 0FFFFFFFFh"], [22, "jz short loc_4017E9"], [23, "mov eax, [rbp+var_C]"], [24, "sub eax, dword ptr [rbp+var_14+4]"], [25, "mov edx, eax"], [26, "mov rax, cs:stdscr"], [27, "mov ecx, dword ptr [rbp+var_14]"], [28, "mov esi, ecx"], [29, "mov rdi, rax"], [30, "call _wvline"], [31, "mov eax, [rbp+var_8]"], [32, "add eax, 1"], [33, "sub eax, dword ptr [rbp+var_14+4]"], [34, "mov ecx, eax"], [35, "mov rax, cs:stdscr"], [36, "mov edx, [rbp+var_4]"], [37, "mov esi, ecx"], [38, "mov rdi, rax"], [39, "call _wmove"], [40, "cmp eax, 0FFFFFFFFh"], [41, "jz loc_401924"], [42, "mov eax, [rbp+var_18]"], [43, "or eax, 40000h"], [44, "mov ecx, eax"], [45, "mov rax, cs:stdscr"], [46, "mov edx, dword ptr [rbp+var_14+4]"], [47, "mov esi, ecx"], [48, "mov rdi, rax"], [49, "call _wvline"], [50, "jmp loc_401924"], [51, "mov eax, [rbp+var_C]"], [52, "cmp eax, dword ptr [rbp+var_14+4]"], [53, "jge loc_4018E2"], [54, "mov eax, [rbp+var_8]"], [55, "add eax, 1"], [56, "sub eax, dword ptr [rbp+var_14+4]"], [57, "mov ecx, eax"], [58, "mov rax, cs:stdscr"], [59, "mov edx, [rbp+var_4]"], [60, "mov esi, ecx"], [61, "mov rdi, rax"], [62, "call _wmove"], [63, "cmp eax, 0FFFFFFFFh"], [64, "jz short loc_40189E"], [65, "mov eax, dword ptr [rbp+var_14+4]"], [66, "sub eax, [rbp+var_C]"], [67, "mov edx, eax"], [68, "mov eax, [rbp+var_18]"], [69, "cmp eax, [rbp+arg_0]"], [70, "jz short loc_40187C"], [71, "mov eax, [rbp+var_18]"], [72, "cmp eax, [rbp+arg_8]"], [73, "jnz short loc_401888"], [74, "mov eax, [rbp+var_18]"], [75, "or eax, 40000h"], [76, "mov ecx, eax"], [77, "jmp short loc_40188D"], [78, "mov ecx, 40020h"], [79, "mov rax, cs:stdscr"], [80, "mov esi, ecx"], [81, "mov rdi, rax"], [82, "call _wvline"], [83, "mov eax, [rbp+var_8]"], [84, "add eax, 1"], [85, "sub eax, [rbp+var_C]"], [86, "mov ecx, eax"], [87, "mov rax, cs:stdscr"], [88, "mov edx, [rbp+var_4]"], [89, "mov esi, ecx"], [90, "mov rdi, rax"], [91, "call _wmove"], [92, "cmp eax, 0FFFFFFFFh"], [93, "jz short loc_401924"], [94, "mov eax, dword ptr [rbp+var_14]"], [95, "or eax, 40000h"], [96, "mov ecx, eax"], [97, "mov rax, cs:stdscr"], [98, "mov edx, [rbp+var_C]"], [99, "mov esi, ecx"], [100, "mov rdi, rax"], [101, "call _wvline"], [102, "jmp short loc_401924"], [103, "mov eax, [rbp+var_8]"], [104, "add eax, 1"], [105, "sub eax, dword ptr [rbp+var_14+4]"], [106, "mov ecx, eax"], [107, "mov rax, cs:stdscr"], [108, "mov edx, [rbp+var_4]"], [109, "mov esi, ecx"], [110, "mov rdi, rax"], [111, "call _wmove"], [112, "cmp eax, 0FFFFFFFFh"], [113, "jz short loc_401924"], [114, "mov eax, [rbp+var_18]"], [115, "or eax, 40000h"], [116, "mov ecx, eax"], [117, "mov rax, cs:stdscr"], [118, "mov edx, dword ptr [rbp+var_14+4]"], [119, "mov esi, ecx"], [120, "mov rdi, rax"], [121, "call _wvline"], [122, "nop"], [123, "leave"], [124, "retn"]], "data_dep": [[9, 5], [10, 6], [10, 9], [11, 10], [12, 4], [13, 12], [14, 13], [14, 5], [15, 14], [17, 3], [18, 15], [19, 16], [21, 20], [22, 21], [23, 5], [24, 23], [24, 6], [25, 24], [27, 7], [28, 27], [29, 26], [31, 4], [32, 31], [33, 6], [33, 32], [34, 33], [36, 3], [37, 34], [38, 35], [40, 39], [41, 40], [42, 8], [43, 42], [44, 43], [46, 6], [47, 44], [48, 45], [51, 5], [52, 51], [52, 6], [53, 52], [54, 4], [55, 54], [56, 55], [56, 6], [57, 56], [59, 3], [60, 57], [61, 58], [63, 62], [64, 63], [65, 6], [66, 5], [66, 65], [67, 66], [68, 8], [69, 68], [70, 69], [71, 8], [72, 4], [72, 71], [73, 72], [74, 8], [75, 74], [76, 75], [80, 76], [80, 78], [81, 79], [83, 4], [84, 83], [85, 84], [85, 5], [86, 85], [88, 3], [89, 86], [90, 87], [92, 91], [93, 92], [94, 7], [95, 94], [96, 95], [98, 5], [99, 96], [100, 97], [103, 4], [104, 103], [105, 6], [105, 104], [106, 105], [108, 3], [109, 106], [110, 107], [112, 111], [113, 112], [114, 8], [115, 114], [116, 115], [118, 6], [119, 116], [120, 117], [124, 111], [124, 49], [124, 101], [124, 39], [124, 91], [124, 121]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/97d575adf2eb45831d90b57b6bbcb4cafb66dc3e1c7676469c6b8e0b5afce876_97d575adf2eb45831d90b57b6bbcb4cafb66dc3e1c7676469c6b8e0b5afce876.jsonl.gz", "strip_func_name": "sub_401781", "query": "\n\n\nint __fastcall sub_401781(int a1, int a2, int a3, int a4, unsigned int a5, int a6, int a7, int a8)\n{\nint result; // eax\nunsigned int v9; // ecx\n\nif ( a3 <= a4 )\n{\nif ( a3 >= a4 )\n{\nresult = wmove(stdscr, a2 + 1 - a4, a1);\nif ( result == -1 )\nreturn result;\nreturn wvline(stdscr, a6 | 0x40000u, a4);\n}\nif ( wmove(stdscr, a2 + 1 - a4, a1) != -1 )\n{\nif ( a6 == a7 || a6 == a8 )\nv9 = a6 | 0x40000;\nelse\nv9 = 262176;\nwvline(stdscr, v9, a4 - a3);\n}\nresult = wmove(stdscr, a2 + 1 - a3, a1);\nif ( result != -1 )\nresult = wvline(stdscr, a5 | 0x40000, a3);\n}\nelse\n{\nif ( wmove(stdscr, a2 + 1 - a3, a1) != -1 )\nwvline(stdscr, a5, a3 - a4);\nresult = wmove(stdscr, a2 + 1 - a4, a1);\nif ( result != -1 )\nreturn wvline(stdscr, a6 | 0x40000u, a4);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,sub_401781,]", "hints": "[]", "response": "{'a3': 'l1', 'a4': 'l2', 'a1': 'x', 'a2': 'ph', 'a5': 'c1', 'a6': 'c2', 'a7': 'hce', 'a8': 'lce', 'sub_401781': 'draw_line'}"}
[ [ 0.7952128648757935, 0.7809872031211853, 0.7787643671035767, 0.7743953466415405, 0.7706828117370605, 0.7632949352264404, 0.7527560591697693, 0.7498316764831543, 0.7491840124130249, 0.7485491037368774, 0.7457343339920044, 0.7321234345436096, 0.7312268018722534, 0.7307805418968201, 0.727547287940979, 0.7270975112915039, 0.7225806713104248, 0.7197475433349609, 0.7189168930053711, 0.7173384428024292 ], [ 160354, 91711, 174129, 28121, 167162, 19524, 9005, 115957, 144681, 160496, 31821, 54330, 221061, 15785, 161177, 2087, 150214, 43272, 73108, 77062 ] ]
parse_dup
1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c
dfguan
purge_dups
NA
int parse_dup(char *s, int l, dup_s *k) { char *q, *r; int i, t; for (i = t = 0, q = s; i <= l; ++i) { if (i < l && s[i] != '\t') continue; s[i] = 0; if (t == 0) k->name= q; else if (t == 1) k->s = strtol(q, &r, 10); else if (t == 2) k->e = strtol(q, &r, 10); else if (t == 3) k->tp = q; ++t, q = i < l? &s[i+1] : 0; } if (t < 2) return -1; return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401F4F", "function_addr": 4202319, "binary_name": "1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_2C], esi"], [5, "mov [rbp+var_38], rdx"], [6, "mov [rbp+var_10], 0"], [7, "mov eax, [rbp+var_10]"], [8, "mov [rbp+var_C], eax"], [9, "mov rax, [rbp+var_28]"], [10, "mov [rbp+nptr], rax"], [11, "jmp loc_402051"], [12, "mov eax, [rbp+var_C]"], [13, "cmp eax, [rbp+var_2C]"], [14, "jge short loc_401F9C"], [15, "mov eax, [rbp+var_C]"], [16, "movsxd rdx, eax"], [17, "mov rax, [rbp+var_28]"], [18, "add rax, rdx"], [19, "movzx eax, byte ptr [rax]"], [20, "cmp al, 9"], [21, "jnz loc_40204C"], [22, "mov eax, [rbp+var_C]"], [23, "movsxd rdx, eax"], [24, "mov rax, [rbp+var_28]"], [25, "add rax, rdx"], [26, "mov byte ptr [rax], 0"], [27, "cmp [rbp+var_10], 0"], [28, "jnz short loc_401FBF"], [29, "mov rax, [rbp+var_38]"], [30, "mov rdx, [rbp+nptr]"], [31, "mov [rax], rdx"], [32, "jmp short loc_402023"], [33, "cmp [rbp+var_10], 1"], [34, "jnz short loc_401FE8"], [35, "lea rcx, [rbp+endptr]"], [36, "mov rax, [rbp+nptr]"], [37, "mov edx, 0Ah"], [38, "mov rsi, rcx"], [39, "mov rdi, rax"], [40, "call _strtol"], [41, "mov edx, eax"], [42, "mov rax, [rbp+var_38]"], [43, "mov [rax+10h], edx"], [44, "jmp short loc_402023"], [45, "cmp [rbp+var_10], 2"], [46, "jnz short loc_402011"], [47, "lea rcx, [rbp+endptr]"], [48, "mov rax, [rbp+nptr]"], [49, "mov edx, 0Ah"], [50, "mov rsi, rcx"], [51, "mov rdi, rax"], [52, "call _strtol"], [53, "mov edx, eax"], [54, "mov rax, [rbp+var_38]"], [55, "mov [rax+14h], edx"], [56, "jmp short loc_402023"], [57, "cmp [rbp+var_10], 3"], [58, "jnz short loc_402023"], [59, "mov rax, [rbp+var_38]"], [60, "mov rdx, [rbp+nptr]"], [61, "mov [rax+8], rdx"], [62, "add [rbp+var_10], 1"], [63, "mov eax, [rbp+var_C]"], [64, "cmp eax, [rbp+var_2C]"], [65, "jge short loc_402041"], [66, "mov eax, [rbp+var_C]"], [67, "cdqe"], [68, "lea rdx, [rax+1]"], [69, "mov rax, [rbp+var_28]"], [70, "add rax, rdx"], [71, "jmp short loc_402046"], [72, "mov eax, 0"], [73, "mov [rbp+nptr], rax"], [74, "jmp short loc_40204D"], [75, "nop"], [76, "add [rbp+var_C], 1"], [77, "mov eax, [rbp+var_C]"], [78, "cmp eax, [rbp+var_2C]"], [79, "jle loc_401F7C"], [80, "cmp [rbp+var_10], 1"], [81, "jg short loc_40206A"], [82, "mov eax, 0FFFFFFFFh"], [83, "jmp short locret_40206F"], [84, "mov eax, 0"], [85, "leave"], [86, "retn"]], "data_dep": [[7, 6], [8, 7], [9, 3], [10, 9], [12, 8], [12, 76], [13, 12], [13, 4], [14, 13], [15, 8], [15, 76], [16, 15], [17, 3], [18, 17], [18, 16], [19, 55], [19, 18], [19, 43], [19, 61], [19, 31], [19, 26], [20, 19], [21, 20], [22, 76], [22, 8], [23, 22], [24, 3], [25, 23], [25, 24], [26, 25], [27, 6], [27, 62], [28, 27], [29, 5], [30, 73], [30, 10], [31, 29], [31, 30], [33, 6], [33, 62], [34, 33], [35, 35], [35, 47], [36, 73], [36, 10], [38, 35], [39, 36], [41, 40], [42, 5], [43, 41], [43, 42], [45, 62], [45, 6], [46, 45], [47, 47], [47, 35], [48, 10], [48, 73], [50, 47], [51, 48], [53, 52], [54, 5], [55, 54], [55, 53], [57, 6], [57, 62], [58, 57], [59, 5], [60, 10], [60, 73], [61, 60], [61, 59], [62, 62], [62, 6], [63, 8], [63, 76], [64, 4], [64, 63], [65, 64], [66, 8], [66, 76], [68, 66], [68, 41], [68, 43], [68, 61], [68, 31], [68, 26], [68, 53], [68, 30], [68, 60], [68, 23], [68, 55], [69, 3], [70, 68], [70, 69], [73, 70], [73, 72], [76, 8], [76, 76], [77, 76], [77, 8], [78, 4], [78, 77], [79, 78], [80, 62], [80, 6], [81, 80], [86, 82], [86, 84]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c_1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c.jsonl.gz", "strip_func_name": "sub_401F4F", "query": "\n\n\n__int64 __fastcall sub_401F4F(char *a1, int a2, __int64 a3)\n{\nchar *v3; // rax\n__int64 result; // rax\nchar *endptr; // [rsp+28h] [rbp-18h] BYREF\nint v7; // [rsp+30h] [rbp-10h]\nint v8; // [rsp+34h] [rbp-Ch]\nchar *nptr; // [rsp+38h] [rbp-8h]\n\nv7 = 0;\nv8 = 0;\nnptr = a1;\nwhile ( v8 <= a2 )\n{\nif ( v8 >= a2 || a1[v8] == 9 )\n{\na1[v8] = 0;\nif ( v7 )\n{\nswitch ( v7 )\n{\ncase 1:\n*(_DWORD *)(a3 + 16) = strtol(nptr, &endptr, 10);\nbreak;\ncase 2:\n*(_DWORD *)(a3 + 20) = strtol(nptr, &endptr, 10);\nbreak;\ncase 3:\n*(_QWORD *)(a3 + 8) = nptr;\nbreak;\n}\n}\nelse\n{\n*(_QWORD *)a3 = nptr;\n}\n++v7;\nif ( v8 >= a2 )\nv3 = 0LL;\nelse\nv3 = &a1[v8 + 1];\nnptr = v3;\n}\n++v8;\n}\nif ( v7 > 1 )\nresult = 0LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\n\n\n\nQ:[a1,a2,endptr,v7,nptr,sub_401F4F,]", "hints": "[]", "response": "{'a1': 's', 'a2': 'l', 'endptr': 'r', 'v7': 't', 'nptr': 'q', 'sub_401F4F': 'parse_dup'}"}
[ [ 0.9095256328582764, 0.905246913433075, 0.8979134559631348, 0.8946491479873657, 0.8928414583206177, 0.891412079334259, 0.8844633102416992, 0.8761774897575378, 0.840876042842865, 0.822523832321167, 0.8190393447875977, 0.7831105589866638, 0.7286408543586731, 0.7266356348991394, 0.7228817939758301, 0.7167076468467712, 0.708191990852356, 0.7059572339057922, 0.7055733799934387, 0.7044605612754822 ], [ 106808, 133546, 34290, 181107, 184826, 260394, 10908, 153434, 146015, 144860, 181628, 65472, 118133, 173255, 94721, 5488, 212020, 78522, 13084, 161049 ] ]
merge_bs
e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149
axboe
fio
NA
static void merge_bs(struct bs **bsap, unsigned int *nr_bsap, struct bs *bsb, unsigned int nr_bsb) { struct bs *bsa = *bsap; unsigned int nr_bsa = *nr_bsap; int a, b; for (b = 0; b < nr_bsb; b++) { int next, found = 0; for (a = 0; a < nr_bsa; a++) { if (bsb[b].bs != bsa[a].bs) continue; bsa[a].nr += bsb[b].nr; bsa[a].merges += bsb[b].merges; found = 1; break; } if (found) continue; next = *nr_bsap; bsa = realloc(bsa, (next + 1) * sizeof(struct bs)); bsa[next].bs = bsb[b].bs; bsa[next].nr = bsb[b].nr; (*nr_bsap)++; *bsap = bsa; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404BDB", "function_addr": 4213723, "binary_name": "e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "mov [rbp+var_3C], ecx"], [7, "mov rax, [rbp+var_28]"], [8, "mov rax, [rax]"], [9, "mov [rbp+ptr], rax"], [10, "mov rax, [rbp+var_30]"], [11, "mov eax, [rax]"], [12, "mov [rbp+var_18], eax"], [13, "mov [rbp+var_10], 0"], [14, "jmp loc_404E2B"], [15, "mov [rbp+var_14], 0"], [16, "mov [rbp+var_C], 0"], [17, "jmp loc_404D3F"], [18, "mov eax, [rbp+var_10]"], [19, "movsxd rdx, eax"], [20, "mov rax, rdx"], [21, "add rax, rax"], [22, "add rax, rdx"], [23, "shl rax, 2"], [24, "mov rdx, rax"], [25, "mov rax, [rbp+var_38]"], [26, "add rax, rdx"], [27, "mov ecx, [rax]"], [28, "mov eax, [rbp+var_C]"], [29, "movsxd rdx, eax"], [30, "mov rax, rdx"], [31, "add rax, rax"], [32, "add rax, rdx"], [33, "shl rax, 2"], [34, "mov rdx, rax"], [35, "mov rax, [rbp+ptr]"], [36, "add rax, rdx"], [37, "mov eax, [rax]"], [38, "cmp ecx, eax"], [39, "jz short loc_404C70"], [40, "add [rbp+var_C], 1"], [41, "jmp loc_404D3F"], [42, "mov eax, [rbp+var_C]"], [43, "movsxd rdx, eax"], [44, "mov rax, rdx"], [45, "add rax, rax"], [46, "add rax, rdx"], [47, "shl rax, 2"], [48, "mov rdx, rax"], [49, "mov rax, [rbp+ptr]"], [50, "add rax, rdx"], [51, "mov esi, [rax+4]"], [52, "mov eax, [rbp+var_10]"], [53, "movsxd rdx, eax"], [54, "mov rax, rdx"], [55, "add rax, rax"], [56, "add rax, rdx"], [57, "shl rax, 2"], [58, "mov rdx, rax"], [59, "mov rax, [rbp+var_38]"], [60, "add rax, rdx"], [61, "mov ecx, [rax+4]"], [62, "mov eax, [rbp+var_C]"], [63, "movsxd rdx, eax"], [64, "mov rax, rdx"], [65, "add rax, rax"], [66, "add rax, rdx"], [67, "shl rax, 2"], [68, "mov rdx, rax"], [69, "mov rax, [rbp+ptr]"], [70, "add rax, rdx"], [71, "lea edx, [rsi+rcx]"], [72, "mov [rax+4], edx"], [73, "mov eax, [rbp+var_C]"], [74, "movsxd rdx, eax"], [75, "mov rax, rdx"], [76, "add rax, rax"], [77, "add rax, rdx"], [78, "shl rax, 2"], [79, "mov rdx, rax"], [80, "mov rax, [rbp+ptr]"], [81, "add rax, rdx"], [82, "mov esi, [rax+8]"], [83, "mov eax, [rbp+var_10]"], [84, "movsxd rdx, eax"], [85, "mov rax, rdx"], [86, "add rax, rax"], [87, "add rax, rdx"], [88, "shl rax, 2"], [89, "mov rdx, rax"], [90, "mov rax, [rbp+var_38]"], [91, "add rax, rdx"], [92, "mov ecx, [rax+8]"], [93, "mov eax, [rbp+var_C]"], [94, "movsxd rdx, eax"], [95, "mov rax, rdx"], [96, "add rax, rax"], [97, "add rax, rdx"], [98, "shl rax, 2"], [99, "mov rdx, rax"], [100, "mov rax, [rbp+ptr]"], [101, "add rax, rdx"], [102, "lea edx, [rsi+rcx]"], [103, "mov [rax+8], edx"], [104, "mov [rbp+var_14], 1"], [105, "jmp short loc_404D4B"], [106, "mov eax, [rbp+var_C]"], [107, "cmp [rbp+var_18], eax"], [108, "ja loc_404C25"], [109, "cmp [rbp+var_14], 0"], [110, "jnz loc_404E26"], [111, "mov rax, [rbp+var_30]"], [112, "mov eax, [rax]"], [113, "mov [rbp+var_1C], eax"], [114, "mov eax, [rbp+var_1C]"], [115, "add eax, 1"], [116, "movsxd rdx, eax"], [117, "mov rax, rdx"], [118, "add rax, rax"], [119, "add rax, rdx"], [120, "shl rax, 2"], [121, "mov rdx, rax"], [122, "mov rax, [rbp+ptr]"], [123, "mov rsi, rdx"], [124, "mov rdi, rax"], [125, "call _realloc"], [126, "mov [rbp+ptr], rax"], [127, "mov eax, [rbp+var_10]"], [128, "movsxd rdx, eax"], [129, "mov rax, rdx"], [130, "add rax, rax"], [131, "add rax, rdx"], [132, "shl rax, 2"], [133, "mov rdx, rax"], [134, "mov rax, [rbp+var_38]"], [135, "lea rcx, [rdx+rax]"], [136, "mov eax, [rbp+var_1C]"], [137, "movsxd rdx, eax"], [138, "mov rax, rdx"], [139, "add rax, rax"], [140, "add rax, rdx"], [141, "shl rax, 2"], [142, "mov rdx, rax"], [143, "mov rax, [rbp+ptr]"], [144, "add rdx, rax"], [145, "mov eax, [rcx]"], [146, "mov [rdx], eax"], [147, "mov eax, [rbp+var_10]"], [148, "movsxd rdx, eax"], [149, "mov rax, rdx"], [150, "add rax, rax"], [151, "add rax, rdx"], [152, "shl rax, 2"], [153, "mov rdx, rax"], [154, "mov rax, [rbp+var_38]"], [155, "lea rcx, [rdx+rax]"], [156, "mov eax, [rbp+var_1C]"], [157, "movsxd rdx, eax"], [158, "mov rax, rdx"], [159, "add rax, rax"], [160, "add rax, rdx"], [161, "shl rax, 2"], [162, "mov rdx, rax"], [163, "mov rax, [rbp+ptr]"], [164, "add rdx, rax"], [165, "mov eax, [rcx+4]"], [166, "mov [rdx+4], eax"], [167, "mov rax, [rbp+var_30]"], [168, "mov eax, [rax]"], [169, "lea edx, [rax+1]"], [170, "mov rax, [rbp+var_30]"], [171, "mov [rax], edx"], [172, "mov rax, [rbp+var_28]"], [173, "mov rdx, [rbp+ptr]"], [174, "mov [rax], rdx"], [175, "jmp short loc_404E27"], [176, "nop"], [177, "add [rbp+var_10], 1"], [178, "mov eax, [rbp+var_10]"], [179, "cmp [rbp+var_3C], eax"], [180, "ja loc_404C12"], [181, "nop"], [182, "nop"], [183, "leave"], [184, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 8], [10, 4], [11, 10], [12, 11], [18, 13], [18, 177], [19, 18], [20, 19], [21, 20], [22, 19], [22, 21], [23, 22], [24, 23], [25, 5], [26, 25], [26, 24], [27, 171], [27, 72], [27, 166], [27, 26], [27, 174], [27, 103], [27, 146], [28, 16], [28, 40], [29, 28], [30, 29], [31, 30], [32, 29], [32, 31], [33, 32], [34, 33], [35, 126], [35, 9], [36, 34], [36, 35], [37, 72], [37, 174], [37, 146], [37, 103], [37, 171], [37, 36], [37, 166], [38, 27], [38, 37], [39, 38], [40, 40], [40, 16], [42, 40], [42, 16], [43, 42], [44, 43], [45, 44], [46, 43], [46, 45], [47, 46], [48, 47], [49, 126], [49, 9], [50, 49], [50, 48], [51, 171], [51, 146], [51, 50], [51, 72], [51, 166], [51, 174], [51, 103], [52, 177], [52, 13], [53, 52], [54, 53], [55, 54], [56, 53], [56, 55], [57, 56], [58, 57], [59, 5], [60, 59], [60, 58], [61, 171], [61, 166], [61, 72], [61, 174], [61, 103], [61, 60], [61, 146], [62, 16], [62, 40], [63, 62], [64, 63], [65, 64], [66, 63], [66, 65], [67, 66], [68, 67], [69, 126], [69, 9], [70, 68], [70, 69], [71, 166], [71, 72], [71, 174], [71, 103], [71, 146], [71, 68], [71, 171], [71, 61], [72, 70], [72, 71], [73, 16], [73, 40], [74, 73], [75, 74], [76, 75], [77, 76], [77, 74], [78, 77], [79, 78], [80, 126], [80, 9], [81, 80], [81, 79], [82, 72], [82, 81], [82, 103], [83, 13], [83, 177], [84, 83], [85, 84], [86, 85], [87, 84], [87, 86], [88, 87], [89, 88], [90, 5], [91, 89], [91, 90], [92, 72], [92, 103], [92, 91], [93, 40], [93, 16], [94, 93], [95, 94], [96, 95], [97, 94], [97, 96], [98, 97], [99, 98], [100, 126], [100, 9], [101, 99], [101, 100], [102, 72], [102, 99], [102, 92], [103, 102], [103, 101], [106, 40], [106, 16], [107, 106], [107, 12], [108, 107], [109, 104], [109, 15], [110, 109], [111, 4], [112, 146], [112, 72], [112, 166], [112, 111], [112, 174], [112, 103], [112, 171], [113, 112], [114, 113], [115, 114], [116, 115], [117, 116], [118, 117], [119, 116], [119, 118], [120, 119], [121, 120], [122, 126], [122, 9], [123, 121], [124, 122], [126, 125], [127, 177], [127, 13], [128, 127], [129, 128], [130, 129], [131, 128], [131, 130], [132, 131], [133, 132], [134, 5], [135, 92], [135, 174], [135, 103], [135, 171], [135, 27], [135, 146], [135, 155], [135, 166], [135, 134], [135, 72], [136, 113], [137, 136], [138, 137], [139, 138], [140, 137], [140, 139], [141, 140], [142, 141], [143, 126], [144, 143], [144, 142], [145, 174], [145, 103], [145, 135], [145, 171], [145, 146], [145, 166], [145, 72], [146, 145], [146, 144], [147, 13], [147, 177], [148, 147], [149, 148], [150, 149], [151, 148], [151, 150], [152, 151], [153, 152], [154, 5], [155, 135], [155, 146], [155, 154], [156, 113], [157, 156], [158, 157], [159, 158], [160, 157], [160, 159], [161, 160], [162, 161], [163, 126], [164, 162], [164, 163], [165, 146], [165, 155], [166, 165], [166, 164], [167, 4], [168, 166], [168, 174], [168, 167], [169, 164], [169, 166], [169, 168], [170, 4], [171, 170], [171, 169], [172, 3], [173, 126], [174, 173], [174, 172], [177, 13], [177, 177], [178, 13], [178, 177], [179, 178], [179, 6], [180, 179], [184, 178]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149_e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149.jsonl.gz", "strip_func_name": "sub_404BDB", "query": "\n\n\n__int64 __fastcall sub_404BDB(void **a1, unsigned int *a2, __int64 a3, unsigned int a4)\n{\n__int64 result; // rax\nunsigned int v7; // [rsp+24h] [rbp-1Ch]\nunsigned int v8; // [rsp+28h] [rbp-18h]\nint v9; // [rsp+2Ch] [rbp-14h]\nunsigned int i; // [rsp+30h] [rbp-10h]\nunsigned int j; // [rsp+34h] [rbp-Ch]\n_DWORD *ptr; // [rsp+38h] [rbp-8h]\n\nptr = *a1;\nv8 = *a2;\nfor ( i = 0; ; ++i )\n{\nresult = i;\nif ( a4 <= i )\nbreak;\nv9 = 0;\nfor ( j = 0; v8 > j; ++j )\n{\nif ( *(_DWORD *)(12LL * (int)i + a3) == ptr[3 * j] )\n{\nptr[3 * j + 1] += *(_DWORD *)(12LL * (int)i + a3 + 4);\nptr[3 * j + 2] += *(_DWORD *)(12LL * (int)i + a3 + 8);\nv9 = 1;\nbreak;\n}\n}\nif ( !v9 )\n{\nv7 = *a2;\nptr = realloc(ptr, 12LL * (int)(*a2 + 1));\nptr[3 * v7] = *(_DWORD *)(12LL * (int)i + a3);\nptr[3 * v7 + 1] = *(_DWORD *)(12LL * (int)i + a3 + 4);\n++*a2;\n*a1 = ptr;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,v7,v8,v9,i,j,ptr,sub_404BDB,]", "hints": "[]", "response": "{'a3': 'bsb', 'a4': 'nr_bsb', 'a1': 'bsap', 'a2': 'nr_bsap', 'v7': 'next', 'v8': 'nr_bsa', 'v9': 'found', 'i': 'b', 'j': 'a', 'ptr': 'bsa', 'sub_404BDB': 'merge_bs'}"}
[ [ 0.8157634735107422, 0.7880187630653381, 0.7776628136634827, 0.7571138739585876, 0.7444229125976562, 0.7331548929214478, 0.7310141921043396, 0.7304041385650635, 0.7299014925956726, 0.7261762619018555, 0.7173012495040894, 0.7153115272521973, 0.7139139771461487, 0.7101287841796875, 0.7089630961418152, 0.7066921591758728, 0.7048210501670837, 0.7031160593032837, 0.7028905153274536, 0.7024367451667786 ], [ 224806, 18009, 224456, 252486, 129912, 33075, 251563, 20406, 250702, 212523, 3986, 251571, 107850, 241777, 254543, 90267, 149546, 19237, 231379, 242824 ] ]
parse_events
3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa
xenogenesi
hidclient
NA
int parse_events ( fd_set * efds, int sockdesc ) { int i, j; signed char c; unsigned char u; char buf[sizeof(struct input_event)]; char hidrep[32]; // mouse ~6, keyboard ~11 chars struct input_event * inevent = (void *)buf; struct hidrep_mouse_t * evmouse = (void *)hidrep; struct hidrep_keyb_t * evkeyb = (void *)hidrep; if ( efds == NULL ) { return -1; } for ( i = 0; i < MAXEVDEVS; ++i ) { if ( 0 > eventdevs[i] ) continue; if ( ! ( FD_ISSET ( eventdevs[i], efds ) ) ) continue; j = read ( eventdevs[i], buf, sizeof(struct input_event) ); if ( j == 0 ) { if ( debugevents & 0x1 ) fprintf(stderr,"."); continue; } if ( -1 == j ) { if ( debugevents & 0x1 ) { if ( errno > 0 ) { fprintf(stderr,"%d|%d(%s) (expected %d bytes). ",eventdevs[i],errno,strerror(errno), (int)sizeof(struct input_event)); } else { fprintf(stderr,"j=-1,errno<=0..."); } } continue; } if ( sizeof(struct input_event) > j ) { // exactly 24 on 64bit, (16 on 32bit): sizeof(struct input_event) // chars expected != got: data invalid, drop it! continue; } fprintf(stderr," read(%d)from(%d) ", j, i ); if ( debugevents & 0x1 ) fprintf ( stdout, "EVENT{%04X %04X %08X}\n", inevent->type, inevent->code, inevent->value ); switch ( inevent->type ) { case EV_SYN: break; case EV_KEY: u = 1; // Modifier keys switch ( inevent->code ) { // *** Mouse button events case BTN_LEFT: case BTN_RIGHT: case BTN_MIDDLE: c = 1 << (inevent->code & 0x03); mousebuttons = mousebuttons & (0x07-c); if ( inevent->value == 1 ) // Key has been pressed DOWN { mousebuttons=mousebuttons | c; } evmouse->btcode = 0xA1; evmouse->rep_id = REPORTID_MOUSE; evmouse->button = mousebuttons & 0x07; evmouse->axis_x = evmouse->axis_y = evmouse->axis_z = 0; if ( ! connectionok ) break; j = send ( sockdesc, evmouse, sizeof(struct hidrep_mouse_t), MSG_NOSIGNAL ); if ( 1 > j ) { return -1; } break; // *** Special key: PAUSE case KEY_PAUSE: // When pressed: abort connection if ( inevent->value == 0 ) { if ( connectionok ) { evkeyb->btcode=0xA1; evkeyb->rep_id=REPORTID_KEYBD; memset ( evkeyb->key, 0, 8 ); evkeyb->modify = 0; j = send ( sockdesc, evkeyb, sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); close ( sockdesc ); } // If also LCtrl+Alt pressed: // Terminate program if (( modifierkeys & 0x5 ) == 0x5 ) { return -99; } return -1; } break; // *** "Modifier" key events case KEY_RIGHTMETA: u <<= 1; case KEY_RIGHTALT: u <<= 1; case KEY_RIGHTSHIFT: u <<= 1; case KEY_RIGHTCTRL: u <<= 1; case KEY_LEFTMETA: u <<= 1; case KEY_LEFTALT: u <<= 1; case KEY_LEFTSHIFT: u <<= 1; case KEY_LEFTCTRL: evkeyb->btcode = 0xA1; evkeyb->rep_id = REPORTID_KEYBD; memcpy ( evkeyb->key, pressedkey, 8 ); modifierkeys &= ( 0xff - u ); if ( inevent->value >= 1 ) { modifierkeys |= u; } evkeyb->modify = modifierkeys; j = send ( sockdesc, evkeyb, sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); if ( 1 > j ) { return -1; } break; // *** Regular key events case KEY_KPDOT: ++u; // Keypad Dot ~ 99 case KEY_KP0: ++u; // code 98... case KEY_KP9: ++u; // countdown... case KEY_KP8: ++u; case KEY_KP7: ++u; case KEY_KP6: ++u; case KEY_KP5: ++u; case KEY_KP4: ++u; case KEY_KP3: ++u; case KEY_KP2: ++u; case KEY_KP1: ++u; case KEY_KPENTER: ++u; case KEY_KPPLUS: ++u; case KEY_KPMINUS: ++u; case KEY_KPASTERISK: ++u; case KEY_KPSLASH: ++u; case KEY_NUMLOCK: ++u; case KEY_UP: ++u; case KEY_DOWN: ++u; case KEY_LEFT: ++u; case KEY_RIGHT: ++u; case KEY_PAGEDOWN: ++u; case KEY_END: ++u; case KEY_DELETE: ++u; case KEY_PAGEUP: ++u; case KEY_HOME: ++u; case KEY_INSERT: ++u; ++u; //[Pause] key // - checked separately case KEY_SCROLLLOCK: ++u; case KEY_SYSRQ: ++u; //[printscr] case KEY_F12: ++u; //F12=> code 69 case KEY_F11: ++u; case KEY_F10: ++u; case KEY_F9: ++u; case KEY_F8: ++u; case KEY_F7: ++u; case KEY_F6: ++u; case KEY_F5: ++u; case KEY_F4: ++u; case KEY_F3: ++u; case KEY_F2: ++u; case KEY_F1: ++u; case KEY_CAPSLOCK: ++u; case KEY_SLASH: ++u; case KEY_DOT: ++u; case KEY_COMMA: ++u; case KEY_GRAVE: ++u; case KEY_APOSTROPHE: ++u; case KEY_SEMICOLON: ++u; case KEY_102ND: ++u; case KEY_BACKSLASH: ++u; case KEY_RIGHTBRACE: ++u; case KEY_LEFTBRACE: ++u; case KEY_EQUAL: ++u; case KEY_MINUS: ++u; case KEY_SPACE: ++u; case KEY_TAB: ++u; case KEY_BACKSPACE: ++u; case KEY_ESC: ++u; case KEY_ENTER: ++u; //Return=> code 40 case KEY_0: ++u; case KEY_9: ++u; case KEY_8: ++u; case KEY_7: ++u; case KEY_6: ++u; case KEY_5: ++u; case KEY_4: ++u; case KEY_3: ++u; case KEY_2: ++u; case KEY_1: ++u; case KEY_Z: ++u; case KEY_Y: ++u; case KEY_X: ++u; case KEY_W: ++u; case KEY_V: ++u; case KEY_U: ++u; case KEY_T: ++u; case KEY_S: ++u; case KEY_R: ++u; case KEY_Q: ++u; case KEY_P: ++u; case KEY_O: ++u; case KEY_N: ++u; case KEY_M: ++u; case KEY_L: ++u; case KEY_K: ++u; case KEY_J: ++u; case KEY_I: ++u; case KEY_H: ++u; case KEY_G: ++u; case KEY_F: ++u; case KEY_E: ++u; case KEY_D: ++u; case KEY_C: ++u; case KEY_B: ++u; case KEY_A: u +=3; // A => 4 evkeyb->btcode = 0xA1; evkeyb->rep_id = REPORTID_KEYBD; if ( inevent->value == 1 ) { // "Key down": Add to list of // currently pressed keys for ( j = 0; j < 8; ++j ) { if (pressedkey[j] == 0) { pressedkey[j]=u; j = 8; } else if(pressedkey[j] == u) { j = 8; } } } else if ( inevent->value == 0 ) { // KEY UP: Remove from array for ( j = 0; j < 8; ++j ) { if ( pressedkey[j] == u ) { while ( j < 7 ) { pressedkey[j] = pressedkey[j+1]; ++j; } pressedkey[7] = 0; } } } else // "Key repeat" event { ; // This should be handled // by the remote side, not us. } memcpy ( evkeyb->key, pressedkey, 8 ); evkeyb->modify = modifierkeys; if ( ! connectionok ) break; j = send ( sockdesc, evkeyb, sizeof(struct hidrep_keyb_t), MSG_NOSIGNAL ); if ( 1 > j ) { // If sending data fails, // abort connection return -1; } break; default: // Unknown key usage - ignore that ; } break; // *** Mouse movement events case EV_REL: switch ( inevent->code ) { case ABS_X: case ABS_Y: case ABS_Z: case REL_WHEEL: evmouse->btcode = 0xA1; evmouse->rep_id = REPORTID_MOUSE; evmouse->button = mousebuttons & 0x07; evmouse->axis_x = ( inevent->code == ABS_X ? inevent->value : 0 ); evmouse->axis_y = ( inevent->code == ABS_Y ? inevent->value : 0 ); evmouse->axis_z = ( inevent->code >= ABS_Z ? inevent->value : 0 ); if ( ! connectionok ) break; j = send ( sockdesc, evmouse, sizeof(struct hidrep_mouse_t), MSG_NOSIGNAL ); if ( 1 > j ) { return -1; } break; } break; // *** Various events we do not know. Ignore those. case EV_ABS: case EV_MSC: case EV_LED: case EV_SND: case EV_REP: case EV_FF: case EV_PWR: case EV_FF_STATUS: break; } } return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4039B0", "function_addr": 4209072, "binary_name": "3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 88h"], [4, "mov [rbp+var_88], rdi"], [5, "mov [rbp+fd], esi"], [6, "lea rax, [rbp+buf]"], [7, "mov [rbp+var_28], rax"], [8, "lea rax, [rbp+var_80]"], [9, "mov [rbp+var_30], rax"], [10, "lea rax, [rbp+var_80]"], [11, "mov [rbp+var_38], rax"], [12, "cmp [rbp+var_88], 0"], [13, "jnz short loc_4039F5"], [14, "mov eax, 0FFFFFFFFh"], [15, "jmp loc_404218"], [16, "mov [rbp+var_14], 0"], [17, "jmp loc_404209"], [18, "mov eax, [rbp+var_14]"], [19, "cdqe"], [20, "mov eax, ds:fd[rax*4]"], [21, "test eax, eax"], [22, "js loc_4041F2"], [23, "mov eax, [rbp+var_14]"], [24, "cdqe"], [25, "mov eax, ds:fd[rax*4]"], [26, "lea edx, [rax+3Fh]"], [27, "test eax, eax"], [28, "cmovs eax, edx"], [29, "sar eax, 6"], [30, "mov edx, eax"], [31, "mov rax, [rbp+var_88]"], [32, "movsxd rdx, edx"], [33, "mov rsi, [rax+rdx*8]"], [34, "mov eax, [rbp+var_14]"], [35, "cdqe"], [36, "mov eax, ds:fd[rax*4]"], [37, "cdq"], [38, "shr edx, 1Ah"], [39, "add eax, edx"], [40, "and eax, 3Fh"], [41, "sub eax, edx"], [42, "mov edx, 1"], [43, "mov ecx, eax"], [44, "shl rdx, cl"], [45, "mov rax, rdx"], [46, "and rax, rsi"], [47, "test rax, rax"], [48, "jz loc_4041F5"], [49, "mov eax, [rbp+var_14]"], [50, "cdqe"], [51, "mov eax, ds:fd[rax*4]"], [52, "lea rcx, [rbp+buf]"], [53, "mov edx, 18h"], [54, "mov rsi, rcx"], [55, "mov edi, eax"], [56, "call _read"], [57, "mov [rbp+var_18], eax"], [58, "cmp [rbp+var_18], 0"], [59, "jnz short loc_403ABE"], [60, "mov eax, cs:dword_4082F8"], [61, "and eax, 1"], [62, "test eax, eax"], [63, "jz loc_4041F8"], [64, "mov rax, cs:stderr"], [65, "mov rsi, rax"], [66, "mov edi, 2Eh "], [67, "call _fputc"], [68, "jmp loc_4041F8"], [69, "cmp [rbp+var_18], 0FFFFFFFFh"], [70, "jnz loc_403B52"], [71, "mov eax, cs:dword_4082F8"], [72, "and eax, 1"], [73, "test eax, eax"], [74, "jz loc_4041FB"], [75, "call ___errno_location"], [76, "mov eax, [rax]"], [77, "test eax, eax"], [78, "jle short loc_403B2F"], [79, "call ___errno_location"], [80, "mov eax, [rax]"], [81, "mov edi, eax"], [82, "call _strerror"], [83, "mov rbx, rax"], [84, "call ___errno_location"], [85, "mov ecx, [rax]"], [86, "mov eax, [rbp+var_14]"], [87, "cdqe"], [88, "mov edx, ds:fd[rax*4]"], [89, "mov rax, cs:stderr"], [90, "mov r9d, 18h"], [91, "mov r8, rbx"], [92, "mov esi, offset aDDSExpectedDBy"], [93, "mov rdi, rax"], [94, "mov eax, 0"], [95, "call _fprintf"], [96, "jmp loc_4041FB"], [97, "mov rax, cs:stderr"], [98, "mov rcx, rax"], [99, "mov edx, 10h"], [100, "mov esi, 1"], [101, "mov edi, offset aJ1Errno0"], [102, "call _fwrite"], [103, "jmp loc_4041FB"], [104, "mov eax, [rbp+var_18]"], [105, "cmp eax, 17h"], [106, "jbe loc_4041FE"], [107, "mov rax, cs:stderr"], [108, "mov ecx, [rbp+var_14]"], [109, "mov edx, [rbp+var_18]"], [110, "mov esi, offset aReadDFromD"], [111, "mov rdi, rax"], [112, "mov eax, 0"], [113, "call _fprintf"], [114, "mov eax, cs:dword_4082F8"], [115, "and eax, 1"], [116, "test eax, eax"], [117, "jz short loc_403BC3"], [118, "mov rax, [rbp+var_28]"], [119, "mov esi, [rax+14h]"], [120, "mov rax, [rbp+var_28]"], [121, "movzx eax, word ptr [rax+12h]"], [122, "movzx ecx, ax"], [123, "mov rax, [rbp+var_28]"], [124, "movzx eax, word ptr [rax+10h]"], [125, "movzx edx, ax"], [126, "mov rax, cs:stdout"], [127, "mov r8d, esi"], [128, "mov esi, offset aEvent04x04x08x"], [129, "mov rdi, rax"], [130, "mov eax, 0"], [131, "call _fprintf"], [132, "mov rax, [rbp+var_28]"], [133, "movzx eax, word ptr [rax+10h]"], [134, "movzx eax, ax"], [135, "cmp eax, 17h"], [136, "ja def_403BE1"], [137, "mov eax, eax"], [138, "mov rax, ds:jpt_403BE1[rax*8]"], [139, "jmp rax"], [140, "mov [rbp+var_19], 1"], [141, "mov rax, [rbp+var_28]"], [142, "movzx eax, word ptr [rax+12h]"], [143, "movzx eax, ax"], [144, "cmp eax, 112h"], [145, "ja def_403C07"], [146, "mov eax, eax"], [147, "mov rax, ds:jpt_403C07[rax*8]"], [148, "jmp rax"], [149, "mov rax, [rbp+var_28]"], [150, "movzx eax, word ptr [rax+12h]"], [151, "movzx eax, ax"], [152, "and eax, 3"], [153, "mov edx, 1"], [154, "mov ecx, eax"], [155, "shl edx, cl"], [156, "mov eax, edx"], [157, "mov [rbp+var_39], al"], [158, "movzx eax, [rbp+var_39]"], [159, "mov edx, 7"], [160, "sub edx, eax"], [161, "movzx eax, cs:byte_4082E0"], [162, "and eax, edx"], [163, "mov cs:byte_4082E0, al"], [164, "mov rax, [rbp+var_28]"], [165, "mov eax, [rax+14h]"], [166, "cmp eax, 1"], [167, "jnz short loc_403C5B"], [168, "movzx eax, cs:byte_4082E0"], [169, "or al, [rbp+var_39]"], [170, "mov cs:byte_4082E0, al"], [171, "mov rax, [rbp+var_30]"], [172, "mov byte ptr [rax], 0A1h"], [173, "mov rax, [rbp+var_30]"], [174, "mov byte ptr [rax+1], 1"], [175, "movzx eax, cs:byte_4082E0"], [176, "and eax, 7"], [177, "mov edx, eax"], [178, "mov rax, [rbp+var_30]"], [179, "mov [rax+2], dl"], [180, "mov rax, [rbp+var_30]"], [181, "mov byte ptr [rax+5], 0"], [182, "mov rax, [rbp+var_30]"], [183, "movzx edx, byte ptr [rax+5]"], [184, "mov rax, [rbp+var_30]"], [185, "mov [rax+4], dl"], [186, "mov rax, [rbp+var_30]"], [187, "movzx edx, byte ptr [rax+4]"], [188, "mov rax, [rbp+var_30]"], [189, "mov [rax+3], dl"], [190, "movzx eax, cs:byte_4082F0"], [191, "test al, al"], [192, "jz loc_4040E0"], [193, "mov rsi, [rbp+var_30]"], [194, "mov eax, [rbp+fd]"], [195, "mov ecx, 4000h"], [196, "mov edx, 6"], [197, "mov edi, eax"], [198, "call _send"], [199, "mov [rbp+var_18], eax"], [200, "cmp [rbp+var_18], 0"], [201, "jg loc_4040E6"], [202, "mov eax, 0FFFFFFFFh"], [203, "jmp loc_404218"], [204, "mov rax, [rbp+var_28]"], [205, "mov eax, [rax+14h]"], [206, "test eax, eax"], [207, "jnz loc_4040EC"], [208, "movzx eax, cs:byte_4082F0"], [209, "test al, al"], [210, "jz short loc_403D5A"], [211, "mov rax, [rbp+var_38]"], [212, "mov byte ptr [rax], 0A1h"], [213, "mov rax, [rbp+var_38]"], [214, "mov byte ptr [rax+1], 2"], [215, "mov rax, [rbp+var_38]"], [216, "add rax, 3"], [217, "mov edx, 8"], [218, "mov esi, 0"], [219, "mov rdi, rax"], [220, "call _memset"], [221, "mov rax, [rbp+var_38]"], [222, "mov byte ptr [rax+2], 0"], [223, "mov rsi, [rbp+var_38]"], [224, "mov eax, [rbp+fd]"], [225, "mov ecx, 4000h"], [226, "mov edx, 0Bh"], [227, "mov edi, eax"], [228, "call _send"], [229, "mov [rbp+var_18], eax"], [230, "mov eax, [rbp+fd]"], [231, "mov edi, eax"], [232, "call _close"], [233, "movzx eax, cs:byte_4082E1"], [234, "movsx eax, al"], [235, "and eax, 5"], [236, "cmp eax, 5"], [237, "jnz short loc_403D76"], [238, "mov eax, 0FFFFFF9Dh"], [239, "jmp loc_404218"], [240, "mov eax, 0FFFFFFFFh"], [241, "jmp loc_404218"], [242, "shl [rbp+var_19], 1"], [243, "shl [rbp+var_19], 1"], [244, "shl [rbp+var_19], 1"], [245, "shl [rbp+var_19], 1"], [246, "shl [rbp+var_19], 1"], [247, "shl [rbp+var_19], 1"], [248, "shl [rbp+var_19], 1"], [249, "mov rax, [rbp+var_38]"], [250, "mov byte ptr [rax], 0A1h"], [251, "mov rax, [rbp+var_38]"], [252, "mov byte ptr [rax+1], 2"], [253, "mov rax, [rbp+var_38]"], [254, "lea rdx, [rax+3]"], [255, "mov rax, cs:qword_4082E8"], [256, "mov [rdx], rax"], [257, "movzx eax, [rbp+var_19]"], [258, "not eax"], [259, "mov edx, eax"], [260, "movzx eax, cs:byte_4082E1"], [261, "and eax, edx"], [262, "mov cs:byte_4082E1, al"], [263, "mov rax, [rbp+var_28]"], [264, "mov eax, [rax+14h]"], [265, "test eax, eax"], [266, "jle short loc_403DEB"], [267, "movzx edx, cs:byte_4082E1"], [268, "movzx eax, [rbp+var_19]"], [269, "or eax, edx"], [270, "mov cs:byte_4082E1, al"], [271, "movzx eax, cs:byte_4082E1"], [272, "mov edx, eax"], [273, "mov rax, [rbp+var_38]"], [274, "mov [rax+2], dl"], [275, "mov rsi, [rbp+var_38]"], [276, "mov eax, [rbp+fd]"], [277, "mov ecx, 4000h"], [278, "mov edx, 0Bh"], [279, "mov edi, eax"], [280, "call _send"], [281, "mov [rbp+var_18], eax"], [282, "cmp [rbp+var_18], 0"], [283, "jg loc_4040F2"], [284, "mov eax, 0FFFFFFFFh"], [285, "jmp loc_404218"], [286, "add [rbp+var_19], 1"], [287, "add [rbp+var_19], 1"], [288, "add [rbp+var_19], 1"], [289, "add [rbp+var_19], 1"], [290, "add [rbp+var_19], 1"], [291, "add [rbp+var_19], 1"], [292, "add [rbp+var_19], 1"], [293, "add [rbp+var_19], 1"], [294, "add [rbp+var_19], 1"], [295, "add [rbp+var_19], 1"], [296, "add [rbp+var_19], 1"], [297, "add [rbp+var_19], 1"], [298, "add [rbp+var_19], 1"], [299, "add [rbp+var_19], 1"], [300, "add [rbp+var_19], 1"], [301, "add [rbp+var_19], 1"], [302, "add [rbp+var_19], 1"], [303, "add [rbp+var_19], 1"], [304, "add [rbp+var_19], 1"], [305, "add [rbp+var_19], 1"], [306, "add [rbp+var_19], 1"], [307, "add [rbp+var_19], 1"], [308, "add [rbp+var_19], 1"], [309, "add [rbp+var_19], 1"], [310, "add [rbp+var_19], 1"], [311, "add [rbp+var_19], 1"], [312, "add [rbp+var_19], 1"], [313, "add [rbp+var_19], 1"], [314, "add [rbp+var_19], 1"], [315, "add [rbp+var_19], 1"], [316, "add [rbp+var_19], 1"], [317, "add [rbp+var_19], 1"], [318, "add [rbp+var_19], 1"], [319, "add [rbp+var_19], 1"], [320, "add [rbp+var_19], 1"], [321, "add [rbp+var_19], 1"], [322, "add [rbp+var_19], 1"], [323, "add [rbp+var_19], 1"], [324, "add [rbp+var_19], 1"], [325, "add [rbp+var_19], 1"], [326, "add [rbp+var_19], 1"], [327, "add [rbp+var_19], 1"], [328, "add [rbp+var_19], 1"], [329, "add [rbp+var_19], 1"], [330, "add [rbp+var_19], 1"], [331, "add [rbp+var_19], 1"], [332, "add [rbp+var_19], 1"], [333, "add [rbp+var_19], 1"], [334, "add [rbp+var_19], 1"], [335, "add [rbp+var_19], 1"], [336, "add [rbp+var_19], 1"], [337, "add [rbp+var_19], 1"], [338, "add [rbp+var_19], 1"], [339, "add [rbp+var_19], 1"], [340, "add [rbp+var_19], 1"], [341, "add [rbp+var_19], 1"], [342, "add [rbp+var_19], 1"], [343, "add [rbp+var_19], 1"], [344, "add [rbp+var_19], 1"], [345, "add [rbp+var_19], 1"], [346, "add [rbp+var_19], 1"], [347, "add [rbp+var_19], 1"], [348, "add [rbp+var_19], 1"], [349, "add [rbp+var_19], 1"], [350, "add [rbp+var_19], 1"], [351, "add [rbp+var_19], 1"], [352, "add [rbp+var_19], 1"], [353, "add [rbp+var_19], 1"], [354, "add [rbp+var_19], 1"], [355, "add [rbp+var_19], 1"], [356, "add [rbp+var_19], 1"], [357, "add [rbp+var_19], 1"], [358, "add [rbp+var_19], 1"], [359, "add [rbp+var_19], 1"], [360, "add [rbp+var_19], 1"], [361, "add [rbp+var_19], 1"], [362, "add [rbp+var_19], 1"], [363, "add [rbp+var_19], 1"], [364, "add [rbp+var_19], 1"], [365, "add [rbp+var_19], 1"], [366, "add [rbp+var_19], 1"], [367, "add [rbp+var_19], 1"], [368, "add [rbp+var_19], 1"], [369, "add [rbp+var_19], 1"], [370, "add [rbp+var_19], 1"], [371, "add [rbp+var_19], 1"], [372, "add [rbp+var_19], 1"], [373, "add [rbp+var_19], 1"], [374, "add [rbp+var_19], 1"], [375, "add [rbp+var_19], 1"], [376, "add [rbp+var_19], 1"], [377, "add [rbp+var_19], 1"], [378, "add [rbp+var_19], 1"], [379, "add [rbp+var_19], 1"], [380, "add [rbp+var_19], 1"], [381, "add [rbp+var_19], 3"], [382, "mov rax, [rbp+var_38]"], [383, "mov byte ptr [rax], 0A1h"], [384, "mov rax, [rbp+var_38]"], [385, "mov byte ptr [rax+1], 2"], [386, "mov rax, [rbp+var_28]"], [387, "mov eax, [rax+14h]"], [388, "cmp eax, 1"], [389, "jnz short loc_404023"], [390, "mov [rbp+var_18], 0"], [391, "jmp short loc_40401B"], [392, "mov eax, [rbp+var_18]"], [393, "cdqe"], [394, "movzx eax, byte ptr ds:qword_4082E8[rax]"], [395, "test al, al"], [396, "jnz short loc_403FF9"], [397, "movzx edx, [rbp+var_19]"], [398, "mov eax, [rbp+var_18]"], [399, "cdqe"], [400, "mov byte ptr ds:qword_4082E8[rax], dl"], [401, "mov [rbp+var_18], 8"], [402, "jmp short loc_404017"], [403, "mov eax, [rbp+var_18]"], [404, "cdqe"], [405, "movzx eax, byte ptr ds:qword_4082E8[rax]"], [406, "movsx edx, al"], [407, "movzx eax, [rbp+var_19]"], [408, "cmp edx, eax"], [409, "jnz short loc_404017"], [410, "mov [rbp+var_18], 8"], [411, "add [rbp+var_18], 1"], [412, "cmp [rbp+var_18], 7"], [413, "jle short loc_403FD1"], [414, "jmp short loc_404085"], [415, "mov rax, [rbp+var_28]"], [416, "mov eax, [rax+14h]"], [417, "test eax, eax"], [418, "jnz short loc_404085"], [419, "mov [rbp+var_18], 0"], [420, "jmp short loc_40407F"], [421, "mov eax, [rbp+var_18]"], [422, "cdqe"], [423, "movzx eax, byte ptr ds:qword_4082E8[rax]"], [424, "movsx edx, al"], [425, "movzx eax, [rbp+var_19]"], [426, "cmp edx, eax"], [427, "jnz short loc_40407B"], [428, "jmp short loc_40406E"], [429, "mov eax, [rbp+var_18]"], [430, "add eax, 1"], [431, "cdqe"], [432, "movzx edx, byte ptr ds:qword_4082E8[rax]"], [433, "mov eax, [rbp+var_18]"], [434, "cdqe"], [435, "mov byte ptr ds:qword_4082E8[rax], dl"], [436, "add [rbp+var_18], 1"], [437, "cmp [rbp+var_18], 6"], [438, "jle short loc_404050"], [439, "mov byte ptr cs:qword_4082E8+7, 0"], [440, "add [rbp+var_18], 1"], [441, "cmp [rbp+var_18], 7"], [442, "jle short loc_404037"], [443, "mov rax, [rbp+var_38]"], [444, "lea rdx, [rax+3]"], [445, "mov rax, cs:qword_4082E8"], [446, "mov [rdx], rax"], [447, "movzx eax, cs:byte_4082E1"], [448, "mov edx, eax"], [449, "mov rax, [rbp+var_38]"], [450, "mov [rax+2], dl"], [451, "movzx eax, cs:byte_4082F0"], [452, "test al, al"], [453, "jz short loc_4040F8"], [454, "mov rsi, [rbp+var_38]"], [455, "mov eax, [rbp+fd]"], [456, "mov ecx, 4000h"], [457, "mov edx, 0Bh"], [458, "mov edi, eax"], [459, "call _send"], [460, "mov [rbp+var_18], eax"], [461, "cmp [rbp+var_18], 0"], [462, "jg short loc_4040FE"], [463, "mov eax, 0FFFFFFFFh"], [464, "jmp loc_404218"], [465, "nop"], [466, "jmp def_403C07"], [467, "nop"], [468, "jmp def_403C07"], [469, "nop"], [470, "jmp def_403C07"], [471, "nop"], [472, "jmp def_403C07"], [473, "nop"], [474, "jmp def_403C07"], [475, "nop"], [476, "jmp def_403C07"], [477, "mov rax, [rbp+var_28]"], [478, "movzx eax, word ptr [rax+12h]"], [479, "movzx eax, ax"], [480, "cmp eax, 2"], [481, "jg short loc_40411D"], [482, "test eax, eax"], [483, "jns short loc_404126"], [484, "jmp loc_404204"], [485, "cmp eax, 8"], [486, "jnz loc_404204"], [487, "mov rax, [rbp+var_30]"], [488, "mov byte ptr [rax], 0A1h"], [489, "mov rax, [rbp+var_30]"], [490, "mov byte ptr [rax+1], 1"], [491, "movzx eax, cs:byte_4082E0"], [492, "and eax, 7"], [493, "mov edx, eax"], [494, "mov rax, [rbp+var_30]"], [495, "mov [rax+2], dl"], [496, "mov rax, [rbp+var_28]"], [497, "movzx eax, word ptr [rax+12h]"], [498, "test ax, ax"], [499, "jnz short loc_404160"], [500, "mov rax, [rbp+var_28]"], [501, "mov eax, [rax+14h]"], [502, "mov edx, eax"], [503, "jmp short loc_404165"], [504, "mov edx, 0"], [505, "mov rax, [rbp+var_30]"], [506, "mov [rax+3], dl"], [507, "mov rax, [rbp+var_28]"], [508, "movzx eax, word ptr [rax+12h]"], [509, "cmp ax, 1"], [510, "jnz short loc_404185"], [511, "mov rax, [rbp+var_28]"], [512, "mov eax, [rax+14h]"], [513, "mov edx, eax"], [514, "jmp short loc_40418A"], [515, "mov edx, 0"], [516, "mov rax, [rbp+var_30]"], [517, "mov [rax+4], dl"], [518, "mov rax, [rbp+var_28]"], [519, "movzx eax, word ptr [rax+12h]"], [520, "cmp ax, 1"], [521, "jbe short loc_4041AA"], [522, "mov rax, [rbp+var_28]"], [523, "mov eax, [rax+14h]"], [524, "mov edx, eax"], [525, "jmp short loc_4041AF"], [526, "mov edx, 0"], [527, "mov rax, [rbp+var_30]"], [528, "mov [rax+5], dl"], [529, "movzx eax, cs:byte_4082F0"], [530, "test al, al"], [531, "jz short loc_4041EC"], [532, "mov rsi, [rbp+var_30]"], [533, "mov eax, [rbp+fd]"], [534, "mov ecx, 4000h"], [535, "mov edx, 6"], [536, "mov edi, eax"], [537, "call _send"], [538, "mov [rbp+var_18], eax"], [539, "cmp [rbp+var_18], 0"], [540, "jg short loc_4041EF"], [541, "mov eax, 0FFFFFFFFh"], [542, "jmp short loc_404218"], [543, "nop"], [544, "jmp short loc_404204"], [545, "nop"], [546, "jmp short loc_404204"], [547, "nop"], [548, "jmp short def_403BE1"], [549, "nop"], [550, "jmp short def_403BE1"], [551, "nop"], [552, "jmp short def_403BE1"], [553, "nop"], [554, "jmp short def_403BE1"], [555, "nop"], [556, "jmp short def_403BE1"], [557, "nop"], [558, "jmp short def_403BE1"], [559, "nop"], [560, "add [rbp+var_14], 1"], [561, "cmp [rbp+var_14], 0Fh"], [562, "jle loc_403A01"], [563, "mov eax, 0"], [564, "mov rbx, [rbp+var_8]"], [565, "leave"], [566, "retn"]], "data_dep": [[7, 6], [8, 6], [9, 8], [10, 8], [11, 10], [12, 4], [13, 12], [18, 16], [18, 560], [21, 20], [22, 21], [23, 560], [23, 16], [26, 524], [26, 25], [26, 528], [26, 109], [26, 383], [26, 495], [26, 490], [26, 99], [26, 53], [26, 448], [26, 457], [26, 187], [26, 196], [26, 172], [26, 252], [26, 517], [26, 526], [26, 535], [26, 256], [26, 274], [26, 125], [26, 385], [26, 250], [26, 488], [26, 506], [26, 88], [26, 181], [26, 446], [26, 185], [26, 450], [26, 189], [26, 278], [26, 179], [26, 44], [26, 174], [27, 25], [28, 27], [28, 26], [29, 28], [30, 29], [31, 4], [32, 30], [33, 172], [33, 252], [33, 517], [33, 256], [33, 274], [33, 488], [33, 506], [33, 181], [33, 446], [33, 185], [33, 450], [33, 189], [33, 31], [33, 385], [33, 250], [33, 528], [33, 383], [33, 495], [33, 490], [33, 179], [33, 174], [34, 16], [34, 560], [38, 32], [39, 38], [39, 36], [40, 39], [41, 40], [41, 38], [43, 41], [44, 42], [44, 43], [45, 44], [46, 45], [46, 33], [47, 46], [48, 47], [49, 16], [49, 560], [52, 43], [54, 52], [55, 51], [57, 56], [58, 57], [59, 58], [61, 60], [62, 61], [63, 62], [65, 64], [69, 57], [70, 69], [72, 71], [73, 72], [74, 73], [76, 385], [76, 250], [76, 488], [76, 506], [76, 185], [76, 450], [76, 189], [76, 179], [76, 174], [76, 528], [76, 383], [76, 495], [76, 252], [76, 490], [76, 517], [76, 75], [76, 172], [76, 181], [76, 446], [76, 256], [76, 274], [77, 76], [78, 77], [80, 495], [80, 252], [80, 490], [80, 517], [80, 79], [80, 172], [80, 181], [80, 446], [80, 256], [80, 274], [80, 385], [80, 250], [80, 488], [80, 506], [80, 185], [80, 450], [80, 189], [80, 179], [80, 174], [80, 528], [80, 383], [81, 80], [83, 82], [85, 84], [85, 172], [85, 181], [85, 446], [85, 256], [85, 274], [85, 385], [85, 250], [85, 488], [85, 506], [85, 185], [85, 450], [85, 189], [85, 179], [85, 174], [85, 528], [85, 383], [85, 495], [85, 252], [85, 490], [85, 517], [86, 560], [86, 16], [91, 83], [93, 89], [98, 97], [104, 57], [105, 104], [106, 105], [108, 560], [108, 16], [109, 57], [111, 107], [115, 114], [116, 115], [117, 116], [118, 7], [119, 450], [119, 189], [119, 179], [119, 174], [119, 528], [119, 118], [119, 383], [119, 495], [119, 252], [119, 490], [119, 517], [119, 172], [119, 181], [119, 446], [119, 185], [119, 256], [119, 274], [119, 385], [119, 250], [119, 488], [119, 506], [120, 7], [121, 528], [121, 383], [121, 495], [121, 252], [121, 490], [121, 517], [121, 172], [121, 181], [121, 446], [121, 256], [121, 274], [121, 120], [121, 385], [121, 250], [121, 488], [121, 506], [121, 185], [121, 450], [121, 189], [121, 179], [121, 174], [122, 121], [123, 7], [124, 179], [124, 174], [124, 528], [124, 123], [124, 383], [124, 495], [124, 252], [124, 490], [124, 517], [124, 172], [124, 181], [124, 446], [124, 185], [124, 256], [124, 274], [124, 385], [124, 250], [124, 488], [124, 506], [124, 450], [124, 189], [125, 124], [127, 119], [129, 126], [132, 7], [133, 385], [133, 250], [133, 488], [133, 506], [133, 185], [133, 450], [133, 189], [133, 179], [133, 174], [133, 528], [133, 132], [133, 383], [133, 495], [133, 252], [133, 490], [133, 517], [133, 172], [133, 181], [133, 446], [133, 256], [133, 274], [134, 133], [135, 134], [136, 135], [137, 134], [139, 138], [141, 7], [142, 172], [142, 181], [142, 446], [142, 256], [142, 274], [142, 385], [142, 250], [142, 488], [142, 506], [142, 185], [142, 450], [142, 189], [142, 179], [142, 174], [142, 528], [142, 141], [142, 383], [142, 495], [142, 252], [142, 490], [142, 517], [143, 142], [144, 143], [145, 144], [146, 143], [148, 147], [149, 7], [150, 172], [150, 181], [150, 446], [150, 149], [150, 185], [150, 274], [150, 385], [150, 250], [150, 488], [150, 506], [150, 450], [150, 189], [150, 179], [150, 174], [150, 528], [150, 383], [150, 495], [150, 252], [150, 490], [150, 517], [150, 256], [151, 150], [152, 151], [154, 152], [155, 153], [155, 154], [156, 155], [157, 156], [158, 157], [160, 159], [160, 158], [161, 163], [161, 170], [162, 161], [162, 160], [163, 162], [164, 7], [165, 179], [165, 174], [165, 528], [165, 164], [165, 383], [165, 495], [165, 252], [165, 490], [165, 517], [165, 256], [165, 172], [165, 181], [165, 446], [165, 185], [165, 274], [165, 385], [165, 250], [165, 488], [165, 506], [165, 450], [165, 189], [166, 165], [167, 166], [168, 163], [169, 157], [169, 168], [170, 169], [171, 9], [172, 171], [173, 9], [174, 173], [175, 163], [175, 170], [176, 175], [177, 176], [178, 9], [179, 178], [179, 177], [180, 9], [181, 180], [182, 9], [183, 182], [183, 181], [184, 9], [185, 184], [185, 183], [186, 9], [187, 186], [187, 185], [188, 9], [189, 188], [189, 187], [191, 190], [192, 191], [193, 9], [194, 5], [197, 194], [199, 198], [200, 199], [201, 200], [204, 7], [205, 383], [205, 495], [205, 490], [205, 252], [205, 517], [205, 204], [205, 172], [205, 181], [205, 446], [205, 256], [205, 274], [205, 385], [205, 250], [205, 488], [205, 506], [205, 185], [205, 450], [205, 189], [205, 179], [205, 174], [205, 528], [206, 205], [207, 206], [209, 208], [210, 209], [211, 11], [212, 211], [213, 11], [214, 213], [215, 11], [216, 215], [219, 216], [221, 11], [222, 221], [223, 11], [224, 5], [227, 224], [229, 228], [230, 5], [231, 230], [233, 262], [233, 270], [234, 233], [235, 234], [236, 235], [237, 236], [242, 140], [243, 242], [243, 140], [244, 140], [244, 243], [245, 244], [245, 140], [246, 140], [246, 245], [247, 140], [247, 246], [248, 140], [248, 247], [249, 11], [250, 249], [251, 11], [252, 251], [253, 11], [254, 252], [254, 125], [254, 189], [254, 506], [254, 253], [254, 109], [256, 254], [256, 255], [257, 140], [257, 248], [258, 257], [259, 258], [260, 262], [260, 270], [261, 259], [261, 260], [262, 261], [263, 7], [264, 263], [264, 256], [265, 264], [266, 265], [267, 262], [268, 140], [268, 248], [269, 268], [269, 267], [270, 269], [271, 262], [271, 270], [272, 271], [273, 11], [274, 273], [274, 272], [275, 11], [276, 5], [279, 276], [281, 280], [282, 281], [283, 282], [286, 140], [287, 140], [287, 286], [288, 140], [288, 287], [289, 140], [289, 288], [290, 289], [290, 140], [291, 290], [291, 140], [292, 140], [292, 291], [293, 140], [293, 292], [294, 293], [294, 140], [295, 294], [295, 140], [296, 295], [296, 140], [297, 296], [297, 140], [298, 140], [298, 297], [299, 298], [299, 140], [300, 299], [300, 140], [301, 140], [301, 300], [302, 301], [302, 140], [303, 140], [303, 302], [304, 303], [304, 140], [305, 304], [305, 140], [306, 140], [306, 305], [307, 140], [307, 306], [308, 307], [308, 140], [309, 308], [309, 140], [310, 309], [310, 140], [311, 140], [311, 310], [312, 140], [312, 311], [313, 312], [314, 140], [314, 313], [315, 140], [315, 314], [316, 315], [316, 140], [317, 140], [317, 316], [318, 317], [318, 140], [319, 318], [319, 140], [320, 140], [320, 319], [321, 320], [321, 140], [322, 140], [322, 321], [323, 322], [323, 140], [324, 323], [324, 140], [325, 140], [325, 324], [326, 140], [326, 325], [327, 326], [327, 140], [328, 327], [328, 140], [329, 328], [329, 140], [330, 140], [330, 329], [331, 140], [331, 330], [332, 331], [332, 140], [333, 140], [333, 332], [334, 140], [334, 333], [335, 334], [335, 140], [336, 335], [336, 140], [337, 336], [337, 140], [338, 337], [338, 140], [339, 140], [339, 338], [340, 140], [340, 339], [341, 140], [341, 340], [342, 341], [342, 140], [343, 342], [343, 140], [344, 140], [344, 343], [345, 140], [345, 344], [346, 345], [346, 140], [347, 346], [347, 140], [348, 140], [348, 347], [349, 140], [349, 348], [350, 140], [350, 349], [351, 350], [351, 140], [352, 140], [352, 351], [353, 140], [353, 352], [354, 353], [354, 140], [355, 140], [355, 354], [356, 355], [356, 140], [357, 356], [357, 140], [358, 140], [358, 357], [359, 140], [359, 358], [360, 140], [360, 359], [361, 360], [361, 140], [362, 361], [362, 140], [363, 140], [363, 362], [364, 140], [364, 363], [365, 364], [365, 140], [366, 140], [366, 365], [367, 140], [367, 366], [368, 140], [368, 367], [369, 368], [369, 140], [370, 369], [370, 140], [371, 140], [371, 370], [372, 140], [372, 371], [373, 140], [373, 372], [374, 140], [374, 373], [375, 374], [375, 140], [376, 375], [376, 140], [377, 140], [377, 376], [378, 140], [378, 377], [379, 140], [379, 378], [380, 379], [380, 140], [381, 140], [381, 380], [382, 11], [383, 382], [384, 11], [385, 384], [386, 7], [387, 386], [387, 385], [388, 387], [389, 388], [392, 411], [392, 390], [394, 435], [394, 400], [395, 394], [396, 395], [397, 381], [398, 390], [398, 411], [400, 397], [403, 411], [403, 390], [405, 435], [405, 400], [406, 405], [407, 381], [408, 407], [408, 406], [409, 408], [411, 411], [411, 401], [411, 410], [411, 390], [412, 390], [412, 411], [413, 412], [415, 7], [416, 179], [416, 174], [416, 528], [416, 383], [416, 495], [416, 252], [416, 490], [416, 517], [416, 415], [416, 172], [416, 181], [416, 446], [416, 256], [416, 274], [416, 385], [416, 250], [416, 488], [416, 506], [416, 185], [416, 450], [416, 189], [417, 416], [418, 417], [421, 419], [421, 440], [423, 400], [423, 435], [424, 423], [425, 381], [426, 424], [426, 425], [427, 426], [429, 419], [429, 436], [429, 440], [430, 429], [432, 400], [432, 435], [433, 436], [433, 440], [433, 419], [435, 432], [436, 436], [436, 440], [436, 419], [437, 419], [437, 436], [437, 440], [438, 437], [440, 419], [440, 436], [440, 440], [441, 440], [441, 419], [442, 441], [443, 11], [444, 274], [444, 125], [444, 385], [444, 250], [444, 506], [444, 528], [444, 109], [444, 495], [444, 189], [444, 490], [444, 179], [444, 174], [444, 443], [444, 397], [444, 406], [444, 424], [444, 383], [444, 252], [444, 517], [444, 256], [444, 488], [444, 172], [444, 181], [444, 446], [444, 185], [444, 432], [444, 450], [446, 445], [446, 444], [447, 270], [447, 262], [448, 447], [449, 11], [450, 449], [450, 448], [452, 451], [453, 452], [454, 11], [455, 5], [458, 455], [460, 459], [461, 460], [462, 461], [477, 7], [478, 383], [478, 252], [478, 490], [478, 517], [478, 256], [478, 488], [478, 172], [478, 181], [478, 446], [478, 185], [478, 450], [478, 274], [478, 385], [478, 250], [478, 506], [478, 477], [478, 495], [478, 189], [478, 179], [478, 174], [478, 528], [479, 478], [480, 479], [481, 480], [482, 479], [483, 482], [485, 479], [486, 485], [487, 9], [488, 487], [489, 9], [490, 489], [491, 170], [491, 163], [492, 491], [493, 492], [494, 9], [495, 494], [495, 493], [496, 7], [497, 495], [497, 496], [498, 497], [499, 498], [500, 7], [501, 274], [501, 385], [501, 250], [501, 506], [501, 528], [501, 500], [501, 495], [501, 189], [501, 490], [501, 179], [501, 174], [501, 383], [501, 252], [501, 517], [501, 256], [501, 488], [501, 172], [501, 181], [501, 446], [501, 185], [501, 450], [502, 501], [505, 9], [506, 504], [506, 502], [506, 505], [507, 7], [508, 507], [508, 506], [509, 508], [510, 509], [511, 7], [512, 189], [512, 274], [512, 511], [512, 385], [512, 250], [512, 506], [512, 528], [512, 495], [512, 490], [512, 179], [512, 174], [512, 383], [512, 252], [512, 517], [512, 256], [512, 488], [512, 172], [512, 181], [512, 446], [512, 185], [512, 450], [513, 512], [516, 9], [517, 515], [517, 513], [517, 516], [518, 7], [519, 517], [519, 518], [520, 519], [521, 520], [522, 7], [523, 189], [523, 274], [523, 385], [523, 250], [523, 506], [523, 528], [523, 495], [523, 490], [523, 179], [523, 174], [523, 383], [523, 522], [523, 252], [523, 517], [523, 256], [523, 488], [523, 172], [523, 181], [523, 446], [523, 185], [523, 450], [524, 523], [527, 9], [528, 524], [528, 527], [528, 526], [530, 529], [531, 530], [532, 9], [533, 5], [536, 533], [538, 537], [539, 538], [540, 539], [560, 560], [560, 16], [561, 16], [561, 560], [562, 561], [566, 240], [566, 463], [566, 202], [566, 541], [566, 563], [566, 284], [566, 14], [566, 238]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa_3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.jsonl.gz", "strip_func_name": "sub_4039B0", "query": "\n\n\n__int64 __fastcall sub_4039B0(__int64 a1, int a2)\n{\n__int64 result; // rax\n__int64 v3; // kr00_8\nint *v4; // rax\nchar *v5; // rbx\nint *v6; // rax\nint v7; // edx\nint v8; // edx\nint v9; // edx\nchar v10[32]; // [rsp+10h] [rbp-80h] BYREF\nchar buf[39]; // [rsp+30h] [rbp-60h] BYREF\nchar v12; // [rsp+57h] [rbp-39h]\nvoid *v13; // [rsp+58h] [rbp-38h]\nvoid *v14; // [rsp+60h] [rbp-30h]\nchar *v15; // [rsp+68h] [rbp-28h]\nunsigned __int8 v16; // [rsp+77h] [rbp-19h]\nint j; // [rsp+78h] [rbp-18h]\nunsigned int i; // [rsp+7Ch] [rbp-14h]\n\nv15 = buf;\nv14 = v10;\nv13 = v10;\nif ( !a1 )\nreturn 0xFFFFFFFFLL;\nfor ( i = 0; ; ++i )\n{\nif ( (int)i > 15 )\nreturn 0LL;\nif ( fd[i] >= 0 )\n{\nv3 = fd[i];\nif ( (*(_QWORD *)(a1 + 8LL * (fd[i] / 64)) & (1LL << ((((HIDWORD(v3) >> 26) + v3) & 0x3F) - (HIDWORD(v3) >> 26)))) != 0 )\nbreak;\n}\nLABEL_176:\n;\n}\nj = read(fd[i], buf, 0x18uLL);\nif ( !j )\n{\nif ( (dword_4082F8 & 1) != 0 )\nfputc(46, stderr);\ngoto LABEL_176;\n}\nif ( j == -1 )\n{\nif ( (dword_4082F8 & 1) != 0 )\n{\nif ( *__errno_location() <= 0 )\n{\nfwrite(\"j=-1,errno<=0...\", 1uLL, 0x10uLL, stderr);\n}\nelse\n{\nv4 = __errno_location();\nv5 = strerror(*v4);\nv6 = __errno_location();\nfprintf(stderr, \"%d|%d(%s) (expected %d bytes). \", (unsigned int)fd[i], (unsigned int)*v6, v5, 24LL);\n}\n}\ngoto LABEL_176;\n}\nif ( (unsigned int)j <= 0x17 )\ngoto LABEL_176;\nfprintf(stderr, \" read(%d)from(%d) \", (unsigned int)j, i);\nif ( (dword_4082F8 & 1) != 0 )\nfprintf(\nstdout,\n\"EVENT{%04X %04X %08X}\\n\",\n*((unsigned __int16 *)v15 + 8),\n*((unsigned __int16 *)v15 + 9),\n*((unsigned int *)v15 + 5));\nswitch ( *((_WORD *)v15 + 8) )\n{\ncase 1:\nv16 = 1;\nswitch ( *((_WORD *)v15 + 9) )\n{\ncase 1:\ngoto LABEL_98;\ncase 2:\ngoto LABEL_109;\ncase 3:\ngoto LABEL_108;\ncase 4:\ngoto LABEL_107;\ncase 5:\ngoto LABEL_106;\ncase 6:\ngoto LABEL_105;\ncase 7:\ngoto LABEL_104;\ncase 8:\ngoto LABEL_103;\ncase 9:\ngoto LABEL_102;\ncase 0xA:\ngoto LABEL_101;\ncase 0xB:\ngoto LABEL_100;\ncase 0xC:\ngoto LABEL_94;\ncase 0xD:\ngoto LABEL_93;\ncase 0xE:\ngoto LABEL_97;\ncase 0xF:\ngoto LABEL_96;\ncase 0x10:\ngoto LABEL_119;\ncase 0x11:\ngoto LABEL_113;\ncase 0x12:\ngoto LABEL_131;\ncase 0x13:\ngoto LABEL_118;\ncase 0x14:\ngoto LABEL_116;\ncase 0x15:\ngoto LABEL_111;\ncase 0x16:\ngoto LABEL_115;\ncase 0x17:\ngoto LABEL_127;\ncase 0x18:\ngoto LABEL_121;\ncase 0x19:\ngoto LABEL_120;\ncase 0x1A:\ngoto LABEL_92;\ncase 0x1B:\ngoto LABEL_91;\ncase 0x1C:\ngoto LABEL_99;\ncase 0x1D:\ngoto LABEL_37;\ncase 0x1E:\ngoto LABEL_135;\ncase 0x1F:\ngoto LABEL_117;\ncase 0x20:\ngoto LABEL_132;\ncase 0x21:\ngoto LABEL_130;\ncase 0x22:\ngoto LABEL_129;\ncase 0x23:\ngoto LABEL_128;\ncase 0x24:\ngoto LABEL_126;\ncase 0x25:\ngoto LABEL_125;\ncase 0x26:\ngoto LABEL_124;\ncase 0x27:\ngoto LABEL_88;\ncase 0x28:\ngoto LABEL_87;\ncase 0x29:\ngoto LABEL_86;\ncase 0x2A:\ngoto LABEL_36;\ncase 0x2B:\ngoto LABEL_90;\ncase 0x2C:\ngoto LABEL_110;\ncase 0x2D:\ngoto LABEL_112;\ncase 0x2E:\ngoto LABEL_133;\ncase 0x2F:\ngoto LABEL_114;\ncase 0x30:\ngoto LABEL_134;\ncase 0x31:\ngoto LABEL_122;\ncase 0x32:\ngoto LABEL_123;\ncase 0x33:\ngoto LABEL_85;\ncase 0x34:\ngoto LABEL_84;\ncase 0x35:\ngoto LABEL_83;\ncase 0x36:\ngoto LABEL_32;\ncase 0x37:\ngoto LABEL_55;\ncase 0x38:\ngoto LABEL_35;\ncase 0x39:\ngoto LABEL_95;\ncase 0x3A:\ngoto LABEL_82;\ncase 0x3B:\ngoto LABEL_81;\ncase 0x3C:\ngoto LABEL_80;\ncase 0x3D:\ngoto LABEL_79;\ncase 0x3E:\ngoto LABEL_78;\ncase 0x3F:\ngoto LABEL_77;\ncase 0x40:\ngoto LABEL_76;\ncase 0x41:\ngoto LABEL_75;\ncase 0x42:\ngoto LABEL_74;\ncase 0x43:\ngoto LABEL_73;\ncase 0x44:\ngoto LABEL_72;\ncase 0x45:\ngoto LABEL_57;\ncase 0x46:\ngoto LABEL_68;\ncase 0x47:\ngoto LABEL_45;\ncase 0x48:\ngoto LABEL_44;\ncase 0x49:\ngoto LABEL_43;\ncase 0x4A:\ngoto LABEL_54;\ncase 0x4B:\ngoto LABEL_48;\ncase 0x4C:\ngoto LABEL_47;\ncase 0x4D:\ngoto LABEL_46;\ncase 0x4E:\ngoto LABEL_53;\ncase 0x4F:\ngoto LABEL_51;\ncase 0x50:\ngoto LABEL_50;\ncase 0x51:\ngoto LABEL_49;\ncase 0x52:\ngoto LABEL_42;\ncase 0x53:\n++v16;\nLABEL_42:\n++v16;\nLABEL_43:\n++v16;\nLABEL_44:\n++v16;\nLABEL_45:\n++v16;\nLABEL_46:\n++v16;\nLABEL_47:\n++v16;\nLABEL_48:\n++v16;\nLABEL_49:\n++v16;\nLABEL_50:\n++v16;\nLABEL_51:\n++v16;\ngoto LABEL_52;\ncase 0x56:\ngoto LABEL_89;\ncase 0x57:\ngoto LABEL_71;\ncase 0x58:\ngoto LABEL_70;\ncase 0x60:\nLABEL_52:\n++v16;\nLABEL_53:\n++v16;\nLABEL_54:\n++v16;\nLABEL_55:\n++v16;\ngoto LABEL_56;\ncase 0x61:\ngoto LABEL_33;\ncase 0x62:\nLABEL_56:\n++v16;\nLABEL_57:\n++v16;\ngoto LABEL_58;\ncase 0x63:\ngoto LABEL_69;\ncase 0x64:\ngoto LABEL_31;\ncase 0x66:\ngoto LABEL_66;\ncase 0x67:\nLABEL_58:\n++v16;\ngoto LABEL_59;\ncase 0x68:\ngoto LABEL_65;\ncase 0x69:\ngoto LABEL_60;\ncase 0x6A:\ngoto LABEL_61;\ncase 0x6B:\ngoto LABEL_63;\ncase 0x6C:\nLABEL_59:\n++v16;\nLABEL_60:\n++v16;\nLABEL_61:\n++v16;\ngoto LABEL_62;\ncase 0x6D:\nLABEL_62:\n++v16;\nLABEL_63:\n++v16;\ngoto LABEL_64;\ncase 0x6E:\ngoto LABEL_67;\ncase 0x6F:\nLABEL_64:\n++v16;\nLABEL_65:\n++v16;\nLABEL_66:\n++v16;\nLABEL_67:\n++v16;\n++v16;\nLABEL_68:\n++v16;\nLABEL_69:\n++v16;\nLABEL_70:\n++v16;\nLABEL_71:\n++v16;\nLABEL_72:\n++v16;\nLABEL_73:\n++v16;\nLABEL_74:\n++v16;\nLABEL_75:\n++v16;\nLABEL_76:\n++v16;\nLABEL_77:\n++v16;\nLABEL_78:\n++v16;\nLABEL_79:\n++v16;\nLABEL_80:\n++v16;\nLABEL_81:\n++v16;\nLABEL_82:\n++v16;\nLABEL_83:\n++v16;\nLABEL_84:\n++v16;\nLABEL_85:\n++v16;\nLABEL_86:\n++v16;\nLABEL_87:\n++v16;\nLABEL_88:\n++v16;\nLABEL_89:\n++v16;\nLABEL_90:\n++v16;\nLABEL_91:\n++v16;\nLABEL_92:\n++v16;\nLABEL_93:\n++v16;\nLABEL_94:\n++v16;\nLABEL_95:\n++v16;\nLABEL_96:\n++v16;\nLABEL_97:\n++v16;\nLABEL_98:\n++v16;\nLABEL_99:\n++v16;\nLABEL_100:\n++v16;\nLABEL_101:\n++v16;\nLABEL_102:\n++v16;\nLABEL_103:\n++v16;\nLABEL_104:\n++v16;\nLABEL_105:\n++v16;\nLABEL_106:\n++v16;\nLABEL_107:\n++v16;\nLABEL_108:\n++v16;\nLABEL_109:\n++v16;\nLABEL_110:\n++v16;\nLABEL_111:\n++v16;\nLABEL_112:\n++v16;\nLABEL_113:\n++v16;\nLABEL_114:\n++v16;\nLABEL_115:\n++v16;\nLABEL_116:\n++v16;\nLABEL_117:\n++v16;\nLABEL_118:\n++v16;\nLABEL_119:\n++v16;\nLABEL_120:\n++v16;\nLABEL_121:\n++v16;\nLABEL_122:\n++v16;\nLABEL_123:\n++v16;\nLABEL_124:\n++v16;\nLABEL_125:\n++v16;\nLABEL_126:\n++v16;\nLABEL_127:\n++v16;\nLABEL_128:\n++v16;\nLABEL_129:\n++v16;\nLABEL_130:\n++v16;\nLABEL_131:\n++v16;\nLABEL_132:\n++v16;\nLABEL_133:\n++v16;\nLABEL_134:\n++v16;\nLABEL_135:\nv16 += 3;\n*(_BYTE *)v13 = -95;\n*((_BYTE *)v13 + 1) = 2;\nif ( *((_DWORD *)v15 + 5) == 1 )\n{\nfor ( j = 0; j <= 7; ++j )\n{\nif ( *((_BYTE *)&qword_4082E8 + j) )\n{\nif ( *((char *)&qword_4082E8 + j) == v16 )\nj = 8;\n}\nelse\n{\n*((_BYTE *)&qword_4082E8 + j) = v16;\nj = 8;\n}\n}\n}\nelse if ( !*((_DWORD *)v15 + 5) )\n{\nfor ( j = 0; j <= 7; ++j )\n{\nif ( *((char *)&qword_4082E8 + j) == v16 )\n{\nwhile ( j <= 6 )\n{\n*((_BYTE *)&qword_4082E8 + j) = *((_BYTE *)&qword_4082E8 + j + 1);\n++j;\n}\nHIBYTE(qword_4082E8) = 0;\n}\n}\n}\n*(_QWORD *)((char *)v13 + 3) = qword_4082E8;\n*((_BYTE *)v13 + 2) = byte_4082E1;\nif ( !byte_4082F0 )\ngoto LABEL_176;\nj = send(a2, v13, 0xBuLL, 0x4000);\nif ( j > 0 )\ngoto LABEL_176;\nreturn 0xFFFFFFFFLL;\ncase 0x77:\nif ( *((_DWORD *)v15 + 5) )\ngoto LABEL_176;\nif ( byte_4082F0 )\n{\n*(_BYTE *)v13 = -95;\n*((_BYTE *)v13 + 1) = 2;\nmemset((char *)v13 + 3, 0, 8uLL);\n*((_BYTE *)v13 + 2) = 0;\nj = send(a2, v13, 0xBuLL, 0x4000);\nclose(a2);\n}\nif ( (byte_4082E1 & 5) == 5 )\nresult = 4294967197LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\ncase 0x7D:\ngoto LABEL_34;\ncase 0x7E:\nv16 *= 2;\nLABEL_31:\nv16 *= 2;\nLABEL_32:\nv16 *= 2;\nLABEL_33:\nv16 *= 2;\nLABEL_34:\nv16 *= 2;\nLABEL_35:\nv16 *= 2;\nLABEL_36:\nv16 *= 2;\nLABEL_37:\n*(_BYTE *)v13 = -95;\n*((_BYTE *)v13 + 1) = 2;\n*(_QWORD *)((char *)v13 + 3) = qword_4082E8;\nbyte_4082E1 &= ~v16;\nif ( *((int *)v15 + 5) > 0 )\nbyte_4082E1 |= v16;\n*((_BYTE *)v13 + 2) = byte_4082E1;\nj = send(a2, v13, 0xBuLL, 0x4000);\nif ( j > 0 )\ngoto LABEL_176;\nresult = 0xFFFFFFFFLL;\nbreak;\ncase 0x110:\ncase 0x111:\ncase 0x112:\nv12 = 1 << (*((_WORD *)v15 + 9) & 3);\nbyte_4082E0 &= 7 - v12;\nif ( *((_DWORD *)v15 + 5) == 1 )\nbyte_4082E0 |= v12;\n*(_BYTE *)v14 = -95;\n*((_BYTE *)v14 + 1) = 1;\n*((_BYTE *)v14 + 2) = byte_4082E0 & 7;\n*((_BYTE *)v14 + 5) = 0;\n*((_BYTE *)v14 + 4) = *((_BYTE *)v14 + 5);\n*((_BYTE *)v14 + 3) = *((_BYTE *)v14 + 4);\nif ( !byte_4082F0 )\ngoto LABEL_176;\nj = send(a2, v14, 6uLL, 0x4000);\nif ( j > 0 )\ngoto LABEL_176;\nreturn 0xFFFFFFFFLL;\ndefault:\ngoto LABEL_176;\n}\nbreak;\ncase 2:\nif ( *((unsigned __int16 *)v15 + 9) > 2u && *((_WORD *)v15 + 9) != 8 )\ngoto LABEL_176;\n*(_BYTE *)v14 = -95;\n*((_BYTE *)v14 + 1) = 1;\n*((_BYTE *)v14 + 2) = byte_4082E0 & 7;\nif ( *((_WORD *)v15 + 9) )\nLOBYTE(v7) = 0;\nelse\nv7 = *((_DWORD *)v15 + 5);\n*((_BYTE *)v14 + 3) = v7;\nif ( *((_WORD *)v15 + 9) == 1 )\nv8 = *((_DWORD *)v15 + 5);\nelse\nLOBYTE(v8) = 0;\n*((_BYTE *)v14 + 4) = v8;\nif ( *((_WORD *)v15 + 9) <= 1u )\nLOBYTE(v9) = 0;\nelse\nv9 = *((_DWORD *)v15 + 5);\n*((_BYTE *)v14 + 5) = v9;\nif ( !byte_4082F0 )\ngoto LABEL_176;\nj = send(a2, v14, 6uLL, 0x4000);\nif ( j > 0 )\ngoto LABEL_176;\nresult = 0xFFFFFFFFLL;\nbreak;\ndefault:\ngoto LABEL_176;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v10,v12,v13,v14,v15,v16,sub_4039B0,]", "hints": "[]", "response": "{'a1': 'efds', 'a2': 'sockdesc', 'v10': 'hidrep', 'v12': 'c', 'v13': 'evkeyb', 'v14': 'evmouse', 'v15': 'inevent', 'v16': 'u', 'sub_4039B0': 'parse_events'}"}
[ [ 0.7520956993103027, 0.7183470726013184, 0.716102123260498, 0.7063024044036865, 0.7012202739715576, 0.6993163824081421, 0.6993163824081421, 0.6941739320755005, 0.6889649629592896, 0.6881920695304871, 0.6881920695304871, 0.6868383288383484, 0.686241626739502, 0.6837362051010132, 0.6808608174324036, 0.6772162914276123, 0.6761943101882935, 0.675875723361969, 0.67343670129776, 0.6723026633262634 ], [ 218681, 178822, 198005, 206839, 46494, 169894, 197714, 203395, 116296, 128071, 232117, 81822, 6339, 246781, 229726, 264318, 58605, 52787, 40996, 70616 ] ]
ReplaceCharacters
3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f
yquake2
yquake2
NA
void ReplaceCharacters(char* s, char r, char c) { char* p = s; if (p == 0) { return; } while (*p != 0) { if (*p == r) { *p = c; } p++; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43BDE6", "function_addr": 4439526, "binary_name": "3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.elf_extract.pkl\n"}, "code": [[0, "mov [rsp+var_18], rdi"], [1, "mov ecx, esi"], [2, "mov eax, edx"], [3, "mov edx, ecx"], [4, "mov [rsp+var_1C], dl"], [5, "mov [rsp+var_20], al"], [6, "mov rax, [rsp+var_18]"], [7, "mov [rsp+var_8], rax"], [8, "cmp [rsp+var_8], 0"], [9, "jz short loc_43BE3A"], [10, "jmp short loc_43BE2D"], [11, "mov rax, [rsp+var_8]"], [12, "movzx eax, byte ptr [rax]"], [13, "cmp [rsp+var_1C], al"], [14, "jnz short loc_43BE27"], [15, "mov rax, [rsp+var_8]"], [16, "movzx edx, [rsp+var_20]"], [17, "mov [rax], dl"], [18, "add [rsp+var_8], 1"], [19, "mov rax, [rsp+var_8]"], [20, "movzx eax, byte ptr [rax]"], [21, "test al, al"], [22, "jnz short loc_43BE0D"], [23, "retn"], [24, "nop"], [25, "retn"]], "data_dep": [[3, 1], [4, 3], [5, 2], [6, 0], [7, 6], [8, 7], [9, 8], [11, 7], [11, 18], [12, 11], [12, 17], [13, 4], [13, 12], [14, 13], [15, 7], [15, 18], [16, 5], [17, 15], [17, 16], [18, 7], [18, 18], [19, 18], [19, 7], [20, 17], [20, 19], [21, 20], [22, 21], [23, 21], [25, 6]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f_3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.jsonl.gz", "strip_func_name": "sub_43BDE6", "query": "\n\n\nunsigned __int64 __fastcall sub_43BDE6(_BYTE *a1, char a2, char a3)\n{\nunsigned __int64 result; // rax\n_BYTE *v4; // [rsp+18h] [rbp-8h]\n\nresult = (unsigned __int64)a1;\nv4 = a1;\nif ( a1 )\n{\nwhile ( 1 )\n{\nresult = (unsigned __int8)*v4;\nif ( !(_BYTE)result )\nbreak;\nif ( a2 == *v4 )\n*v4 = a3;\n++v4;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v4,sub_43BDE6,]", "hints": "[]", "response": "{'a3': 'c', 'a1': 's', 'a2': 'r', 'v4': 'p', 'sub_43BDE6': 'ReplaceCharacters'}"}
[ [ 0.781514585018158, 0.7803914546966553, 0.7776042222976685, 0.7659205198287964, 0.7637959122657776, 0.7602234482765198, 0.7543089389801025, 0.7532795667648315, 0.7512999176979065, 0.7392622828483582, 0.7391669154167175, 0.7311130166053772, 0.7278248071670532, 0.7271124124526978, 0.7259633541107178, 0.7232598066329956, 0.7223846912384033, 0.7212436199188232, 0.7207894325256348, 0.7194324135780334 ], [ 21483, 161479, 248500, 19274, 105148, 202338, 124120, 212619, 232950, 223305, 53120, 18849, 13316, 202785, 254024, 202382, 13076, 97233, 45591, 211581 ] ]
getportpoop
5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0
xelerance
Openswan
NA
USHORT getportpoop (pstring, pnum) char * pstring; unsigned int pnum; { struct servent * servent; register int x; register int y; char * whichp = p_tcp; if (o_udpmode) whichp = p_udp; portpoop->name[0] = '?'; /* fast preload */ portpoop->name[1] = '\0'; /* case 1: reverse-lookup of a number; placed first since this case is much more frequent if we're scanning */ if (pnum) { if (pstring) /* one or the other, pleeze */ return (0); x = pnum; /* disabled, see bug #98902. if this is *really* slowing someone * down I'll reconsider. */ /* if (o_nflag) */ /* go faster, skip getservbyblah */ /* goto gp_finish; */ y = htons (x); /* gotta do this -- see Fig.1 below */ servent = getservbyport (y, whichp); if (servent) { y = ntohs (servent->s_port); if (x != y) /* "never happen" */ holler ("Warning: port-bynum mismatch, %d != %d", x, y); strncpy (portpoop->name, servent->s_name, sizeof (portpoop->name)); } /* if servent */ goto gp_finish; } /* if pnum */ /* case 2: resolve a string, but we still give preference to numbers instead of trying to resolve conflicts. None of the entries in *my* extensive /etc/services begins with a digit, so this should "always work" unless you're at 3com and have some company-internal services defined... */ if (pstring) { if (pnum) /* one or the other, pleeze */ return (0); x = atoi (pstring); if (x) return (getportpoop (NULL, x)); /* recurse for numeric-string-arg */ if (o_nflag) /* can't use names! */ return (0); servent = getservbyname (pstring, whichp); if (servent) { strncpy (portpoop->name, servent->s_name, sizeof (portpoop->name)); x = ntohs (servent->s_port); goto gp_finish; } /* if servent */ } /* if pstring */ return (0); /* catches any problems so far */ /* Obligatory netdb.h-inspired rant: servent.s_port is supposed to be an int. Despite this, we still have to treat it as a short when copying it around. Not only that, but we have to convert it *back* into net order for getservbyport to work. Manpages generally aren't clear on all this, but there are plenty of examples in which it is just quietly done. More BSD lossage... since everything getserv* ever deals with is local to our own host, why bother with all this network-order/host-order crap at all?! That should be saved for when we want to actually plug the port[s] into some real network calls -- and guess what, we have to *re*-convert at that point as well. Fuckheads. */ gp_finish: /* Fall here whether or not we have a valid servent at this point, with x containing our [host-order and therefore useful, dammit] port number */ sprintf (portpoop->anum, "%d", x); /* always load any numeric specs! */ portpoop->num = (x & 0xffff); /* ushort, remember... */ return (portpoop->num); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402BCA", "function_addr": 4205514, "binary_name": "5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "sub rsp, 20h"], [5, "mov [rbp+nptr], rdi"], [6, "mov [rbp+var_2C], esi"], [7, "mov [rbp+proto], offset aTcp"], [8, "movzx eax, cs:word_409458"], [9, "test ax, ax"], [10, "jz short loc_402BF8"], [11, "mov [rbp+proto], offset aUdp"], [12, "mov rax, cs:dest"], [13, "mov byte ptr [rax], 3Fh "], [14, "mov rax, cs:dest"], [15, "mov byte ptr [rax+1], 0"], [16, "cmp [rbp+var_2C], 0"], [17, "jz loc_402CAD"], [18, "cmp [rbp+nptr], 0"], [19, "jz short loc_402C28"], [20, "mov eax, 0"], [21, "jmp loc_402D9A"], [22, "mov ebx, [rbp+var_2C]"], [23, "mov eax, ebx"], [24, "movzx eax, ax"], [25, "mov edi, eax"], [26, "call _htons"], [27, "movzx r12d, ax"], [28, "mov rax, [rbp+proto]"], [29, "mov rsi, rax"], [30, "mov edi, r12d"], [31, "call _getservbyport"], [32, "mov [rbp+var_20], rax"], [33, "cmp [rbp+var_20], 0"], [34, "jz loc_402D62"], [35, "mov rax, [rbp+var_20]"], [36, "mov eax, [rax+10h]"], [37, "movzx eax, ax"], [38, "mov edi, eax"], [39, "call _ntohs"], [40, "movzx r12d, ax"], [41, "cmp ebx, r12d"], [42, "jz short loc_402C87"], [43, "mov edx, r12d"], [44, "mov esi, ebx"], [45, "mov edi, offset aWarningPortByn"], [46, "mov eax, 0"], [47, "call sub_4024C2"], [48, "mov rax, [rbp+var_20]"], [49, "mov rax, [rax]"], [50, "mov rdx, cs:dest"], [51, "mov rcx, rdx"], [52, "mov edx, 40h "], [53, "mov rsi, rax"], [54, "mov rdi, rcx"], [55, "call _strncpy"], [56, "jmp loc_402D62"], [57, "cmp [rbp+nptr], 0"], [58, "jz loc_402D5B"], [59, "cmp [rbp+var_2C], 0"], [60, "jz short loc_402CC8"], [61, "mov eax, 0"], [62, "jmp loc_402D9A"], [63, "mov rax, [rbp+nptr]"], [64, "mov rdi, rax"], [65, "call _atoi"], [66, "mov ebx, eax"], [67, "test ebx, ebx"], [68, "jz short loc_402CF0"], [69, "mov esi, ebx"], [70, "mov edi, 0"], [71, "mov eax, 0"], [72, "call sub_402BCA"], [73, "jmp loc_402D9A"], [74, "movzx eax, cs:word_40944E"], [75, "test ax, ax"], [76, "jz short loc_402D06"], [77, "mov eax, 0"], [78, "jmp loc_402D9A"], [79, "mov rdx, [rbp+proto]"], [80, "mov rax, [rbp+nptr]"], [81, "mov rsi, rdx"], [82, "mov rdi, rax"], [83, "call _getservbyname"], [84, "mov [rbp+var_20], rax"], [85, "cmp [rbp+var_20], 0"], [86, "jz short loc_402D5B"], [87, "mov rax, [rbp+var_20]"], [88, "mov rax, [rax]"], [89, "mov rdx, cs:dest"], [90, "mov rcx, rdx"], [91, "mov edx, 40h "], [92, "mov rsi, rax"], [93, "mov rdi, rcx"], [94, "call _strncpy"], [95, "mov rax, [rbp+var_20]"], [96, "mov eax, [rax+10h]"], [97, "movzx eax, ax"], [98, "mov edi, eax"], [99, "call _ntohs"], [100, "movzx ebx, ax"], [101, "jmp short loc_402D63"], [102, "mov eax, 0"], [103, "jmp short loc_402D9A"], [104, "nop"], [105, "mov rax, cs:dest"], [106, "add rax, 40h "], [107, "mov edx, ebx"], [108, "mov esi, offset aD"], [109, "mov rdi, rax"], [110, "mov eax, 0"], [111, "call _sprintf"], [112, "mov rax, cs:dest"], [113, "mov edx, ebx"], [114, "mov [rax+48h], dx"], [115, "mov rax, cs:dest"], [116, "movzx eax, word ptr [rax+48h]"], [117, "add rsp, 20h"], [118, "pop rbx"], [119, "pop r12"], [120, "pop rbp"], [121, "retn"]], "data_dep": [[9, 8], [10, 9], [13, 12], [15, 14], [16, 6], [17, 16], [18, 5], [19, 18], [22, 6], [23, 22], [24, 23], [25, 24], [27, 26], [28, 7], [28, 11], [29, 28], [30, 27], [32, 31], [33, 32], [34, 33], [35, 32], [36, 13], [36, 15], [36, 35], [37, 36], [38, 37], [40, 39], [41, 40], [41, 22], [42, 41], [43, 40], [44, 22], [48, 32], [49, 48], [49, 13], [49, 15], [51, 50], [53, 49], [54, 51], [57, 5], [58, 57], [59, 6], [60, 59], [63, 5], [64, 63], [66, 65], [67, 66], [68, 67], [69, 67], [75, 74], [76, 75], [79, 7], [79, 11], [80, 5], [81, 79], [82, 80], [84, 83], [85, 84], [86, 85], [87, 84], [88, 15], [88, 87], [88, 13], [90, 89], [92, 88], [93, 90], [95, 84], [96, 95], [96, 13], [96, 15], [97, 96], [98, 97], [100, 99], [106, 105], [107, 100], [107, 22], [109, 106], [113, 100], [113, 22], [114, 113], [114, 112], [116, 115], [116, 114], [117, 4], [118, 3], [119, 2], [120, 0], [121, 20], [121, 77], [121, 116], [121, 61], [121, 72], [121, 102]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0_5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0.jsonl.gz", "strip_func_name": "sub_402BCA", "query": "\n\n\n__int64 __fastcall sub_402BCA(const char *a1, unsigned int a2)\n{\nunsigned int v3; // ebx\nuint16_t v4; // ax\nuint16_t v5; // ax\n__int64 v6; // rcx\n__int64 v7; // r8\n__int64 v8; // r9\nunsigned int v9; // eax\n__int64 v10; // [rsp+0h] [rbp-30h]\nstruct servent *v11; // [rsp+10h] [rbp-20h]\nstruct servent *v12; // [rsp+10h] [rbp-20h]\nchar *proto; // [rsp+18h] [rbp-18h]\n\nHIDWORD(v10) = a2;\nproto = aTcp;\nif ( word_409458 )\nproto = aUdp;\n*dest = 63;\ndest[1] = 0;\nif ( a2 )\n{\nif ( a1 )\nreturn 0LL;\nv3 = a2;\nv4 = htons(a2);\nv11 = getservbyport(v4, proto);\nif ( v11 )\n{\nv5 = ntohs(v11->s_port);\nif ( a2 != v5 )\nsub_4024C2(\"Warning: port-bynum mismatch, %d != %d\", a2, v5, v6, v7, v8, v10);\nstrncpy(dest, v11->s_name, 0x40uLL);\n}\n}\nelse\n{\nif ( !a1 )\nreturn 0LL;\nv9 = atoi(a1);\nif ( v9 )\nreturn sub_402BCA(0LL, v9);\nif ( word_40944E )\nreturn 0LL;\nv12 = getservbyname(a1, proto);\nif ( !v12 )\nreturn 0LL;\nstrncpy(dest, v12->s_name, 0x40uLL);\nv3 = ntohs(v12->s_port);\n}\nsprintf(dest + 64, \"%d\", v3);\n*((_WORD *)dest + 36) = v3;\nreturn *((unsigned __int16 *)dest + 36);\n}\n\n\n\nQ:[a1,a2,v12,proto,sub_402BCA,sub_4024C2,]", "hints": "[]", "response": "{'a1': 'pstring', 'a2': 'pnum', 'v12': 'servent', 'proto': 'whichp', 'sub_402BCA': 'getportpoop', 'sub_4024C2': 'holler'}"}
[ [ 0.7139956951141357, 0.7130805253982544, 0.7066019773483276, 0.6970273852348328, 0.6952337622642517, 0.6876396536827087, 0.6871480345726013, 0.6862996816635132, 0.6822049617767334, 0.676788330078125, 0.6744597554206848, 0.672175407409668, 0.6688817739486694, 0.6682417392730713, 0.6673811674118042, 0.6610137224197388, 0.660355806350708, 0.660331130027771, 0.6575765609741211, 0.6545958518981934 ], [ 22158, 151551, 186694, 149854, 52219, 169729, 70845, 188941, 106978, 207221, 148274, 173546, 20352, 203805, 171490, 80668, 213906, 52337, 261935, 33789 ] ]
pq_down
ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9
google
neper
NA
static void pq_down(struct pq_impl *impl, int i) { void **heap = impl->pq_list; for (;;) { int j = i * 2; /* left child */ int k = j + 1; /* right child */ int top = i; if (j <= impl->pq_curlen && impl->pq_cmp(heap[j], heap[top]) < 0) top = j; if (k <= impl->pq_curlen && impl->pq_cmp(heap[k], heap[top]) < 0) top = k; if (top == i) break; void *tmp = heap[i]; heap[i] = heap[top]; heap[top] = tmp; i = top; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40EDA4", "function_addr": 4255140, "binary_name": "ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_2C], esi"], [5, "mov rax, [rbp+var_28]"], [6, "mov rax, [rax+20h]"], [7, "mov [rbp+var_10], rax"], [8, "mov eax, [rbp+var_2C]"], [9, "add eax, eax"], [10, "mov [rbp+var_14], eax"], [11, "mov eax, [rbp+var_14]"], [12, "add eax, 1"], [13, "mov [rbp+var_18], eax"], [14, "mov eax, [rbp+var_2C]"], [15, "mov [rbp+var_4], eax"], [16, "mov rax, [rbp+var_28]"], [17, "mov eax, [rax+1Ch]"], [18, "cmp [rbp+var_14], eax"], [19, "jg short loc_40EE30"], [20, "mov rax, [rbp+var_28]"], [21, "mov rcx, [rax+28h]"], [22, "mov eax, [rbp+var_4]"], [23, "cdqe"], [24, "lea rdx, ds:0[rax*8]"], [25, "mov rax, [rbp+var_10]"], [26, "add rax, rdx"], [27, "mov rdx, [rax]"], [28, "mov eax, [rbp+var_14]"], [29, "cdqe"], [30, "lea rsi, ds:0[rax*8]"], [31, "mov rax, [rbp+var_10]"], [32, "add rax, rsi"], [33, "mov rax, [rax]"], [34, "mov rsi, rdx"], [35, "mov rdi, rax"], [36, "call rcx"], [37, "pxor xmm1, xmm1"], [38, "comisd xmm1, xmm0"], [39, "jbe short loc_40EE30"], [40, "mov eax, [rbp+var_14]"], [41, "mov [rbp+var_4], eax"], [42, "mov rax, [rbp+var_28]"], [43, "mov eax, [rax+1Ch]"], [44, "cmp [rbp+var_18], eax"], [45, "jg short loc_40EE8A"], [46, "mov rax, [rbp+var_28]"], [47, "mov rcx, [rax+28h]"], [48, "mov eax, [rbp+var_4]"], [49, "cdqe"], [50, "lea rdx, ds:0[rax*8]"], [51, "mov rax, [rbp+var_10]"], [52, "add rax, rdx"], [53, "mov rdx, [rax]"], [54, "mov eax, [rbp+var_18]"], [55, "cdqe"], [56, "lea rsi, ds:0[rax*8]"], [57, "mov rax, [rbp+var_10]"], [58, "add rax, rsi"], [59, "mov rax, [rax]"], [60, "mov rsi, rdx"], [61, "mov rdi, rax"], [62, "call rcx"], [63, "pxor xmm1, xmm1"], [64, "comisd xmm1, xmm0"], [65, "jbe short loc_40EE8A"], [66, "mov eax, [rbp+var_18]"], [67, "mov [rbp+var_4], eax"], [68, "mov eax, [rbp+var_4]"], [69, "cmp eax, [rbp+var_2C]"], [70, "jz short loc_40EF02"], [71, "mov eax, [rbp+var_2C]"], [72, "cdqe"], [73, "lea rdx, ds:0[rax*8]"], [74, "mov rax, [rbp+var_10]"], [75, "add rax, rdx"], [76, "mov rax, [rax]"], [77, "mov [rbp+var_20], rax"], [78, "mov eax, [rbp+var_4]"], [79, "cdqe"], [80, "lea rdx, ds:0[rax*8]"], [81, "mov rax, [rbp+var_10]"], [82, "add rax, rdx"], [83, "mov edx, [rbp+var_2C]"], [84, "movsxd rdx, edx"], [85, "lea rcx, ds:0[rdx*8]"], [86, "mov rdx, [rbp+var_10]"], [87, "add rdx, rcx"], [88, "mov rax, [rax]"], [89, "mov [rdx], rax"], [90, "mov eax, [rbp+var_4]"], [91, "cdqe"], [92, "lea rdx, ds:0[rax*8]"], [93, "mov rax, [rbp+var_10]"], [94, "add rdx, rax"], [95, "mov rax, [rbp+var_20]"], [96, "mov [rdx], rax"], [97, "mov eax, [rbp+var_4]"], [98, "mov [rbp+var_2C], eax"], [99, "jmp loc_40EDBF"], [100, "nop"], [101, "nop"], [102, "leave"], [103, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 4], [8, 98], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 4], [14, 98], [15, 14], [16, 3], [17, 16], [17, 96], [17, 89], [18, 17], [18, 10], [19, 18], [20, 3], [21, 96], [21, 89], [21, 20], [22, 15], [24, 94], [25, 7], [26, 25], [26, 24], [27, 26], [27, 96], [27, 89], [28, 10], [30, 34], [30, 60], [31, 7], [32, 30], [32, 31], [33, 89], [33, 32], [33, 96], [34, 27], [35, 33], [36, 21], [38, 37], [39, 32], [40, 10], [41, 40], [42, 3], [43, 96], [43, 89], [43, 42], [44, 13], [44, 43], [45, 44], [46, 3], [47, 89], [47, 46], [47, 96], [48, 15], [48, 41], [50, 27], [50, 94], [51, 7], [52, 51], [52, 50], [53, 96], [53, 89], [53, 52], [54, 13], [56, 60], [56, 34], [57, 7], [58, 56], [58, 57], [59, 96], [59, 58], [59, 89], [60, 53], [61, 59], [62, 47], [64, 63], [65, 58], [66, 13], [67, 66], [68, 41], [68, 15], [68, 67], [69, 98], [69, 4], [69, 68], [70, 69], [71, 4], [71, 98], [73, 53], [73, 94], [73, 27], [74, 7], [75, 74], [75, 73], [76, 96], [76, 89], [76, 75], [77, 76], [78, 15], [78, 67], [78, 41], [80, 73], [81, 7], [82, 81], [82, 80], [83, 98], [83, 4], [84, 83], [85, 47], [85, 21], [85, 85], [86, 7], [87, 86], [87, 85], [88, 96], [88, 89], [88, 82], [89, 88], [89, 87], [90, 41], [90, 15], [90, 67], [92, 87], [93, 7], [94, 93], [94, 92], [95, 77], [96, 95], [96, 94], [97, 67], [97, 41], [97, 15], [98, 97], [103, 68]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9_ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.jsonl.gz", "strip_func_name": "sub_40EDA4", "query": "\n\n\n__int64 __fastcall sub_40EDA4(__int64 a1, int a2)\n{\n__int64 result; // rax\n__int64 v4; // [rsp+10h] [rbp-20h]\nint v5; // [rsp+18h] [rbp-18h]\n__int64 v6; // [rsp+20h] [rbp-10h]\nint v7; // [rsp+2Ch] [rbp-4h]\n\nv6 = *(_QWORD *)(a1 + 32);\nwhile ( 1 )\n{\nv5 = 2 * a2 + 1;\nv7 = a2;\nif ( 2 * a2 <= *(_DWORD *)(a1 + 28)\n&& (*(double (__fastcall **)(_QWORD, _QWORD))(a1 + 40))(*(_QWORD *)(16LL * a2 + v6), *(_QWORD *)(8LL * a2 + v6)) < 0.0 )\n{\nv7 = 2 * a2;\n}\nif ( v5 <= *(_DWORD *)(a1 + 28)\n&& (*(double (__fastcall **)(_QWORD, _QWORD))(a1 + 40))(*(_QWORD *)(8LL * v5 + v6), *(_QWORD *)(8LL * v7 + v6)) < 0.0 )\n{\nv7 = 2 * a2 + 1;\n}\nresult = (unsigned int)v7;\nif ( v7 == a2 )\nbreak;\nv4 = *(_QWORD *)(8LL * a2 + v6);\n*(_QWORD *)(8LL * a2 + v6) = *(_QWORD *)(8LL * v7 + v6);\n*(_QWORD *)(v6 + 8LL * v7) = v4;\na2 = v7;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v4,v6,v7,sub_40EDA4,]", "hints": "[]", "response": "{'a1': 'impl', 'v4': 'tmp', 'v6': 'heap', 'v7': 'top', 'sub_40EDA4': 'pq_down'}"}
[ [ 0.7811310887336731, 0.7706546783447266, 0.7646718621253967, 0.7627041339874268, 0.761857807636261, 0.751063346862793, 0.7447963953018188, 0.7379055023193359, 0.7356723546981812, 0.7351132035255432, 0.7344255447387695, 0.732964813709259, 0.729941189289093, 0.7290665507316589, 0.7236418724060059, 0.7218947410583496, 0.7218093276023865, 0.7198272943496704, 0.7189661264419556, 0.7182617783546448 ], [ 236926, 74868, 74600, 214048, 17609, 10651, 187022, 110398, 104380, 78847, 92862, 46286, 80652, 165933, 58856, 142832, 119827, 135335, 195454, 93864 ] ]
report_error
b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97
marcobambini
gravity
NA
static void report_error (gravity_vm *vm, error_type_t error_type, const char *message, error_desc_t error_desc, void *xdata) { (void) vm, (void) xdata; const char *type = "N/A"; switch (error_type) { case GRAVITY_ERROR_NONE: type = "NONE"; break; case GRAVITY_ERROR_SYNTAX: type = "SYNTAX"; break; case GRAVITY_ERROR_SEMANTIC: type = "SEMANTIC"; break; case GRAVITY_ERROR_RUNTIME: type = "RUNTIME"; break; case GRAVITY_WARNING: type = "WARNING"; break; case GRAVITY_ERROR_IO: type = "I/O"; break; } if (error_type == GRAVITY_ERROR_RUNTIME) printf("RUNTIME ERROR: "); else printf("%s ERROR on %d (%d,%d): ", type, error_desc.fileid, error_desc.lineno, error_desc.colno); printf("%s\n", message); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4687D9", "function_addr": 4622297, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov [rbp+s], rdx"], [6, "mov rax, rcx"], [7, "mov rcx, r8"], [8, "mov rdx, rcx"], [9, "mov [rbp+var_40], rax"], [10, "mov [rbp+var_38], rdx"], [11, "mov [rbp+var_30], r9"], [12, "lea rax, aNA_3"], [13, "mov [rbp+var_8], rax"], [14, "cmp [rbp+var_1C], 5"], [15, "ja short def_468833"], [16, "mov eax, [rbp+var_1C]"], [17, "lea rdx, ds:0[rax*4]"], [18, "lea rax, jpt_468833"], [19, "mov eax, ds:(jpt_468833 - 46FC58h)[rdx+rax]"], [20, "cdqe"], [21, "lea rdx, jpt_468833"], [22, "add rax, rdx"], [23, "jmp rax"], [24, "lea rax, aNone_1"], [25, "mov [rbp+var_8], rax"], [26, "jmp short def_468833"], [27, "lea rax, aSyntax_0"], [28, "mov [rbp+var_8], rax"], [29, "jmp short def_468833"], [30, "lea rax, aSemantic_0"], [31, "mov [rbp+var_8], rax"], [32, "jmp short def_468833"], [33, "lea rax, aRuntime_0"], [34, "mov [rbp+var_8], rax"], [35, "jmp short def_468833"], [36, "lea rax, aWarning_0"], [37, "mov [rbp+var_8], rax"], [38, "jmp short def_468833"], [39, "lea rax, aIO"], [40, "mov [rbp+var_8], rax"], [41, "nop"], [42, "cmp [rbp+var_1C], 3"], [43, "jnz short loc_46889B"], [44, "lea rdi, aRuntimeError"], [45, "mov eax, 0"], [46, "call _printf"], [47, "jmp short loc_4688BF"], [48, "mov esi, dword ptr [rbp+var_40+4]"], [49, "mov ecx, dword ptr [rbp+var_40]"], [50, "mov edx, dword ptr [rbp+var_38]"], [51, "mov rax, [rbp+var_8]"], [52, "mov r8d, esi"], [53, "mov rsi, rax"], [54, "lea rdi, aSErrorOnDDD"], [55, "mov eax, 0"], [56, "call _printf"], [57, "mov rax, [rbp+s]"], [58, "mov rdi, rax"], [59, "call _puts"], [60, "nop"], [61, "leave"], [62, "retn"]], "data_dep": [[8, 7], [9, 6], [10, 8], [12, 6], [13, 12], [14, 4], [15, 14], [16, 4], [17, 8], [18, 16], [21, 17], [22, 19], [22, 21], [23, 22], [24, 22], [25, 24], [27, 22], [28, 27], [30, 22], [31, 30], [33, 22], [34, 33], [36, 22], [37, 36], [39, 22], [40, 39], [42, 4], [43, 42], [49, 9], [50, 10], [51, 13], [51, 25], [51, 28], [51, 34], [51, 31], [51, 37], [51, 40], [52, 48], [53, 51], [57, 5], [58, 57], [62, 59]]}
{"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_4687D9", "query": "\n\n\nint __fastcall sub_4687D9(__int64 a1, int a2, const char *a3, __int64 a4, unsigned int a5)\n{\nconst char *v7; // [rsp+38h] [rbp-8h]\n\nv7 = \"N/A\";\nswitch ( a2 )\n{\ncase 0:\nv7 = \"NONE\";\nbreak;\ncase 1:\nv7 = \"SYNTAX\";\nbreak;\ncase 2:\nv7 = \"SEMANTIC\";\nbreak;\ncase 3:\nv7 = \"RUNTIME\";\nbreak;\ncase 4:\nv7 = \"I/O\";\nbreak;\ncase 5:\nv7 = \"WARNING\";\nbreak;\ndefault:\nbreak;\n}\nif ( a2 == 3 )\nprintf(\"RUNTIME ERROR: \");\nelse\nprintf(\"%s ERROR on %d (%d,%d): \", v7, a5, (unsigned int)a4, HIDWORD(a4));\nreturn puts(a3);\n}\n\n\n\nQ:[a3,a2,a1,v7,sub_4687D9,]", "hints": "[]", "response": "{'a3': 'message', 'a2': 'error_type', 'a1': 'vm', 'v7': 'type', 'sub_4687D9': 'report_error_3'}"}
[ [ 0.8168672323226929, 0.8141024112701416, 0.8048088550567627, 0.7810134291648865, 0.7663841843605042, 0.7540709972381592, 0.7529646754264832, 0.7306888699531555, 0.7244813442230225, 0.7216036319732666, 0.7183368802070618, 0.7151732444763184, 0.7142202854156494, 0.712693452835083, 0.7086951732635498, 0.7011770606040955, 0.7008732557296753, 0.70082026720047, 0.6989319324493408, 0.6941796541213989 ], [ 121652, 185961, 54327, 51662, 184377, 74754, 27657, 163262, 208132, 166490, 179362, 161794, 133063, 190892, 140180, 249644, 256999, 194963, 67112, 33487 ] ]