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
|
---|---|---|---|---|---|---|---|---|---|
drawAxisLine | 1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d | cleanflight | blackbox-tools | NA | void drawAxisLine(cairo_t *cr)
{
cairo_save(cr);
cairo_set_source_rgba(cr, 1, 1, 1, 0.5);
cairo_set_dash(cr, 0, 0, 0);
cairo_set_line_width(cr, 1);
cairo_move_to(cr, 0, 0);
cairo_line_to(cr, options.imageWidth, 0);
cairo_stroke(cr);
cairo_restore(cr);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A717", "function_addr": 4237079, "binary_name": "1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d.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 rdi, rax"], [6, "call _cairo_save"], [7, "movsd xmm2, cs:qword_412090"], [8, "movsd xmm1, cs:qword_411FF8"], [9, "movsd xmm0, cs:qword_411FF8"], [10, "mov rdx, cs:qword_411FF8"], [11, "mov rax, [rbp+var_8]"], [12, "movapd xmm3, xmm2"], [13, "movapd xmm2, xmm1"], [14, "movapd xmm1, xmm0"], [15, "movq xmm0, rdx"], [16, "mov rdi, rax"], [17, "call _cairo_set_source_rgba"], [18, "mov rax, [rbp+var_8]"], [19, "pxor xmm0, xmm0"], [20, "mov edx, 0"], [21, "mov esi, 0"], [22, "mov rdi, rax"], [23, "call _cairo_set_dash"], [24, "mov rdx, cs:qword_411FF8"], [25, "mov rax, [rbp+var_8]"], [26, "movq xmm0, rdx"], [27, "mov rdi, rax"], [28, "call _cairo_set_line_width"], [29, "mov rax, [rbp+var_8]"], [30, "pxor xmm1, xmm1"], [31, "pxor xmm0, xmm0"], [32, "mov rdi, rax"], [33, "call _cairo_move_to"], [34, "mov eax, cs:dword_434C64"], [35, "pxor xmm4, xmm4"], [36, "cvtsi2sd xmm4, eax"], [37, "movq rdx, xmm4"], [38, "mov rax, [rbp+var_8]"], [39, "pxor xmm1, xmm1"], [40, "movq xmm0, rdx"], [41, "mov rdi, rax"], [42, "call _cairo_line_to"], [43, "mov rax, [rbp+var_8]"], [44, "mov rdi, rax"], [45, "call _cairo_stroke"], [46, "mov rax, [rbp+var_8]"], [47, "mov rdi, rax"], [48, "call _cairo_restore"], [49, "nop"], [50, "leave"], [51, "retn"]], "data_dep": [[4, 3], [5, 4], [11, 3], [12, 7], [13, 8], [14, 9], [15, 10], [16, 11], [18, 3], [22, 18], [25, 3], [26, 24], [27, 25], [29, 3], [32, 29], [36, 34], [36, 35], [37, 36], [38, 3], [40, 37], [41, 38], [43, 3], [44, 43], [46, 3], [47, 46], [51, 48]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d_1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d.jsonl.gz", "strip_func_name": "sub_40A717", "query": "\n\n\n__int64 sub_40A717()\n{\ncairo_save();\ncairo_set_source_rgba();\ncairo_set_dash();\ncairo_set_line_width();\ncairo_move_to();\ncairo_line_to();\ncairo_stroke();\nreturn cairo_restore();\n}\n\n\n\nQ:[sub_40A717,]", "hints": "[]", "response": "{'sub_40A717': 'drawAxisLine'}"} | [
[
0.7774710655212402,
0.7603431344032288,
0.748599112033844,
0.7446256875991821,
0.7330802083015442,
0.7310289740562439,
0.7302003502845764,
0.7269275188446045,
0.7203057408332825,
0.7129508256912231,
0.7103807330131531,
0.7046814560890198,
0.7030986547470093,
0.7027655839920044,
0.7022014260292053,
0.6995793581008911,
0.6991679668426514,
0.6983025670051575,
0.6978514194488525,
0.6973046064376831
],
[
196939,
194074,
207670,
85460,
259686,
244358,
74803,
161500,
233181,
226228,
220195,
121771,
177359,
73116,
16634,
194384,
207435,
67825,
246180,
112842
]
] |
|
ircode_free | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | void ircode_free (ircode_t *code) {
uint32_t count = ircode_count(code);
for (uint32_t i=0; i<count; ++i) {
inst_t *inst = marray_get(*code->list, i);
mem_free(inst);
}
marray_destroy(*code->list);
marray_destroy(code->context);
marray_destroy(code->registers);
marray_destroy(code->label_true);
marray_destroy(code->label_false);
marray_destroy(code->label_check);
mem_free(code->list);
mem_free(code);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41CD7E", "function_addr": 4312446, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.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 sub_41CEC5"], [7, "mov [rbp+var_8], eax"], [8, "mov [rbp+var_4], 0"], [9, "jmp short loc_41CDCE"], [10, "mov rax, [rbp+var_18]"], [11, "mov rax, [rax]"], [12, "mov rdx, [rax+10h]"], [13, "mov eax, [rbp+var_4]"], [14, "shl rax, 3"], [15, "add rax, rdx"], [16, "mov rax, [rax]"], [17, "mov [rbp+ptr], rax"], [18, "mov rax, [rbp+ptr]"], [19, "mov rdi, rax"], [20, "call _free"], [21, "add [rbp+var_4], 1"], [22, "mov eax, [rbp+var_4]"], [23, "cmp eax, [rbp+var_8]"], [24, "jb short loc_41CDA2"], [25, "mov rax, [rbp+var_18]"], [26, "mov rax, [rax]"], [27, "mov rax, [rax+10h]"], [28, "test rax, rax"], [29, "jz short loc_41CDF9"], [30, "mov rax, [rbp+var_18]"], [31, "mov rax, [rax]"], [32, "mov rax, [rax+10h]"], [33, "mov rdi, rax"], [34, "call _free"], [35, "mov rax, [rbp+var_18]"], [36, "mov rax, [rax+288h]"], [37, "test rax, rax"], [38, "jz short loc_41CE1C"], [39, "mov rax, [rbp+var_18]"], [40, "mov rax, [rax+288h]"], [41, "mov rdi, rax"], [42, "call _free"], [43, "mov rax, [rbp+var_18]"], [44, "mov rax, [rax+270h]"], [45, "test rax, rax"], [46, "jz short loc_41CE3F"], [47, "mov rax, [rbp+var_18]"], [48, "mov rax, [rax+270h]"], [49, "mov rdi, rax"], [50, "call _free"], [51, "mov rax, [rbp+var_18]"], [52, "mov rax, [rax+18h]"], [53, "test rax, rax"], [54, "jz short loc_41CE5C"], [55, "mov rax, [rbp+var_18]"], [56, "mov rax, [rax+18h]"], [57, "mov rdi, rax"], [58, "call _free"], [59, "mov rax, [rbp+var_18]"], [60, "mov rax, [rax+30h]"], [61, "test rax, rax"], [62, "jz short loc_41CE79"], [63, "mov rax, [rbp+var_18]"], [64, "mov rax, [rax+30h]"], [65, "mov rdi, rax"], [66, "call _free"], [67, "mov rax, [rbp+var_18]"], [68, "mov rax, [rax+48h]"], [69, "test rax, rax"], [70, "jz short loc_41CE96"], [71, "mov rax, [rbp+var_18]"], [72, "mov rax, [rax+48h]"], [73, "mov rdi, rax"], [74, "call _free"], [75, "mov rax, [rbp+var_18]"], [76, "mov rax, [rax]"], [77, "mov rdi, rax"], [78, "call _free"], [79, "mov rax, [rbp+var_18]"], [80, "mov rdi, rax"], [81, "call _free"], [82, "nop"], [83, "leave"], [84, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [10, 3], [11, 10], [12, 11], [13, 8], [13, 21], [14, 13], [15, 14], [15, 12], [16, 15], [17, 16], [18, 17], [19, 18], [21, 21], [21, 8], [22, 8], [22, 21], [23, 7], [23, 22], [24, 23], [25, 3], [26, 25], [27, 26], [28, 27], [29, 28], [30, 3], [31, 30], [32, 31], [33, 32], [35, 3], [36, 35], [37, 36], [38, 37], [39, 3], [40, 39], [41, 40], [43, 3], [44, 43], [45, 44], [46, 45], [47, 3], [48, 47], [49, 48], [51, 3], [52, 51], [53, 52], [54, 53], [55, 3], [56, 55], [57, 56], [59, 3], [60, 59], [61, 60], [62, 61], [63, 3], [64, 63], [65, 64], [67, 3], [68, 67], [69, 68], [70, 69], [71, 3], [72, 71], [73, 72], [75, 3], [76, 75], [77, 76], [79, 3], [80, 79], [84, 81]]}
| {"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_41CD7E", "query": "\n\n\nvoid __fastcall sub_41CD7E(void **a1)\n{\nunsigned int v1; // [rsp+18h] [rbp-8h]\nunsigned int i; // [rsp+1Ch] [rbp-4h]\n\nv1 = sub_41CEC5(a1);\nfor ( i = 0; i < v1; ++i )\nfree(*(void **)(*((_QWORD *)*a1 + 2) + 8LL * i));\nif ( *((_QWORD *)*a1 + 2) )\nfree(*((void **)*a1 + 2));\nif ( a1[81] )\nfree(a1[81]);\nif ( a1[78] )\nfree(a1[78]);\nif ( a1[3] )\nfree(a1[3]);\nif ( a1[6] )\nfree(a1[6]);\nif ( a1[9] )\nfree(a1[9]);\nfree(*a1);\nfree(a1);\n}\n\n\n\nQ:[a1,v1,sub_41CD7E,sub_41CEC5,]", "hints": "[]", "response": "{'a1': 'code', 'v1': 'count', 'sub_41CD7E': 'ircode_free', 'sub_41CEC5': 'ircode_count'}"} | [
[
0.827193021774292,
0.8240567445755005,
0.8110921382904053,
0.8058838248252869,
0.8005104064941406,
0.7975078821182251,
0.7968180179595947,
0.7940054535865784,
0.7916011214256287,
0.788251519203186,
0.780767023563385,
0.779656171798706,
0.7770731449127197,
0.7740498185157776,
0.7728620171546936,
0.7685203552246094,
0.7647229433059692,
0.7644420266151428,
0.7635254859924316,
0.763285219669342
],
[
244816,
240481,
73299,
132644,
33899,
109932,
30204,
170380,
29663,
223505,
216220,
120168,
186059,
235125,
132757,
104042,
157711,
34802,
192791,
26318
]
] |
|
encode_name | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void encode_name(int i, char *name)
{
unsigned char *data = &radio_mem[0x1000 + i * 16];
int n;
if (name && *name && *name != '-') {
// Setup channel name.
for (n = 0; n < 7 && name[n]; n++) {
data[n] = encode_char(name[n]);
}
for (; n < 7; n++)
data[n] = ' ';
} else {
// Clear name.
for (n = 0; n < 7; n++)
data[n] = 0xff;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404DE9", "function_addr": 4214249, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_14], edi"], [4, "mov [rbp+var_20], rsi"], [5, "mov eax, [rbp+var_14]"], [6, "add eax, 100h"], [7, "shl eax, 4"], [8, "cdqe"], [9, "add rax, 41A9E0h"], [10, "mov [rbp+var_10], rax"], [11, "cmp [rbp+var_20], 0"], [12, "jz loc_404EA0"], [13, "mov rax, [rbp+var_20]"], [14, "movzx eax, byte ptr [rax]"], [15, "test al, al"], [16, "jz short loc_404EA0"], [17, "mov rax, [rbp+var_20]"], [18, "movzx eax, byte ptr [rax]"], [19, "cmp al, 2Dh "], [20, "jz short loc_404EA0"], [21, "mov [rbp+var_4], 0"], [22, "jmp short loc_404E68"], [23, "mov eax, [rbp+var_4]"], [24, "movsxd rdx, eax"], [25, "mov rax, [rbp+var_20]"], [26, "add rax, rdx"], [27, "movzx eax, byte ptr [rax]"], [28, "movsx eax, al"], [29, "mov edi, eax"], [30, "call sub_404DB3"], [31, "mov edx, eax"], [32, "mov eax, [rbp+var_4]"], [33, "movsxd rcx, eax"], [34, "mov rax, [rbp+var_10]"], [35, "add rax, rcx"], [36, "mov [rax], dl"], [37, "add [rbp+var_4], 1"], [38, "cmp [rbp+var_4], 6"], [39, "jg short loc_404E98"], [40, "mov eax, [rbp+var_4]"], [41, "movsxd rdx, eax"], [42, "mov rax, [rbp+var_20]"], [43, "add rax, rdx"], [44, "movzx eax, byte ptr [rax]"], [45, "test al, al"], [46, "jnz short loc_404E39"], [47, "jmp short loc_404E98"], [48, "mov eax, [rbp+var_4]"], [49, "movsxd rdx, eax"], [50, "mov rax, [rbp+var_10]"], [51, "add rax, rdx"], [52, "mov byte ptr [rax], 20h "], [53, "add [rbp+var_4], 1"], [54, "cmp [rbp+var_4], 6"], [55, "jle short loc_404E84"], [56, "jmp short loc_404EC4"], [57, "mov [rbp+var_4], 0"], [58, "jmp short loc_404EBD"], [59, "mov eax, [rbp+var_4]"], [60, "movsxd rdx, eax"], [61, "mov rax, [rbp+var_10]"], [62, "add rax, rdx"], [63, "mov byte ptr [rax], 0FFh"], [64, "add [rbp+var_4], 1"], [65, "cmp [rbp+var_4], 6"], [66, "jle short loc_404EA9"], [67, "nop"], [68, "nop"], [69, "leave"], [70, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [9, 7], [10, 9], [11, 4], [12, 11], [13, 4], [14, 13], [15, 14], [16, 15], [17, 4], [18, 17], [19, 18], [20, 19], [23, 37], [23, 21], [24, 23], [25, 4], [26, 25], [26, 24], [27, 36], [27, 26], [28, 27], [29, 28], [31, 30], [32, 37], [32, 21], [33, 32], [34, 10], [35, 33], [35, 34], [36, 31], [36, 35], [37, 21], [37, 37], [38, 37], [38, 21], [39, 38], [40, 37], [40, 21], [41, 40], [42, 4], [43, 41], [43, 42], [44, 36], [44, 43], [45, 44], [46, 45], [48, 53], [48, 37], [48, 21], [49, 48], [50, 10], [51, 50], [51, 49], [52, 51], [53, 53], [53, 37], [53, 21], [54, 37], [54, 21], [54, 53], [55, 54], [59, 64], [59, 57], [60, 59], [61, 10], [62, 60], [62, 61], [63, 62], [64, 64], [64, 57], [65, 64], [65, 57], [66, 65], [70, 9], [70, 18], [70, 45], [70, 15], [70, 51], [70, 35], [70, 62]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_404DE9", "query": "\n\n\n__int64 __fastcall sub_404DE9(int a1, unsigned __int8 *a2)\n{\n__int64 result; // rax\nchar v3; // dl\n__int64 v4; // [rsp+10h] [rbp-10h]\nint i; // [rsp+1Ch] [rbp-4h]\nint j; // [rsp+1Ch] [rbp-4h]\n\nresult = 16 * (a1 + 256) + 4303328LL;\nv4 = result;\nif ( a2 && (result = *a2, (_BYTE)result) && (result = *a2, (_BYTE)result != 45) )\n{\nfor ( i = 0; i <= 6; ++i )\n{\nresult = a2[i];\nif ( !(_BYTE)result )\nbreak;\nv3 = sub_404DB3((char)a2[i]);\nresult = i + v4;\n*(_BYTE *)result = v3;\n}\nwhile ( i <= 6 )\n{\nresult = i + v4;\n*(_BYTE *)result = 32;\n++i;\n}\n}\nelse\n{\nfor ( j = 0; j <= 6; ++j )\n{\nresult = j + v4;\n*(_BYTE *)result = -1;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a2,j,sub_404DE9,sub_404DB3,]", "hints": "[]", "response": "{'a2': 'name', 'j': 'na', 'sub_404DE9': 'encode_name', 'sub_404DB3': 'encode_char'}"} | [
[
0.7415310740470886,
0.726367175579071,
0.7053251266479492,
0.7043843865394592,
0.6942956447601318,
0.6866459846496582,
0.6838144659996033,
0.6799882054328918,
0.6789040565490723,
0.6753031015396118,
0.6741617918014526,
0.6687615513801575,
0.6664633750915527,
0.665509819984436,
0.6638106107711792,
0.6608691215515137,
0.6594806909561157,
0.6572748422622681,
0.6566072702407837,
0.6531169414520264
],
[
36987,
19549,
181033,
136648,
260662,
85725,
87021,
200466,
212596,
208744,
85442,
228798,
188365,
53013,
107278,
36314,
242824,
47223,
207809,
85077
]
] |
|
fbitstr_flush | 219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea | rockcarry | ffjpeg | NA | static int fbitstr_flush(void *stream)
{
FBITSTR *context = (FBITSTR*)stream;
if (!context || !context->fp) return EOF;
if (context->bitnum != 0) {
if (EOF == fputc(context->bitbuf & 0xff, context->fp)) {
return EOF;
}
context->bitbuf = 0;
context->bitnum = 0;
}
return fflush(context->fp);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405EA6", "function_addr": 4218534, "binary_name": "219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.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 [rbp+var_8], rax"], [6, "cmp [rbp+var_8], 0"], [7, "jz short loc_405ECE"], [8, "mov rax, [rbp+var_8]"], [9, "mov rax, [rax+10h]"], [10, "test rax, rax"], [11, "jnz short loc_405ED5"], [12, "mov eax, 0FFFFFFFFh"], [13, "jmp short locret_405F2E"], [14, "mov rax, [rbp+var_8]"], [15, "mov eax, [rax+8]"], [16, "test eax, eax"], [17, "jz short loc_405F1E"], [18, "mov rax, [rbp+var_8]"], [19, "mov rdx, [rax+10h]"], [20, "mov rax, [rbp+var_8]"], [21, "mov eax, [rax+4]"], [22, "movzx eax, al"], [23, "mov rsi, rdx"], [24, "mov edi, eax"], [25, "call _fputc"], [26, "cmp eax, 0FFFFFFFFh"], [27, "jnz short loc_405F08"], [28, "mov eax, 0FFFFFFFFh"], [29, "jmp short locret_405F2E"], [30, "mov rax, [rbp+var_8]"], [31, "mov dword ptr [rax+4], 0"], [32, "mov rax, [rbp+var_8]"], [33, "mov dword ptr [rax+8], 0"], [34, "mov rax, [rbp+var_8]"], [35, "mov rax, [rax+10h]"], [36, "mov rdi, rax"], [37, "call _fflush"], [38, "leave"], [39, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 5], [9, 8], [10, 9], [11, 10], [14, 5], [15, 14], [16, 15], [17, 16], [18, 5], [19, 18], [20, 5], [21, 20], [22, 21], [23, 19], [24, 22], [26, 25], [27, 26], [30, 5], [31, 30], [32, 5], [33, 32], [34, 5], [35, 33], [35, 31], [35, 34], [36, 35], [39, 12], [39, 28], [39, 37]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea_219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.jsonl.gz", "strip_func_name": "sub_405EA6", "query": "\n\n\nint __fastcall sub_405EA6(__int64 a1)\n{\nif ( !a1 || !*(_QWORD *)(a1 + 16) )\nreturn -1;\nif ( *(_DWORD *)(a1 + 8) )\n{\nif ( fputc((unsigned __int8)*(_DWORD *)(a1 + 4), *(FILE **)(a1 + 16)) == -1 )\nreturn -1;\n*(_DWORD *)(a1 + 4) = 0;\n*(_DWORD *)(a1 + 8) = 0;\n}\nreturn fflush(*(FILE **)(a1 + 16));\n}\n\n\n\nQ:[a1,sub_405EA6,]", "hints": "[]", "response": "{'a1': 'stream', 'sub_405EA6': 'fbitstr_flush'}"} | [
[
0.7422055602073669,
0.7303735613822937,
0.7198954820632935,
0.7186263203620911,
0.7143880128860474,
0.7124321460723877,
0.7023386359214783,
0.7016448378562927,
0.7015905380249023,
0.6999900341033936,
0.6998500823974609,
0.698741614818573,
0.6946353912353516,
0.6915825009346008,
0.6909738779067993,
0.6906958818435669,
0.6900293231010437,
0.6872766017913818,
0.6859918832778931,
0.6841156482696533
],
[
117137,
33857,
175302,
125474,
56312,
104145,
140705,
117228,
24550,
109474,
155230,
108354,
159723,
113924,
193844,
127221,
171518,
138464,
240861,
90323
]
] |
|
handle_connection | 8ec76f5b69c2e6e8adb949d804db8caa455385969b780fc09eaccc112899f7d5 | cpb- | Developpement-systeme-sous-Linux | NA | void handle_connection (int sock)
{
struct sockaddr * sockaddr;
socklen_t length = 0;
char hostname [NI_MAXHOST];
char servname [NI_MAXSERV];
char buffer [256];
// Afficher l'adresse du correspondant
getpeername(sock, NULL, &length);
if (length == 0)
return;
sockaddr = malloc(length);
if (getpeername(sock, sockaddr, & length) < 0) {
perror ("getpeername");
free(sockaddr);
return;
}
if (getnameinfo(sockaddr, length,
hostname, NI_MAXHOST,
servname, NI_MAXSERV,
NI_NUMERICHOST | NI_NUMERICSERV) == 0) {
snprintf (buffer, 256, "IP = %s, Port = %s \n", hostname, servname);
fprintf(stdout, "Connexion distante %s", buffer);
write(sock, "Votre adresse : ", 16);
write(sock, buffer, strlen(buffer));
}
free(sockaddr);
close(sock);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4014E8", "function_addr": 4199656, "binary_name": "8ec76f5b69c2e6e8adb949d804db8caa455385969b780fc09eaccc112899f7d5.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 540h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+len], 0"], [5, "lea rdx, [rbp+len]"], [6, "mov eax, [rbp+fd]"], [7, "mov esi, 0"], [8, "mov edi, eax"], [9, "call _getpeername"], [10, "mov eax, [rbp+len]"], [11, "test eax, eax"], [12, "jz loc_401653"], [13, "mov eax, [rbp+len]"], [14, "mov eax, eax"], [15, "mov rdi, rax"], [16, "call _malloc"], [17, "mov [rbp+addr], rax"], [18, "lea rdx, [rbp+len]"], [19, "mov rcx, [rbp+addr]"], [20, "mov eax, [rbp+fd]"], [21, "mov rsi, rcx"], [22, "mov edi, eax"], [23, "call _getpeername"], [24, "test eax, eax"], [25, "jns short loc_401569"], [26, "mov edi, offset aGetpeername_0"], [27, "call _perror"], [28, "mov rax, [rbp+addr]"], [29, "mov rdi, rax"], [30, "call _free"], [31, "jmp locret_401654"], [32, "mov esi, [rbp+len]"], [33, "lea rcx, [rbp+serv]"], [34, "lea rdx, [rbp+host]"], [35, "mov rax, [rbp+addr]"], [36, "sub rsp, 8"], [37, "push 3"], [38, "mov r9d, 20h "], [39, "mov r8, rcx"], [40, "mov ecx, 401h"], [41, "mov rdi, rax"], [42, "call _getnameinfo"], [43, "add rsp, 10h"], [44, "test eax, eax"], [45, "jnz loc_401638"], [46, "lea rcx, [rbp+serv]"], [47, "lea rdx, [rbp+host]"], [48, "lea rax, [rbp+s]"], [49, "mov r8, rcx"], [50, "mov rcx, rdx"], [51, "mov edx, offset aIpSPortS"], [52, "mov esi, 100h"], [53, "mov rdi, rax"], [54, "mov eax, 0"], [55, "call _snprintf"], [56, "mov rax, cs:stdout"], [57, "lea rdx, [rbp+s]"], [58, "mov esi, offset aConnexionDista"], [59, "mov rdi, rax"], [60, "mov eax, 0"], [61, "call _fprintf"], [62, "mov eax, [rbp+fd]"], [63, "mov edx, 10h"], [64, "mov esi, offset aVotreAdresse"], [65, "mov edi, eax"], [66, "call _write"], [67, "lea rax, [rbp+s]"], [68, "mov rdi, rax"], [69, "call _strlen"], [70, "mov rdx, rax"], [71, "lea rcx, [rbp+s]"], [72, "mov eax, [rbp+fd]"], [73, "mov rsi, rcx"], [74, "mov edi, eax"], [75, "call _write"], [76, "mov rax, [rbp+addr]"], [77, "mov rdi, rax"], [78, "call _free"], [79, "mov eax, [rbp+fd]"], [80, "mov edi, eax"], [81, "call _close"], [82, "jmp short locret_401654"], [83, "nop"], [84, "leave"], [85, "retn"]], "data_dep": [[5, 4], [6, 3], [8, 6], [10, 4], [11, 10], [12, 11], [13, 4], [14, 13], [15, 14], [17, 16], [18, 4], [18, 5], [19, 17], [20, 3], [21, 19], [22, 20], [24, 23], [25, 24], [28, 17], [29, 28], [32, 4], [33, 19], [34, 18], [35, 17], [36, 2], [39, 33], [41, 35], [43, 36], [44, 42], [45, 44], [46, 40], [47, 34], [48, 44], [49, 46], [50, 47], [53, 48], [57, 51], [59, 56], [62, 3], [65, 62], [67, 66], [68, 67], [70, 69], [71, 50], [72, 3], [73, 71], [74, 72], [76, 17], [77, 76], [79, 3], [80, 79], [85, 30], [85, 11], [85, 81]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8ec76f5b69c2e6e8adb949d804db8caa455385969b780fc09eaccc112899f7d5_8ec76f5b69c2e6e8adb949d804db8caa455385969b780fc09eaccc112899f7d5.jsonl.gz", "strip_func_name": "sub_4014E8", "query": "\n\n\nvoid __fastcall sub_4014E8(int a1)\n{\nsize_t v1; // rax\nchar s[256]; // [rsp+10h] [rbp-530h] BYREF\nchar serv[32]; // [rsp+110h] [rbp-430h] BYREF\nchar host[1028]; // [rsp+130h] [rbp-410h] BYREF\nsocklen_t len; // [rsp+534h] [rbp-Ch] BYREF\nstruct sockaddr *addr; // [rsp+538h] [rbp-8h]\n\nlen = 0;\ngetpeername(a1, 0LL, &len);\nif ( len )\n{\naddr = (struct sockaddr *)malloc(len);\nif ( getpeername(a1, addr, &len) >= 0 )\n{\nif ( !getnameinfo(addr, len, host, 0x401u, serv, 0x20u, 3) )\n{\nsnprintf(s, 0x100uLL, \"IP = %s, Port = %s \\n\", host, serv);\nfprintf(stdout, \"Connexion distante %s\", s);\nwrite(a1, \"Votre adresse : \", 0x10uLL);\nv1 = strlen(s);\nwrite(a1, s, v1);\n}\nfree(addr);\nclose(a1);\n}\nelse\n{\nperror(\"getpeername\");\nfree(addr);\n}\n}\n}\n\n\n\nQ:[a1,s,serv,host,len,addr,sub_4014E8,]", "hints": "[]", "response": "{'a1': 'sock', 's': 'buffer', 'serv': 'servname', 'host': 'hostname', 'len': 'length', 'addr': 'sockaddr', 'sub_4014E8': 'handle_connection'}"} | [
[
0.7809953689575195,
0.7580215334892273,
0.7521246671676636,
0.749153196811676,
0.7458860874176025,
0.7450847625732422,
0.7397470474243164,
0.7391537427902222,
0.7359464764595032,
0.7324095368385315,
0.7300850749015808,
0.7285369038581848,
0.7278760075569153,
0.7242296934127808,
0.7195534706115723,
0.7147318124771118,
0.7144328951835632,
0.7124837636947632,
0.7098406553268433,
0.7085761427879333
],
[
138742,
52643,
233736,
76996,
166058,
186378,
169647,
131587,
118074,
56681,
172742,
182861,
102567,
58902,
247722,
32902,
105732,
245342,
157939,
233064
]
] |
|
stack_sort | 8ddaced626645131a45582a4817460593cf15f93f6ea409516e52427974dbf5b | nplab | DTLS-Examples | NA | void stack_sort(int* stack, int* stackindex) {
int pointer, save, counter = *stackindex - 1;
while (counter--) {
pointer = 0;
while (pointer++ < *stackindex) {
if (stack[pointer] < stack[pointer + 1]) {
save = stack[pointer];
stack[pointer] = stack[pointer + 1];
stack[pointer + 1] = save;
}
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4028B3", "function_addr": 4204723, "binary_name": "8ddaced626645131a45582a4817460593cf15f93f6ea409516e52427974dbf5b.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_20]"], [5, "mov eax, [rax]"], [6, "sub eax, 1"], [7, "mov [rbp+var_8], eax"], [8, "jmp loc_40298E"], [9, "mov [rbp+var_4], 0"], [10, "jmp loc_402977"], [11, "mov eax, [rbp+var_4]"], [12, "cdqe"], [13, "lea rdx, ds:0[rax*4]"], [14, "mov rax, [rbp+var_18]"], [15, "add rax, rdx"], [16, "mov edx, [rax]"], [17, "mov eax, [rbp+var_4]"], [18, "cdqe"], [19, "add rax, 1"], [20, "lea rcx, ds:0[rax*4]"], [21, "mov rax, [rbp+var_18]"], [22, "add rax, rcx"], [23, "mov eax, [rax]"], [24, "cmp edx, eax"], [25, "jge short loc_402977"], [26, "mov eax, [rbp+var_4]"], [27, "cdqe"], [28, "lea rdx, ds:0[rax*4]"], [29, "mov rax, [rbp+var_18]"], [30, "add rax, rdx"], [31, "mov eax, [rax]"], [32, "mov [rbp+var_C], eax"], [33, "mov eax, [rbp+var_4]"], [34, "cdqe"], [35, "add rax, 1"], [36, "lea rdx, ds:0[rax*4]"], [37, "mov rax, [rbp+var_18]"], [38, "add rax, rdx"], [39, "mov edx, [rbp+var_4]"], [40, "movsxd rdx, edx"], [41, "lea rcx, ds:0[rdx*4]"], [42, "mov rdx, [rbp+var_18]"], [43, "add rdx, rcx"], [44, "mov eax, [rax]"], [45, "mov [rdx], eax"], [46, "mov eax, [rbp+var_4]"], [47, "cdqe"], [48, "add rax, 1"], [49, "lea rdx, ds:0[rax*4]"], [50, "mov rax, [rbp+var_18]"], [51, "add rdx, rax"], [52, "mov eax, [rbp+var_C]"], [53, "mov [rdx], eax"], [54, "mov eax, [rbp+var_4]"], [55, "lea edx, [rax+1]"], [56, "mov [rbp+var_4], edx"], [57, "mov rdx, [rbp+var_20]"], [58, "mov edx, [rdx]"], [59, "cmp eax, edx"], [60, "jl loc_4028DC"], [61, "mov eax, [rbp+var_8]"], [62, "lea edx, [rax-1]"], [63, "mov [rbp+var_8], edx"], [64, "test eax, eax"], [65, "jnz loc_4028D0"], [66, "nop"], [67, "nop"], [68, "pop rbp"], [69, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [11, 56], [13, 58], [14, 2], [15, 14], [15, 13], [16, 15], [16, 53], [16, 45], [17, 56], [19, 17], [20, 20], [20, 41], [21, 2], [22, 21], [22, 20], [23, 45], [23, 22], [23, 53], [24, 23], [24, 16], [25, 24], [26, 56], [28, 16], [29, 2], [30, 29], [30, 28], [31, 30], [31, 53], [31, 45], [32, 31], [33, 56], [35, 33], [36, 28], [37, 2], [38, 36], [38, 37], [39, 56], [40, 39], [41, 20], [42, 2], [43, 41], [43, 42], [44, 45], [44, 38], [44, 53], [45, 43], [45, 44], [46, 56], [48, 46], [49, 43], [50, 2], [51, 50], [51, 49], [52, 32], [53, 52], [53, 51], [54, 9], [54, 56], [55, 45], [55, 54], [55, 51], [55, 53], [55, 62], [55, 16], [56, 55], [57, 3], [58, 53], [58, 57], [58, 45], [59, 54], [59, 58], [60, 59], [61, 63], [61, 7], [62, 53], [62, 61], [62, 45], [62, 58], [63, 62], [64, 61], [65, 64], [68, 0], [69, 64]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8ddaced626645131a45582a4817460593cf15f93f6ea409516e52427974dbf5b_8ddaced626645131a45582a4817460593cf15f93f6ea409516e52427974dbf5b.jsonl.gz", "strip_func_name": "sub_4028B3", "query": "\n\n\n__int64 __fastcall sub_4028B3(__int64 a1, int *a2)\n{\nint v2; // eax\n__int64 result; // rax\nint v4; // [rsp+14h] [rbp-Ch]\nunsigned int v5; // [rsp+18h] [rbp-8h]\nint v6; // [rsp+1Ch] [rbp-4h]\n\nv5 = *a2 - 1;\nwhile ( 1 )\n{\nresult = v5--;\nif ( !(_DWORD)result )\nbreak;\nv6 = 0;\nwhile ( 1 )\n{\nv2 = v6++;\nif ( v2 >= *a2 )\nbreak;\nif ( *(_DWORD *)(4LL * v6 + a1) < *(_DWORD *)(4 * (v6 + 1LL) + a1) )\n{\nv4 = *(_DWORD *)(4LL * v6 + a1);\n*(_DWORD *)(4LL * v6 + a1) = *(_DWORD *)(4 * (v6 + 1LL) + a1);\n*(_DWORD *)(a1 + 4 * (v6 + 1LL)) = v4;\n}\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v4,v5,v6,sub_4028B3,]", "hints": "[]", "response": "{'a1': 'stack', 'a2': 'stackindex', 'v4': 'save', 'v5': 'counter', 'v6': 'pointer', 'sub_4028B3': 'stack_sort'}"} | [
[
0.8444836735725403,
0.8031068444252014,
0.7752147912979126,
0.7709202766418457,
0.7592631578445435,
0.757144033908844,
0.74391770362854,
0.731551468372345,
0.7305577993392944,
0.7303944826126099,
0.7284616231918335,
0.7270748019218445,
0.726804256439209,
0.725945770740509,
0.7252280116081238,
0.7236011028289795,
0.7197278141975403,
0.7184731960296631,
0.7146221399307251,
0.7134767174720764
],
[
135511,
202903,
133325,
242650,
173802,
130331,
140909,
146878,
205181,
107677,
236146,
73980,
58160,
202803,
217321,
136986,
250942,
10457,
109574,
257797
]
] |
|
rr_print_snap | ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9 | google | neper | NA | static void rr_print_snap(struct thread *t, int flow_index,
const struct neper_snap *snap, FILE *csv)
{
if (snap && csv) {
const struct rr_snap_opaque *rso = (void *)&snap->opaque;
fprintf(csv, ",%f,%f,%f,%f",
rso->min / MILLION, rso->mean / MILLION,
rso->max / MILLION, rso->stddev / MILLION);
if (t->percentiles) {
const struct options *opts = t->opts;
int i, j = 0;
for (i = 0; i < PER_INDEX_COUNT; i++)
if (percentiles_chosen(&opts->percentiles, i))
fprintf(csv, ",%f",
rso->percentile[j++] / MILLION);
}
fprintf(csv, "\n");
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404A9C", "function_addr": 4213404, "binary_name": "ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.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+stream], rcx"], [7, "cmp [rbp+var_38], 0"], [8, "jz loc_404C17"], [9, "cmp [rbp+stream], 0"], [10, "jz loc_404C17"], [11, "mov rax, [rbp+var_38]"], [12, "add rax, 20h "], [13, "mov [rbp+var_10], rax"], [14, "mov rax, [rbp+var_10]"], [15, "movsd xmm0, qword ptr [rax+18h]"], [16, "mov eax, 0F4240h"], [17, "pxor xmm1, xmm1"], [18, "cvtsi2sd xmm1, eax"], [19, "movapd xmm3, xmm0"], [20, "divsd xmm3, xmm1"], [21, "mov rax, [rbp+var_10]"], [22, "movsd xmm0, qword ptr [rax+8]"], [23, "mov eax, 0F4240h"], [24, "pxor xmm1, xmm1"], [25, "cvtsi2sd xmm1, eax"], [26, "movapd xmm2, xmm0"], [27, "divsd xmm2, xmm1"], [28, "mov rax, [rbp+var_10]"], [29, "movsd xmm0, qword ptr [rax+10h]"], [30, "mov eax, 0F4240h"], [31, "pxor xmm1, xmm1"], [32, "cvtsi2sd xmm1, eax"], [33, "movapd xmm4, xmm0"], [34, "divsd xmm4, xmm1"], [35, "mov rax, [rbp+var_10]"], [36, "movsd xmm0, qword ptr [rax]"], [37, "mov eax, 0F4240h"], [38, "pxor xmm1, xmm1"], [39, "cvtsi2sd xmm1, eax"], [40, "divsd xmm0, xmm1"], [41, "movq rdx, xmm0"], [42, "mov rax, [rbp+stream]"], [43, "movapd xmm1, xmm4"], [44, "movq xmm0, rdx"], [45, "mov esi, offset format"], [46, "mov rdi, rax"], [47, "mov eax, 4"], [48, "call _fprintf"], [49, "mov rax, [rbp+var_28]"], [50, "mov eax, [rax+60h]"], [51, "test eax, eax"], [52, "jz loc_404C06"], [53, "mov rax, [rbp+var_28]"], [54, "mov rax, [rax+38h]"], [55, "mov [rbp+var_18], rax"], [56, "mov [rbp+var_8], 0"], [57, "mov [rbp+var_4], 0"], [58, "jmp short loc_404C00"], [59, "mov rax, [rbp+var_18]"], [60, "lea rdx, [rax+0D8h]"], [61, "mov eax, [rbp+var_4]"], [62, "mov esi, eax"], [63, "mov rdi, rdx"], [64, "call sub_40EC41"], [65, "test al, al"], [66, "jz short loc_404BFC"], [67, "mov eax, [rbp+var_8]"], [68, "lea edx, [rax+1]"], [69, "mov [rbp+var_8], edx"], [70, "mov rdx, [rbp+var_10]"], [71, "cdqe"], [72, "add rax, 4"], [73, "movsd xmm0, qword ptr [rdx+rax*8]"], [74, "mov eax, 0F4240h"], [75, "pxor xmm1, xmm1"], [76, "cvtsi2sd xmm1, eax"], [77, "divsd xmm0, xmm1"], [78, "movq rdx, xmm0"], [79, "mov rax, [rbp+stream]"], [80, "movq xmm0, rdx"], [81, "mov esi, offset asc_41411C"], [82, "mov rdi, rax"], [83, "mov eax, 1"], [84, "call _fprintf"], [85, "add [rbp+var_4], 1"], [86, "cmp [rbp+var_4], 66h "], [87, "jle short loc_404B97"], [88, "mov rax, [rbp+stream]"], [89, "mov rsi, rax"], [90, "mov edi, 0Ah"], [91, "call _fputc"], [92, "nop"], [93, "leave"], [94, "retn"]], "data_dep": [[7, 5], [8, 7], [9, 6], [10, 9], [11, 5], [12, 11], [13, 12], [14, 13], [15, 14], [18, 17], [18, 16], [19, 15], [20, 19], [20, 18], [21, 13], [22, 21], [25, 23], [25, 24], [26, 22], [27, 26], [27, 25], [28, 13], [29, 28], [32, 30], [32, 31], [33, 29], [34, 32], [34, 33], [35, 13], [36, 35], [39, 37], [39, 38], [40, 36], [40, 39], [41, 40], [42, 6], [43, 34], [44, 41], [46, 42], [49, 3], [50, 49], [51, 50], [52, 51], [53, 3], [54, 53], [55, 54], [59, 55], [60, 78], [60, 41], [60, 59], [60, 60], [61, 85], [61, 57], [62, 61], [63, 60], [65, 64], [66, 65], [67, 56], [67, 69], [68, 67], [68, 60], [69, 68], [70, 13], [72, 67], [73, 72], [76, 74], [76, 75], [77, 76], [77, 73], [78, 77], [79, 6], [80, 78], [82, 79], [85, 57], [85, 85], [86, 85], [86, 57], [87, 86], [88, 6], [89, 88], [94, 91]]}
| {"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_404A9C", "query": "\n\n\nvoid __fastcall sub_404A9C(__int64 a1, __int64 a2, double *a3, FILE *a4)\n{\nint v4; // eax\n__int64 v7; // [rsp+28h] [rbp-18h]\nint v8; // [rsp+38h] [rbp-8h]\nint i; // [rsp+3Ch] [rbp-4h]\n\nif ( a3 && a4 )\n{\nfprintf(\na4,\n\",%f,%f,%f,%f\",\na3[4] / (double)1000000,\na3[6] / (double)1000000,\na3[5] / (double)1000000,\na3[7] / (double)1000000);\nif ( *(_DWORD *)(a1 + 96) )\n{\nv7 = *(_QWORD *)(a1 + 56);\nv8 = 0;\nfor ( i = 0; i <= 102; ++i )\n{\nif ( (unsigned __int8)sub_40EC41(v7 + 216, (unsigned int)i) )\n{\nv4 = v8++;\nfprintf(a4, \",%f\", a3[v4 + 8] / (double)1000000);\n}\n}\n}\nfputc(10, a4);\n}\n}\n\n\n\nQ:[a3,a4,a1,a2,v7,sub_404A9C,sub_40EC41,]", "hints": "[]", "response": "{'a3': 'snap', 'a4': 'csv', 'a1': 't', 'a2': 'flow_index', 'v7': 'opts', 'sub_404A9C': 'rr_print_snap', 'sub_40EC41': 'percentiles_chosen'}"} | [
[
0.7038177251815796,
0.6883808374404907,
0.6875471472740173,
0.6863572597503662,
0.6847561597824097,
0.6756295561790466,
0.6755929589271545,
0.666743814945221,
0.661710798740387,
0.6606427431106567,
0.6597062945365906,
0.6564364433288574,
0.6561117172241211,
0.6554694175720215,
0.6530599594116211,
0.6519409418106079,
0.6518015265464783,
0.6514456272125244,
0.651330828666687,
0.6504440307617188
],
[
139732,
122717,
198720,
158914,
67031,
191413,
250340,
187725,
52898,
253730,
38480,
184627,
46081,
59132,
251590,
123639,
87420,
134292,
81667,
7935
]
] |
|
m_sinh | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_sinh(bvm *vm)
{
if (be_top(vm) >= 1 && be_isnumber(vm, 1)) {
breal x = be_toreal(vm, 1);
be_pushreal(vm, mathfunc(sinh)(x));
} else {
be_pushreal(vm, (breal)0.0);
}
be_return(vm);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_427B82", "function_addr": 4356994, "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_427BED"], [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_427BED"], [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 _sinhf"], [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_427BFD"], [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_427B82", "query": "\n\n\n__int64 __fastcall sub_427B82(__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 = sinhf(*(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_427B82,]", "hints": "[]", "response": "{'a1': 'vm', 'sub_427B82': 'm_sinh'}"} | [
[
0.7673817873001099,
0.7579426765441895,
0.7549210786819458,
0.7504571676254272,
0.7501611709594727,
0.7499257922172546,
0.7497574090957642,
0.7488404512405396,
0.748164713382721,
0.7469679117202759,
0.7461708784103394,
0.744759202003479,
0.7444560527801514,
0.7427449226379395,
0.7427027821540833,
0.7418537139892578,
0.7390892505645752,
0.7387426495552063,
0.7382143139839172,
0.7346542477607727
],
[
243776,
29063,
259240,
47277,
233921,
188973,
258100,
127430,
119522,
247074,
215476,
137038,
104708,
123404,
21993,
7804,
241351,
77905,
14015,
256290
]
] |
|
print_help | 843e4c6fffe44f62096dd218ec083ccfea9913dc4ecd337f53217f9ed7ac920a | xbarin02 | x-compressor | NA | void print_help(char *path)
{
fprintf(stderr, "Usage :\n\t%s [arguments] [input-file] [output-file]\n\n", path);
fprintf(stderr, "Arguments :\n");
fprintf(stderr, " -0 : store only\n");
fprintf(stderr, " -1 : compress faster (default)\n");
fprintf(stderr, " -9 : compress better\n");
fprintf(stderr, " -d : force decompression\n");
fprintf(stderr, " -z : force compression\n");
fprintf(stderr, " -f : overwrite existing output file\n");
fprintf(stderr, " -k : keep (don't delete) input file (default)\n");
fprintf(stderr, " -h : print this message\n");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013CE", "function_addr": 4199374, "binary_name": "843e4c6fffe44f62096dd218ec083ccfea9913dc4ecd337f53217f9ed7ac920a.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 format"], [7, "mov rdi, rax"], [8, "mov eax, 0"], [9, "call _fprintf"], [10, "mov rax, cs:stderr"], [11, "mov rcx, rax"], [12, "mov edx, 0Ch"], [13, "mov esi, 1"], [14, "mov edi, offset aArguments"], [15, "call _fwrite"], [16, "mov rax, cs:stderr"], [17, "mov rcx, rax"], [18, "mov edx, 15h"], [19, "mov esi, 1"], [20, "mov edi, offset a0StoreOnly"], [21, "call _fwrite"], [22, "mov rax, cs:stderr"], [23, "mov rcx, rax"], [24, "mov edx, 24h "], [25, "mov esi, 1"], [26, "mov edi, offset a1CompressFaste"], [27, "call _fwrite"], [28, "mov rax, cs:stderr"], [29, "mov rcx, rax"], [30, "mov edx, 1Ah"], [31, "mov esi, 1"], [32, "mov edi, offset a9CompressBette"], [33, "call _fwrite"], [34, "mov rax, cs:stderr"], [35, "mov rcx, rax"], [36, "mov edx, 1Eh"], [37, "mov esi, 1"], [38, "mov edi, offset aDForceDecompre"], [39, "call _fwrite"], [40, "mov rax, cs:stderr"], [41, "mov rcx, rax"], [42, "mov edx, 1Ch"], [43, "mov esi, 1"], [44, "mov edi, offset aZForceCompress"], [45, "call _fwrite"], [46, "mov rax, cs:stderr"], [47, "mov rcx, rax"], [48, "mov edx, 29h "], [49, "mov esi, 1"], [50, "mov edi, offset aFOverwriteExis"], [51, "call _fwrite"], [52, "mov rax, cs:stderr"], [53, "mov rcx, rax"], [54, "mov edx, 33h "], [55, "mov esi, 1"], [56, "mov edi, offset aKKeepDonTDelet"], [57, "call _fwrite"], [58, "mov rax, cs:stderr"], [59, "mov rcx, rax"], [60, "mov edx, 1Dh"], [61, "mov esi, 1"], [62, "mov edi, offset aHPrintThisMess"], [63, "call _fwrite"], [64, "nop"], [65, "leave"], [66, "retn"]], "data_dep": [[5, 3], [7, 4], [11, 10], [17, 16], [23, 22], [29, 28], [35, 34], [41, 40], [47, 46], [53, 52], [59, 58], [66, 63]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/843e4c6fffe44f62096dd218ec083ccfea9913dc4ecd337f53217f9ed7ac920a_843e4c6fffe44f62096dd218ec083ccfea9913dc4ecd337f53217f9ed7ac920a.jsonl.gz", "strip_func_name": "sub_4013CE", "query": "\n\n\nsize_t __fastcall sub_4013CE(const char *a1)\n{\nfprintf(stderr, \"Usage :\\n\\t%s [arguments] [input-file] [output-file]\\n\\n\", a1);\nfwrite(\"Arguments :\\n\", 1uLL, 0xCuLL, stderr);\nfwrite(\" -0 : store only\\n\", 1uLL, 0x15uLL, stderr);\nfwrite(\" -1 : compress faster (default)\\n\", 1uLL, 0x24uLL, stderr);\nfwrite(\" -9 : compress better\\n\", 1uLL, 0x1AuLL, stderr);\nfwrite(\" -d : force decompression\\n\", 1uLL, 0x1EuLL, stderr);\nfwrite(\" -z : force compression\\n\", 1uLL, 0x1CuLL, stderr);\nfwrite(\" -f : overwrite existing output file\\n\", 1uLL, 0x29uLL, stderr);\nfwrite(\" -k : keep (don't delete) input file (default)\\n\", 1uLL, 0x33uLL, stderr);\nreturn fwrite(\" -h : print this message\\n\", 1uLL, 0x1DuLL, stderr);\n}\n\n\n\nQ:[a1,sub_4013CE,]", "hints": "[]", "response": "{'a1': 'path', 'sub_4013CE': 'print_help'}"} | [
[
0.9145433902740479,
0.9106646776199341,
0.9039747714996338,
0.9027317762374878,
0.9027010202407837,
0.902023434638977,
0.9016367793083191,
0.8983630537986755,
0.8938303589820862,
0.8924996256828308,
0.8921613693237305,
0.889515221118927,
0.8881250619888306,
0.886013925075531,
0.884284496307373,
0.8813734650611877,
0.8813314437866211,
0.8812872171401978,
0.8792809247970581,
0.8749533295631409
],
[
57687,
187859,
80709,
46781,
60341,
126484,
168448,
247140,
216281,
207935,
244587,
233964,
163033,
48862,
261475,
178997,
231928,
253842,
240059,
88745
]
] |
|
ircode_set_index | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | void ircode_set_index (uint32_t index, ircode_t *code, opcode_t op, uint32_t p1, uint32_t p2, uint32_t p3) {
inst_t *inst = marray_get(*code->list, index);
inst->op = op;
inst->p1 = p1;
inst->p2 = p2;
inst->p3 = p3;
inst->tag = NO_TAG;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41DE95", "function_addr": 4316821, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_14], edi"], [3, "mov [rbp+var_20], rsi"], [4, "mov [rbp+var_18], edx"], [5, "mov [rbp+var_24], ecx"], [6, "mov [rbp+var_28], r8d"], [7, "mov [rbp+var_2C], r9d"], [8, "mov rax, [rbp+var_20]"], [9, "mov rax, [rax]"], [10, "mov rdx, [rax+10h]"], [11, "mov eax, [rbp+var_14]"], [12, "shl rax, 3"], [13, "add rax, rdx"], [14, "mov rax, [rax]"], [15, "mov [rbp+var_8], rax"], [16, "mov rax, [rbp+var_8]"], [17, "mov edx, [rbp+var_18]"], [18, "mov [rax], edx"], [19, "mov edx, [rbp+var_24]"], [20, "mov rax, [rbp+var_8]"], [21, "mov [rax+8], edx"], [22, "mov edx, [rbp+var_28]"], [23, "mov rax, [rbp+var_8]"], [24, "mov [rax+0Ch], edx"], [25, "mov edx, [rbp+var_2C]"], [26, "mov rax, [rbp+var_8]"], [27, "mov [rax+10h], edx"], [28, "mov rax, [rbp+var_8]"], [29, "mov dword ptr [rax+4], 0"], [30, "nop"], [31, "pop rbp"], [32, "retn"]], "data_dep": [[8, 3], [9, 8], [10, 9], [11, 2], [12, 11], [13, 10], [13, 12], [14, 13], [15, 14], [16, 15], [17, 4], [18, 17], [18, 16], [19, 5], [20, 15], [21, 19], [21, 20], [22, 6], [23, 15], [24, 23], [24, 22], [25, 7], [26, 15], [27, 25], [27, 26], [28, 15], [29, 28], [31, 0], [32, 28]]}
| {"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_41DE95", "query": "\n\n\n_DWORD *__fastcall sub_41DE95(unsigned int a1, __int64 a2, int a3, int a4, int a5, int a6)\n{\n_DWORD *result; // rax\n_DWORD *v7; // [rsp+24h] [rbp-8h]\n\nv7 = *(_DWORD **)(*(_QWORD *)(*(_QWORD *)a2 + 16LL) + 8LL * a1);\n*v7 = a3;\nv7[2] = a4;\nv7[3] = a5;\nv7[4] = a6;\nresult = v7;\nv7[1] = 0;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,v7,sub_41DE95,]", "hints": "[]", "response": "{'a3': 'op', 'a4': 'p1', 'a1': 'index', 'a2': 'code', 'a5': 'p2', 'a6': 'p3', 'v7': 'inst', 'sub_41DE95': 'ircode_set_index'}"} | [
[
0.8045161366462708,
0.7934635877609253,
0.784125030040741,
0.777426540851593,
0.7558830380439758,
0.7496206760406494,
0.7495862245559692,
0.7487694025039673,
0.7428385615348816,
0.7359499335289001,
0.7355351448059082,
0.7352913618087769,
0.7330118417739868,
0.7258498668670654,
0.7244685888290405,
0.7232617139816284,
0.7213345766067505,
0.7145072817802429,
0.71384596824646,
0.7130787372589111
],
[
130033,
132361,
259435,
68516,
143189,
50208,
240403,
201317,
184222,
258497,
120115,
133629,
120394,
41783,
96330,
246929,
103742,
93537,
208294,
203037
]
] |
|
mark_proto | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static void mark_proto(bvm *vm, bgcobject *obj)
{
bproto *p = cast_proto(obj);
gc_try (p != NULL) {
int count;
bvalue *k = p->ktab;
bproto **ptab = p->ptab;
vm->gc.gray = p->gray; /* remove object from gray list */
for (count = p->nconst; count--; ++k) {
mark_gray_var(vm, k);
}
for (count = p->nproto; count--; ++ptab) {
mark_gray(vm, gc_object(*ptab));
}
gc_setdark_safe(p->name);
#if BE_DEBUG_SOURCE_FILE
gc_setdark_safe(p->source);
#endif
#if BE_DEBUG_VAR_INFO
if (p->nvarinfo) {
bvarinfo *vinfo = p->varinfo;
be_assert(vinfo != NULL);
for (count = p->nvarinfo; count--; ++vinfo) {
gc_setdark_safe(vinfo->name);
}
}
#endif
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42C0AB", "function_addr": 4374699, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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_30], rsi"], [5, "cmp [rbp+var_30], 0"], [6, "jz short loc_42C0D4"], [7, "mov rax, [rbp+var_30]"], [8, "movzx eax, byte ptr [rax+8]"], [9, "cmp al, 13h"], [10, "jnz short loc_42C0D4"], [11, "mov rax, [rbp+var_30]"], [12, "jmp short loc_42C0D9"], [13, "mov eax, 0"], [14, "mov [rbp+var_20], rax"], [15, "cmp [rbp+var_20], 0"], [16, "jz loc_42C254"], [17, "mov rax, [rbp+var_20]"], [18, "mov rax, [rax+20h]"], [19, "mov [rbp+var_10], rax"], [20, "mov rax, [rbp+var_20]"], [21, "mov rax, [rax+28h]"], [22, "mov [rbp+var_18], rax"], [23, "mov rax, [rbp+var_20]"], [24, "mov rdx, [rax+10h]"], [25, "mov rax, [rbp+var_28]"], [26, "mov [rax+140h], rdx"], [27, "mov rax, [rbp+var_20]"], [28, "mov eax, [rax+44h]"], [29, "mov [rbp+var_4], eax"], [30, "jmp short loc_42C137"], [31, "mov rdx, [rbp+var_10]"], [32, "mov rax, [rbp+var_28]"], [33, "mov rsi, rdx"], [34, "mov rdi, rax"], [35, "call sub_42BEEF"], [36, "add [rbp+var_10], 10h"], [37, "mov eax, [rbp+var_4]"], [38, "lea edx, [rax-1]"], [39, "mov [rbp+var_4], edx"], [40, "test eax, eax"], [41, "jnz short loc_42C11F"], [42, "mov rax, [rbp+var_20]"], [43, "mov eax, [rax+48h]"], [44, "mov [rbp+var_4], eax"], [45, "jmp short loc_42C16B"], [46, "mov rax, [rbp+var_18]"], [47, "mov rdx, [rax]"], [48, "mov rax, [rbp+var_28]"], [49, "mov rsi, rdx"], [50, "mov rdi, rax"], [51, "call sub_42B9E2"], [52, "add [rbp+var_18], 8"], [53, "mov eax, [rbp+var_4]"], [54, "lea edx, [rax-1]"], [55, "mov [rbp+var_4], edx"], [56, "test eax, eax"], [57, "jnz short loc_42C150"], [58, "mov rax, [rbp+var_20]"], [59, "mov rax, [rax+38h]"], [60, "test rax, rax"], [61, "jz short loc_42C1E6"], [62, "mov rax, [rbp+var_28]"], [63, "mov eax, [rax+1B4h]"], [64, "lea edx, [rax+1]"], [65, "mov rax, [rbp+var_28]"], [66, "mov [rax+1B4h], edx"], [67, "mov rax, [rbp+var_20]"], [68, "mov rax, [rax+38h]"], [69, "movzx eax, byte ptr [rax+9]"], [70, "movzx eax, al"], [71, "and eax, 8"], [72, "test eax, eax"], [73, "jnz short loc_42C1E6"], [74, "mov rax, [rbp+var_20]"], [75, "mov rax, [rax+38h]"], [76, "movzx edx, byte ptr [rax+9]"], [77, "mov rax, [rbp+var_20]"], [78, "mov rax, [rax+38h]"], [79, "and edx, 0FFFFFFFCh"], [80, "mov [rax+9], dl"], [81, "mov rax, [rbp+var_20]"], [82, "mov rax, [rax+38h]"], [83, "movzx edx, byte ptr [rax+9]"], [84, "mov rax, [rbp+var_20]"], [85, "mov rax, [rax+38h]"], [86, "or edx, 2"], [87, "mov [rax+9], dl"], [88, "mov rax, [rbp+var_20]"], [89, "mov rax, [rax+50h]"], [90, "test rax, rax"], [91, "jz short loc_42C254"], [92, "mov rax, [rbp+var_28]"], [93, "mov eax, [rax+1B4h]"], [94, "lea edx, [rax+1]"], [95, "mov rax, [rbp+var_28]"], [96, "mov [rax+1B4h], edx"], [97, "mov rax, [rbp+var_20]"], [98, "mov rax, [rax+50h]"], [99, "movzx eax, byte ptr [rax+9]"], [100, "movzx eax, al"], [101, "and eax, 8"], [102, "test eax, eax"], [103, "jnz short loc_42C254"], [104, "mov rax, [rbp+var_20]"], [105, "mov rax, [rax+50h]"], [106, "movzx edx, byte ptr [rax+9]"], [107, "mov rax, [rbp+var_20]"], [108, "mov rax, [rax+50h]"], [109, "and edx, 0FFFFFFFCh"], [110, "mov [rax+9], dl"], [111, "mov rax, [rbp+var_20]"], [112, "mov rax, [rax+50h]"], [113, "movzx edx, byte ptr [rax+9]"], [114, "mov rax, [rbp+var_20]"], [115, "mov rax, [rax+50h]"], [116, "or edx, 2"], [117, "mov [rax+9], dl"], [118, "nop"], [119, "leave"], [120, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 4], [8, 7], [9, 8], [10, 9], [11, 4], [14, 13], [14, 11], [15, 14], [16, 15], [17, 14], [18, 17], [19, 18], [20, 14], [21, 20], [22, 21], [23, 14], [24, 23], [25, 3], [26, 25], [26, 24], [27, 14], [28, 27], [28, 26], [29, 28], [31, 19], [31, 36], [32, 3], [33, 31], [34, 32], [36, 36], [36, 19], [37, 39], [37, 29], [38, 31], [38, 24], [38, 26], [38, 37], [39, 38], [40, 37], [41, 40], [42, 14], [43, 42], [43, 26], [44, 43], [46, 52], [46, 22], [47, 26], [47, 46], [48, 3], [49, 47], [50, 48], [52, 52], [52, 22], [53, 55], [53, 44], [54, 26], [54, 53], [54, 38], [54, 47], [55, 54], [56, 53], [57, 56], [58, 14], [59, 26], [59, 58], [60, 59], [61, 60], [62, 3], [63, 26], [63, 62], [63, 66], [64, 66], [64, 54], [64, 63], [64, 26], [65, 3], [66, 64], [66, 65], [67, 14], [68, 66], [68, 67], [69, 66], [69, 68], [70, 69], [71, 70], [72, 71], [73, 72], [74, 14], [75, 26], [75, 74], [75, 87], [75, 80], [75, 66], [76, 26], [76, 87], [76, 80], [76, 66], [76, 75], [77, 14], [78, 77], [78, 26], [78, 87], [78, 80], [78, 66], [79, 76], [80, 78], [80, 79], [81, 14], [82, 81], [82, 80], [83, 80], [83, 82], [84, 14], [85, 84], [85, 80], [86, 83], [87, 86], [87, 85], [88, 14], [89, 88], [89, 26], [89, 87], [89, 80], [89, 66], [90, 89], [91, 90], [92, 3], [93, 26], [93, 92], [93, 87], [93, 96], [93, 80], [93, 66], [94, 87], [94, 96], [94, 80], [94, 64], [94, 66], [94, 54], [94, 93], [94, 86], [94, 26], [95, 3], [96, 95], [96, 94], [97, 14], [98, 96], [98, 97], [99, 87], [99, 96], [99, 98], [100, 99], [101, 100], [102, 101], [103, 102], [104, 14], [105, 104], [105, 26], [105, 117], [105, 110], [105, 87], [105, 96], [105, 80], [105, 66], [106, 26], [106, 117], [106, 110], [106, 87], [106, 96], [106, 105], [106, 80], [106, 66], [107, 14], [108, 66], [108, 107], [108, 26], [108, 117], [108, 110], [108, 87], [108, 96], [108, 80], [109, 106], [110, 109], [110, 108], [111, 14], [112, 111], [112, 110], [113, 110], [113, 112], [114, 14], [115, 114], [115, 110], [116, 113], [117, 116], [117, 115], [120, 115], [120, 90], [120, 11], [120, 13], [120, 102]]}
| {"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_42C0AB", "query": "\n\n\n__int64 __fastcall sub_42C0AB(__int64 a1, __int64 a2)\n{\n__int64 result; // rax\n__int64 v5; // [rsp+10h] [rbp-20h]\n__int64 *v6; // [rsp+18h] [rbp-18h]\n__int64 v7; // [rsp+20h] [rbp-10h]\nint v8; // [rsp+2Ch] [rbp-4h]\nint v9; // [rsp+2Ch] [rbp-4h]\n\nif ( a2 && *(_BYTE *)(a2 + 8) == 19 )\nresult = a2;\nelse\nresult = 0LL;\nv5 = result;\nif ( result )\n{\nv7 = *(_QWORD *)(result + 32);\nv6 = *(__int64 **)(result + 40);\n*(_QWORD *)(a1 + 320) = *(_QWORD *)(result + 16);\nv8 = *(_DWORD *)(result + 68);\nwhile ( v8-- )\n{\nsub_42BEEF(a1, v7);\nv7 += 16LL;\n}\nv9 = *(_DWORD *)(v5 + 72);\nwhile ( v9-- )\nsub_42B9E2(a1, *v6++);\nif ( *(_QWORD *)(v5 + 56) )\n{\n++*(_DWORD *)(a1 + 436);\nif ( (*(_BYTE *)(*(_QWORD *)(v5 + 56) + 9LL) & 8) == 0 )\n{\n*(_BYTE *)(*(_QWORD *)(v5 + 56) + 9LL) &= 0xFCu;\n*(_BYTE *)(*(_QWORD *)(v5 + 56) + 9LL) |= 2u;\n}\n}\nresult = *(_QWORD *)(v5 + 80);\nif ( result )\n{\n++*(_DWORD *)(a1 + 436);\nresult = *(_BYTE *)(*(_QWORD *)(v5 + 80) + 9LL) & 8;\nif ( (*(_BYTE *)(*(_QWORD *)(v5 + 80) + 9LL) & 8) == 0 )\n{\n*(_BYTE *)(*(_QWORD *)(v5 + 80) + 9LL) &= 0xFCu;\nresult = *(_QWORD *)(v5 + 80);\n*(_BYTE *)(result + 9) |= 2u;\n}\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v5,v6,v9,sub_42C0AB,sub_42BEEF,sub_42B9E2,]", "hints": "[]", "response": "{'a1': 'vm', 'a2': 'obj', 'v5': 'p', 'v6': 'ptab', 'v9': 'count', 'sub_42C0AB': 'mark_proto', 'sub_42BEEF': 'mark_gray_var', 'sub_42B9E2': 'mark_gray'}"} | [
[
0.8119598627090454,
0.7600907683372498,
0.7600907683372498,
0.7541803121566772,
0.7498641610145569,
0.7467592358589172,
0.7442812919616699,
0.7286317348480225,
0.7282167077064514,
0.7282167077064514,
0.727371335029602,
0.7248963713645935,
0.7229616641998291,
0.7192878127098083,
0.7189855575561523,
0.7183454036712646,
0.718061625957489,
0.7160980105400085,
0.7158325910568237,
0.7156373858451843
],
[
250197,
75183,
100227,
166325,
189309,
236483,
9220,
203689,
168244,
173030,
101837,
166832,
159430,
182180,
133447,
109117,
15197,
203917,
207192,
132952
]
] |
|
print_usage | ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9 | google | neper | NA | static void print_usage(FILE *f, const char *program, struct flag *flags)
{
const struct flag *flag;
size_t i, maxlen;
maxlen = 0;
for (flag = flags; flag; flag = flag->next) {
if (strlen(flag->long_name) > maxlen)
maxlen = strlen(flag->long_name);
}
fprintf(f, "usage: %s [<options>]\n\n", program);
for (flag = flags; flag; flag = flag->next) {
if (isgraph(flag->short_name))
fprintf(f, " -%c,", flag->short_name);
else
fprintf(f, " ");
fprintf(f, " --%s", flag->long_name);
for (i = 0; i < maxlen - strlen(flag->long_name); i++)
fprintf(f, " ");
fprintf(f, " %s\n", flag->usage);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_409FAB", "function_addr": 4235179, "binary_name": "ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "mov [rbp+var_18], 0"], [7, "mov rax, [rbp+var_38]"], [8, "mov [rbp+var_8], rax"], [9, "jmp short loc_40A007"], [10, "mov rax, [rbp+var_8]"], [11, "mov rax, [rax+8]"], [12, "mov rdi, rax"], [13, "call _strlen"], [14, "cmp [rbp+var_18], rax"], [15, "jnb short loc_409FFB"], [16, "mov rax, [rbp+var_8]"], [17, "mov rax, [rax+8]"], [18, "mov rdi, rax"], [19, "call _strlen"], [20, "mov [rbp+var_18], rax"], [21, "mov rax, [rbp+var_8]"], [22, "mov rax, [rax+48h]"], [23, "mov [rbp+var_8], rax"], [24, "cmp [rbp+var_8], 0"], [25, "jnz short loc_409FD1"], [26, "mov rdx, [rbp+var_30]"], [27, "mov rax, [rbp+stream]"], [28, "mov esi, offset aUsageSOptions"], [29, "mov rdi, rax"], [30, "mov eax, 0"], [31, "call _fprintf"], [32, "mov rax, [rbp+var_38]"], [33, "mov [rbp+var_8], rax"], [34, "jmp loc_40A11B"], [35, "call ___ctype_b_loc"], [36, "mov rdx, [rax]"], [37, "mov rax, [rbp+var_8]"], [38, "movzx eax, byte ptr [rax]"], [39, "movsx rax, al"], [40, "add rax, rax"], [41, "add rax, rdx"], [42, "movzx eax, word ptr [rax]"], [43, "test ax, ax"], [44, "jns short loc_40A078"], [45, "mov rax, [rbp+var_8]"], [46, "movzx eax, byte ptr [rax]"], [47, "movsx edx, al"], [48, "mov rax, [rbp+stream]"], [49, "mov esi, offset aC"], [50, "mov rdi, rax"], [51, "mov eax, 0"], [52, "call _fprintf"], [53, "jmp short loc_40A093"], [54, "mov rax, [rbp+stream]"], [55, "mov rcx, rax"], [56, "mov edx, 5"], [57, "mov esi, 1"], [58, "mov edi, offset asc_416179"], [59, "call _fwrite"], [60, "mov rax, [rbp+var_8]"], [61, "mov rdx, [rax+8]"], [62, "mov rax, [rbp+stream]"], [63, "mov esi, offset aS_0"], [64, "mov rdi, rax"], [65, "mov eax, 0"], [66, "call _fprintf"], [67, "mov [rbp+var_10], 0"], [68, "jmp short loc_40A0D1"], [69, "mov rax, [rbp+stream]"], [70, "mov rsi, rax"], [71, "mov edi, 20h "], [72, "call _fputc"], [73, "add [rbp+var_10], 1"], [74, "mov rax, [rbp+var_8]"], [75, "mov rax, [rax+8]"], [76, "mov rdi, rax"], [77, "call _strlen"], [78, "mov rdx, rax"], [79, "mov rax, [rbp+var_18]"], [80, "sub rax, rdx"], [81, "cmp [rbp+var_10], rax"], [82, "jb short loc_40A0BB"], [83, "mov rax, [rbp+var_8]"], [84, "mov rdx, [rax+10h]"], [85, "mov rax, [rbp+stream]"], [86, "mov esi, offset aS_1"], [87, "mov rdi, rax"], [88, "mov eax, 0"], [89, "call _fprintf"], [90, "mov rax, [rbp+var_8]"], [91, "mov rax, [rax+48h]"], [92, "mov [rbp+var_8], rax"], [93, "cmp [rbp+var_8], 0"], [94, "jnz loc_40A035"], [95, "nop"], [96, "nop"], [97, "leave"], [98, "retn"]], "data_dep": [[7, 5], [8, 7], [10, 8], [10, 23], [11, 10], [12, 11], [14, 13], [14, 6], [14, 20], [15, 14], [16, 8], [16, 23], [17, 16], [18, 17], [20, 19], [21, 8], [21, 23], [22, 21], [23, 22], [24, 8], [24, 23], [25, 24], [26, 4], [27, 3], [29, 27], [32, 5], [33, 32], [36, 35], [37, 33], [37, 92], [38, 37], [39, 38], [40, 39], [41, 40], [41, 36], [42, 41], [43, 42], [44, 43], [45, 92], [45, 33], [46, 45], [47, 46], [48, 3], [50, 48], [54, 3], [55, 54], [60, 92], [60, 33], [61, 60], [62, 3], [64, 62], [69, 3], [70, 69], [73, 67], [73, 73], [74, 33], [74, 92], [75, 74], [76, 75], [78, 77], [79, 20], [79, 6], [80, 78], [80, 79], [81, 80], [81, 73], [81, 67], [82, 81], [83, 33], [83, 92], [84, 83], [85, 3], [87, 85], [90, 33], [90, 92], [91, 90], [92, 91], [93, 33], [93, 92], [94, 93], [98, 32], [98, 91]]}
| {"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_409FAB", "query": "\n\n\nchar *__fastcall sub_409FAB(FILE *a1, const char *a2, char *a3)\n{\nchar *result; // rax\nchar *v4; // [rsp+8h] [rbp-38h]\nsize_t v5; // [rsp+28h] [rbp-18h]\nsize_t k; // [rsp+30h] [rbp-10h]\nchar *i; // [rsp+38h] [rbp-8h]\nchar *j; // [rsp+38h] [rbp-8h]\n\nv4 = a3;\nv5 = 0LL;\nfor ( i = a3; i; i = (char *)*((_QWORD *)i + 9) )\n{\nif ( v5 < strlen(*((const char **)i + 1)) )\nv5 = strlen(*((const char **)i + 1));\n}\nfprintf(a1, \"usage: %s [<options>]\\n\\n\", a2);\nresult = v4;\nfor ( j = v4; j; j = result )\n{\nif ( ((*__ctype_b_loc())[*j] & 0x8000u) == 0 )\nfwrite(\" \", 1uLL, 5uLL, a1);\nelse\nfprintf(a1, \" -%c,\", (unsigned int)*j);\nfprintf(a1, \" --%s\", *((const char **)j + 1));\nfor ( k = 0LL; k < v5 - strlen(*((const char **)j + 1)); ++k )\nfputc(32, a1);\nfprintf(a1, \" %s\\n\", *((const char **)j + 2));\nresult = (char *)*((_QWORD *)j + 9);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v4,v5,i,sub_409FAB,]", "hints": "[]", "response": "{'a3': 'flags', 'a1': 'f', 'a2': 'program', 'v4': 'flagsa', 'v5': 'maxlen', 'i': 'flaga', 'sub_409FAB': 'print_usage'}"} | [
[
0.780156672000885,
0.7779213190078735,
0.7680957913398743,
0.7552800178527832,
0.7480254173278809,
0.7473776936531067,
0.7434350848197937,
0.7427048683166504,
0.7349592447280884,
0.729894757270813,
0.7294689416885376,
0.7284570932388306,
0.7283823490142822,
0.7259843945503235,
0.7255548238754272,
0.7249016761779785,
0.7197954654693604,
0.7184121608734131,
0.7131296396255493,
0.7126492261886597
],
[
212864,
184059,
125961,
110630,
135453,
264036,
252210,
82835,
218824,
231720,
227625,
119941,
80150,
236576,
58105,
24027,
234733,
147414,
34528,
7618
]
] |
|
send_fake_RST | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | void send_fake_RST(struct mypacket *orig_packet, unsigned int flags)
{
char sip[16], dip[16];
unsigned short sport, dport;
unsigned int seq_num, ack_num;
struct send_tcp_vars vars = {};
struct in_addr s_in_addr = {orig_packet->iphdr->saddr};
struct in_addr d_in_addr = {orig_packet->iphdr->daddr};
strncpy(sip, inet_ntoa(s_in_addr), 16);
strncpy(dip, inet_ntoa(d_in_addr), 16);
sport = ntohs(orig_packet->tcphdr->th_sport);
dport = ntohs(orig_packet->tcphdr->th_dport);
seq_num = ntohl(orig_packet->tcphdr->th_seq);
ack_num = ntohl(orig_packet->tcphdr->th_ack);
memset(&vars, 0, sizeof vars);
strncpy(vars.src_ip, sip, 16);
strncpy(vars.dst_ip, dip, 16);
vars.src_port = sport;
vars.dst_port = dport;
vars.flags = TCP_RST | TCP_ACK;
vars.seq_num = seq_num;
vars.ack_num = 0;
// mss (aliyun discards SYN without mss option header)
//u_char bytes[4] = {0x02, 0x04, 0x05, 0xb4};
//memcpy(vars.tcp_opt, bytes, 4);
//vars.tcp_opt_len = 4;
// copy the tcp option header to the insertion packet
char *tcp_opt = (char*)orig_packet->tcphdr + 20;
unsigned char tcp_opt_len = orig_packet->tcphdr->th_off * 4 - 20;
memcpy(vars.tcp_opt, tcp_opt, tcp_opt_len);
vars.tcp_opt_len = tcp_opt_len;
send_insertion_packet(&vars, flags);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_411A0A", "function_addr": 4266506, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10D0h"], [3, "mov [rbp+var_10C8], rdi"], [4, "mov [rbp+var_10CC], esi"], [5, "lea rdx, [rbp+s]"], [6, "mov eax, 0"], [7, "mov ecx, 20Ch"], [8, "mov rdi, rdx"], [9, "rep stosq"], [10, "mov rdx, rdi"], [11, "mov [rdx], eax"], [12, "add rdx, 4"], [13, "mov rax, [rbp+var_10C8]"], [14, "mov rax, [rax+10h]"], [15, "mov eax, [rax+0Ch]"], [16, "mov [rbp+in.s_addr], eax"], [17, "mov rax, [rbp+var_10C8]"], [18, "mov rax, [rax+10h]"], [19, "mov eax, [rax+10h]"], [20, "mov [rbp+var_10B8.s_addr], eax"], [21, "mov eax, [rbp+in.s_addr]"], [22, "mov edi, eax"], [23, "call _inet_ntoa"], [24, "mov rcx, rax"], [25, "lea rax, [rbp+dest]"], [26, "mov edx, 10h"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _strncpy"], [30, "mov eax, [rbp+var_10B8.s_addr]"], [31, "mov edi, eax"], [32, "call _inet_ntoa"], [33, "mov rcx, rax"], [34, "lea rax, [rbp+src]"], [35, "mov edx, 10h"], [36, "mov rsi, rcx"], [37, "mov rdi, rax"], [38, "call _strncpy"], [39, "mov rax, [rbp+var_10C8]"], [40, "mov rax, [rax+18h]"], [41, "movzx eax, word ptr [rax]"], [42, "movzx eax, ax"], [43, "mov edi, eax"], [44, "call _ntohs"], [45, "mov [rbp+var_2], ax"], [46, "mov rax, [rbp+var_10C8]"], [47, "mov rax, [rax+18h]"], [48, "movzx eax, word ptr [rax+2]"], [49, "movzx eax, ax"], [50, "mov edi, eax"], [51, "call _ntohs"], [52, "mov [rbp+var_4], ax"], [53, "mov rax, [rbp+var_10C8]"], [54, "mov rax, [rax+18h]"], [55, "mov eax, [rax+4]"], [56, "mov edi, eax"], [57, "call _ntohl"], [58, "mov [rbp+var_8], eax"], [59, "mov rax, [rbp+var_10C8]"], [60, "mov rax, [rax+18h]"], [61, "mov eax, [rax+8]"], [62, "mov edi, eax"], [63, "call _ntohl"], [64, "mov [rbp+var_C], eax"], [65, "lea rax, [rbp+s]"], [66, "mov edx, 1064h"], [67, "mov esi, 0"], [68, "mov rdi, rax"], [69, "call _memset"], [70, "lea rcx, [rbp+dest]"], [71, "lea rax, [rbp+s]"], [72, "mov edx, 10h"], [73, "mov rsi, rcx"], [74, "mov rdi, rax"], [75, "call _strncpy"], [76, "lea rax, [rbp+src]"], [77, "lea rdx, [rbp+s]"], [78, "lea rcx, [rdx+10h]"], [79, "mov edx, 10h"], [80, "mov rsi, rax"], [81, "mov rdi, rcx"], [82, "call _strncpy"], [83, "movzx eax, [rbp+var_2]"], [84, "mov [rbp+var_108C], ax"], [85, "movzx eax, [rbp+var_4]"], [86, "mov [rbp+var_108A], ax"], [87, "mov [rbp+var_107D], 14h"], [88, "mov eax, [rbp+var_8]"], [89, "mov [rbp+var_1088], eax"], [90, "mov [rbp+var_1084], 0"], [91, "mov rax, [rbp+var_10C8]"], [92, "mov rax, [rax+18h]"], [93, "add rax, 14h"], [94, "mov [rbp+var_18], rax"], [95, "mov rax, [rbp+var_10C8]"], [96, "mov rax, [rax+18h]"], [97, "movzx eax, byte ptr [rax+0Ch]"], [98, "shr al, 4"], [99, "movzx eax, al"], [100, "sub eax, 5"], [101, "shl eax, 2"], [102, "mov [rbp+var_19], al"], [103, "movzx edx, [rbp+var_19]"], [104, "mov rax, [rbp+var_18]"], [105, "lea rcx, [rbp+s]"], [106, "add rcx, 37h "], [107, "mov rsi, rax"], [108, "mov rdi, rcx"], [109, "call _memcpy"], [110, "movzx eax, [rbp+var_19]"], [111, "mov [rbp+var_1051], al"], [112, "mov edx, [rbp+var_10CC]"], [113, "lea rax, [rbp+s]"], [114, "mov esi, edx"], [115, "mov rdi, rax"], [116, "call sub_41146E"], [117, "nop"], [118, "leave"], [119, "retn"]], "data_dep": [[8, 5], [10, 8], [11, 6], [11, 10], [12, 10], [13, 3], [14, 13], [14, 11], [15, 14], [15, 11], [16, 15], [17, 3], [18, 17], [18, 11], [19, 18], [19, 11], [20, 19], [21, 16], [22, 21], [24, 23], [25, 23], [27, 24], [28, 25], [30, 20], [31, 30], [33, 32], [34, 32], [36, 33], [37, 34], [39, 3], [40, 39], [40, 11], [41, 40], [41, 11], [42, 41], [43, 42], [45, 44], [46, 3], [47, 11], [47, 46], [48, 47], [48, 11], [49, 48], [50, 49], [52, 51], [53, 3], [54, 53], [54, 11], [55, 11], [55, 54], [56, 55], [58, 57], [59, 3], [60, 11], [60, 59], [61, 60], [61, 11], [62, 61], [64, 63], [65, 63], [68, 65], [70, 33], [71, 69], [73, 70], [74, 71], [76, 75], [77, 72], [78, 77], [78, 70], [78, 11], [80, 76], [81, 78], [83, 45], [84, 83], [85, 52], [86, 85], [88, 58], [89, 88], [91, 3], [92, 11], [92, 91], [93, 92], [94, 93], [95, 3], [96, 95], [96, 11], [97, 96], [97, 11], [98, 97], [99, 98], [100, 99], [101, 100], [102, 101], [103, 102], [104, 94], [105, 78], [106, 105], [107, 104], [108, 106], [110, 102], [111, 110], [112, 4], [113, 110], [114, 112], [115, 113], [119, 116]]}
| {"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_411A0A", "query": "\n\n\nint __fastcall sub_411A0A(__int64 a1, char a2)\n{\nchar *v2; // rax\nchar *v3; // rax\nstruct in_addr v5; // [rsp+18h] [rbp-10B8h]\nint s[1052]; // [rsp+20h] [rbp-10B0h] BYREF\nchar src[16]; // [rsp+1090h] [rbp-40h] BYREF\nchar dest[23]; // [rsp+10A0h] [rbp-30h] BYREF\nunsigned __int8 v9; // [rsp+10B7h] [rbp-19h]\nvoid *v10; // [rsp+10B8h] [rbp-18h]\nuint32_t v11; // [rsp+10C4h] [rbp-Ch]\nuint32_t v12; // [rsp+10C8h] [rbp-8h]\nuint16_t v13; // [rsp+10CCh] [rbp-4h]\nuint16_t v14; // [rsp+10CEh] [rbp-2h]\n\nmemset(s, 0, 0x1060uLL);\ns[1048] = 0;\nv5.s_addr = *(_DWORD *)(*(_QWORD *)(a1 + 16) + 16LL);\nv2 = inet_ntoa(*(struct in_addr *)(*(_QWORD *)(a1 + 16) + 12LL));\nstrncpy(dest, v2, 0x10uLL);\nv3 = inet_ntoa(v5);\nstrncpy(src, v3, 0x10uLL);\nv14 = ntohs(**(_WORD **)(a1 + 24));\nv13 = ntohs(*(_WORD *)(*(_QWORD *)(a1 + 24) + 2LL));\nv12 = ntohl(*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL));\nv11 = ntohl(*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL));\nmemset(s, 0, 0x1064uLL);\nstrncpy((char *)s, dest, 0x10uLL);\nstrncpy((char *)&s[4], src, 0x10uLL);\nLOWORD(s[9]) = v14;\nHIWORD(s[9]) = v13;\nHIBYTE(s[12]) = 20;\ns[10] = v12;\ns[11] = 0;\nv10 = (void *)(*(_QWORD *)(a1 + 24) + 20LL);\nv9 = 4 * ((*(_BYTE *)(*(_QWORD *)(a1 + 24) + 12LL) >> 4) - 5);\nmemcpy((char *)&s[13] + 3, v10, v9);\nHIBYTE(s[23]) = v9;\nreturn sub_41146E((__int64)s, a2);\n}\n\n\n\nQ:[a1,a2,v5,s,src,dest,v9,v10,v11,v12,v13,v14,sub_411A0A,sub_41146E,]", "hints": "[]", "response": "{'a1': 'orig_packet', 'a2': 'flags', 'v5': 'd_in_addr', 's': 'vars', 'src': 'dip', 'dest': 'sip', 'v9': 'tcp_opt_len', 'v10': 'tcp_opt', 'v11': 'ack_num', 'v12': 'seq_num', 'v13': 'dport', 'v14': 'sport', 'sub_411A0A': 'send_fake_RST', 'sub_41146E': 'send_insertion_packet'}"} | [
[
0.7588285207748413,
0.7390269041061401,
0.7245630621910095,
0.7235305309295654,
0.7214500904083252,
0.7209643721580505,
0.7185299396514893,
0.7090200185775757,
0.7028123736381531,
0.6991196870803833,
0.6887491345405579,
0.6871131658554077,
0.6844465732574463,
0.6832553148269653,
0.6822866201400757,
0.6790372729301453,
0.6764938235282898,
0.6759964227676392,
0.6736607551574707,
0.6735045909881592
],
[
210631,
150537,
193477,
118856,
63563,
241188,
47776,
163817,
150355,
4576,
932,
146142,
244619,
170406,
83922,
204094,
82308,
257553,
135000,
22595
]
] |
|
csv_init | 78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a | fenugrec | nissutils | NA | int
csv_init(struct csv_parser *p, unsigned char options)
{
/* Initialize a csv_parser object returns 0 on success, -1 on error */
if (p == NULL)
return -1;
p->entry_buf = NULL;
p->pstate = ROW_NOT_BEGUN;
p->quoted = 0;
p->spaces = 0;
p->entry_pos = 0;
p->entry_size = 0;
p->status = 0;
p->options = options;
p->quote_char = CSV_QUOTE;
p->delim_char = CSV_COMMA;
p->is_space = NULL;
p->is_term = NULL;
p->blk_size = MEM_BLK_SIZE;
p->malloc_func = NULL;
p->realloc_func = realloc;
p->free_func = free;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B8C1", "function_addr": 4241601, "binary_name": "78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov eax, esi"], [4, "mov [rbp+var_C], al"], [5, "cmp [rbp+var_8], 0"], [6, "jnz short loc_40B8DF"], [7, "mov eax, 0FFFFFFFFh"], [8, "jmp loc_40B997"], [9, "mov rax, [rbp+var_8]"], [10, "mov qword ptr [rax+10h], 0"], [11, "mov rax, [rbp+var_8]"], [12, "mov dword ptr [rax], 0"], [13, "mov rax, [rbp+var_8]"], [14, "mov dword ptr [rax+4], 0"], [15, "mov rax, [rbp+var_8]"], [16, "mov qword ptr [rax+8], 0"], [17, "mov rax, [rbp+var_8]"], [18, "mov qword ptr [rax+18h], 0"], [19, "mov rax, [rbp+var_8]"], [20, "mov qword ptr [rax+20h], 0"], [21, "mov rax, [rbp+var_8]"], [22, "mov dword ptr [rax+28h], 0"], [23, "mov rax, [rbp+var_8]"], [24, "movzx edx, [rbp+var_C]"], [25, "mov [rax+2Ch], dl"], [26, "mov rax, [rbp+var_8]"], [27, "mov byte ptr [rax+2Dh], 22h "], [28, "mov rax, [rbp+var_8]"], [29, "mov byte ptr [rax+2Eh], 2Ch "], [30, "mov rax, [rbp+var_8]"], [31, "mov qword ptr [rax+30h], 0"], [32, "mov rax, [rbp+var_8]"], [33, "mov qword ptr [rax+38h], 0"], [34, "mov rax, [rbp+var_8]"], [35, "mov qword ptr [rax+40h], 80h"], [36, "mov rax, [rbp+var_8]"], [37, "mov qword ptr [rax+48h], 0"], [38, "mov rax, [rbp+var_8]"], [39, "mov qword ptr [rax+50h], offset _realloc"], [40, "mov rax, [rbp+var_8]"], [41, "mov qword ptr [rax+58h], offset _free"], [42, "mov eax, 0"], [43, "pop rbp"], [44, "retn"]], "data_dep": [[4, 3], [5, 2], [6, 5], [9, 2], [10, 9], [11, 2], [12, 11], [13, 2], [14, 13], [15, 2], [16, 15], [17, 2], [18, 17], [19, 2], [20, 19], [21, 2], [22, 21], [23, 2], [24, 4], [25, 23], [25, 24], [26, 2], [27, 26], [28, 2], [29, 28], [30, 2], [31, 30], [32, 2], [33, 32], [34, 2], [35, 34], [36, 2], [37, 36], [38, 2], [39, 38], [40, 2], [41, 40], [43, 0], [44, 42], [44, 7]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a_78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a.jsonl.gz", "strip_func_name": "sub_40B8C1", "query": "\n\n\n__int64 __fastcall sub_40B8C1(__int64 a1, char a2)\n{\nif ( !a1 )\nreturn 0xFFFFFFFFLL;\n*(_QWORD *)(a1 + 16) = 0LL;\n*(_DWORD *)a1 = 0;\n*(_DWORD *)(a1 + 4) = 0;\n*(_QWORD *)(a1 + 8) = 0LL;\n*(_QWORD *)(a1 + 24) = 0LL;\n*(_QWORD *)(a1 + 32) = 0LL;\n*(_DWORD *)(a1 + 40) = 0;\n*(_BYTE *)(a1 + 44) = a2;\n*(_BYTE *)(a1 + 45) = 34;\n*(_BYTE *)(a1 + 46) = 44;\n*(_QWORD *)(a1 + 48) = 0LL;\n*(_QWORD *)(a1 + 56) = 0LL;\n*(_QWORD *)(a1 + 64) = 128LL;\n*(_QWORD *)(a1 + 72) = 0LL;\n*(_QWORD *)(a1 + 80) = realloc;\n*(_QWORD *)(a1 + 88) = free;\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,sub_40B8C1,]", "hints": "[]", "response": "{'a1': 'p', 'a2': 'options', 'sub_40B8C1': 'csv_init'}"} | [
[
0.7906208038330078,
0.7617080211639404,
0.7520902752876282,
0.7436729669570923,
0.7372734546661377,
0.7364874482154846,
0.7328783273696899,
0.7322419881820679,
0.7281520366668701,
0.7272716760635376,
0.7244020700454712,
0.7234660983085632,
0.7214002013206482,
0.7210702300071716,
0.7196731567382812,
0.7190142869949341,
0.7186576128005981,
0.7180731296539307,
0.7176754474639893,
0.715441107749939
],
[
147096,
123341,
247775,
19180,
53659,
175246,
13755,
50345,
158421,
47881,
227853,
48488,
233224,
10888,
48996,
87788,
124086,
124670,
204077,
104893
]
] |
|
buffer_read | 4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3 | 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_4334AF", "function_addr": 4404399, "binary_name": "4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3.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_4334DF"], [11, "mov eax, 0"], [12, "jmp short loc_433553"], [13, "mov rax, [rbp+var_28]"], [14, "mov [rbp+var_10], rax"], [15, "cmp [rbp+var_10], 0"], [16, "jnz short loc_433500"], [17, "call ___errno_location"], [18, "mov dword ptr [rax], 16h"], [19, "mov eax, 0FFFFFFFFh"], [20, "jmp short loc_433553"], [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_43353A"], [34, "call ___errno_location"], [35, "mov dword ptr [rax], 0Bh"], [36, "mov eax, 0FFFFFFFFh"], [37, "jmp short loc_433553"], [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_43892E"], [44, "mov eax, [rbp+var_14]"], [45, "mov rsi, [rbp+var_8]"], [46, "sub rsi, fs:28h"], [47, "jz short locret_433567"], [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/4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3_4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3.jsonl.gz", "strip_func_name": "sub_4334AF", "query": "\n\n\n__int64 __fastcall sub_4334AF(__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_43892E(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_4334AF,sub_43892E,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 'io_context', 'a2': 'buf', 'v4': 'result', 'v5': 'n_read', 'sub_4334AF': 'buffer_read', 'sub_43892E': 's2n_stuffer_read_bytes'}"} | [
[
0.7935341596603394,
0.7771271467208862,
0.770474374294281,
0.7621262669563293,
0.7604873180389404,
0.7422284483909607,
0.7388906478881836,
0.7387900352478027,
0.7361781597137451,
0.7348198890686035,
0.7323681116104126,
0.7263083457946777,
0.725848913192749,
0.7174129486083984,
0.7162690162658691,
0.7145470976829529,
0.7078739404678345,
0.7072956562042236,
0.7063901424407959,
0.7060680985450745
],
[
175616,
55568,
151531,
88415,
54412,
178511,
88091,
129322,
57765,
143508,
42841,
106570,
230946,
120486,
137868,
10219,
162463,
220532,
250399,
262354
]
] |
|
help_bfg | a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40 | vanhauser-thc | thc-hydra | NA | void help_bfg() {
printf("Hydra bruteforce password generation option usage:\n\n"
" -x MIN:MAX:CHARSET\n\n"
" MIN is the minimum number of characters in the password\n"
" MAX is the maximum number of characters in the password\n"
" CHARSET is a specification of the characters to use in the "
"generation\n"
" valid CHARSET values are: 'a' for lowercase letters,\n"
" 'A' for uppercase letters, '1' for numbers, and for all "
"others,\n"
" just add their real representation.\n"
" -y disable the use of the above letters as placeholders\n"
"Examples:\n"
" -x 3:5:a generate passwords from length 3 to 5 with all "
"lowercase letters\n"
" -x 5:8:A1 generate passwords from length 5 to 8 with uppercase "
"and numbers\n"
" -x 1:3:/ generate passwords from length 1 to 3 containing only "
"slashes\n"
" -x 5:5:/%%,.- generate passwords with length 5 which consists "
"only of /%%,.-\n"
" -x 3:5:aA1 -y generate passwords from length 3 to 5 with a, A and "
"1 only\n"
"\nThe bruteforce mode was made by Jan Dlabal, "
"http://houbysoft.com/bfg/\n");
exit(-1);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4063C4", "function_addr": 4219844, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov rax, fs:28h"], [4, "mov [rbp+var_8], rax"], [5, "xor eax, eax"], [6, "mov edi, offset aHydraBruteforc"], [7, "mov eax, 0"], [8, "call _printf"], [9, "mov edi, 0FFFFFFFFh"], [10, "call _exit"]], "data_dep": [[4, 3]]}
| {"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_4063C4", "query": "\n\n\nvoid __noreturn sub_4063C4()\n{\nprintf(\n\"Hydra bruteforce password generation option usage:\\n\"\n\"\\n\"\n\" -x MIN:MAX:CHARSET\\n\"\n\"\\n\"\n\" MIN is the minimum number of characters in the password\\n\"\n\" MAX is the maximum number of characters in the password\\n\"\n\" CHARSET is a specification of the characters to use in the generation\\n\"\n\" valid CHARSET values are: 'a' for lowercase letters,\\n\"\n\" 'A' for uppercase letters, '1' for numbers, and for all others,\\n\"\n\" just add their real representation.\\n\"\n\" -y disable the use of the above letters as placeholders\\n\"\n\"Examples:\\n\"\n\" -x 3:5:a generate passwords from length 3 to 5 with all lowercase letters\\n\"\n\" -x 5:8:A1 generate passwords from length 5 to 8 with uppercase and numbers\\n\"\n\" -x 1:3:/ generate passwords from length 1 to 3 containing only slashes\\n\"\n\" -x 5:5:/%%,.- generate passwords with length 5 which consists only of /%%,.-\\n\"\n\" -x 3:5:aA1 -y generate passwords from length 3 to 5 with a, A and 1 only\\n\"\n\"\\n\"\n\"The bruteforce mode was made by Jan Dlabal, http://houbysoft.com/bfg/\\n\");\nexit(-1);\n}\n\n\n\nQ:[sub_4063C4,]", "hints": "[]", "response": "{'sub_4063C4': 'help_bfg'}"} | [
[
0.8939512372016907,
0.8644959330558777,
0.8070015907287598,
0.8041654825210571,
0.8033558130264282,
0.7966845631599426,
0.7965725064277649,
0.7964123487472534,
0.7940688133239746,
0.7912778854370117,
0.7892158031463623,
0.7875977754592896,
0.786236047744751,
0.7843835353851318,
0.7828807234764099,
0.7819347381591797,
0.7813829779624939,
0.7803137898445129,
0.7801004648208618,
0.7784929275512695
],
[
115602,
52667,
22900,
80882,
43120,
246628,
146830,
231817,
207533,
197567,
242531,
21309,
92493,
1343,
174602,
218083,
156704,
156791,
57863,
200980
]
] |
|
fgetinfo | ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af | sergev | vak-opensource | NA | int fgetinfo (char *info, int maxlen, FILE *fd)
{
char *p = info;
int n;
while (maxlen > 0) {
if (! fgets (p, maxlen, fd))
break;
n = strlen (p);
maxlen -= n;
p += n;
while (p > info && (p[-1] == '\n' || p[-1] == '\15')) {
*--p = 0;
++maxlen;
}
n = getc (fd);
if (n != ' ' && n != '\t') {
ungetc (n, fd);
break;
}
*p++ = ' ';
--maxlen;
do {
n = getc (fd);
} while (n == ' ' || n == '\t');
ungetc (n, fd);
}
while (p > info && (p[-1] == '\n' || p[-1] == '\15')) {
*--p = 0;
++maxlen;
}
return (p - info);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402064", "function_addr": 4202596, "binary_name": "ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+n], esi"], [5, "mov [rbp+stream], rdx"], [6, "mov rax, [rbp+var_18]"], [7, "mov [rbp+s], rax"], [8, "jmp loc_402167"], [9, "mov rdx, [rbp+stream]"], [10, "mov ecx, [rbp+n]"], [11, "mov rax, [rbp+s]"], [12, "mov esi, ecx"], [13, "mov rdi, rax"], [14, "call _fgets"], [15, "test rax, rax"], [16, "jz loc_402173"], [17, "mov rax, [rbp+s]"], [18, "mov rdi, rax"], [19, "call _strlen"], [20, "mov [rbp+c], eax"], [21, "mov eax, [rbp+c]"], [22, "sub [rbp+n], eax"], [23, "mov eax, [rbp+c]"], [24, "cdqe"], [25, "add [rbp+s], rax"], [26, "jmp short loc_4020D2"], [27, "sub [rbp+s], 1"], [28, "mov rax, [rbp+s]"], [29, "mov byte ptr [rax], 0"], [30, "add [rbp+n], 1"], [31, "mov rax, [rbp+s]"], [32, "cmp rax, [rbp+var_18]"], [33, "jbe short loc_4020FA"], [34, "mov rax, [rbp+s]"], [35, "sub rax, 1"], [36, "movzx eax, byte ptr [rax]"], [37, "cmp al, 0Ah"], [38, "jz short loc_4020C2"], [39, "mov rax, [rbp+s]"], [40, "sub rax, 1"], [41, "movzx eax, byte ptr [rax]"], [42, "cmp al, 0Dh"], [43, "jz short loc_4020C2"], [44, "mov rax, [rbp+stream]"], [45, "mov rdi, rax"], [46, "call _getc"], [47, "mov [rbp+c], eax"], [48, "cmp [rbp+c], 20h "], [49, "jz short loc_402128"], [50, "cmp [rbp+c], 9"], [51, "jz short loc_402128"], [52, "mov rdx, [rbp+stream]"], [53, "mov eax, [rbp+c]"], [54, "mov rsi, rdx"], [55, "mov edi, eax"], [56, "call _ungetc"], [57, "jmp short loc_402174"], [58, "mov rax, [rbp+s]"], [59, "lea rdx, [rax+1]"], [60, "mov [rbp+s], rdx"], [61, "mov byte ptr [rax], 20h "], [62, "sub [rbp+n], 1"], [63, "mov rax, [rbp+stream]"], [64, "mov rdi, rax"], [65, "call _getc"], [66, "mov [rbp+c], eax"], [67, "cmp [rbp+c], 20h "], [68, "jz short loc_40213B"], [69, "cmp [rbp+c], 9"], [70, "jz short loc_40213B"], [71, "mov rdx, [rbp+stream]"], [72, "mov eax, [rbp+c]"], [73, "mov rsi, rdx"], [74, "mov edi, eax"], [75, "call _ungetc"], [76, "cmp [rbp+n], 0"], [77, "jg loc_402084"], [78, "jmp short loc_402186"], [79, "nop"], [80, "jmp short loc_402186"], [81, "sub [rbp+s], 1"], [82, "mov rax, [rbp+s]"], [83, "mov byte ptr [rax], 0"], [84, "add [rbp+n], 1"], [85, "mov rax, [rbp+s]"], [86, "cmp rax, [rbp+var_18]"], [87, "jbe short loc_4021AE"], [88, "mov rax, [rbp+s]"], [89, "sub rax, 1"], [90, "movzx eax, byte ptr [rax]"], [91, "cmp al, 0Ah"], [92, "jz short loc_402176"], [93, "mov rax, [rbp+s]"], [94, "sub rax, 1"], [95, "movzx eax, byte ptr [rax]"], [96, "cmp al, 0Dh"], [97, "jz short loc_402176"], [98, "mov rax, [rbp+s]"], [99, "sub rax, [rbp+var_18]"], [100, "leave"], [101, "retn"]], "data_dep": [[6, 3], [7, 6], [9, 5], [10, 62], [10, 4], [11, 60], [11, 7], [12, 10], [13, 11], [15, 14], [16, 15], [17, 60], [17, 7], [18, 17], [20, 19], [21, 20], [22, 21], [22, 62], [22, 4], [23, 20], [25, 23], [25, 60], [25, 7], [27, 25], [27, 27], [28, 27], [29, 28], [30, 22], [30, 30], [31, 25], [31, 27], [32, 3], [32, 31], [33, 32], [34, 25], [34, 27], [35, 34], [36, 61], [36, 29], [36, 35], [37, 36], [38, 37], [39, 25], [39, 27], [40, 39], [41, 40], [41, 61], [41, 29], [42, 41], [43, 42], [44, 5], [45, 44], [47, 46], [48, 47], [49, 48], [50, 47], [51, 50], [52, 5], [53, 47], [54, 52], [55, 53], [58, 25], [58, 27], [59, 9], [59, 61], [59, 29], [59, 58], [60, 59], [61, 58], [62, 30], [62, 22], [63, 5], [64, 63], [66, 65], [67, 66], [68, 67], [69, 66], [70, 69], [71, 5], [72, 66], [73, 71], [74, 72], [76, 62], [76, 4], [77, 76], [81, 7], [81, 25], [81, 27], [81, 60], [81, 81], [82, 81], [83, 82], [84, 84], [84, 4], [84, 22], [84, 30], [84, 62], [85, 27], [85, 60], [85, 81], [85, 7], [85, 25], [86, 3], [86, 85], [87, 86], [88, 81], [88, 60], [88, 7], [88, 25], [88, 27], [89, 88], [90, 83], [90, 89], [90, 61], [90, 29], [91, 90], [92, 91], [93, 81], [93, 60], [93, 7], [93, 25], [93, 27], [94, 93], [95, 61], [95, 29], [95, 83], [95, 94], [96, 95], [97, 96], [98, 7], [98, 25], [98, 27], [98, 81], [98, 60], [99, 3], [99, 98], [101, 99]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af_ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af.jsonl.gz", "strip_func_name": "sub_402064", "query": "\n\n\nchar *__fastcall sub_402064(char *a1, int a2, FILE *a3)\n{\nchar *v3; // rax\nint cb; // [rsp+24h] [rbp-Ch]\nint c; // [rsp+24h] [rbp-Ch]\nint ca; // [rsp+24h] [rbp-Ch]\nchar *s; // [rsp+28h] [rbp-8h]\n\ns = a1;\nwhile ( a2 > 0 && fgets(s, a2, a3) )\n{\ncb = strlen(s);\na2 -= cb;\ns += cb;\nwhile ( s > a1 && (*(s - 1) == 10 || *(s - 1) == 13) )\n{\n*--s = 0;\n++a2;\n}\nc = getc(a3);\nif ( c != 32 && c != 9 )\n{\nungetc(c, a3);\nbreak;\n}\nv3 = s++;\n*v3 = 32;\n--a2;\ndo\n{\ndo\nca = getc(a3);\nwhile ( ca == 32 );\n}\nwhile ( ca == 9 );\nungetc(ca, a3);\n}\nwhile ( s > a1 && (*(s - 1) == 10 || *(s - 1) == 13) )\n{\n*--s = 0;\n++a2;\n}\nreturn (char *)(s - a1);\n}\n\n\n\nQ:[a3,a1,a2,cb,s,sub_402064,]", "hints": "[]", "response": "{'a3': 'fd', 'a1': 'info', 'a2': 'maxlen', 'cb': 'na', 's': 'p', 'sub_402064': 'fgetinfo'}"} | [
[
0.7867482900619507,
0.7816472053527832,
0.7615367770195007,
0.7604478001594543,
0.7584775686264038,
0.7572226524353027,
0.7424980998039246,
0.7408546209335327,
0.7382882833480835,
0.7308815717697144,
0.7278301119804382,
0.7275012731552124,
0.7260956168174744,
0.7200242280960083,
0.7148699760437012,
0.7137643098831177,
0.7092666029930115,
0.7092069387435913,
0.7053665518760681,
0.7008286118507385
],
[
198181,
154024,
42793,
5824,
8640,
15224,
232286,
179920,
136410,
107538,
197940,
145721,
24895,
238089,
171634,
114884,
238940,
255641,
151638,
214029
]
] |
|
parse_entire_size | 6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172 | noporpoise | seq-align | NA | char parse_entire_size(const char *str, size_t *result)
{
char *strtol_last_char_ptr = NULL;
if(*str < '0' || *str > '9') return 0;
unsigned long tmp = strtoul(str, &strtol_last_char_ptr, 10);
if(tmp > SIZE_MAX) return 0;
if(strtol_last_char_ptr == NULL || *strtol_last_char_ptr != '\0') return 0;
*result = (size_t)tmp;
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40638C", "function_addr": 4219788, "binary_name": "6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+nptr], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+endptr], 0"], [6, "mov rax, [rbp+nptr]"], [7, "movzx eax, byte ptr [rax]"], [8, "cmp al, 2Fh "], [9, "jle short loc_4063BA"], [10, "mov rax, [rbp+nptr]"], [11, "movzx eax, byte ptr [rax]"], [12, "cmp al, 39h "], [13, "jle short loc_4063C1"], [14, "mov eax, 0"], [15, "jmp short locret_406408"], [16, "lea rcx, [rbp+endptr]"], [17, "mov rax, [rbp+nptr]"], [18, "mov edx, 0Ah"], [19, "mov rsi, rcx"], [20, "mov rdi, rax"], [21, "call _strtoul"], [22, "mov [rbp+var_8], rax"], [23, "mov rax, [rbp+endptr]"], [24, "test rax, rax"], [25, "jz short loc_4063F1"], [26, "mov rax, [rbp+endptr]"], [27, "movzx eax, byte ptr [rax]"], [28, "test al, al"], [29, "jz short loc_4063F8"], [30, "mov eax, 0"], [31, "jmp short locret_406408"], [32, "mov rax, [rbp+var_20]"], [33, "mov rdx, [rbp+var_8]"], [34, "mov [rax], rdx"], [35, "mov eax, 1"], [36, "leave"], [37, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 3], [11, 10], [12, 11], [13, 12], [16, 5], [17, 3], [19, 16], [20, 17], [22, 21], [23, 5], [24, 23], [25, 24], [26, 5], [27, 26], [28, 27], [29, 28], [32, 4], [33, 22], [34, 33], [34, 32], [37, 30], [37, 14], [37, 35]]}
| {"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_40638C", "query": "\n\n\n__int64 __fastcall sub_40638C(const char *a1, unsigned __int64 *a2)\n{\nchar *endptr; // [rsp+10h] [rbp-10h] BYREF\nunsigned __int64 v4; // [rsp+18h] [rbp-8h]\n\nendptr = 0LL;\nif ( *a1 <= 47 || *a1 > 57 )\nreturn 0LL;\nv4 = strtoul(a1, &endptr, 10);\nif ( !endptr || *endptr )\nreturn 0LL;\n*a2 = v4;\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,endptr,v4,sub_40638C,]", "hints": "[]", "response": "{'a1': 'str', 'a2': 'result', 'endptr': 'strtol_last_char_ptr', 'v4': 'tmp', 'sub_40638C': 'parse_entire_size'}"} | [
[
0.8675497770309448,
0.8168870806694031,
0.8072493076324463,
0.7962090373039246,
0.7943727970123291,
0.7912504076957703,
0.7779867649078369,
0.7771101593971252,
0.7691522836685181,
0.7686229944229126,
0.7637295722961426,
0.7600488662719727,
0.7589462995529175,
0.7571964263916016,
0.7571737170219421,
0.7541713714599609,
0.7524802684783936,
0.7521569132804871,
0.7520672082901001,
0.7517802715301514
],
[
122813,
106149,
98932,
7690,
29582,
35905,
82446,
136975,
182998,
36693,
161049,
114826,
256680,
209250,
88529,
17716,
196818,
178977,
149563,
79902
]
] |
|
parse_vfo | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static int parse_vfo(int first_row, char *line)
{
char num_str[256], band_str[256], rxfreq_str[256], offset_str[256];
char rq_str[256], tq_str[256], step_str[256];
char power_str[256], wide_str[256], scode_str[256];
int num, band, rq, tq, step, lowpower, wide, scode;
double rx_mhz, txoff_mhz;
if (sscanf(line, "%s %s %s %s %s %s %s %s %s %s", num_str, band_str, rxfreq_str, offset_str,
rq_str, tq_str, step_str, power_str, wide_str, scode_str) != 10)
return 0;
if (*num_str == 'A' || *num_str == 'a')
num = 0;
else if (*num_str == 'B' || *num_str == 'b')
num = 1;
else {
fprintf(stderr, "Bad VFO number.\n");
return 0;
}
if (strcasecmp("VHF", band_str) == 0) {
band = 'V';
} else if (strcasecmp("UHF", band_str) == 0) {
band = 'U';
} else {
fprintf(stderr, "Unknown band.\n");
return 0;
}
if (sscanf(rxfreq_str, "%lf", &rx_mhz) != 1 || !is_valid_frequency(rx_mhz)) {
fprintf(stderr, "Bad receive frequency.\n");
return 0;
}
if (sscanf(offset_str, "%lf", &txoff_mhz) != 1 || !is_valid_frequency(rx_mhz + txoff_mhz)) {
fprintf(stderr, "Bad transmit offset.\n");
return 0;
}
rq = encode_squelch(rq_str);
tq = encode_squelch(tq_str);
step = string_in_table(step_str, STEP_NAME, 8);
if (step < 0) {
fprintf(stderr, "Bad step.\n");
return 0;
}
if (strcasecmp("High", power_str) == 0) {
lowpower = 0;
} else if (strcasecmp("Low", power_str) == 0) {
lowpower = 1;
} else {
fprintf(stderr, "Bad power level.\n");
return 0;
}
if (strcasecmp("Wide", wide_str) == 0) {
wide = 1;
} else if (strcasecmp("Narrow", wide_str) == 0) {
wide = 0;
} else {
fprintf(stderr, "Bad modulation width.\n");
return 0;
}
if (*scode_str == '-') {
scode = 0;
} else if (*scode_str >= '0' && *scode_str <= '9') {
scode = *scode_str - '0';
} else if (*scode_str >= 'A' && *scode_str <= 'A') {
scode = *scode_str - 'A' + 10;
} else if (*scode_str >= 'a' && *scode_str <= 'a') {
scode = *scode_str - 'a' + 10;
} else {
fprintf(stderr, "Bad scode value.\n");
return 0;
}
uv5r_setup_vfo(num, band, rx_mhz, txoff_mhz, rq, tq, step, lowpower, wide, scode);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_408252", "function_addr": 4227666, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A40h"], [3, "mov [rbp+var_A34], edi"], [4, "mov [rbp+var_A40], rsi"], [5, "lea r8, [rbp+var_420]"], [6, "lea rdi, [rbp+var_320]"], [7, "lea rcx, [rbp+s2]"], [8, "lea rdx, [rbp+var_120]"], [9, "mov rax, [rbp+var_A40]"], [10, "lea rsi, [rbp+var_A20]"], [11, "push rsi"], [12, "lea rsi, [rbp+var_920]"], [13, "push rsi"], [14, "lea rsi, [rbp+var_820]"], [15, "push rsi"], [16, "lea rsi, [rbp+var_720]"], [17, "push rsi"], [18, "lea rsi, [rbp+var_620]"], [19, "push rsi"], [20, "lea rsi, [rbp+var_520]"], [21, "push rsi"], [22, "mov r9, r8"], [23, "mov r8, rdi"], [24, "mov esi, offset aSSSSSSSSSS"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call ___isoc99_sscanf"], [28, "add rsp, 30h"], [29, "cmp eax, 0Ah"], [30, "jz short loc_4082E8"], [31, "mov eax, 0"], [32, "jmp locret_4086E0"], [33, "movzx eax, [rbp+var_120]"], [34, "cmp al, 41h "], [35, "jz short loc_4082FE"], [36, "movzx eax, [rbp+var_120]"], [37, "cmp al, 61h "], [38, "jnz short loc_408307"], [39, "mov [rbp+var_4], 0"], [40, "jmp short loc_40834E"], [41, "movzx eax, [rbp+var_120]"], [42, "cmp al, 42h "], [43, "jz short loc_40831D"], [44, "movzx eax, [rbp+var_120]"], [45, "cmp al, 62h "], [46, "jnz short loc_408326"], [47, "mov [rbp+var_4], 1"], [48, "jmp short loc_40834E"], [49, "mov rax, cs:stderr"], [50, "mov rcx, rax"], [51, "mov edx, 10h"], [52, "mov esi, 1"], [53, "mov edi, offset aBadVfoNumber"], [54, "call _fwrite"], [55, "mov eax, 0"], [56, "jmp locret_4086E0"], [57, "lea rax, [rbp+s2]"], [58, "mov rsi, rax"], [59, "mov edi, offset aVhf"], [60, "call _strcasecmp"], [61, "test eax, eax"], [62, "jnz short loc_40836F"], [63, "mov [rbp+var_8], 56h "], [64, "jmp short loc_4083B8"], [65, "lea rax, [rbp+s2]"], [66, "mov rsi, rax"], [67, "mov edi, offset aUhf"], [68, "call _strcasecmp"], [69, "test eax, eax"], [70, "jnz short loc_408390"], [71, "mov [rbp+var_8], 55h "], [72, "jmp short loc_4083B8"], [73, "mov rax, cs:stderr"], [74, "mov rcx, rax"], [75, "mov edx, 0Eh"], [76, "mov esi, 1"], [77, "mov edi, offset aUnknownBand"], [78, "call _fwrite"], [79, "mov eax, 0"], [80, "jmp locret_4086E0"], [81, "lea rdx, [rbp+var_A28]"], [82, "lea rax, [rbp+var_320]"], [83, "mov esi, offset aLf"], [84, "mov rdi, rax"], [85, "mov eax, 0"], [86, "call ___isoc99_sscanf"], [87, "cmp eax, 1"], [88, "jnz short loc_4083F4"], [89, "movsd xmm0, [rbp+var_A28]"], [90, "cvttsd2si eax, xmm0"], [91, "mov edi, eax"], [92, "call sub_404467"], [93, "test eax, eax"], [94, "jnz short loc_40841C"], [95, "mov rax, cs:stderr"], [96, "mov rcx, rax"], [97, "mov edx, 17h"], [98, "mov esi, 1"], [99, "mov edi, offset aBadReceiveFreq"], [100, "call _fwrite"], [101, "mov eax, 0"], [102, "jmp locret_4086E0"], [103, "lea rdx, [rbp+var_A30]"], [104, "lea rax, [rbp+var_420]"], [105, "mov esi, offset aLf"], [106, "mov rdi, rax"], [107, "mov eax, 0"], [108, "call ___isoc99_sscanf"], [109, "cmp eax, 1"], [110, "jnz short loc_408464"], [111, "movsd xmm1, [rbp+var_A28]"], [112, "movsd xmm0, [rbp+var_A30]"], [113, "addsd xmm0, xmm1"], [114, "cvttsd2si eax, xmm0"], [115, "mov edi, eax"], [116, "call sub_404467"], [117, "test eax, eax"], [118, "jnz short loc_40848C"], [119, "mov rax, cs:stderr"], [120, "mov rcx, rax"], [121, "mov edx, 15h"], [122, "mov esi, 1"], [123, "mov edi, offset aBadTransmitOff"], [124, "call _fwrite"], [125, "mov eax, 0"], [126, "jmp locret_4086E0"], [127, "lea rax, [rbp+var_520]"], [128, "mov rdi, rax"], [129, "call sub_404A4C"], [130, "mov [rbp+var_18], eax"], [131, "lea rax, [rbp+var_620]"], [132, "mov rdi, rax"], [133, "call sub_404A4C"], [134, "mov [rbp+var_1C], eax"], [135, "lea rax, [rbp+var_720]"], [136, "mov edx, 8"], [137, "mov esi, offset off_41A1E0"], [138, "mov rdi, rax"], [139, "call sub_40353E"], [140, "mov [rbp+var_20], eax"], [141, "cmp [rbp+var_20], 0"], [142, "jns short loc_4084FA"], [143, "mov rax, cs:stderr"], [144, "mov rcx, rax"], [145, "mov edx, 0Ah"], [146, "mov esi, 1"], [147, "mov edi, offset aBadStep"], [148, "call _fwrite"], [149, "mov eax, 0"], [150, "jmp locret_4086E0"], [151, "lea rax, [rbp+var_820]"], [152, "mov rsi, rax"], [153, "mov edi, offset aHigh"], [154, "call _strcasecmp"], [155, "test eax, eax"], [156, "jnz short loc_40851B"], [157, "mov [rbp+var_C], 0"], [158, "jmp short loc_408564"], [159, "lea rax, [rbp+var_820]"], [160, "mov rsi, rax"], [161, "mov edi, offset aLow"], [162, "call _strcasecmp"], [163, "test eax, eax"], [164, "jnz short loc_40853C"], [165, "mov [rbp+var_C], 1"], [166, "jmp short loc_408564"], [167, "mov rax, cs:stderr"], [168, "mov rcx, rax"], [169, "mov edx, 11h"], [170, "mov esi, 1"], [171, "mov edi, offset aBadPowerLevel"], [172, "call _fwrite"], [173, "mov eax, 0"], [174, "jmp locret_4086E0"], [175, "lea rax, [rbp+var_920]"], [176, "mov rsi, rax"], [177, "mov edi, offset aWide"], [178, "call _strcasecmp"], [179, "test eax, eax"], [180, "jnz short loc_408585"], [181, "mov [rbp+var_10], 1"], [182, "jmp short loc_4085CE"], [183, "lea rax, [rbp+var_920]"], [184, "mov rsi, rax"], [185, "mov edi, offset aNarrow"], [186, "call _strcasecmp"], [187, "test eax, eax"], [188, "jnz short loc_4085A6"], [189, "mov [rbp+var_10], 0"], [190, "jmp short loc_4085CE"], [191, "mov rax, cs:stderr"], [192, "mov rcx, rax"], [193, "mov edx, 16h"], [194, "mov esi, 1"], [195, "mov edi, offset aBadModulationW"], [196, "call _fwrite"], [197, "mov eax, 0"], [198, "jmp locret_4086E0"], [199, "movzx eax, [rbp+var_A20]"], [200, "cmp al, 2Dh "], [201, "jnz short loc_4085E5"], [202, "mov [rbp+var_14], 0"], [203, "jmp loc_408682"], [204, "movzx eax, [rbp+var_A20]"], [205, "cmp al, 2Fh "], [206, "jle short loc_40860D"], [207, "movzx eax, [rbp+var_A20]"], [208, "cmp al, 39h "], [209, "jg short loc_40860D"], [210, "movzx eax, [rbp+var_A20]"], [211, "movsx eax, al"], [212, "sub eax, 30h "], [213, "mov [rbp+var_14], eax"], [214, "jmp short loc_408682"], [215, "movzx eax, [rbp+var_A20]"], [216, "cmp al, 40h "], [217, "jle short loc_408635"], [218, "movzx eax, [rbp+var_A20]"], [219, "cmp al, 41h "], [220, "jg short loc_408635"], [221, "movzx eax, [rbp+var_A20]"], [222, "movsx eax, al"], [223, "sub eax, 37h "], [224, "mov [rbp+var_14], eax"], [225, "jmp short loc_408682"], [226, "movzx eax, [rbp+var_A20]"], [227, "cmp al, 60h "], [228, "jle short loc_40865D"], [229, "movzx eax, [rbp+var_A20]"], [230, "cmp al, 61h "], [231, "jg short loc_40865D"], [232, "movzx eax, [rbp+var_A20]"], [233, "movsx eax, al"], [234, "sub eax, 57h "], [235, "mov [rbp+var_14], eax"], [236, "jmp short loc_408682"], [237, "mov rax, cs:stderr"], [238, "mov rcx, rax"], [239, "mov edx, 11h"], [240, "mov esi, 1"], [241, "mov edi, offset aBadScodeValue"], [242, "call _fwrite"], [243, "mov eax, 0"], [244, "jmp short locret_4086E0"], [245, "movsd xmm1, [rbp+var_A30]"], [246, "movsd xmm0, cs:qword_413EC0"], [247, "mulsd xmm0, xmm1"], [248, "cvttsd2si ecx, xmm0"], [249, "movsd xmm1, [rbp+var_A28]"], [250, "movsd xmm0, cs:qword_413EC0"], [251, "mulsd xmm0, xmm1"], [252, "cvttsd2si edx, xmm0"], [253, "mov r9d, [rbp+var_1C]"], [254, "mov r8d, [rbp+var_18]"], [255, "mov esi, [rbp+var_8]"], [256, "mov eax, [rbp+var_4]"], [257, "mov edi, [rbp+var_14]"], [258, "push rdi"], [259, "mov edi, [rbp+var_10]"], [260, "push rdi"], [261, "mov edi, [rbp+var_C]"], [262, "push rdi"], [263, "mov edi, [rbp+var_20]"], [264, "push rdi"], [265, "mov edi, eax"], [266, "call sub_4057E5"], [267, "add rsp, 20h"], [268, "mov eax, 1"], [269, "leave"], [270, "retn"]], "data_dep": [[9, 4], [11, 10], [12, 10], [13, 12], [14, 12], [15, 14], [16, 14], [17, 16], [18, 16], [19, 18], [20, 18], [21, 20], [22, 5], [23, 6], [25, 9], [28, 2], [29, 27], [30, 29], [34, 33], [35, 34], [37, 36], [38, 37], [42, 41], [43, 42], [45, 44], [46, 45], [50, 49], [57, 41], [57, 36], [57, 33], [57, 44], [58, 57], [61, 60], [62, 61], [65, 61], [66, 65], [69, 68], [70, 69], [74, 73], [81, 8], [82, 69], [82, 61], [84, 82], [87, 86], [88, 87], [90, 89], [90, 86], [91, 90], [93, 92], [94, 93], [96, 95], [103, 81], [104, 93], [106, 104], [109, 108], [110, 109], [113, 112], [113, 111], [114, 113], [114, 108], [115, 114], [117, 116], [118, 117], [120, 119], [127, 117], [128, 127], [130, 129], [131, 129], [132, 131], [134, 133], [135, 133], [138, 135], [140, 139], [141, 140], [142, 141], [144, 143], [151, 139], [152, 151], [155, 154], [156, 155], [159, 155], [160, 159], [163, 162], [164, 163], [168, 167], [175, 163], [175, 155], [176, 175], [179, 178], [180, 179], [183, 179], [184, 183], [187, 186], [188, 187], [192, 191], [200, 199], [201, 200], [205, 204], [206, 205], [208, 207], [209, 208], [211, 210], [212, 211], [213, 212], [216, 215], [217, 216], [219, 218], [220, 219], [222, 221], [223, 222], [224, 223], [227, 226], [228, 227], [230, 229], [231, 230], [233, 232], [234, 233], [235, 234], [238, 237], [247, 245], [247, 246], [248, 7], [248, 247], [251, 249], [251, 250], [252, 136], [252, 251], [253, 134], [254, 130], [255, 63], [255, 71], [256, 39], [256, 47], [257, 235], [257, 202], [257, 213], [257, 224], [258, 257], [259, 189], [259, 181], [260, 259], [261, 157], [261, 165], [262, 261], [263, 140], [264, 263], [265, 256], [267, 28], [270, 101], [270, 55], [270, 125], [270, 173], [270, 31], [270, 79], [270, 149], [270, 268], [270, 243], [270, 197]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_408252", "query": "\n\n\n__int64 sub_408252()\n{\ndouble v1; // [rsp+10h] [rbp-A30h]\ndouble v2; // [rsp+18h] [rbp-A28h]\nchar v3; // [rsp+20h] [rbp-A20h]\nchar v4[256]; // [rsp+120h] [rbp-920h] BYREF\nchar v5[256]; // [rsp+220h] [rbp-820h] BYREF\nchar v6[256]; // [rsp+320h] [rbp-720h] BYREF\nchar v7[256]; // [rsp+420h] [rbp-620h] BYREF\nchar v8[256]; // [rsp+520h] [rbp-520h] BYREF\nchar s2[256]; // [rsp+820h] [rbp-220h] BYREF\nchar v10; // [rsp+920h] [rbp-120h]\nint v11; // [rsp+A20h] [rbp-20h]\nint v12; // [rsp+A24h] [rbp-1Ch]\nint v13; // [rsp+A28h] [rbp-18h]\nint v14; // [rsp+A2Ch] [rbp-14h]\nint v15; // [rsp+A30h] [rbp-10h]\nint v16; // [rsp+A34h] [rbp-Ch]\nint v17; // [rsp+A38h] [rbp-8h]\nint v18; // [rsp+A3Ch] [rbp-4h]\n\nif ( (unsigned int)__isoc99_sscanf() != 10 )\nreturn 0LL;\nif ( v10 == 65 || v10 == 97 )\n{\nv18 = 0;\n}\nelse\n{\nif ( v10 != 66 && v10 != 98 )\n{\nfwrite(\"Bad VFO number.\\n\", 1uLL, 0x10uLL, stderr);\nreturn 0LL;\n}\nv18 = 1;\n}\nif ( !strcasecmp(\"VHF\", s2) )\n{\nv17 = 86;\n}\nelse\n{\nif ( strcasecmp(\"UHF\", s2) )\n{\nfwrite(\"Unknown band.\\n\", 1uLL, 0xEuLL, stderr);\nreturn 0LL;\n}\nv17 = 85;\n}\nif ( (unsigned int)__isoc99_sscanf() != 1 || !sub_404467((int)v2) )\n{\nfwrite(\"Bad receive frequency.\\n\", 1uLL, 0x17uLL, stderr);\nreturn 0LL;\n}\nif ( (unsigned int)__isoc99_sscanf() != 1 || !sub_404467((int)(v1 + v2)) )\n{\nfwrite(\"Bad transmit offset.\\n\", 1uLL, 0x15uLL, stderr);\nreturn 0LL;\n}\nv13 = sub_404A4C((__int64)v8);\nv12 = sub_404A4C((__int64)v7);\nv11 = sub_40353E(v6, (__int64)off_41A1E0, 8);\nif ( v11 < 0 )\n{\nfwrite(\"Bad step.\\n\", 1uLL, 0xAuLL, stderr);\nreturn 0LL;\n}\nif ( !strcasecmp(\"High\", v5) )\n{\nv16 = 0;\n}\nelse\n{\nif ( strcasecmp(\"Low\", v5) )\n{\nfwrite(\"Bad power level.\\n\", 1uLL, 0x11uLL, stderr);\nreturn 0LL;\n}\nv16 = 1;\n}\nif ( !strcasecmp(\"Wide\", v4) )\n{\nv15 = 1;\n}\nelse\n{\nif ( strcasecmp(\"Narrow\", v4) )\n{\nfwrite(\"Bad modulation width.\\n\", 1uLL, 0x16uLL, stderr);\nreturn 0LL;\n}\nv15 = 0;\n}\nif ( v3 == 45 )\n{\nv14 = 0;\n}\nelse if ( v3 <= 47 || v3 > 57 )\n{\nif ( v3 <= 64 || v3 > 65 )\n{\nif ( v3 <= 96 || v3 > 97 )\n{\nfwrite(\"Bad scode value.\\n\", 1uLL, 0x11uLL, stderr);\nreturn 0LL;\n}\nv14 = v3 - 87;\n}\nelse\n{\nv14 = v3 - 55;\n}\n}\nelse\n{\nv14 = v3 - 48;\n}\nsub_4057E5(v18, v17, (int)(1000000.0 * v2), (int)(1000000.0 * v1), v13, v12, v11, v16, v15, v14);\nreturn 1LL;\n}\n\n\n\nQ:[v1,v2,v3,v4,v5,v6,v7,v8,s2,v10,v11,v12,v13,v14,v15,v16,v17,v18,sub_408252,sub_404467,sub_404A4C,sub_40353E,sub_4057E5,]", "hints": "[]", "response": "{'v1': 'txoff_mhz', 'v2': 'rx_mhz', 'v3': 'scode_str', 'v4': 'wide_str', 'v5': 'power_str', 'v6': 'step_str', 'v7': 'tq_str', 'v8': 'rq_str', 's2': 'band_str', 'v10': 'num_str', 'v11': 'step', 'v12': 'tq', 'v13': 'rq', 'v14': 'scode', 'v15': 'wide', 'v16': 'lowpower', 'v17': 'band', 'v18': 'num', 'sub_408252': 'parse_vfo', 'sub_404467': 'is_valid_frequency', 'sub_404A4C': 'encode_squelch', 'sub_40353E': 'string_in_table', 'sub_4057E5': 'setup_vfo'}"} | [
[
0.8019748330116272,
0.8016015291213989,
0.8015136122703552,
0.8015136122703552,
0.8015136122703552,
0.7990041971206665,
0.7990041971206665,
0.7990041971206665,
0.7990041971206665,
0.7772931456565857,
0.7327298521995544,
0.7288085222244263,
0.725286066532135,
0.7251707911491394,
0.7224206328392029,
0.7182080149650574,
0.7179102897644043,
0.717496395111084,
0.7159035205841064,
0.7127979397773743
],
[
131693,
117844,
41168,
215999,
263036,
222568,
223226,
246935,
130320,
236392,
142078,
175107,
93125,
207552,
194282,
123412,
32533,
215997,
113760,
42659
]
] |
|
test_deflate | 69f0de33eedcd9436fcb94092331e4136551d42ae633c2c8a944915571ee0c7f | hecomi | node-julius | NA | void test_deflate(compr, comprLen)
Byte *compr;
uLong comprLen;
{
z_stream c_stream; /* compression stream */
int err;
uLong len = (uLong)strlen(hello)+1;
c_stream.zalloc = zalloc;
c_stream.zfree = zfree;
c_stream.opaque = (voidpf)0;
err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
CHECK_ERR(err, "deflateInit");
c_stream.next_in = (Bytef*)hello;
c_stream.next_out = compr;
while (c_stream.total_in != len && c_stream.total_out < comprLen) {
c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
err = deflate(&c_stream, Z_NO_FLUSH);
CHECK_ERR(err, "deflate");
}
/* Finish the stream, still forcing small buffers: */
for (;;) {
c_stream.avail_out = 1;
err = deflate(&c_stream, Z_FINISH);
if (err == Z_STREAM_END) break;
CHECK_ERR(err, "deflate");
}
err = deflateEnd(&c_stream);
CHECK_ERR(err, "deflateEnd");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40189C", "function_addr": 4200604, "binary_name": "69f0de33eedcd9436fcb94092331e4136551d42ae633c2c8a944915571ee0c7f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+var_88], rdi"], [4, "mov [rbp+var_90], rsi"], [5, "mov [rbp+var_8], 0Eh"], [6, "mov rax, cs:qword_405178"], [7, "mov [rbp+var_40], rax"], [8, "mov rax, cs:qword_405180"], [9, "mov [rbp+var_38], rax"], [10, "mov [rbp+var_30], 0"], [11, "lea rax, [rbp+var_80]"], [12, "mov ecx, 70h "], [13, "mov edx, offset a127"], [14, "mov esi, 0FFFFFFFFh"], [15, "mov rdi, rax"], [16, "call _deflateInit_"], [17, "mov [rbp+var_C], eax"], [18, "cmp [rbp+var_C], 0"], [19, "jz short loc_40192C"], [20, "mov rax, cs:stderr"], [21, "mov edx, [rbp+var_C]"], [22, "mov ecx, edx"], [23, "mov edx, offset aDeflateinit_0"], [24, "mov esi, offset format"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _fprintf"], [28, "mov edi, 1"], [29, "call _exit"], [30, "mov [rbp+var_80], offset s2"], [31, "mov rax, [rbp+var_88]"], [32, "mov [rbp+var_68], rax"], [33, "jmp short loc_401995"], [34, "mov [rbp+var_60], 1"], [35, "mov eax, [rbp+var_60]"], [36, "mov [rbp+var_78], eax"], [37, "lea rax, [rbp+var_80]"], [38, "mov esi, 0"], [39, "mov rdi, rax"], [40, "call _deflate"], [41, "mov [rbp+var_C], eax"], [42, "cmp [rbp+var_C], 0"], [43, "jz short loc_401995"], [44, "mov rax, cs:stderr"], [45, "mov edx, [rbp+var_C]"], [46, "mov ecx, edx"], [47, "mov edx, offset aDeflate_0"], [48, "mov esi, offset format"], [49, "mov rdi, rax"], [50, "mov eax, 0"], [51, "call _fprintf"], [52, "mov edi, 1"], [53, "call _exit"], [54, "mov rax, [rbp+var_70]"], [55, "cmp [rbp+var_8], rax"], [56, "jz short loc_4019AC"], [57, "mov rax, [rbp+var_58]"], [58, "cmp [rbp+var_90], rax"], [59, "ja short loc_401941"], [60, "mov [rbp+var_60], 1"], [61, "lea rax, [rbp+var_80]"], [62, "mov esi, 4"], [63, "mov rdi, rax"], [64, "call _deflate"], [65, "mov [rbp+var_C], eax"], [66, "cmp [rbp+var_C], 1"], [67, "jz short loc_401A00"], [68, "cmp [rbp+var_C], 0"], [69, "jz short loc_4019AC"], [70, "mov rax, cs:stderr"], [71, "mov edx, [rbp+var_C]"], [72, "mov ecx, edx"], [73, "mov edx, offset aDeflate_0"], [74, "mov esi, offset format"], [75, "mov rdi, rax"], [76, "mov eax, 0"], [77, "call _fprintf"], [78, "mov edi, 1"], [79, "call _exit"], [80, "nop"], [81, "lea rax, [rbp+var_80]"], [82, "mov rdi, rax"], [83, "call _deflateEnd"], [84, "mov [rbp+var_C], eax"], [85, "cmp [rbp+var_C], 0"], [86, "jz short loc_401A43"], [87, "mov rax, cs:stderr"], [88, "mov edx, [rbp+var_C]"], [89, "mov ecx, edx"], [90, "mov edx, offset aDeflateend_0"], [91, "mov esi, offset format"], [92, "mov rdi, rax"], [93, "mov eax, 0"], [94, "call _fprintf"], [95, "mov edi, 1"], [96, "call _exit"], [97, "nop"], [98, "leave"], [99, "retn"]], "data_dep": [[7, 6], [9, 8], [11, 8], [15, 11], [17, 16], [18, 17], [19, 18], [21, 17], [22, 21], [25, 20], [31, 3], [32, 31], [35, 34], [36, 35], [37, 30], [37, 35], [39, 37], [41, 40], [42, 41], [43, 42], [45, 41], [46, 45], [49, 44], [55, 5], [55, 54], [56, 55], [58, 4], [58, 57], [59, 58], [61, 64], [61, 30], [61, 54], [61, 57], [63, 61], [65, 64], [66, 65], [67, 66], [68, 65], [69, 68], [71, 65], [72, 71], [75, 70], [81, 30], [81, 64], [82, 81], [84, 83], [85, 84], [86, 85], [88, 84], [89, 88], [92, 87], [99, 83]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/69f0de33eedcd9436fcb94092331e4136551d42ae633c2c8a944915571ee0c7f_69f0de33eedcd9436fcb94092331e4136551d42ae633c2c8a944915571ee0c7f.jsonl.gz", "strip_func_name": "sub_40189C", "query": "\n\n\n__int64 __fastcall sub_40189C(__int64 a1, unsigned __int64 a2)\n{\n__int64 result; // rax\n__int64 v3; // [rsp+20h] [rbp-70h]\nunsigned __int64 v4; // [rsp+38h] [rbp-58h]\nunsigned int v5; // [rsp+84h] [rbp-Ch]\nunsigned int v6; // [rsp+84h] [rbp-Ch]\nunsigned int v7; // [rsp+84h] [rbp-Ch]\n\nv5 = deflateInit_();\nif ( v5 )\n{\nfprintf(stderr, \"%s error: %d\\n\", \"deflateInit\", v5);\nexit(1);\n}\nwhile ( v3 != 14 && a2 > v4 )\n{\nv6 = deflate();\nif ( v6 )\n{\nfprintf(stderr, \"%s error: %d\\n\", \"deflate\", v6);\nexit(1);\n}\n}\nwhile ( 1 )\n{\nv7 = deflate();\nif ( v7 == 1 )\nbreak;\nif ( v7 )\n{\nfprintf(stderr, \"%s error: %d\\n\", \"deflate\", v7);\nexit(1);\n}\n}\nresult = deflateEnd();\nif ( (_DWORD)result )\n{\nfprintf(stderr, \"%s error: %d\\n\", \"deflateEnd\", (unsigned int)result);\nexit(1);\n}\nreturn result;\n}\n\n\n\nQ:[a2,a1,v3,v4,v7,sub_40189C,]", "hints": "[]", "response": "{'a2': 'comprLen', 'a1': 'compr', 'v3': 'c_stream_16', 'v4': 'c_stream_40', 'v7': 'erra', 'sub_40189C': 'test_deflate'}"} | [
[
0.7668487429618835,
0.7667993903160095,
0.7667681574821472,
0.764079213142395,
0.7636114358901978,
0.760696291923523,
0.7507467269897461,
0.7504230737686157,
0.7463583946228027,
0.7461107969284058,
0.7460026741027832,
0.7443912029266357,
0.7441394925117493,
0.7441104054450989,
0.7416654229164124,
0.7416573762893677,
0.7414056062698364,
0.7413579821586609,
0.7398790121078491,
0.7395567297935486
],
[
196483,
183038,
197964,
61687,
45667,
149605,
159522,
74457,
223909,
119588,
168863,
117311,
165425,
209199,
112742,
85124,
67849,
6805,
243333,
209089
]
] |
|
do_flush | 4a26162d52baa49e02bcf6b75ffa2f7a6e8bdc4994017d29e9af644edca214c3 | Logitech | squeezeplay | NA | local int do_flush (file, flush)
gzFile file;
int flush;
{
uInt len;
int done = 0;
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
s->stream.avail_in = 0; /* should be zero already anyway */
for (;;) {
len = Z_BUFSIZE - s->stream.avail_out;
if (len != 0) {
if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
s->z_err = Z_ERRNO;
return Z_ERRNO;
}
s->stream.next_out = s->outbuf;
s->stream.avail_out = Z_BUFSIZE;
}
if (done) break;
s->out += s->stream.avail_out;
s->z_err = deflate(&(s->stream), flush);
s->out -= s->stream.avail_out;
/* Ignore the second of two consecutive flushes: */
if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
/* deflate has finished flushing only when it hasn't used up
* all the available space in the output buffer:
*/
done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
}
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40372F", "function_addr": 4208431, "binary_name": "4a26162d52baa49e02bcf6b75ffa2f7a6e8bdc4994017d29e9af644edca214c3.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 [rbp+var_4], 0"], [6, "mov rax, [rbp+var_28]"], [7, "mov [rbp+n+4], rax"], [8, "cmp [rbp+n+4], 0"], [9, "jz short loc_403763"], [10, "mov rax, [rbp+n+4]"], [11, "movzx eax, byte ptr [rax+0ACh]"], [12, "cmp al, 77h "], [13, "jz short loc_40376D"], [14, "mov eax, 0FFFFFFFEh"], [15, "jmp locret_4038D1"], [16, "mov rax, [rbp+n+4]"], [17, "mov dword ptr [rax+8], 0"], [18, "mov rax, [rbp+n+4]"], [19, "mov edx, [rax+20h]"], [20, "mov eax, 4000h"], [21, "sub eax, edx"], [22, "mov dword ptr [rbp+n], eax"], [23, "cmp dword ptr [rbp+n], 0"], [24, "jz short loc_4037EA"], [25, "mov rax, [rbp+n+4]"], [26, "mov rcx, [rax+78h]"], [27, "mov edx, dword ptr [rbp+n]"], [28, "mov rax, [rbp+n+4]"], [29, "mov rax, [rax+88h]"], [30, "mov esi, 1"], [31, "mov rdi, rax"], [32, "call _fwrite"], [33, "cmp dword ptr [rbp+n], eax"], [34, "jz short loc_4037CC"], [35, "mov rax, [rbp+n+4]"], [36, "mov dword ptr [rax+70h], 0FFFFFFFFh"], [37, "mov eax, 0FFFFFFFFh"], [38, "jmp locret_4038D1"], [39, "mov rax, [rbp+n+4]"], [40, "mov rdx, [rax+88h]"], [41, "mov rax, [rbp+n+4]"], [42, "mov [rax+18h], rdx"], [43, "mov rax, [rbp+n+4]"], [44, "mov dword ptr [rax+20h], 4000h"], [45, "cmp [rbp+var_4], 0"], [46, "jnz loc_4038B3"], [47, "mov rax, [rbp+n+4]"], [48, "mov rdx, [rax+0C0h]"], [49, "mov rax, [rbp+n+4]"], [50, "mov eax, [rax+20h]"], [51, "mov eax, eax"], [52, "add rdx, rax"], [53, "mov rax, [rbp+n+4]"], [54, "mov [rax+0C0h], rdx"], [55, "mov rax, [rbp+n+4]"], [56, "mov edx, [rbp+var_2C]"], [57, "mov esi, edx"], [58, "mov rdi, rax"], [59, "call sub_404DD5"], [60, "mov rdx, [rbp+n+4]"], [61, "mov [rdx+70h], eax"], [62, "mov rax, [rbp+n+4]"], [63, "mov rdx, [rax+0C0h]"], [64, "mov rax, [rbp+n+4]"], [65, "mov eax, [rax+20h]"], [66, "mov eax, eax"], [67, "sub rdx, rax"], [68, "mov rax, [rbp+n+4]"], [69, "mov [rax+0C0h], rdx"], [70, "cmp dword ptr [rbp+n], 0"], [71, "jnz short loc_40386D"], [72, "mov rax, [rbp+n+4]"], [73, "mov eax, [rax+70h]"], [74, "cmp eax, 0FFFFFFFBh"], [75, "jnz short loc_40386D"], [76, "mov rax, [rbp+n+4]"], [77, "mov dword ptr [rax+70h], 0"], [78, "mov rax, [rbp+n+4]"], [79, "mov eax, [rax+20h]"], [80, "test eax, eax"], [81, "jnz short loc_403884"], [82, "mov rax, [rbp+n+4]"], [83, "mov eax, [rax+70h]"], [84, "cmp eax, 1"], [85, "jnz short loc_40388B"], [86, "mov eax, 1"], [87, "jmp short loc_403890"], [88, "mov eax, 0"], [89, "mov [rbp+var_4], eax"], [90, "mov rax, [rbp+n+4]"], [91, "mov eax, [rax+70h]"], [92, "test eax, eax"], [93, "jz loc_403778"], [94, "mov rax, [rbp+n+4]"], [95, "mov eax, [rax+70h]"], [96, "cmp eax, 1"], [97, "jnz short loc_4038B6"], [98, "jmp loc_403778"], [99, "nop"], [100, "jmp short loc_4038B7"], [101, "nop"], [102, "mov rax, [rbp+n+4]"], [103, "mov eax, [rax+70h]"], [104, "cmp eax, 1"], [105, "jz short loc_4038CC"], [106, "mov rax, [rbp+n+4]"], [107, "mov eax, [rax+70h]"], [108, "jmp short locret_4038D1"], [109, "mov eax, 0"], [110, "leave"], [111, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 7], [11, 10], [12, 11], [13, 12], [16, 7], [17, 16], [18, 7], [19, 18], [19, 61], [19, 54], [19, 77], [19, 42], [19, 17], [19, 44], [19, 69], [21, 20], [21, 19], [22, 21], [23, 22], [24, 23], [25, 7], [26, 69], [26, 25], [26, 77], [26, 61], [26, 54], [26, 42], [26, 17], [26, 44], [27, 22], [28, 7], [29, 61], [29, 54], [29, 77], [29, 42], [29, 17], [29, 44], [29, 28], [29, 69], [31, 29], [33, 22], [33, 32], [34, 33], [35, 7], [36, 35], [39, 7], [40, 77], [40, 61], [40, 54], [40, 42], [40, 17], [40, 44], [40, 69], [40, 39], [41, 7], [42, 41], [42, 40], [43, 7], [44, 43], [45, 5], [45, 89], [46, 45], [47, 7], [48, 54], [48, 47], [48, 42], [48, 17], [48, 44], [48, 69], [48, 77], [48, 61], [49, 7], [50, 61], [50, 54], [50, 49], [50, 42], [50, 17], [50, 44], [50, 69], [50, 77], [51, 50], [52, 51], [52, 48], [53, 7], [54, 53], [54, 52], [55, 7], [56, 4], [57, 56], [58, 55], [60, 7], [61, 60], [61, 59], [62, 7], [63, 61], [63, 54], [63, 62], [64, 7], [65, 61], [65, 44], [65, 64], [66, 65], [67, 63], [67, 66], [68, 7], [69, 67], [69, 68], [70, 22], [71, 70], [72, 7], [73, 17], [73, 44], [73, 69], [73, 77], [73, 61], [73, 54], [73, 72], [73, 42], [74, 73], [75, 74], [76, 7], [77, 76], [78, 7], [79, 42], [79, 17], [79, 44], [79, 69], [79, 78], [79, 77], [79, 61], [79, 54], [80, 79], [81, 80], [82, 7], [83, 69], [83, 82], [83, 77], [83, 61], [83, 54], [83, 42], [83, 17], [83, 44], [84, 83], [85, 84], [89, 86], [89, 88], [90, 7], [91, 77], [91, 61], [91, 54], [91, 42], [91, 17], [91, 90], [91, 44], [91, 69], [92, 91], [93, 92], [94, 7], [95, 77], [95, 61], [95, 54], [95, 42], [95, 17], [95, 44], [95, 94], [95, 69], [96, 95], [97, 96], [102, 7], [103, 54], [103, 17], [103, 102], [103, 42], [103, 44], [103, 69], [103, 77], [103, 61], [104, 103], [105, 104], [106, 7], [107, 106], [107, 42], [107, 17], [107, 44], [107, 69], [107, 77], [107, 61], [107, 54], [111, 37], [111, 14], [111, 107], [111, 109]]}
| {"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_40372F", "query": "\n\n\n__int64 __fastcall sub_40372F(__int64 a1, unsigned int a2)\n{\n__int64 result; // rax\nint v3; // edx\n_BOOL4 v4; // eax\nunsigned int n; // [rsp+1Ch] [rbp-14h]\n_BOOL4 v6; // [rsp+2Ch] [rbp-4h]\n\nv6 = 0;\nif ( !a1 || *(_BYTE *)(a1 + 172) != 119 )\nreturn 4294967294LL;\n*(_DWORD *)(a1 + 8) = 0;\nwhile ( 1 )\n{\nv3 = *(_DWORD *)(a1 + 32);\nn = 0x4000 - v3;\nif ( v3 != 0x4000 )\n{\nif ( n != (unsigned int)fwrite(*(const void **)(a1 + 136), 1uLL, n, *(FILE **)(a1 + 120)) )\n{\n*(_DWORD *)(a1 + 112) = -1;\nreturn 0xFFFFFFFFLL;\n}\n*(_QWORD *)(a1 + 24) = *(_QWORD *)(a1 + 136);\n*(_DWORD *)(a1 + 32) = 0x4000;\n}\nif ( v6 )\nbreak;\n*(_QWORD *)(a1 + 192) += *(unsigned int *)(a1 + 32);\n*(_DWORD *)(a1 + 112) = sub_404DD5(a1, a2);\n*(_QWORD *)(a1 + 192) -= *(unsigned int *)(a1 + 32);\nif ( !n && *(_DWORD *)(a1 + 112) == -5 )\n*(_DWORD *)(a1 + 112) = 0;\nv4 = *(_DWORD *)(a1 + 32) || *(_DWORD *)(a1 + 112) == 1;\nv6 = v4;\nif ( *(_DWORD *)(a1 + 112) )\n{\nif ( *(_DWORD *)(a1 + 112) != 1 )\nbreak;\n}\n}\nif ( *(_DWORD *)(a1 + 112) == 1 )\nresult = 0LL;\nelse\nresult = *(unsigned int *)(a1 + 112);\nreturn result;\n}\n\n\n\nQ:[a1,a2,n,v6,sub_40372F,sub_404DD5,]", "hints": "[]", "response": "{'a1': 'file', 'a2': 'flush', 'n': 'len', 'v6': 'done', 'sub_40372F': 'do_flush', 'sub_404DD5': 'deflate'}"} | [
[
0.8165295720100403,
0.7839025855064392,
0.7838249206542969,
0.7832786440849304,
0.7792537212371826,
0.778157114982605,
0.7753648161888123,
0.7659364342689514,
0.7659364342689514,
0.7659364342689514,
0.7655317783355713,
0.7651612162590027,
0.7587475776672363,
0.7526156902313232,
0.7511793375015259,
0.750466525554657,
0.7498905062675476,
0.7479575872421265,
0.7479575872421265,
0.7479353547096252
],
[
133049,
205585,
175923,
251999,
263962,
252362,
240184,
152579,
125104,
129995,
183391,
217561,
44059,
193077,
43054,
151185,
162922,
100706,
166042,
239
]
] |
|
run_script | f780b89831a717b2e330e4b1a5c8ea347453f5c093263dd6548c8509f01cd329 | OpenIPC | mini | NA | void run_script (int pin, int value, int switch_interval) {
char *script_path,
pin_str[GPIODIRLEN],
value_str[2],
interval_str[10];
int script_path_len;
pid_t pid;
int status;
script_path_len = strlen(script_dir)
+ GPIODIRLEN
+ 2;
script_path = (char *)malloc(script_path_len);
snprintf(script_path, script_path_len,
"%s/%d", script_dir, pin);
if (! is_file(script_path)) {
syslog(LOG_WARNING,"pin %d: script \"%s\" does not exist",
pin, script_path);
return;
}
snprintf(pin_str, GPIODIRLEN, "%d", pin);
sprintf(value_str, "%d", value);
sprintf(interval_str, "%d", switch_interval);
syslog(LOG_INFO,"pin %d state %d interval %d: running script %s", pin, value, switch_interval, script_path);
if (0 == (pid = fork())) {
int res;
res = execl(script_path, script_path, pin_str, value_str, interval_str, (char *)NULL);
if (-1 == res) exit(255);
}
wait(&status);
if (WIFEXITED(status)) {
if (0 != WEXITSTATUS(status)) {
syslog(LOG_WARNING,"pin %d: event script exited with status = %d",
pin, WEXITSTATUS(status));
}
} else if (WIFSIGNALED(status)) {
syslog(LOG_WARNING,"pin %d: event script exited due to signal %d",
pin, WTERMSIG(status));
}
free(script_path);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40132C", "function_addr": 4199212, "binary_name": "f780b89831a717b2e330e4b1a5c8ea347453f5c093263dd6548c8509f01cd329.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_34], edi"], [4, "mov [rbp+var_38], esi"], [5, "mov [rbp+var_3C], edx"], [6, "mov rax, cs:s"], [7, "mov rdi, rax"], [8, "call _strlen"], [9, "add eax, 0Ah"], [10, "mov [rbp+var_4], eax"], [11, "mov eax, [rbp+var_4]"], [12, "cdqe"], [13, "mov rdi, rax"], [14, "call _malloc"], [15, "mov [rbp+s], rax"], [16, "mov rdx, cs:s"], [17, "mov eax, [rbp+var_4]"], [18, "movsxd rsi, eax"], [19, "mov ecx, [rbp+var_34]"], [20, "mov rax, [rbp+s]"], [21, "mov r8d, ecx"], [22, "mov rcx, rdx"], [23, "mov edx, offset format"], [24, "mov rdi, rax"], [25, "mov eax, 0"], [26, "call _snprintf"], [27, "mov rax, [rbp+s]"], [28, "mov rdi, rax"], [29, "call sub_4022EB"], [30, "test eax, eax"], [31, "jnz short loc_4013C4"], [32, "mov rdx, [rbp+s]"], [33, "mov eax, [rbp+var_34]"], [34, "mov rcx, rdx"], [35, "mov edx, eax"], [36, "mov esi, offset fmt"], [37, "mov edi, 4"], [38, "mov eax, 0"], [39, "call _syslog"], [40, "jmp locret_401513"], [41, "mov edx, [rbp+var_34]"], [42, "lea rax, [rbp+var_20]"], [43, "mov ecx, edx"], [44, "mov edx, offset aD"], [45, "mov esi, 8"], [46, "mov rdi, rax"], [47, "mov eax, 0"], [48, "call _snprintf"], [49, "mov edx, [rbp+var_38]"], [50, "lea rax, [rbp+var_22]"], [51, "mov esi, offset aD"], [52, "mov rdi, rax"], [53, "mov eax, 0"], [54, "call _sprintf"], [55, "mov edx, [rbp+var_3C]"], [56, "lea rax, [rbp+stat_loc+4]"], [57, "mov esi, offset aD"], [58, "mov rdi, rax"], [59, "mov eax, 0"], [60, "call _sprintf"], [61, "mov rsi, [rbp+s]"], [62, "mov ecx, [rbp+var_3C]"], [63, "mov edx, [rbp+var_38]"], [64, "mov eax, [rbp+var_34]"], [65, "mov r9, rsi"], [66, "mov r8d, ecx"], [67, "mov ecx, edx"], [68, "mov edx, eax"], [69, "mov esi, offset aPinDStateDInte"], [70, "mov edi, 6"], [71, "mov eax, 0"], [72, "call _syslog"], [73, "call _fork"], [74, "mov [rbp+var_14], eax"], [75, "cmp [rbp+var_14], 0"], [76, "jnz short loc_40148C"], [77, "lea rdi, [rbp+stat_loc+4]"], [78, "lea rcx, [rbp+var_22]"], [79, "lea rdx, [rbp+var_20]"], [80, "mov rsi, [rbp+s]"], [81, "mov rax, [rbp+s]"], [82, "mov r9d, 0"], [83, "mov r8, rdi"], [84, "mov rdi, rax"], [85, "mov eax, 0"], [86, "call _execl"], [87, "mov [rbp+var_18], eax"], [88, "cmp [rbp+var_18], 0FFFFFFFFh"], [89, "jnz short loc_40148C"], [90, "mov edi, 0FFh"], [91, "call _exit"], [92, "lea rax, [rbp+stat_loc]"], [93, "mov rdi, rax"], [94, "call _wait"], [95, "mov eax, dword ptr [rbp+stat_loc]"], [96, "and eax, 7Fh"], [97, "test eax, eax"], [98, "jnz short loc_4014D5"], [99, "mov eax, dword ptr [rbp+stat_loc]"], [100, "sar eax, 8"], [101, "movzx eax, al"], [102, "test eax, eax"], [103, "jz short loc_401507"], [104, "mov eax, dword ptr [rbp+stat_loc]"], [105, "sar eax, 8"], [106, "movzx edx, al"], [107, "mov eax, [rbp+var_34]"], [108, "mov ecx, edx"], [109, "mov edx, eax"], [110, "mov esi, offset aPinDEventScrip"], [111, "mov edi, 4"], [112, "mov eax, 0"], [113, "call _syslog"], [114, "jmp short loc_401507"], [115, "mov eax, dword ptr [rbp+stat_loc]"], [116, "and eax, 7Fh"], [117, "add eax, 1"], [118, "sar al, 1"], [119, "test al, al"], [120, "jle short loc_401507"], [121, "mov eax, dword ptr [rbp+stat_loc]"], [122, "and eax, 7Fh"], [123, "mov edx, eax"], [124, "mov eax, [rbp+var_34]"], [125, "mov ecx, edx"], [126, "mov edx, eax"], [127, "mov esi, offset aPinDEventScrip_0"], [128, "mov edi, 4"], [129, "mov eax, 0"], [130, "call _syslog"], [131, "mov rax, [rbp+s]"], [132, "mov rdi, rax"], [133, "call _free"], [134, "leave"], [135, "retn"]], "data_dep": [[7, 6], [9, 8], [10, 9], [11, 10], [13, 11], [15, 14], [17, 10], [18, 17], [19, 3], [20, 15], [21, 19], [22, 16], [24, 20], [27, 15], [28, 27], [30, 29], [31, 30], [32, 15], [33, 3], [34, 32], [35, 33], [41, 3], [42, 30], [43, 41], [46, 42], [49, 4], [50, 48], [52, 50], [55, 5], [56, 54], [58, 56], [61, 15], [62, 5], [63, 4], [64, 3], [65, 61], [66, 62], [67, 63], [68, 64], [74, 73], [75, 74], [76, 75], [77, 70], [78, 67], [79, 68], [80, 15], [81, 15], [83, 77], [84, 81], [87, 86], [88, 87], [89, 88], [92, 73], [92, 86], [93, 92], [96, 95], [97, 96], [98, 97], [100, 99], [101, 100], [102, 101], [103, 102], [105, 104], [106, 105], [107, 3], [108, 106], [109, 107], [116, 115], [117, 116], [118, 117], [119, 118], [120, 119], [122, 121], [123, 122], [124, 3], [125, 123], [126, 124], [131, 15], [132, 131], [135, 133], [135, 39]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f780b89831a717b2e330e4b1a5c8ea347453f5c093263dd6548c8509f01cd329_f780b89831a717b2e330e4b1a5c8ea347453f5c093263dd6548c8509f01cd329.jsonl.gz", "strip_func_name": "sub_40132C", "query": "\n\n\nvoid __fastcall sub_40132C(unsigned int a1, unsigned int a2, unsigned int a3)\n{\n__WAIT_STATUS stat_loc; // [rsp+10h] [rbp-30h] BYREF\nchar v5[2]; // [rsp+1Eh] [rbp-22h] BYREF\nchar v6[8]; // [rsp+20h] [rbp-20h] BYREF\nint v7; // [rsp+28h] [rbp-18h]\nchar *s; // [rsp+30h] [rbp-10h]\nint v10; // [rsp+3Ch] [rbp-4h]\n\nv10 = strlen(::s) + 10;\ns = (char *)malloc(v10);\nsnprintf(s, v10, \"%s/%d\", ::s, a1);\nif ( (unsigned int)sub_4022EB(s) )\n{\nsnprintf(v6, 8uLL, \"%d\", a1);\nsprintf(v5, \"%d\", a2);\nsprintf((char *)&stat_loc.__iptr + 4, \"%d\", a3);\nsyslog(6, \"pin %d state %d interval %d: running script %s\", a1, a2, a3, s);\nif ( !fork() )\n{\nv7 = execl(s, s, v6, v5, (char *)&stat_loc.__iptr + 4, 0LL);\nif ( v7 == -1 )\nexit(255);\n}\nwait((__WAIT_STATUS)&stat_loc);\nif ( ((__int64)stat_loc.__uptr & 0x7F) != 0 )\n{\nif ( (char)(((__int64)stat_loc.__uptr & 0x7F) + 1) >> 1 > 0 )\nsyslog(4, \"pin %d: event script exited due to signal %d\", a1, (__int64)stat_loc.__uptr & 0x7F);\n}\nelse if ( BYTE1(stat_loc.__uptr) )\n{\nsyslog(4, \"pin %d: event script exited with status = %d\", a1, BYTE1(stat_loc.__uptr));\n}\nfree(s);\n}\nelse\n{\nsyslog(4, \"pin %d: script \\\"%s\\\" does not exist\", a1, s);\n}\n}\n\n\n\nQ:[a3,a1,a2,stat_loc,v5,v6,v7,s,v10,sub_40132C,sub_4022EB,]", "hints": "[]", "response": "{'a3': 'switch_interval', 'a1': 'pin', 'a2': 'value', 'stat_loc': 'status', 'v5': 'value_str', 'v6': 'pin_str', 'v7': 'res', 's': 'script_path', 'v10': 'script_path_len', 'sub_40132C': 'run_script', 'sub_4022EB': 'is_file'}"} | [
[
0.8027787208557129,
0.793442964553833,
0.7817103862762451,
0.773007333278656,
0.7537958025932312,
0.745410680770874,
0.740763247013092,
0.7365171313285828,
0.7359000444412231,
0.7354116439819336,
0.7341523766517639,
0.7298267483711243,
0.7263091206550598,
0.7165650725364685,
0.7158546447753906,
0.7143024206161499,
0.7129977941513062,
0.7091362476348877,
0.7091126441955566,
0.7066168785095215
],
[
69458,
36124,
223791,
258280,
122916,
226856,
135788,
64465,
10080,
169601,
167626,
236233,
256565,
131922,
215681,
91540,
205671,
195029,
99599,
83310
]
] |
|
dumpbeef | 3640447f5bb300346409f324a3ebb86df143ff2590faf76255d52b1381c0d287 | rdebath | Brainfuck | NA | void dumpbeef(void)
{
int n;
for(n = 0; pgm[n].cmd; n++) {
if (pgm[n].mov > 0 ) printf(">%-4d:", pgm[n].mov);
else if (pgm[n].mov < 0) printf("<%-4d:", -pgm[n].mov);
else printf(" :");
if (pgm[n].cmd == '.' || pgm[n].cmd == ',')
printf("%c\n", pgm[n].cmd);
else if (pgm[n].cmd != '[' && pgm[n].cmd != ']')
printf("%c %d\n", pgm[n].cmd, pgm[n].arg);
else
printf("%c %d\n", pgm[n].cmd, pgm[n].arg-n);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404C98", "function_addr": 4213912, "binary_name": "3640447f5bb300346409f324a3ebb86df143ff2590faf76255d52b1381c0d287.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_4], 0"], [4, "jmp loc_404EDE"], [5, "mov rcx, cs:ptr"], [6, "mov eax, [rbp+var_4]"], [7, "movsxd rdx, eax"], [8, "mov rax, rdx"], [9, "add rax, rax"], [10, "add rax, rdx"], [11, "shl rax, 2"], [12, "add rax, rcx"], [13, "mov eax, [rax]"], [14, "test eax, eax"], [15, "jle short loc_404D01"], [16, "mov rcx, cs:ptr"], [17, "mov eax, [rbp+var_4]"], [18, "movsxd rdx, eax"], [19, "mov rax, rdx"], [20, "add rax, rax"], [21, "add rax, rdx"], [22, "shl rax, 2"], [23, "add rax, rcx"], [24, "mov eax, [rax]"], [25, "mov esi, eax"], [26, "mov edi, offset a4d"], [27, "mov eax, 0"], [28, "call _printf"], [29, "jmp short loc_404D67"], [30, "mov rcx, cs:ptr"], [31, "mov eax, [rbp+var_4]"], [32, "movsxd rdx, eax"], [33, "mov rax, rdx"], [34, "add rax, rax"], [35, "add rax, rdx"], [36, "shl rax, 2"], [37, "add rax, rcx"], [38, "mov eax, [rax]"], [39, "test eax, eax"], [40, "jns short loc_404D58"], [41, "mov rcx, cs:ptr"], [42, "mov eax, [rbp+var_4]"], [43, "movsxd rdx, eax"], [44, "mov rax, rdx"], [45, "add rax, rax"], [46, "add rax, rdx"], [47, "shl rax, 2"], [48, "add rax, rcx"], [49, "mov eax, [rax]"], [50, "neg eax"], [51, "mov esi, eax"], [52, "mov edi, offset a4d_0"], [53, "mov eax, 0"], [54, "call _printf"], [55, "jmp short loc_404D67"], [56, "mov edi, offset asc_40D3F6"], [57, "mov eax, 0"], [58, "call _printf"], [59, "mov rcx, cs:ptr"], [60, "mov eax, [rbp+var_4]"], [61, "movsxd rdx, eax"], [62, "mov rax, rdx"], [63, "add rax, rax"], [64, "add rax, rdx"], [65, "shl rax, 2"], [66, "add rax, rcx"], [67, "mov eax, [rax+4]"], [68, "cmp eax, 2Eh "], [69, "jz short loc_404DB1"], [70, "mov rcx, cs:ptr"], [71, "mov eax, [rbp+var_4]"], [72, "movsxd rdx, eax"], [73, "mov rax, rdx"], [74, "add rax, rax"], [75, "add rax, rdx"], [76, "shl rax, 2"], [77, "add rax, rcx"], [78, "mov eax, [rax+4]"], [79, "cmp eax, 2Ch "], [80, "jnz short loc_404DE7"], [81, "mov rcx, cs:ptr"], [82, "mov eax, [rbp+var_4]"], [83, "movsxd rdx, eax"], [84, "mov rax, rdx"], [85, "add rax, rax"], [86, "add rax, rdx"], [87, "shl rax, 2"], [88, "add rax, rcx"], [89, "mov eax, [rax+4]"], [90, "mov esi, eax"], [91, "mov edi, offset aC"], [92, "mov eax, 0"], [93, "call _printf"], [94, "jmp loc_404EDA"], [95, "mov rcx, cs:ptr"], [96, "mov eax, [rbp+var_4]"], [97, "movsxd rdx, eax"], [98, "mov rax, rdx"], [99, "add rax, rax"], [100, "add rax, rdx"], [101, "shl rax, 2"], [102, "add rax, rcx"], [103, "mov eax, [rax+4]"], [104, "cmp eax, 5Bh "], [105, "jz short loc_404E84"], [106, "mov rcx, cs:ptr"], [107, "mov eax, [rbp+var_4]"], [108, "movsxd rdx, eax"], [109, "mov rax, rdx"], [110, "add rax, rax"], [111, "add rax, rdx"], [112, "shl rax, 2"], [113, "add rax, rcx"], [114, "mov eax, [rax+4]"], [115, "cmp eax, 5Dh "], [116, "jz short loc_404E84"], [117, "mov rcx, cs:ptr"], [118, "mov eax, [rbp+var_4]"], [119, "movsxd rdx, eax"], [120, "mov rax, rdx"], [121, "add rax, rax"], [122, "add rax, rdx"], [123, "shl rax, 2"], [124, "add rax, rcx"], [125, "mov edx, [rax+8]"], [126, "mov rsi, cs:ptr"], [127, "mov eax, [rbp+var_4]"], [128, "movsxd rcx, eax"], [129, "mov rax, rcx"], [130, "add rax, rax"], [131, "add rax, rcx"], [132, "shl rax, 2"], [133, "add rax, rsi"], [134, "mov eax, [rax+4]"], [135, "mov esi, eax"], [136, "mov edi, offset aCD"], [137, "mov eax, 0"], [138, "call _printf"], [139, "jmp short loc_404EDA"], [140, "mov rcx, cs:ptr"], [141, "mov eax, [rbp+var_4]"], [142, "movsxd rdx, eax"], [143, "mov rax, rdx"], [144, "add rax, rax"], [145, "add rax, rdx"], [146, "shl rax, 2"], [147, "add rax, rcx"], [148, "mov eax, [rax+8]"], [149, "sub eax, [rbp+var_4]"], [150, "mov edx, eax"], [151, "mov rsi, cs:ptr"], [152, "mov eax, [rbp+var_4]"], [153, "movsxd rcx, eax"], [154, "mov rax, rcx"], [155, "add rax, rax"], [156, "add rax, rcx"], [157, "shl rax, 2"], [158, "add rax, rsi"], [159, "mov eax, [rax+4]"], [160, "mov esi, eax"], [161, "mov edi, offset aCD"], [162, "mov eax, 0"], [163, "call _printf"], [164, "add [rbp+var_4], 1"], [165, "mov rcx, cs:ptr"], [166, "mov eax, [rbp+var_4]"], [167, "movsxd rdx, eax"], [168, "mov rax, rdx"], [169, "add rax, rax"], [170, "add rax, rdx"], [171, "shl rax, 2"], [172, "add rax, rcx"], [173, "mov eax, [rax+4]"], [174, "test eax, eax"], [175, "jnz loc_404CAC"], [176, "nop"], [177, "nop"], [178, "leave"], [179, "retn"]], "data_dep": [[6, 164], [6, 3], [7, 6], [8, 7], [9, 8], [10, 7], [10, 9], [11, 10], [12, 5], [12, 11], [13, 12], [14, 13], [15, 14], [17, 3], [17, 164], [18, 17], [19, 18], [20, 19], [21, 18], [21, 20], [22, 21], [23, 22], [23, 16], [24, 23], [25, 24], [31, 3], [31, 164], [32, 31], [33, 32], [34, 33], [35, 32], [35, 34], [36, 35], [37, 30], [37, 36], [38, 37], [39, 38], [40, 39], [42, 164], [42, 3], [43, 42], [44, 43], [45, 44], [46, 43], [46, 45], [47, 46], [48, 47], [48, 41], [49, 48], [50, 49], [51, 50], [60, 164], [60, 3], [61, 60], [62, 61], [63, 62], [64, 61], [64, 63], [65, 64], [66, 59], [66, 65], [67, 66], [68, 67], [69, 68], [71, 3], [71, 164], [72, 71], [73, 72], [74, 73], [75, 72], [75, 74], [76, 75], [77, 76], [77, 70], [78, 77], [79, 78], [80, 79], [82, 3], [82, 164], [83, 82], [84, 83], [85, 84], [86, 83], [86, 85], [87, 86], [88, 81], [88, 87], [89, 88], [90, 89], [96, 3], [96, 164], [97, 96], [98, 97], [99, 98], [100, 97], [100, 99], [101, 100], [102, 95], [102, 101], [103, 102], [104, 103], [105, 104], [107, 3], [107, 164], [108, 107], [109, 108], [110, 109], [111, 110], [111, 108], [112, 111], [113, 112], [113, 106], [114, 113], [115, 114], [116, 115], [118, 3], [118, 164], [119, 118], [120, 119], [121, 120], [122, 119], [122, 121], [123, 122], [124, 117], [124, 123], [125, 124], [127, 3], [127, 164], [128, 127], [129, 128], [130, 129], [131, 128], [131, 130], [132, 131], [133, 132], [133, 126], [134, 133], [135, 134], [141, 3], [141, 164], [142, 141], [143, 142], [144, 143], [145, 142], [145, 144], [146, 145], [147, 146], [147, 140], [148, 147], [149, 164], [149, 148], [149, 3], [150, 149], [152, 3], [152, 164], [153, 152], [154, 153], [155, 154], [156, 153], [156, 155], [157, 156], [158, 151], [158, 157], [159, 158], [160, 159], [164, 164], [164, 3], [166, 164], [166, 3], [167, 166], [168, 167], [169, 168], [170, 169], [170, 167], [171, 170], [172, 165], [172, 171], [173, 172], [174, 173], [175, 174], [179, 174]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3640447f5bb300346409f324a3ebb86df143ff2590faf76255d52b1381c0d287_3640447f5bb300346409f324a3ebb86df143ff2590faf76255d52b1381c0d287.jsonl.gz", "strip_func_name": "sub_404C98", "query": "\n\n\n__int64 sub_404C98()\n{\n__int64 result; // rax\nint i; // [rsp+Ch] [rbp-4h]\n\nfor ( i = 0; ; ++i )\n{\nresult = *((unsigned int *)ptr + 3 * i + 1);\nif ( !(_DWORD)result )\nbreak;\nif ( *((int *)ptr + 3 * i) <= 0 )\n{\nif ( *((int *)ptr + 3 * i) >= 0 )\nprintf(\" :\");\nelse\nprintf(\"<%-4d:\", (unsigned int)-*((_DWORD *)ptr + 3 * i));\n}\nelse\n{\nprintf(\">%-4d:\", *((unsigned int *)ptr + 3 * i));\n}\nif ( *((_DWORD *)ptr + 3 * i + 1) == 46 || *((_DWORD *)ptr + 3 * i + 1) == 44 )\n{\nprintf(\"%c\\n\", *((unsigned int *)ptr + 3 * i + 1));\n}\nelse if ( *((_DWORD *)ptr + 3 * i + 1) == 91 || *((_DWORD *)ptr + 3 * i + 1) == 93 )\n{\nprintf(\"%c %d\\n\", *((unsigned int *)ptr + 3 * i + 1), (unsigned int)(*((_DWORD *)ptr + 3 * i + 2) - i));\n}\nelse\n{\nprintf(\"%c %d\\n\", *((unsigned int *)ptr + 3 * i + 1), *((unsigned int *)ptr + 3 * i + 2));\n}\n}\nreturn result;\n}\n\n\n\nQ:[i,sub_404C98,]", "hints": "[]", "response": "{'i': 'n', 'sub_404C98': 'dumpbeef'}"} | [
[
0.7689273357391357,
0.7585856318473816,
0.7557944059371948,
0.7505251169204712,
0.7388628125190735,
0.7316213250160217,
0.7209958434104919,
0.7207587957382202,
0.7166432738304138,
0.7143011093139648,
0.7113943696022034,
0.7105197310447693,
0.7058398723602295,
0.7010762691497803,
0.6962008476257324,
0.6944893002510071,
0.6840114593505859,
0.6833165884017944,
0.6833112239837646,
0.6820100545883179
],
[
101093,
204914,
246386,
85378,
159774,
222711,
9423,
37701,
133242,
231444,
143425,
137586,
45218,
17214,
158136,
134566,
119154,
199373,
65385,
9636
]
] |
|
usage_ldap | a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40 | vanhauser-thc | thc-hydra | NA | void usage_ldap(const char *service) {
printf("Module %s is optionally taking the DN (depending of the auth method "
"choosed\n"
"Note: you can also specify the DN as login when Simple auth method "
"is used).\n"
"The keyword \"^USER^\" is replaced with the login.\n"
"Special notes for Simple method has 3 operation modes: anonymous, "
"(no user no pass),\n"
"unauthenticated (user but no pass), user/pass authenticated (user "
"and pass).\n"
"So don't forget to set empty string as user/pass to test all modes.\n"
"Hint: to authenticate to a windows active directory ldap, this is "
"usually\n"
" cn=^USER^,cn=users,dc=foo,dc=bar,dc=com for domain foo.bar.com\n\n",
service);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_429E23", "function_addr": 4365859, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.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, fs:28h"], [5, "mov [rbp+var_8], rax"], [6, "xor eax, eax"], [7, "mov rax, [rbp+var_18]"], [8, "mov rsi, rax"], [9, "mov edi, offset aModuleSIsOptio"], [10, "mov eax, 0"], [11, "call _printf"], [12, "nop"], [13, "mov rax, [rbp+var_8]"], [14, "sub rax, fs:28h"], [15, "jz short locret_429E69"], [16, "call ___stack_chk_fail"], [17, "leave"], [18, "retn"]], "data_dep": [[5, 4], [7, 3], [8, 7], [13, 5], [14, 13], [15, 14], [18, 14]]}
| {"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_429E23", "query": "\n\n\nunsigned __int64 __fastcall sub_429E23(const char *a1)\n{\nunsigned __int64 v2; // [rsp+18h] [rbp-8h]\n\nv2 = __readfsqword(0x28u);\nprintf(\n\"Module %s is optionally taking the DN (depending of the auth method choosed\\n\"\n\"Note: you can also specify the DN as login when Simple auth method is used).\\n\"\n\"The keyword \\\"^USER^\\\" is replaced with the login.\\n\"\n\"Special notes for Simple method has 3 operation modes: anonymous, (no user no pass),\\n\"\n\"unauthenticated (user but no pass), user/pass authenticated (user and pass).\\n\"\n\"So don't forget to set empty string as user/pass to test all modes.\\n\"\n\"Hint: to authenticate to a windows active directory ldap, this is usually\\n\"\n\" cn=^USER^,cn=users,dc=foo,dc=bar,dc=com for domain foo.bar.com\\n\"\n\"\\n\",\na1);\nreturn v2 - __readfsqword(0x28u);\n}\n\n\n\nQ:[a1,sub_429E23,]", "hints": "[]", "response": "{'a1': 'service', 'sub_429E23': 'usage_ldap'}"} | [
[
0.8668781518936157,
0.8612500429153442,
0.8597022294998169,
0.8596200942993164,
0.8587449789047241,
0.8553034663200378,
0.854666531085968,
0.8537635803222656,
0.8529075980186462,
0.8516521453857422,
0.8502747416496277,
0.8497366905212402,
0.8496988415718079,
0.847881555557251,
0.8475934267044067,
0.8462944030761719,
0.8454445004463196,
0.8451817035675049,
0.8443916440010071,
0.843177080154419
],
[
173225,
126083,
178719,
39931,
104819,
191218,
117921,
183278,
236736,
56231,
200690,
187566,
164790,
214744,
84856,
250937,
95617,
166276,
170043,
85416
]
] |
|
decgets | eebf1b9c8eb7a43e36692f81e2e92ed877f53f1a000674def138e518d0220b99 | sergev | vak-opensource | NA | static int decgets (p, n)
char *p;
int n;
{
register c;
register char *s;
s = p;
--n;
while (--n > 0) {
c = DECGET ();
if (c < 0) {
*s = 0;
return (s != p);
}
if ((*s++ = c) == '\n')
break;
}
*s = 0;
return (1);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401D86", "function_addr": 4201862, "binary_name": "eebf1b9c8eb7a43e36692f81e2e92ed877f53f1a000674def138e518d0220b99.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "sub rsp, 10h"], [5, "mov [rbp+var_18], rdi"], [6, "mov [rbp+var_1C], esi"], [7, "mov rbx, [rbp+var_18]"], [8, "sub [rbp+var_1C], 1"], [9, "jmp short loc_401DDA"], [10, "mov rdx, cs:qword_414870"], [11, "mov eax, 0"], [12, "call rdx "], [13, "mov r12d, eax"], [14, "test r12d, r12d"], [15, "jns short loc_401DC7"], [16, "mov byte ptr [rbx], 0"], [17, "cmp rbx, [rbp+var_18]"], [18, "setnz al"], [19, "movzx eax, al"], [20, "jmp short loc_401DEF"], [21, "mov rax, rbx"], [22, "lea rbx, [rax+1]"], [23, "mov edx, r12d"], [24, "mov [rax], dl"], [25, "movzx eax, byte ptr [rax]"], [26, "cmp al, 0Ah"], [27, "jz short loc_401DE6"], [28, "sub [rbp+var_1C], 1"], [29, "cmp [rbp+var_1C], 0"], [30, "jg short loc_401DA2"], [31, "jmp short loc_401DE7"], [32, "nop"], [33, "mov byte ptr [rbx], 0"], [34, "mov eax, 1"], [35, "add rsp, 10h"], [36, "pop rbx"], [37, "pop r12"], [38, "pop rbp"], [39, "retn"]], "data_dep": [[7, 5], [8, 6], [12, 10], [13, 12], [14, 13], [15, 14], [16, 7], [16, 22], [17, 5], [17, 7], [17, 22], [18, 17], [18, 12], [19, 18], [21, 22], [21, 7], [22, 7], [22, 22], [22, 21], [22, 24], [23, 14], [24, 23], [24, 21], [25, 21], [25, 24], [26, 25], [27, 26], [28, 8], [28, 28], [29, 28], [30, 29], [33, 7], [33, 22], [35, 4], [36, 3], [37, 2], [38, 0], [39, 19], [39, 34]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/eebf1b9c8eb7a43e36692f81e2e92ed877f53f1a000674def138e518d0220b99_eebf1b9c8eb7a43e36692f81e2e92ed877f53f1a000674def138e518d0220b99.jsonl.gz", "strip_func_name": "sub_401D86", "query": "\n\n\n_BOOL8 __fastcall sub_401D86(_BYTE *a1, int a2)\n{\n_BYTE *v2; // rbx\nint v3; // eax\nchar v4; // r12\n_BYTE *v6; // rax\nint v7; // [rsp+4h] [rbp-1Ch]\n\nv2 = a1;\nv7 = a2 - 1;\ndo\n{\nif ( --v7 <= 0 )\nbreak;\nv3 = qword_414870();\nv4 = v3;\nif ( v3 < 0 )\n{\n*v2 = 0;\nreturn v2 != a1;\n}\nv6 = v2++;\n*v6 = v4;\n}\nwhile ( *v6 != 10 );\n*v2 = 0;\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,v7,sub_401D86,]", "hints": "[]", "response": "{'a1': 'p', 'a2': 'n', 'v7': 'na', 'sub_401D86': 'decgets'}"} | [
[
0.7351181507110596,
0.7303324937820435,
0.7184308171272278,
0.7089409232139587,
0.6993234157562256,
0.695659875869751,
0.6932613849639893,
0.6926339864730835,
0.6864959001541138,
0.6860436201095581,
0.6787678003311157,
0.6773179173469543,
0.6766262054443359,
0.6751841902732849,
0.6738088130950928,
0.6727901101112366,
0.672723650932312,
0.6723446846008301,
0.6702785491943359,
0.6688129305839539
],
[
100057,
37077,
76251,
88190,
264534,
169521,
177801,
259128,
134453,
242609,
18059,
163329,
200832,
9780,
5866,
51366,
177482,
18867,
127806,
103673
]
] |
|
logger | 0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10 | git-hulk | rdbtools | NA | void
logger(enum LEVEL loglevel,char *fmt, ...)
{
FILE *fp;
va_list ap;
time_t now;
char buf[4096];
char t_buf[64];
char *msg = NULL;
const char *color = "";
if(loglevel < log_level) {
return;
}
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
switch(loglevel) {
case DEBUG: msg = "DEBUG"; break;
case INFO: msg = "INFO"; color = C_YELLOW ; break;
case WARN: msg = "WARN"; color = C_PURPLE; break;
case ERROR: msg = "ERROR"; color = C_RED; break;
}
now = time(NULL);
strftime(t_buf,64,"%Y-%m-%d %H:%M:%S",localtime(&now));
fp = (log_file == NULL) ? stdout : fopen(log_file,"a");
if(log_file) {
fprintf(fp, "[%s] [%s] %s\n", t_buf, msg, buf);
fclose(fp);
} else {
fprintf(fp, "%s[%s] [%s] %s"C_NONE"\n", color, t_buf, msg, buf);
}
if(loglevel >= ERROR) {
exit(1);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405849", "function_addr": 4216905, "binary_name": "0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 1140h"], [3, "mov [rbp+var_1134], edi"], [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_4058A1"], [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+var_B8], 0"], [20, "mov [rbp+var_C0], offset unk_431CC0"], [21, "mov eax, cs:dword_442374"], [22, "cmp [rbp+var_1134], eax"], [23, "jb loc_405AAF"], [24, "mov [rbp+arg], 10h"], [25, "mov [rbp+var_DC], 30h "], [26, "lea rax, [rbp+arg_0]"], [27, "mov [rbp+var_D8], rax"], [28, "lea rax, [rbp+var_B0]"], [29, "mov [rbp+var_D0], rax"], [30, "lea rcx, [rbp+arg]"], [31, "mov rdx, [rbp+format]"], [32, "lea rax, [rbp+s]"], [33, "mov esi, 1000h"], [34, "mov rdi, rax"], [35, "call _vsnprintf"], [36, "cmp [rbp+var_1134], 4"], [37, "jz short loc_40598D"], [38, "cmp [rbp+var_1134], 4"], [39, "ja short loc_4059A4"], [40, "cmp [rbp+var_1134], 3"], [41, "jz short loc_405975"], [42, "cmp [rbp+var_1134], 3"], [43, "ja short loc_4059A4"], [44, "cmp [rbp+var_1134], 1"], [45, "jz short loc_405950"], [46, "cmp [rbp+var_1134], 2"], [47, "jz short loc_40595D"], [48, "jmp short loc_4059A4"], [49, "mov [rbp+var_B8], offset aDebug"], [50, "jmp short loc_4059A4"], [51, "mov [rbp+var_B8], offset aInfo"], [52, "mov [rbp+var_C0], offset a33m"], [53, "jmp short loc_4059A4"], [54, "mov [rbp+var_B8], offset aWarn"], [55, "mov [rbp+var_C0], offset a35m"], [56, "jmp short loc_4059A4"], [57, "mov [rbp+var_B8], offset aError"], [58, "mov [rbp+var_C0], offset a31m"], [59, "nop"], [60, "mov edi, 0"], [61, "call _time"], [62, "mov [rbp+timer], rax"], [63, "lea rax, [rbp+timer]"], [64, "mov rdi, rax"], [65, "call _localtime"], [66, "mov rdx, rax"], [67, "lea rax, [rbp+var_1130]"], [68, "mov rcx, rdx"], [69, "mov edx, offset aYMDHMS"], [70, "mov esi, 40h "], [71, "mov rdi, rax"], [72, "call _strftime"], [73, "mov rax, cs:filename"], [74, "test rax, rax"], [75, "jz short loc_405A05"], [76, "mov rax, cs:filename"], [77, "mov esi, offset modes"], [78, "mov rdi, rax"], [79, "call _fopen"], [80, "jmp short loc_405A0C"], [81, "mov rax, cs:stdout"], [82, "mov [rbp+stream], rax"], [83, "mov rax, cs:filename"], [84, "test rax, rax"], [85, "jz short loc_405A61"], [86, "lea rsi, [rbp+s]"], [87, "mov rcx, [rbp+var_B8]"], [88, "lea rdx, [rbp+var_1130]"], [89, "mov rax, [rbp+stream]"], [90, "mov r8, rsi"], [91, "mov esi, offset aSSS"], [92, "mov rdi, rax"], [93, "mov eax, 0"], [94, "call _fprintf"], [95, "mov rax, [rbp+stream]"], [96, "mov rdi, rax"], [97, "call _fclose"], [98, "jmp short loc_405A9C"], [99, "lea rdi, [rbp+s]"], [100, "mov rsi, [rbp+var_B8]"], [101, "lea rcx, [rbp+var_1130]"], [102, "mov rdx, [rbp+var_C0]"], [103, "mov rax, [rbp+stream]"], [104, "mov r9, rdi"], [105, "mov r8, rsi"], [106, "mov esi, offset aSSSS0m"], [107, "mov rdi, rax"], [108, "mov eax, 0"], [109, "call _fprintf"], [110, "cmp [rbp+var_1134], 3"], [111, "jbe short locret_405AB0"], [112, "mov edi, 1"], [113, "call _exit"], [114, "nop"], [115, "leave"], [116, "retn"]], "data_dep": [[10, 9], [22, 3], [22, 21], [23, 22], [26, 21], [27, 26], [28, 26], [29, 28], [30, 24], [31, 4], [32, 28], [34, 32], [36, 3], [37, 36], [38, 3], [39, 38], [40, 3], [41, 40], [42, 3], [43, 42], [44, 3], [45, 44], [46, 3], [47, 46], [62, 61], [63, 61], [63, 62], [64, 63], [66, 65], [67, 65], [68, 66], [71, 67], [74, 73], [75, 74], [78, 76], [82, 81], [82, 79], [84, 83], [85, 84], [86, 77], [86, 70], [87, 19], [87, 49], [87, 51], [87, 54], [87, 57], [88, 69], [89, 82], [90, 86], [92, 89], [95, 82], [96, 95], [99, 78], [99, 71], [100, 19], [100, 49], [100, 51], [100, 54], [100, 57], [101, 68], [102, 55], [102, 52], [102, 58], [102, 20], [103, 82], [104, 99], [105, 100], [107, 103], [110, 3], [111, 110], [116, 21], [116, 97], [116, 109]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10_0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10.jsonl.gz", "strip_func_name": "sub_405849", "query": "\n\n\nint sub_405849(unsigned int a1, const char *a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, ...)\n{\nint result; // eax\nstruct tm *v7; // rax\nFILE *v8; // rax\nchar v9[64]; // [rsp+10h] [rbp-1130h] BYREF\nchar s[4104]; // [rsp+50h] [rbp-10F0h] BYREF\ntime_t timer; // [rsp+1058h] [rbp-E8h] BYREF\ngcc_va_list arg; // [rsp+1060h] [rbp-E0h] BYREF\nFILE *stream; // [rsp+1078h] [rbp-C8h]\nconst char *v14; // [rsp+1080h] [rbp-C0h]\nconst char *v15; // [rsp+1088h] [rbp-B8h]\n__int64 v16; // [rsp+10A0h] [rbp-A0h]\n__int64 v17; // [rsp+10A8h] [rbp-98h]\n__int64 v18; // [rsp+10B0h] [rbp-90h]\n__int64 v19; // [rsp+10B8h] [rbp-88h]\n\nv16 = a3;\nv17 = a4;\nv18 = a5;\nv19 = a6;\nv15 = 0LL;\nv14 = (const char *)&unk_431CC0;\nresult = dword_442374;\nif ( a1 >= dword_442374 )\n{\narg[0].gp_offset = 16;\nva_start(arg, a6);\nvsnprintf(s, 0x1000uLL, a2, arg);\nif ( a1 == 4 )\n{\nv15 = \"ERROR\";\nv14 = \"\\x1B[31m\";\n}\nelse if ( a1 <= 4 )\n{\nswitch ( a1 )\n{\ncase 3u:\nv15 = \"WARN\";\nv14 = \"\\x1B[35m\";\nbreak;\ncase 1u:\nv15 = \"DEBUG\";\nbreak;\ncase 2u:\nv15 = \"INFO\";\nv14 = \"\\x1B[33m\";\nbreak;\n}\n}\ntimer = time(0LL);\nv7 = localtime(&timer);\nstrftime(v9, 0x40uLL, \"%Y-%m-%d %H:%M:%S\", v7);\nif ( filename )\nv8 = fopen(filename, \"a\");\nelse\nv8 = stdout;\nstream = v8;\nif ( filename )\n{\nfprintf(stream, \"[%s] [%s] %s\\n\", v9, v15, s);\nresult = fclose(stream);\n}\nelse\n{\nresult = fprintf(stream, \"%s[%s] [%s] %s\\x1B[0m\\n\", v14, v9, v15, s);\n}\nif ( a1 > 3 )\nexit(1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v9,s,timer,arg,stream,v14,v15,sub_405849,]", "hints": "[]", "response": "{'a1': 'loglevel', 'a2': 'fmt', 'v9': 't_buf', 's': 'buf', 'timer': 'now', 'arg': 'ap', 'stream': 'fp', 'v14': 'color', 'v15': 'msg', 'sub_405849': 'logger'}"} | [
[
0.7470723986625671,
0.7426573634147644,
0.7311601638793945,
0.7261602878570557,
0.722743570804596,
0.7214022874832153,
0.7208373546600342,
0.7201970815658569,
0.7201970815658569,
0.7201970815658569,
0.7193471789360046,
0.7109357118606567,
0.7101345062255859,
0.7092370390892029,
0.7026146650314331,
0.6947934627532959,
0.6920478343963623,
0.6843503713607788,
0.6838165521621704,
0.6821228265762329
],
[
243002,
54327,
217621,
36033,
33487,
28060,
61546,
150723,
208678,
159516,
84218,
115644,
162913,
210378,
263731,
147590,
235955,
193325,
262183,
175189
]
] |
|
readLen | 163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad | haakonnessjoen | librouteros-api | NA | static int readLen(struct ros_connection *conn)
{
char data[4];
memset(data, 0, 4);
if (_read(conn->socket, data, 1) != 1) {
return -1;
}
if ((data[0] & 0xE0) == 0xE0) {
if (_read(conn->socket, data + 1, 3) != 3) {
return -1;
}
printf("Giant packet: %d\n", *((int *)data));
return *((int *)data);
}
else if ((data[0] & 0xC0) == 0XC0) {
data[0] &= 0x3f; // mask out the 1st 2 bits
if (_read(conn->socket, data + 1, 2) != 2) {
return -1;
}
printf("Lesser small packet: %d\n", *((int *)data));
return *((int *)data);
}
else if ((data[0] & 0x80) == 0x80) {
data[0] &= 0x7f; // mask out the 1st bit
if (_read(conn->socket, data + 1, 1) != 1) {
return -1;
}
printf("Less small packet: %d\n", *((int *)data));
return *((int *)data);
}
else {
return *((int *)data);
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40184D", "function_addr": 4200525, "binary_name": "163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "lea rax, [rbp+s]"], [5, "mov edx, 4"], [6, "mov esi, 0"], [7, "mov rdi, rax"], [8, "call _memset"], [9, "mov rax, [rbp+var_18]"], [10, "mov eax, [rax+4]"], [11, "lea rcx, [rbp+s]"], [12, "mov edx, 1"], [13, "mov rsi, rcx"], [14, "mov edi, eax"], [15, "call _read"], [16, "cmp rax, 1"], [17, "jz short loc_401899"], [18, "mov eax, 0FFFFFFFFh"], [19, "jmp locret_4019C8"], [20, "movzx eax, [rbp+s]"], [21, "movsx eax, al"], [22, "and eax, 0E0h"], [23, "cmp eax, 0E0h"], [24, "jnz short loc_4018FC"], [25, "lea rax, [rbp+s]"], [26, "add rax, 1"], [27, "mov rdx, [rbp+var_18]"], [28, "mov ecx, [rdx+4]"], [29, "mov edx, 3"], [30, "mov rsi, rax"], [31, "mov edi, ecx"], [32, "call _read"], [33, "cmp rax, 3"], [34, "jz short loc_4018DA"], [35, "mov eax, 0FFFFFFFFh"], [36, "jmp locret_4019C8"], [37, "lea rax, [rbp+s]"], [38, "mov eax, [rax]"], [39, "mov esi, eax"], [40, "mov edi, offset aGiantPacketD"], [41, "mov eax, 0"], [42, "call _printf"], [43, "lea rax, [rbp+s]"], [44, "mov eax, [rax]"], [45, "jmp locret_4019C8"], [46, "movzx eax, [rbp+s]"], [47, "movsx eax, al"], [48, "and eax, 0C0h"], [49, "cmp eax, 0C0h"], [50, "jnz short loc_401966"], [51, "movzx eax, [rbp+s]"], [52, "and eax, 3Fh"], [53, "mov [rbp+s], al"], [54, "lea rax, [rbp+s]"], [55, "add rax, 1"], [56, "mov rdx, [rbp+var_18]"], [57, "mov ecx, [rdx+4]"], [58, "mov edx, 2"], [59, "mov rsi, rax"], [60, "mov edi, ecx"], [61, "call _read"], [62, "cmp rax, 2"], [63, "jz short loc_401947"], [64, "mov eax, 0FFFFFFFFh"], [65, "jmp locret_4019C8"], [66, "lea rax, [rbp+s]"], [67, "mov eax, [rax]"], [68, "mov esi, eax"], [69, "mov edi, offset aLesserSmallPac"], [70, "mov eax, 0"], [71, "call _printf"], [72, "lea rax, [rbp+s]"], [73, "mov eax, [rax]"], [74, "jmp short locret_4019C8"], [75, "movzx eax, [rbp+s]"], [76, "test al, al"], [77, "jns short loc_4019C2"], [78, "movzx eax, [rbp+s]"], [79, "and eax, 7Fh"], [80, "mov [rbp+s], al"], [81, "lea rax, [rbp+s]"], [82, "add rax, 1"], [83, "mov rdx, [rbp+var_18]"], [84, "mov ecx, [rdx+4]"], [85, "mov edx, 1"], [86, "mov rsi, rax"], [87, "mov edi, ecx"], [88, "call _read"], [89, "cmp rax, 1"], [90, "jz short loc_4019A3"], [91, "mov eax, 0FFFFFFFFh"], [92, "jmp short locret_4019C8"], [93, "lea rax, [rbp+s]"], [94, "mov eax, [rax]"], [95, "mov esi, eax"], [96, "mov edi, offset aLessSmallPacke"], [97, "mov eax, 0"], [98, "call _printf"], [99, "lea rax, [rbp+s]"], [100, "mov eax, [rax]"], [101, "jmp short locret_4019C8"], [102, "lea rax, [rbp+s]"], [103, "mov eax, [rax]"], [104, "leave"], [105, "retn"]], "data_dep": [[7, 4], [9, 3], [10, 9], [13, 11], [14, 10], [16, 15], [17, 16], [21, 20], [22, 21], [23, 22], [24, 23], [25, 22], [26, 25], [27, 3], [28, 27], [30, 26], [31, 28], [33, 32], [34, 33], [37, 32], [38, 37], [39, 38], [43, 42], [44, 43], [47, 46], [48, 47], [49, 48], [50, 49], [52, 51], [53, 52], [54, 52], [54, 53], [55, 54], [56, 3], [57, 56], [59, 55], [60, 57], [62, 61], [63, 62], [66, 53], [66, 61], [67, 66], [68, 67], [72, 53], [72, 71], [73, 72], [76, 75], [77, 76], [79, 78], [80, 79], [81, 80], [81, 79], [82, 81], [83, 3], [84, 83], [86, 82], [87, 84], [89, 88], [90, 89], [93, 80], [93, 88], [94, 93], [95, 94], [99, 80], [99, 98], [100, 99], [102, 76], [103, 102], [105, 64], [105, 73], [105, 18], [105, 91], [105, 103], [105, 100], [105, 35], [105, 44]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad_163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad.jsonl.gz", "strip_func_name": "sub_40184D", "query": "\n\n\n__int64 __fastcall sub_40184D(__int64 a1)\n{\n__int64 result; // rax\nunsigned int s; // [rsp+1Ch] [rbp-4h] BYREF\n\nmemset(&s, 0, sizeof(s));\nif ( read(*(_DWORD *)(a1 + 4), &s, 1uLL) != 1 )\nreturn 0xFFFFFFFFLL;\nif ( (s & 0xE0) == 224 )\n{\nif ( read(*(_DWORD *)(a1 + 4), (char *)&s + 1, 3uLL) == 3 )\n{\nprintf(\"Giant packet: %d\\n\", s);\nresult = s;\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse if ( (s & 0xC0) == 192 )\n{\nLOBYTE(s) = s & 0x3F;\nif ( read(*(_DWORD *)(a1 + 4), (char *)&s + 1, 2uLL) == 2 )\n{\nprintf(\"Lesser small packet: %d\\n\", s);\nresult = s;\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse if ( (s & 0x80u) == 0 )\n{\nresult = s;\n}\nelse\n{\nLOBYTE(s) = s & 0x7F;\nif ( read(*(_DWORD *)(a1 + 4), (char *)&s + 1, 1uLL) == 1 )\n{\nprintf(\"Less small packet: %d\\n\", s);\nresult = s;\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,s,sub_40184D,]", "hints": "[]", "response": "{'a1': 'conn', 's': 'data', 'sub_40184D': 'readLen'}"} | [
[
0.7928805947303772,
0.7817831039428711,
0.7531329989433289,
0.7482237815856934,
0.7443364858627319,
0.7409144043922424,
0.7254396080970764,
0.7204333543777466,
0.7204333543777466,
0.7135201096534729,
0.7096703052520752,
0.7006201148033142,
0.6990492939949036,
0.6987512111663818,
0.6973876953125,
0.695755660533905,
0.6948001980781555,
0.6947119832038879,
0.6939504146575928,
0.6911475658416748
],
[
263725,
169990,
164238,
104345,
261026,
193773,
95482,
38091,
32978,
94613,
246100,
64101,
164072,
237839,
163146,
210867,
211324,
229116,
27231,
62761
]
] |
|
activate_nonblock | 89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6 | Tachone | Tachftp | NA | void activate_nonblock(int fd)
{
int ret;
int flags = fcntl(fd, F_GETFL);
if (flags == -1)
ERR_EXIT("fcntl");
flags |= O_NONBLOCK;
ret = fcntl(fd, F_SETFL, flags);
if (ret == -1)
ERR_EXIT("fcntl");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402F8F", "function_addr": 4206479, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+fd], edi"], [4, "mov eax, [rbp+fd]"], [5, "mov esi, 3"], [6, "mov edi, eax"], [7, "mov eax, 0"], [8, "call _fcntl"], [9, "mov [rbp+var_4], eax"], [10, "cmp [rbp+var_4], 0FFFFFFFFh"], [11, "jnz short loc_402FCB"], [12, "mov edi, offset aFcntl_0"], [13, "call _perror"], [14, "mov edi, 1"], [15, "call _exit"], [16, "or [rbp+var_4], 800h"], [17, "mov edx, [rbp+var_4]"], [18, "mov eax, [rbp+fd]"], [19, "mov esi, 4"], [20, "mov edi, eax"], [21, "mov eax, 0"], [22, "call _fcntl"], [23, "mov [rbp+var_8], eax"], [24, "cmp [rbp+var_8], 0FFFFFFFFh"], [25, "jnz short loc_403006"], [26, "mov edi, offset aFcntl_0"], [27, "call _perror"], [28, "mov edi, 1"], [29, "call _exit"], [30, "nop"], [31, "leave"], [32, "retn"]], "data_dep": [[4, 3], [6, 4], [9, 8], [10, 9], [11, 10], [16, 9], [17, 16], [18, 3], [20, 18], [23, 22], [24, 23], [25, 24], [32, 22]]}
| {"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_402F8F", "query": "\n\n\nint __fastcall sub_402F8F(int a1)\n{\nint result; // eax\nint v2; // [rsp+1Ch] [rbp-4h]\n\nv2 = fcntl(a1, 3);\nif ( v2 == -1 )\n{\nperror(\"fcntl\");\nexit(1);\n}\nresult = fcntl(a1, 4, v2 | 0x800u);\nif ( result == -1 )\n{\nperror(\"fcntl\");\nexit(1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,v2,sub_402F8F,]", "hints": "[]", "response": "{'a1': 'fd', 'v2': 'flags', 'sub_402F8F': 'activate_nonblock'}"} | [
[
0.8471859097480774,
0.8368170857429504,
0.836224377155304,
0.8165096044540405,
0.8116433620452881,
0.8002756834030151,
0.7972341775894165,
0.7943828105926514,
0.7922601103782654,
0.7683312892913818,
0.7476561665534973,
0.7451372146606445,
0.7436591386795044,
0.7360117435455322,
0.7342222929000854,
0.7332680225372314,
0.7329679131507874,
0.7323019504547119,
0.7313748598098755,
0.7307847142219543
],
[
212830,
140087,
118197,
139786,
200456,
125416,
141342,
239566,
145771,
260092,
215336,
56514,
182016,
45186,
48774,
160659,
80323,
7369,
168882,
198232
]
] |
|
probe_header | 3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4 | sezero | mikmod | NA | static int probe_header(void *header)
{
struct upkg_hdr *hdr;
unsigned char *p;
unsigned int *swp;
int i;
/* byte swap the header - all members are 32 bit LE values */
p = (unsigned char *) header;
swp = (unsigned int *) header;
for (i = 0; i < (int)sizeof(struct upkg_hdr)/4; i++, p += 4) {
swp[i] = p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}
hdr = (struct upkg_hdr *) header;
if (hdr->tag != UPKG_HDR_TAG) {
fprintf(stderr, "Unknown header tag 0x%x\n", hdr->tag);
return -1;
}
if (hdr->name_count < 0 ||
hdr->export_count < 0 ||
hdr->import_count < 0 ||
hdr->name_offset < 36 ||
hdr->export_offset < 36 ||
hdr->import_offset < 36) {
fprintf(stderr, "Illegal values in header\n");
return -1;
}
#if 1 /* no need being overzealous */
return 0;
#else
switch (hdr->file_version) {
case 35: case 37: /* Unreal beta - */
case 40: case 41: /* 1998 */
case 61:/* Unreal */
case 62:/* Unreal Tournament */
case 63:/* Return to NaPali */
case 64:/* Unreal Tournament */
case 66:/* Unreal Tournament */
case 68:/* Unreal Tournament */
case 69:/* Tactical Ops */
case 75:/* Harry Potter and the Philosopher's Stone */
case 76: /* mpeg layer II data */
case 83:/* Mobile Forces */
return 0;
}
fprintf(stderr, "Unknown upkg version %d\n", hdr->file_version);
return -1;
#endif /* #if 0 */
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401BC8", "function_addr": 4201416, "binary_name": "3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov rax, [rbp+var_28]"], [5, "mov [rbp+var_8], rax"], [6, "mov rax, [rbp+var_28]"], [7, "mov [rbp+var_18], rax"], [8, "mov [rbp+var_C], 0"], [9, "jmp short loc_401C4F"], [10, "mov rax, [rbp+var_8]"], [11, "movzx eax, byte ptr [rax]"], [12, "movzx edx, al"], [13, "mov rax, [rbp+var_8]"], [14, "add rax, 1"], [15, "movzx eax, byte ptr [rax]"], [16, "movzx eax, al"], [17, "shl eax, 8"], [18, "or edx, eax"], [19, "mov rax, [rbp+var_8]"], [20, "add rax, 2"], [21, "movzx eax, byte ptr [rax]"], [22, "movzx eax, al"], [23, "shl eax, 10h"], [24, "or edx, eax"], [25, "mov rax, [rbp+var_8]"], [26, "add rax, 3"], [27, "movzx eax, byte ptr [rax]"], [28, "movzx eax, al"], [29, "shl eax, 18h"], [30, "or edx, eax"], [31, "mov eax, [rbp+var_C]"], [32, "cdqe"], [33, "lea rcx, ds:0[rax*4]"], [34, "mov rax, [rbp+var_18]"], [35, "add rax, rcx"], [36, "mov [rax], edx"], [37, "add [rbp+var_C], 1"], [38, "add [rbp+var_8], 4"], [39, "cmp [rbp+var_C], 0Ah"], [40, "jle short loc_401BED"], [41, "mov rax, [rbp+var_28]"], [42, "mov [rbp+var_20], rax"], [43, "mov rax, [rbp+var_20]"], [44, "mov eax, [rax]"], [45, "cmp eax, 9E2A83C1h"], [46, "jz short loc_401C90"], [47, "mov rax, [rbp+var_20]"], [48, "mov edx, [rax]"], [49, "mov rax, cs:stderr"], [50, "mov esi, offset format"], [51, "mov rdi, rax"], [52, "mov eax, 0"], [53, "call _fprintf"], [54, "mov eax, 0FFFFFFFFh"], [55, "jmp short locret_401CFF"], [56, "mov rax, [rbp+var_20]"], [57, "mov eax, [rax+0Ch]"], [58, "test eax, eax"], [59, "js short loc_401CD5"], [60, "mov rax, [rbp+var_20]"], [61, "mov eax, [rax+14h]"], [62, "test eax, eax"], [63, "js short loc_401CD5"], [64, "mov rax, [rbp+var_20]"], [65, "mov eax, [rax+1Ch]"], [66, "test eax, eax"], [67, "js short loc_401CD5"], [68, "mov rax, [rbp+var_20]"], [69, "mov eax, [rax+10h]"], [70, "cmp eax, 23h "], [71, "jle short loc_401CD5"], [72, "mov rax, [rbp+var_20]"], [73, "mov eax, [rax+18h]"], [74, "cmp eax, 23h "], [75, "jle short loc_401CD5"], [76, "mov rax, [rbp+var_20]"], [77, "mov eax, [rax+20h]"], [78, "cmp eax, 23h "], [79, "jg short loc_401CFA"], [80, "mov rax, cs:stderr"], [81, "mov rcx, rax"], [82, "mov edx, 19h"], [83, "mov esi, 1"], [84, "mov edi, offset aIllegalValuesI"], [85, "call _fwrite"], [86, "mov eax, 0FFFFFFFFh"], [87, "jmp short locret_401CFF"], [88, "mov eax, 0"], [89, "leave"], [90, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 3], [7, 6], [10, 38], [10, 5], [11, 36], [11, 10], [12, 11], [13, 5], [13, 38], [14, 13], [15, 14], [15, 36], [16, 15], [17, 16], [18, 17], [18, 12], [19, 38], [19, 5], [20, 19], [21, 36], [21, 20], [22, 21], [23, 22], [24, 23], [24, 18], [25, 38], [25, 5], [26, 25], [27, 36], [27, 26], [28, 27], [29, 28], [30, 29], [30, 24], [31, 8], [31, 37], [33, 33], [34, 7], [35, 33], [35, 34], [36, 35], [36, 30], [37, 8], [37, 37], [38, 38], [38, 5], [39, 37], [39, 8], [40, 39], [41, 3], [42, 41], [43, 42], [44, 36], [44, 43], [45, 44], [46, 45], [47, 42], [48, 36], [48, 47], [51, 49], [56, 42], [57, 36], [57, 56], [58, 57], [59, 58], [60, 42], [61, 36], [61, 60], [62, 61], [63, 62], [64, 42], [65, 36], [65, 64], [66, 65], [67, 66], [68, 42], [69, 68], [69, 36], [70, 69], [71, 70], [72, 42], [73, 36], [73, 72], [74, 73], [75, 74], [76, 42], [77, 76], [77, 36], [78, 77], [79, 78], [81, 80], [90, 88], [90, 86], [90, 54]]}
| {"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_401BC8", "query": "\n\n\n__int64 __fastcall sub_401BC8(unsigned int *a1)\n{\n__int64 result; // rax\nint i; // [rsp+24h] [rbp-Ch]\nunsigned int *v3; // [rsp+28h] [rbp-8h]\n\nv3 = a1;\nfor ( i = 0; i <= 10; ++i )\n{\na1[i] = (*((unsigned __int8 *)v3 + 3) << 24) | (*((unsigned __int8 *)v3 + 2) << 16) | *(unsigned __int16 *)v3;\n++v3;\n}\nif ( *a1 == -1641380927 )\n{\nif ( (a1[3] & 0x80000000) == 0\n&& (a1[5] & 0x80000000) == 0\n&& (a1[7] & 0x80000000) == 0\n&& (int)a1[4] > 35\n&& (int)a1[6] > 35\n&& (int)a1[8] > 35 )\n{\nresult = 0LL;\n}\nelse\n{\nfwrite(\"Illegal values in header\\n\", 1uLL, 0x19uLL, stderr);\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nfprintf(stderr, \"Unknown header tag 0x%x\\n\", *a1);\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v3,sub_401BC8,]", "hints": "[]", "response": "{'a1': 'header', 'v3': 'p', 'sub_401BC8': 'probe_header'}"} | [
[
0.7223767042160034,
0.7135692834854126,
0.7048525810241699,
0.704568088054657,
0.6951874494552612,
0.6947153806686401,
0.6911879777908325,
0.6898910999298096,
0.6892437934875488,
0.6856218576431274,
0.6853716373443604,
0.6849335432052612,
0.684406042098999,
0.6824751496315002,
0.6822590231895447,
0.6811826825141907,
0.680181086063385,
0.6800177097320557,
0.6792086362838745,
0.6788531541824341
],
[
71935,
208224,
164522,
239464,
29739,
149135,
62773,
200724,
31891,
117152,
76255,
249643,
203716,
215468,
264322,
30811,
216300,
101398,
823,
75048
]
] |
|
print_help | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static void print_help (void) {
printf("Usage: gravity [options] [arguments...]\n");
printf("\n");
printf("To start the REPL (not yet supported):\n");
printf(" gravity\n");
printf("\n");
printf("To compile and execute file:\n");
printf(" gravity example.gravity\n");
printf("\n");
printf("Available options are:\n");
printf(" --version show version information and exit\n");
printf(" --help show command line usage and exit\n");
printf(" -c input_file compile input_file\n");
printf(" -o output_file specify output file name (default to gravity.json)\n");
printf(" -x input_file execute input_file (JSON format expected)\n");
printf(" -i source_code compile and execute source_code string\n");
printf(" -q don't print result and execution time\n");
printf(" -t folder run unit tests from folder\n");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_469029", "function_addr": 4624425, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "lea rdi, aUsageGravityOp"], [3, "call _puts"], [4, "mov edi, 0Ah"], [5, "call _putchar"], [6, "lea rdi, aToStartTheRepl"], [7, "call _puts"], [8, "lea rdi, aGravity_0"], [9, "call _puts"], [10, "mov edi, 0Ah"], [11, "call _putchar"], [12, "lea rdi, aToCompileAndEx"], [13, "call _puts"], [14, "lea rdi, aGravityExample"], [15, "call _puts"], [16, "mov edi, 0Ah"], [17, "call _putchar"], [18, "lea rdi, aAvailableOptio"], [19, "call _puts"], [20, "lea rdi, aVersionShowVer"], [21, "call _puts"], [22, "lea rdi, aHelpShowComman"], [23, "call _puts"], [24, "lea rdi, aCInputFileComp"], [25, "call _puts"], [26, "lea rdi, aOOutputFileSpe"], [27, "call _puts"], [28, "lea rdi, aXInputFileExec"], [29, "call _puts"], [30, "lea rdi, aISourceCodeCom"], [31, "call _puts"], [32, "lea rdi, aQDonTPrintResu"], [33, "call _puts"], [34, "lea rdi, aTFolderRunUnit"], [35, "call _puts"], [36, "nop"], [37, "pop rbp"], [38, "retn"]], "data_dep": [[6, 4], [8, 6], [12, 10], [14, 12], [18, 16], [20, 18], [22, 20], [24, 22], [26, 24], [28, 26], [30, 28], [32, 30], [34, 32], [37, 0], [38, 35]]}
| {"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_469029", "query": "\n\n\nint sub_469029()\n{\nputs(\"Usage: gravity [options] [arguments...]\");\nputchar(10);\nputs(\"To start the REPL (not yet supported):\");\nputs(\" gravity\");\nputchar(10);\nputs(\"To compile and execute file:\");\nputs(\" gravity example.gravity\");\nputchar(10);\nputs(\"Available options are:\");\nputs(\" --version show version information and exit\");\nputs(\" --help show command line usage and exit\");\nputs(\" -c input_file compile input_file\");\nputs(\" -o output_file specify output file name (default to gravity.json)\");\nputs(\" -x input_file execute input_file (JSON format expected)\");\nputs(\" -i source_code compile and execute source_code string\");\nputs(\" -q don't print result and execution time\");\nreturn puts(\" -t folder run unit tests from folder\");\n}\n\n\n\nQ:[sub_469029,]", "hints": "[]", "response": "{'sub_469029': 'print_help'}"} | [
[
0.8705981969833374,
0.8672143220901489,
0.8670205473899841,
0.8585296273231506,
0.858295738697052,
0.8538751006126404,
0.85291588306427,
0.8508411049842834,
0.8488065004348755,
0.8479039669036865,
0.846309244632721,
0.8462470769882202,
0.8452195525169373,
0.8448381423950195,
0.8443304300308228,
0.8430327773094177,
0.842340350151062,
0.8416932225227356,
0.8412178158760071,
0.8407437801361084
],
[
82908,
188001,
34491,
158255,
109804,
224111,
94414,
60506,
139839,
152652,
98602,
260311,
10911,
97751,
184386,
155174,
240077,
139804,
217828,
113547
]
] |
|
UMX_Seek | 3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4 | sezero | mikmod | NA | static int UMX_Seek(MREADER* reader,long offset,int whence)
{
UMXREADER* r = (UMXREADER*)reader;
int ret;
switch (whence) {
case SEEK_SET:
break;
case SEEK_CUR:
offset += r->pos;
break;
case SEEK_END:
offset = r->length + offset;
break;
default: return -1;
}
if (offset < 0) return -1;
if (offset > r->length) /* just seek to end */
offset = r->length;
ret = fseek(r->file, r->start + offset, SEEK_SET);
if (ret < 0)
return ret;
r->pos = offset;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401EAD", "function_addr": 4202157, "binary_name": "3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+var_24], edx"], [6, "mov rax, [rbp+var_18]"], [7, "mov [rbp+var_8], rax"], [8, "cmp [rbp+var_24], 2"], [9, "jz short loc_401EEE"], [10, "cmp [rbp+var_24], 2"], [11, "jg short loc_401EFC"], [12, "cmp [rbp+var_24], 0"], [13, "jz short loc_401F03"], [14, "cmp [rbp+var_24], 1"], [15, "jnz short loc_401EFC"], [16, "mov rax, [rbp+var_8]"], [17, "mov rax, [rax+58h]"], [18, "add [rbp+var_20], rax"], [19, "jmp short loc_401F04"], [20, "mov rax, [rbp+var_8]"], [21, "mov rax, [rax+50h]"], [22, "add [rbp+var_20], rax"], [23, "jmp short loc_401F04"], [24, "mov eax, 0FFFFFFFFh"], [25, "jmp short locret_401F73"], [26, "nop"], [27, "cmp [rbp+var_20], 0"], [28, "jns short loc_401F12"], [29, "mov eax, 0FFFFFFFFh"], [30, "jmp short locret_401F73"], [31, "mov rax, [rbp+var_8]"], [32, "mov rax, [rax+50h]"], [33, "cmp [rbp+var_20], rax"], [34, "jle short loc_401F2C"], [35, "mov rax, [rbp+var_8]"], [36, "mov rax, [rax+50h]"], [37, "mov [rbp+var_20], rax"], [38, "mov rax, [rbp+var_8]"], [39, "mov rdx, [rax+48h]"], [40, "mov rax, [rbp+var_20]"], [41, "lea rcx, [rdx+rax]"], [42, "mov rax, [rbp+var_8]"], [43, "mov rax, [rax+60h]"], [44, "mov edx, 0"], [45, "mov rsi, rcx"], [46, "mov rdi, rax"], [47, "call _fseek"], [48, "mov [rbp+var_C], eax"], [49, "cmp [rbp+var_C], 0"], [50, "jns short loc_401F62"], [51, "mov eax, [rbp+var_C]"], [52, "jmp short locret_401F73"], [53, "mov rax, [rbp+var_8]"], [54, "mov rdx, [rbp+var_20]"], [55, "mov [rax+58h], rdx"], [56, "mov eax, 0"], [57, "leave"], [58, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 5], [9, 8], [10, 5], [11, 10], [12, 5], [13, 12], [14, 5], [15, 14], [16, 7], [17, 16], [18, 17], [18, 4], [20, 7], [21, 20], [22, 4], [22, 21], [27, 4], [27, 22], [27, 18], [28, 27], [31, 7], [32, 31], [33, 32], [33, 4], [33, 22], [33, 18], [34, 33], [35, 7], [36, 35], [37, 36], [38, 7], [39, 38], [40, 4], [40, 22], [40, 37], [40, 18], [41, 40], [42, 7], [43, 42], [45, 41], [46, 43], [48, 47], [49, 48], [50, 49], [51, 48], [53, 7], [54, 22], [54, 37], [54, 18], [54, 4], [55, 53], [55, 54], [58, 56], [58, 24], [58, 51], [58, 29]]}
| {"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_401EAD", "query": "\n\n\n__int64 __fastcall sub_401EAD(__int64 a1, __int64 a2, int a3)\n{\n__int64 v4; // [rsp+10h] [rbp-20h]\nint v5; // [rsp+24h] [rbp-Ch]\n\nv4 = a2;\nif ( a3 == 2 )\n{\nv4 = *(_QWORD *)(a1 + 80) + a2;\n}\nelse\n{\nif ( a3 > 2 )\nreturn 0xFFFFFFFFLL;\nif ( !a3 )\ngoto LABEL_8;\nif ( a3 != 1 )\nreturn 0xFFFFFFFFLL;\nv4 = *(_QWORD *)(a1 + 88) + a2;\n}\nLABEL_8:\nif ( v4 < 0 )\nreturn 0xFFFFFFFFLL;\nif ( v4 > *(_QWORD *)(a1 + 80) )\nv4 = *(_QWORD *)(a1 + 80);\nv5 = fseek(*(FILE **)(a1 + 96), *(_QWORD *)(a1 + 72) + v4, 0);\nif ( v5 < 0 )\nreturn (unsigned int)v5;\n*(_QWORD *)(a1 + 88) = v4;\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,v4,sub_401EAD,]", "hints": "[]", "response": "{'a3': 'whence', 'a1': 'reader', 'a2': 'offset', 'v4': 'offseta', 'sub_401EAD': 'UMX_Seek'}"} | [
[
0.7523672580718994,
0.7516489028930664,
0.7382893562316895,
0.736802339553833,
0.7235799431800842,
0.6987552642822266,
0.6968674063682556,
0.6964088678359985,
0.6943963170051575,
0.6925666928291321,
0.6888610124588013,
0.6737395524978638,
0.6720801591873169,
0.6716301441192627,
0.6715824604034424,
0.670541524887085,
0.6685841083526611,
0.6646475791931152,
0.6592060327529907,
0.6580309867858887
],
[
108099,
65175,
24016,
235699,
55568,
172913,
59159,
35411,
254560,
212586,
109612,
25095,
201072,
124596,
120486,
171412,
38567,
244628,
34823,
207073
]
] |
|
clar_usage | 92065e971d0fc9bd555a0edb5b250bd6750fed9ff4577338a4c1db2f15b5b08b | sshirokov | csgtool | NA | static void
clar_usage(const char *arg)
{
printf("Usage: %s [options]\n\n", arg);
printf("Options:\n");
printf(" -sname\tRun only the suite with `name`\n");
printf(" -iname\tInclude the suite with `name`\n");
printf(" -xname\tExclude the suite with `name`\n");
printf(" -q \tOnly report tests that had an error\n");
printf(" -Q \tQuit as soon as a test fails\n");
printf(" -l \tPrint suite names\n");
exit(-1);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4027D9", "function_addr": 4204505, "binary_name": "92065e971d0fc9bd555a0edb5b250bd6750fed9ff4577338a4c1db2f15b5b08b.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 format"], [7, "mov eax, 0"], [8, "call _printf"], [9, "mov edi, offset s"], [10, "call _puts"], [11, "mov edi, offset aSnameRunOnlyTh"], [12, "call _puts"], [13, "mov edi, offset aInameIncludeTh"], [14, "call _puts"], [15, "mov edi, offset aXnameExcludeTh"], [16, "call _puts"], [17, "mov edi, offset aQOnlyReportTes"], [18, "call _puts"], [19, "mov edi, offset aQQuitAsSoonAsA"], [20, "call _puts"], [21, "mov edi, offset aLPrintSuiteNam"], [22, "call _puts"], [23, "mov edi, 0FFFFFFFFh"], [24, "call _exit"]], "data_dep": [[4, 3], [5, 4]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/92065e971d0fc9bd555a0edb5b250bd6750fed9ff4577338a4c1db2f15b5b08b_92065e971d0fc9bd555a0edb5b250bd6750fed9ff4577338a4c1db2f15b5b08b.jsonl.gz", "strip_func_name": "sub_4027D9", "query": "\n\n\nvoid __fastcall __noreturn sub_4027D9(const char *a1)\n{\nprintf(\"Usage: %s [options]\\n\\n\", a1);\nputs(\"Options:\");\nputs(\" -sname\\tRun only the suite with `name`\");\nputs(\" -iname\\tInclude the suite with `name`\");\nputs(\" -xname\\tExclude the suite with `name`\");\nputs(\" -q \\tOnly report tests that had an error\");\nputs(\" -Q \\tQuit as soon as a test fails\");\nputs(\" -l \\tPrint suite names\");\nexit(-1);\n}\n\n\n\nQ:[a1,sub_4027D9,]", "hints": "[]", "response": "{'a1': 'arg', 'sub_4027D9': 'clar_usage'}"} | [
[
0.7676806449890137,
0.7658673524856567,
0.7598084211349487,
0.7575658559799194,
0.7558554410934448,
0.7534074783325195,
0.749962568283081,
0.7479088306427002,
0.7473639249801636,
0.744978129863739,
0.7433710098266602,
0.7390310168266296,
0.7371537685394287,
0.7370290756225586,
0.7356475591659546,
0.7343162298202515,
0.7274464964866638,
0.7216106653213501,
0.7206475734710693,
0.7205437421798706
],
[
72346,
110813,
86788,
108322,
150466,
85302,
207177,
76515,
175711,
110808,
235257,
95590,
100622,
90249,
227460,
172823,
132834,
122273,
141409,
252784
]
] |
|
utf8_charbytes | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | inline uint32_t utf8_charbytes (const char *s, uint32_t i) {
unsigned char c = (unsigned char)s[i];
// determine bytes needed for character, based on RFC 3629
if ((c > 0) && (c <= 127)) return 1;
if ((c >= 194) && (c <= 223)) return 2;
if ((c >= 224) && (c <= 239)) return 3;
if ((c >= 240) && (c <= 244)) return 4;
// means error
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_45F7F1", "function_addr": 4585457, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.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 edx, [rbp+var_1C]"], [5, "mov rax, [rbp+var_18]"], [6, "add rax, rdx"], [7, "movzx eax, byte ptr [rax]"], [8, "mov [rbp+var_1], al"], [9, "cmp [rbp+var_1], 0"], [10, "jz short loc_45F821"], [11, "movzx eax, [rbp+var_1]"], [12, "test al, al"], [13, "js short loc_45F821"], [14, "mov eax, 1"], [15, "jmp short loc_45F85F"], [16, "cmp [rbp+var_1], 0C1h"], [17, "jbe short loc_45F834"], [18, "cmp [rbp+var_1], 0DFh"], [19, "ja short loc_45F834"], [20, "mov eax, 2"], [21, "jmp short loc_45F85F"], [22, "cmp [rbp+var_1], 0DFh"], [23, "jbe short loc_45F847"], [24, "cmp [rbp+var_1], 0EFh"], [25, "ja short loc_45F847"], [26, "mov eax, 3"], [27, "jmp short loc_45F85F"], [28, "cmp [rbp+var_1], 0EFh"], [29, "jbe short loc_45F85A"], [30, "cmp [rbp+var_1], 0F4h"], [31, "ja short loc_45F85A"], [32, "mov eax, 4"], [33, "jmp short loc_45F85F"], [34, "mov eax, 0"], [35, "pop rbp"], [36, "retn"]], "data_dep": [[4, 3], [5, 2], [6, 5], [6, 4], [7, 6], [8, 7], [9, 8], [10, 9], [11, 8], [12, 11], [13, 12], [16, 8], [17, 16], [18, 8], [19, 18], [22, 8], [23, 22], [24, 8], [25, 24], [28, 8], [29, 28], [30, 8], [31, 30], [35, 0], [36, 34], [36, 20], [36, 14], [36, 32], [36, 26]]}
| {"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_45F7F1", "query": "\n\n\n__int64 __fastcall sub_45F7F1(__int64 a1, unsigned int a2)\n{\nchar v3; // [rsp+1Bh] [rbp-1h]\n\nv3 = *(_BYTE *)(a2 + a1);\nif ( v3 && v3 >= 0 )\nreturn 1LL;\nif ( (unsigned __int8)v3 > 0xC1u && (unsigned __int8)v3 <= 0xDFu )\nreturn 2LL;\nif ( (unsigned __int8)v3 > 0xDFu && (unsigned __int8)v3 <= 0xEFu )\nreturn 3LL;\nif ( (unsigned __int8)v3 <= 0xEFu || (unsigned __int8)v3 > 0xF4u )\nreturn 0LL;\nreturn 4LL;\n}\n\n\n\nQ:[a1,v3,sub_45F7F1,]", "hints": "[]", "response": "{'a1': 's', 'v3': 'c', 'sub_45F7F1': 'utf8_charbytes'}"} | [
[
0.7719250917434692,
0.7511615753173828,
0.7172017097473145,
0.7166656255722046,
0.7100816369056702,
0.7071755528450012,
0.7044867277145386,
0.7044023871421814,
0.6994224786758423,
0.6953161358833313,
0.694912314414978,
0.694912314414978,
0.6942504644393921,
0.6917824149131775,
0.6908287405967712,
0.6882113218307495,
0.6849465370178223,
0.6811398863792419,
0.6805060505867004,
0.6803615689277649
],
[
232760,
123120,
61043,
133859,
204978,
25804,
56423,
68080,
111695,
245103,
127282,
242200,
169612,
57888,
138620,
249011,
155103,
139997,
125153,
258879
]
] |
|
dumpTreeNode | ece3aa5f9f658a9b8bb1738f3cb8ab0522b60e6bc3abd4dfc9e70e9c3fc43f60 | matteyeux | iOS-Utilities | NA | uint32_t
dumpTreeNode(DeviceTreeNode *Node, int indent)
{
char buffer[40960];
char temp[10240];
char *name;
int prop = 0, child = 0;
int i = 0;
memset(buffer, '\0', 4096);
DeviceTreeNodeProperty *dtp = (DeviceTreeNodeProperty * ) ((char*)Node + sizeof(DeviceTreeNode));
char *offset = 0;
for (prop = 0; prop < Node->nProperties; prop++)
{
char *val;
temp[0] = '\0'; // strcat will do the rest
for (i=0; i< indent ; i++) { strcat(temp,"| "); }
strcat (temp, "+--");
strncat (buffer, temp, 1024);
sprintf (temp, "%s %d bytes: ", dtp->name, dtp->length);
strncat (buffer, temp, 1024);
if (strcmp(dtp->name,"name") == 0)
{
name = (char *) &dtp->length + sizeof(uint32_t);
strncat(buffer, name, dtp->length);
strcat (buffer,"\n");
}
else
{
copyValue (temp, ((char *) &dtp->length) + sizeof(uint32_t), dtp->length);
// Yeah, Yeah, Buffer overflows, etc.. :-)
strcat (buffer, temp);
strcat(buffer, "\n");
}
dtp = ((char *) dtp) + sizeof(DeviceTreeNodeProperty) + dtp->length ;
// Align
dtp = (((long) dtp %4) ? ((char *) dtp) + (4 - ((long)dtp) %4) : dtp);
offset = (char *) dtp;
}
for (i=0; i< indent-1; i++) { printf(" "); }
if (indent>1) printf ("+--");
printf ("%s:\n", name);
printf (buffer);
// Now do children:
for (child = 0; child < Node->nChildren; child++)
{
offset+= dumpTreeNode ( (DeviceTreeNode *) offset, indent+1 );
}
return ( (char *) offset - (char*) Node);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401304", "function_addr": 4199172, "binary_name": "ece3aa5f9f658a9b8bb1738f3cb8ab0522b60e6bc3abd4dfc9e70e9c3fc43f60.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0C840h"], [3, "mov [rbp+var_C838], rdi"], [4, "mov [rbp+var_C83C], esi"], [5, "mov [rbp+var_C], 0"], [6, "mov [rbp+var_10], 0"], [7, "mov [rbp+var_14], 0"], [8, "lea rax, [rbp+s]"], [9, "mov edx, 1000h"], [10, "mov esi, 0"], [11, "mov rdi, rax"], [12, "call _memset"], [13, "mov rax, [rbp+var_C838]"], [14, "add rax, 8"], [15, "mov [rbp+s1], rax"], [16, "mov [rbp+var_28], 0"], [17, "mov [rbp+var_C], 0"], [18, "jmp loc_401553"], [19, "mov [rbp+src], 0"], [20, "mov [rbp+var_14], 0"], [21, "jmp short loc_4013A3"], [22, "lea rax, [rbp+src]"], [23, "mov rdi, rax"], [24, "call _strlen"], [25, "mov rdx, rax"], [26, "lea rax, [rbp+src]"], [27, "add rax, rdx"], [28, "mov dword ptr [rax], 20207Ch"], [29, "add [rbp+var_14], 1"], [30, "mov eax, [rbp+var_14]"], [31, "cmp eax, [rbp+var_C83C]"], [32, "jl short loc_40137D"], [33, "lea rax, [rbp+src]"], [34, "mov rdi, rax"], [35, "call _strlen"], [36, "mov rdx, rax"], [37, "lea rax, [rbp+src]"], [38, "add rax, rdx"], [39, "mov dword ptr [rax], 2D2D2Bh"], [40, "lea rcx, [rbp+src]"], [41, "lea rax, [rbp+s]"], [42, "mov edx, 400h"], [43, "mov rsi, rcx"], [44, "mov rdi, rax"], [45, "call _strncat"], [46, "mov rax, [rbp+s1]"], [47, "mov ecx, [rax+20h]"], [48, "mov rdx, [rbp+s1]"], [49, "lea rax, [rbp+src]"], [50, "mov esi, offset aSDBytes"], [51, "mov rdi, rax"], [52, "mov eax, 0"], [53, "call _sprintf"], [54, "lea rcx, [rbp+src]"], [55, "lea rax, [rbp+s]"], [56, "mov edx, 400h"], [57, "mov rsi, rcx"], [58, "mov rdi, rax"], [59, "call _strncat"], [60, "mov rax, [rbp+s1]"], [61, "mov esi, offset s2"], [62, "mov rdi, rax"], [63, "call _strcmp"], [64, "test eax, eax"], [65, "jnz short loc_401497"], [66, "mov rax, [rbp+s1]"], [67, "add rax, 20h "], [68, "add rax, 4"], [69, "mov [rbp+var_8], rax"], [70, "mov rax, [rbp+s1]"], [71, "mov eax, [rax+20h]"], [72, "mov edx, eax"], [73, "mov rcx, [rbp+var_8]"], [74, "lea rax, [rbp+s]"], [75, "mov rsi, rcx"], [76, "mov rdi, rax"], [77, "call _strncat"], [78, "lea rax, [rbp+s]"], [79, "mov rdi, rax"], [80, "call _strlen"], [81, "mov rdx, rax"], [82, "lea rax, [rbp+s]"], [83, "add rax, rdx"], [84, "mov word ptr [rax], 0Ah"], [85, "jmp short loc_4014F8"], [86, "mov rax, [rbp+s1]"], [87, "mov eax, [rax+20h]"], [88, "mov edx, eax"], [89, "mov rax, [rbp+s1]"], [90, "add rax, 20h "], [91, "lea rcx, [rax+4]"], [92, "lea rax, [rbp+src]"], [93, "mov rsi, rcx"], [94, "mov rdi, rax"], [95, "call sub_401267"], [96, "lea rdx, [rbp+src]"], [97, "lea rax, [rbp+s]"], [98, "mov rsi, rdx"], [99, "mov rdi, rax"], [100, "call _strcat"], [101, "lea rax, [rbp+s]"], [102, "mov rdi, rax"], [103, "call _strlen"], [104, "mov rdx, rax"], [105, "lea rax, [rbp+s]"], [106, "add rax, rdx"], [107, "mov word ptr [rax], 0Ah"], [108, "mov rax, [rbp+s1]"], [109, "mov eax, [rax+20h]"], [110, "mov eax, eax"], [111, "add rax, 24h "], [112, "add [rbp+s1], rax"], [113, "mov rax, [rbp+s1]"], [114, "and eax, 3"], [115, "test rax, rax"], [116, "jz short loc_40153F"], [117, "mov rax, [rbp+s1]"], [118, "cqo"], [119, "shr rdx, 3Eh"], [120, "add rax, rdx"], [121, "and eax, 3"], [122, "sub rax, rdx"], [123, "mov rdx, rax"], [124, "mov eax, 4"], [125, "sub rax, rdx"], [126, "mov rdx, rax"], [127, "mov rax, [rbp+s1]"], [128, "add rax, rdx"], [129, "jmp short loc_401543"], [130, "mov rax, [rbp+s1]"], [131, "mov [rbp+s1], rax"], [132, "mov rax, [rbp+s1]"], [133, "mov [rbp+var_28], rax"], [134, "add [rbp+var_C], 1"], [135, "mov rax, [rbp+var_C838]"], [136, "mov edx, [rax]"], [137, "mov eax, [rbp+var_C]"], [138, "cmp edx, eax"], [139, "ja loc_40136D"], [140, "mov [rbp+var_14], 0"], [141, "jmp short loc_401583"], [142, "mov edi, offset asc_402021"], [143, "mov eax, 0"], [144, "call _printf"], [145, "add [rbp+var_14], 1"], [146, "mov eax, [rbp+var_C83C]"], [147, "sub eax, 1"], [148, "cmp [rbp+var_14], eax"], [149, "jl short loc_401570"], [150, "cmp [rbp+var_C83C], 1"], [151, "jle short loc_4015A9"], [152, "mov edi, offset asc_402025"], [153, "mov eax, 0"], [154, "call _printf"], [155, "mov rax, [rbp+var_8]"], [156, "mov rsi, rax"], [157, "mov edi, offset aS"], [158, "mov eax, 0"], [159, "call _printf"], [160, "lea rax, [rbp+s]"], [161, "mov rdi, rax"], [162, "mov eax, 0"], [163, "call _printf"], [164, "mov [rbp+var_10], 0"], [165, "jmp short loc_4015FD"], [166, "mov eax, [rbp+var_C83C]"], [167, "lea edx, [rax+1]"], [168, "mov rax, [rbp+var_28]"], [169, "mov esi, edx"], [170, "mov rdi, rax"], [171, "call sub_401304"], [172, "mov eax, eax"], [173, "add [rbp+var_28], rax"], [174, "add [rbp+var_10], 1"], [175, "mov rax, [rbp+var_C838]"], [176, "mov edx, [rax+4]"], [177, "mov eax, [rbp+var_10]"], [178, "cmp edx, eax"], [179, "ja short loc_4015DC"], [180, "mov rax, [rbp+var_28]"], [181, "sub rax, [rbp+var_C838]"], [182, "leave"], [183, "retn"]], "data_dep": [[11, 8], [13, 3], [14, 13], [15, 14], [22, 19], [22, 30], [23, 22], [25, 24], [26, 24], [26, 19], [27, 26], [27, 25], [28, 27], [29, 20], [29, 29], [30, 20], [30, 29], [31, 30], [31, 4], [32, 31], [33, 19], [33, 30], [34, 33], [36, 35], [37, 35], [37, 19], [38, 36], [38, 37], [39, 38], [40, 91], [40, 19], [40, 73], [41, 38], [43, 40], [44, 41], [46, 15], [46, 131], [47, 46], [47, 39], [48, 15], [48, 131], [49, 46], [49, 19], [51, 49], [54, 19], [54, 47], [55, 53], [57, 54], [58, 55], [60, 15], [60, 131], [62, 60], [64, 63], [65, 64], [66, 15], [66, 131], [67, 66], [68, 67], [69, 68], [70, 15], [70, 131], [71, 28], [71, 39], [71, 84], [71, 107], [71, 70], [72, 71], [73, 69], [74, 71], [75, 73], [76, 74], [78, 77], [79, 78], [81, 80], [82, 80], [83, 82], [83, 81], [84, 83], [86, 131], [86, 15], [87, 84], [87, 107], [87, 86], [87, 28], [87, 39], [88, 87], [89, 15], [89, 131], [90, 89], [91, 84], [91, 107], [91, 54], [91, 90], [91, 28], [91, 39], [92, 90], [92, 19], [93, 91], [94, 92], [96, 88], [96, 19], [97, 95], [98, 96], [99, 97], [101, 100], [102, 101], [104, 103], [105, 103], [106, 104], [106, 105], [107, 106], [108, 15], [108, 131], [109, 108], [109, 28], [109, 39], [109, 84], [109, 107], [110, 109], [111, 110], [112, 15], [112, 111], [112, 131], [113, 112], [114, 113], [115, 114], [116, 115], [117, 112], [119, 81], [119, 104], [120, 117], [120, 119], [121, 120], [122, 119], [122, 121], [123, 122], [125, 123], [125, 124], [126, 125], [127, 112], [128, 126], [128, 127], [130, 112], [131, 128], [131, 130], [132, 131], [133, 132], [134, 134], [134, 17], [135, 3], [136, 39], [136, 135], [136, 107], [136, 84], [136, 28], [137, 17], [137, 134], [138, 137], [138, 136], [139, 138], [145, 145], [145, 140], [146, 4], [147, 146], [148, 145], [148, 147], [148, 140], [149, 148], [150, 4], [151, 150], [155, 69], [156, 155], [160, 159], [161, 160], [166, 4], [167, 84], [167, 166], [167, 28], [167, 39], [167, 176], [167, 107], [168, 16], [168, 173], [168, 133], [169, 167], [170, 168], [172, 171], [173, 133], [173, 172], [173, 16], [173, 173], [174, 164], [174, 174], [175, 3], [176, 39], [176, 107], [176, 84], [176, 175], [176, 28], [177, 174], [177, 164], [178, 177], [178, 176], [179, 178], [180, 173], [180, 133], [180, 16], [181, 180], [181, 3], [183, 181]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ece3aa5f9f658a9b8bb1738f3cb8ab0522b60e6bc3abd4dfc9e70e9c3fc43f60_ece3aa5f9f658a9b8bb1738f3cb8ab0522b60e6bc3abd4dfc9e70e9c3fc43f60.jsonl.gz", "strip_func_name": "sub_401304", "query": "\n\n\nchar *__fastcall sub_401304(__int64 a1, int a2)\n{\nchar *v2; // rax\nunsigned int v3; // eax\nchar src[10240]; // [rsp+10h] [rbp-C830h] BYREF\nchar s[40968]; // [rsp+2810h] [rbp-A030h] BYREF\nchar *v7; // [rsp+C818h] [rbp-28h]\nchar *s1; // [rsp+C820h] [rbp-20h]\nint j; // [rsp+C82Ch] [rbp-14h]\nunsigned int k; // [rsp+C830h] [rbp-10h]\nunsigned int i; // [rsp+C834h] [rbp-Ch]\nchar *v12; // [rsp+C838h] [rbp-8h]\n\ni = 0;\nk = 0;\nj = 0;\nmemset(s, 0, 0x1000uLL);\ns1 = (char *)(a1 + 8);\nv7 = 0LL;\nfor ( i = 0; *(_DWORD *)a1 > i; ++i )\n{\nsrc[0] = 0;\nfor ( j = 0; j < a2; ++j )\n*(_DWORD *)&src[strlen(src)] = 2105468;\n*(_DWORD *)&src[strlen(src)] = 2960683;\nstrncat(s, src, 0x400uLL);\nsprintf(src, \"%s %d bytes: \", s1, *((unsigned int *)s1 + 8));\nstrncat(s, src, 0x400uLL);\nif ( !strcmp(s1, \"name\") )\n{\nv12 = s1 + 36;\nstrncat(s, s1 + 36, *((unsigned int *)s1 + 8));\n}\nelse\n{\nsub_401267(src, s1 + 36, *((_DWORD *)s1 + 8));\nstrcat(s, src);\n}\n*(_WORD *)&s[strlen(s)] = 10;\ns1 += *((unsigned int *)s1 + 8) + 36;\nif ( ((unsigned __int8)s1 & 3) != 0 )\nv2 = &s1[4 - (__int64)s1 % 4];\nelse\nv2 = s1;\ns1 = v2;\nv7 = v2;\n}\nfor ( j = 0; j < a2 - 1; ++j )\nprintf(\" \");\nif ( a2 > 1 )\nprintf(\"+--\");\nprintf(\"%s:\\n\", v12);\nprintf(s);\nfor ( k = 0; *(_DWORD *)(a1 + 4) > k; ++k )\n{\nv3 = sub_401304(v7, (unsigned int)(a2 + 1));\nv7 += v3;\n}\nreturn &v7[-a1];\n}\n\n\n\nQ:[a1,a2,src,s,v7,s1,k,i,v12,sub_401304,sub_401267,]", "hints": "[]", "response": "{'a1': 'Node', 'a2': 'indent', 'src': 'temp', 's': 'buffer', 'v7': 'offset', 's1': 'dtp', 'k': 'child', 'i': 'prop', 'v12': 'name', 'sub_401304': 'dumpTreeNode', 'sub_401267': 'copyValue'}"} | [
[
0.8036249876022339,
0.7833019495010376,
0.7695322632789612,
0.7553620934486389,
0.7484376430511475,
0.7439667582511902,
0.7439545392990112,
0.7392077445983887,
0.7315893173217773,
0.7312570214271545,
0.7301608920097351,
0.7240301966667175,
0.7237670421600342,
0.7113553881645203,
0.7106250524520874,
0.7097975015640259,
0.7097950577735901,
0.707922101020813,
0.707842230796814,
0.7065721154212952
],
[
145851,
127355,
65456,
41997,
127262,
197534,
62356,
109870,
255371,
134506,
188245,
50292,
220541,
260576,
108714,
98362,
205046,
14208,
3690,
247404
]
] |
|
map_keys_array | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static void map_keys_array (gravity_hash_t *hashtable, gravity_value_t key, gravity_value_t value, void *data) {
#pragma unused (hashtable, value)
gravity_list_t *list = (gravity_list_t *)data;
marray_push(gravity_value_t, list->array, key);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4378E0", "function_addr": 4421856, "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 rax, rsi"], [5, "mov rsi, rdx"], [6, "mov rdx, rsi"], [7, "mov [rbp+var_30], rax"], [8, "mov [rbp+var_28], rdx"], [9, "mov rax, rcx"], [10, "mov rcx, r8"], [11, "mov rdx, rcx"], [12, "mov [rbp+var_40], rax"], [13, "mov [rbp+var_38], rdx"], [14, "mov [rbp+var_20], r9"], [15, "mov rax, [rbp+var_20]"], [16, "mov [rbp+var_8], rax"], [17, "mov rax, [rbp+var_8]"], [18, "mov rdx, [rax+30h]"], [19, "mov rax, [rbp+var_8]"], [20, "mov rax, [rax+38h]"], [21, "cmp rdx, rax"], [22, "jnz short loc_437981"], [23, "mov rax, [rbp+var_8]"], [24, "mov rax, [rax+38h]"], [25, "test rax, rax"], [26, "jz short loc_43794A"], [27, "mov rax, [rbp+var_8]"], [28, "mov rax, [rax+38h]"], [29, "lea rdx, [rax+rax]"], [30, "jmp short loc_43794F"], [31, "mov edx, 8"], [32, "mov rax, [rbp+var_8]"], [33, "mov [rax+38h], rdx"], [34, "mov rax, [rbp+var_8]"], [35, "mov rax, [rax+38h]"], [36, "shl rax, 4"], [37, "mov rdx, rax"], [38, "mov rax, [rbp+var_8]"], [39, "mov rax, [rax+40h]"], [40, "mov rsi, rdx"], [41, "mov rdi, rax"], [42, "call _realloc"], [43, "mov rdx, [rbp+var_8]"], [44, "mov [rdx+40h], rax"], [45, "mov rax, [rbp+var_8]"], [46, "mov rsi, [rax+40h]"], [47, "mov rax, [rbp+var_8]"], [48, "mov rax, [rax+30h]"], [49, "lea rcx, [rax+1]"], [50, "mov rdx, [rbp+var_8]"], [51, "mov [rdx+30h], rcx"], [52, "shl rax, 4"], [53, "lea rcx, [rsi+rax]"], [54, "mov rax, [rbp+var_30]"], [55, "mov rdx, [rbp+var_28]"], [56, "mov [rcx], rax"], [57, "mov [rcx+8], rdx"], [58, "nop"], [59, "leave"], [60, "retn"]], "data_dep": [[6, 5], [7, 4], [8, 6], [11, 10], [12, 9], [13, 11], [15, 14], [16, 15], [17, 16], [18, 17], [19, 16], [20, 19], [21, 18], [21, 20], [22, 21], [23, 16], [24, 23], [25, 24], [26, 25], [27, 16], [28, 27], [29, 28], [29, 18], [32, 16], [33, 29], [33, 32], [33, 31], [34, 16], [35, 33], [35, 34], [36, 35], [37, 36], [38, 16], [39, 33], [39, 38], [40, 37], [41, 39], [43, 16], [44, 42], [44, 43], [45, 16], [46, 33], [46, 45], [46, 51], [46, 57], [46, 44], [46, 56], [47, 16], [48, 33], [48, 51], [48, 57], [48, 44], [48, 47], [48, 56], [49, 44], [49, 56], [49, 10], [49, 33], [49, 48], [49, 51], [49, 57], [50, 16], [51, 50], [51, 49], [52, 48], [53, 49], [53, 52], [53, 51], [54, 7], [55, 8], [56, 54], [56, 53], [57, 53], [57, 55], [60, 54]]}
| {"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_4378E0", "query": "\n\n\n__int64 __fastcall sub_4378E0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6)\n{\n__int64 v6; // rdx\n__int64 v7; // rsi\n__int64 v8; // rax\n_QWORD *v9; // rcx\n__int64 result; // rax\n\nif ( *(_QWORD *)(a6 + 48) == *(_QWORD *)(a6 + 56) )\n{\nif ( *(_QWORD *)(a6 + 56) )\nv6 = 2LL * *(_QWORD *)(a6 + 56);\nelse\nv6 = 8LL;\n*(_QWORD *)(a6 + 56) = v6;\n*(_QWORD *)(a6 + 64) = realloc(*(void **)(a6 + 64), 16LL * *(_QWORD *)(a6 + 56));\n}\nv7 = *(_QWORD *)(a6 + 64);\nv8 = *(_QWORD *)(a6 + 48);\n*(_QWORD *)(a6 + 48) = v8 + 1;\nv9 = (_QWORD *)(v7 + 16 * v8);\nresult = a2;\n*v9 = a2;\nv9[1] = a3;\nreturn result;\n}\n\n\n\nQ:[a2,a6,a1,a4,sub_4378E0,]", "hints": "[]", "response": "{'a2': 'key', 'a6': 'data', 'a1': 'hashtable', 'a4': 'value', 'sub_4378E0': 'map_keys_array'}"} | [
[
0.7731748819351196,
0.7608956098556519,
0.7430271506309509,
0.6979687213897705,
0.690386950969696,
0.6867567300796509,
0.6865583658218384,
0.6797045469284058,
0.6775407195091248,
0.674298107624054,
0.6718868017196655,
0.6643434762954712,
0.6633535027503967,
0.6623966693878174,
0.6619714498519897,
0.6556289196014404,
0.653215765953064,
0.6529661417007446,
0.650839626789093,
0.6491007208824158
],
[
251571,
261705,
175313,
158918,
193848,
29604,
223776,
159143,
6602,
84456,
134027,
85889,
239979,
247554,
128013,
216347,
115096,
140729,
104409,
127070
]
] |
|
gesummv | e22cac507349d4baa480009f8f08b92957eb910d3878917f90f7c2a9a1c18a13 | cavazos-lab | PolyBench-ACC | NA | void gesummv(int n, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_1D(tmp,N,n),
DATA_TYPE POLYBENCH_1D(x,N,n), DATA_TYPE POLYBENCH_1D(y,N,n))
{
int i, j;
for (i = 0; i < _PB_N; i++)
{
tmp[i] = 0;
y[i] = 0;
for (j = 0; j < _PB_N; j++)
{
tmp[i] = A[i][j] * x[j] + tmp[i];
y[i] = B[i][j] * x[j] + y[i];
}
y[i] = alpha * tmp[i] + beta * y[i];
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4016D0", "function_addr": 4200144, "binary_name": "e22cac507349d4baa480009f8f08b92957eb910d3878917f90f7c2a9a1c18a13.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_14], edi"], [3, "movss [rbp+var_18], xmm0"], [4, "movss [rbp+var_1C], xmm1"], [5, "mov [rbp+var_28], rsi"], [6, "mov [rbp+var_30], rdx"], [7, "mov [rbp+var_38], rcx"], [8, "mov [rbp+var_40], r8"], [9, "mov [rbp+var_48], r9"], [10, "mov [rbp+var_4], 0"], [11, "jmp loc_40188C"], [12, "mov eax, [rbp+var_4]"], [13, "cdqe"], [14, "lea rdx, ds:0[rax*4]"], [15, "mov rax, [rbp+var_38]"], [16, "add rax, rdx"], [17, "pxor xmm0, xmm0"], [18, "movss dword ptr [rax], xmm0"], [19, "mov eax, [rbp+var_4]"], [20, "cdqe"], [21, "lea rdx, ds:0[rax*4]"], [22, "mov rax, [rbp+var_48]"], [23, "add rax, rdx"], [24, "pxor xmm0, xmm0"], [25, "movss dword ptr [rax], xmm0"], [26, "mov [rbp+var_8], 0"], [27, "jmp loc_401823"], [28, "mov eax, [rbp+var_4]"], [29, "cdqe"], [30, "shl rax, 0Eh"], [31, "mov rdx, rax"], [32, "mov rax, [rbp+var_28]"], [33, "add rdx, rax"], [34, "mov eax, [rbp+var_8]"], [35, "cdqe"], [36, "movss xmm1, dword ptr [rdx+rax*4]"], [37, "mov eax, [rbp+var_8]"], [38, "cdqe"], [39, "lea rdx, ds:0[rax*4]"], [40, "mov rax, [rbp+var_40]"], [41, "add rax, rdx"], [42, "movss xmm0, dword ptr [rax]"], [43, "mulss xmm1, xmm0"], [44, "mov eax, [rbp+var_4]"], [45, "cdqe"], [46, "lea rdx, ds:0[rax*4]"], [47, "mov rax, [rbp+var_38]"], [48, "add rax, rdx"], [49, "movss xmm0, dword ptr [rax]"], [50, "mov eax, [rbp+var_4]"], [51, "cdqe"], [52, "lea rdx, ds:0[rax*4]"], [53, "mov rax, [rbp+var_38]"], [54, "add rax, rdx"], [55, "addss xmm0, xmm1"], [56, "movss dword ptr [rax], xmm0"], [57, "mov eax, [rbp+var_4]"], [58, "cdqe"], [59, "shl rax, 0Eh"], [60, "mov rdx, rax"], [61, "mov rax, [rbp+var_30]"], [62, "add rdx, rax"], [63, "mov eax, [rbp+var_8]"], [64, "cdqe"], [65, "movss xmm1, dword ptr [rdx+rax*4]"], [66, "mov eax, [rbp+var_8]"], [67, "cdqe"], [68, "lea rdx, ds:0[rax*4]"], [69, "mov rax, [rbp+var_40]"], [70, "add rax, rdx"], [71, "movss xmm0, dword ptr [rax]"], [72, "mulss xmm1, xmm0"], [73, "mov eax, [rbp+var_4]"], [74, "cdqe"], [75, "lea rdx, ds:0[rax*4]"], [76, "mov rax, [rbp+var_48]"], [77, "add rax, rdx"], [78, "movss xmm0, dword ptr [rax]"], [79, "mov eax, [rbp+var_4]"], [80, "cdqe"], [81, "lea rdx, ds:0[rax*4]"], [82, "mov rax, [rbp+var_48]"], [83, "add rax, rdx"], [84, "addss xmm0, xmm1"], [85, "movss dword ptr [rax], xmm0"], [86, "add [rbp+var_8], 1"], [87, "mov eax, [rbp+var_8]"], [88, "cmp eax, [rbp+var_14]"], [89, "jl loc_401745"], [90, "mov eax, [rbp+var_4]"], [91, "cdqe"], [92, "lea rdx, ds:0[rax*4]"], [93, "mov rax, [rbp+var_38]"], [94, "add rax, rdx"], [95, "movss xmm0, dword ptr [rax]"], [96, "movaps xmm1, xmm0"], [97, "mulss xmm1, [rbp+var_18]"], [98, "mov eax, [rbp+var_4]"], [99, "cdqe"], [100, "lea rdx, ds:0[rax*4]"], [101, "mov rax, [rbp+var_48]"], [102, "add rax, rdx"], [103, "movss xmm0, dword ptr [rax]"], [104, "mulss xmm0, [rbp+var_1C]"], [105, "mov eax, [rbp+var_4]"], [106, "cdqe"], [107, "lea rdx, ds:0[rax*4]"], [108, "mov rax, [rbp+var_48]"], [109, "add rax, rdx"], [110, "addss xmm0, xmm1"], [111, "movss dword ptr [rax], xmm0"], [112, "add [rbp+var_4], 1"], [113, "mov eax, [rbp+var_4]"], [114, "cmp eax, [rbp+var_14]"], [115, "jl loc_401701"], [116, "nop"], [117, "nop"], [118, "pop rbp"], [119, "retn"]], "data_dep": [[12, 10], [12, 112], [14, 107], [15, 7], [16, 15], [16, 14], [18, 17], [18, 16], [19, 112], [19, 10], [21, 14], [22, 9], [23, 22], [23, 21], [25, 23], [25, 24], [28, 112], [28, 10], [30, 28], [31, 30], [32, 5], [33, 31], [33, 32], [34, 86], [34, 26], [36, 25], [36, 18], [36, 34], [36, 111], [36, 56], [36, 85], [37, 26], [37, 86], [39, 33], [40, 8], [41, 40], [41, 39], [42, 41], [42, 25], [42, 18], [42, 111], [42, 56], [42, 85], [43, 36], [43, 42], [44, 10], [44, 112], [46, 39], [47, 7], [48, 47], [48, 46], [49, 25], [49, 18], [49, 48], [49, 111], [49, 56], [49, 85], [50, 10], [50, 112], [52, 46], [53, 7], [54, 53], [54, 52], [55, 43], [55, 49], [56, 55], [56, 54], [57, 112], [57, 10], [59, 57], [60, 59], [61, 6], [62, 60], [62, 61], [63, 86], [63, 26], [65, 63], [65, 56], [66, 86], [66, 26], [68, 62], [69, 8], [70, 68], [70, 69], [71, 56], [71, 70], [72, 65], [72, 71], [73, 10], [73, 112], [75, 68], [76, 9], [77, 76], [77, 75], [78, 77], [78, 56], [79, 10], [79, 112], [81, 75], [82, 9], [83, 82], [83, 81], [84, 72], [84, 78], [85, 84], [85, 83], [86, 26], [86, 86], [87, 86], [87, 26], [88, 87], [88, 2], [89, 88], [90, 10], [90, 112], [92, 81], [92, 21], [93, 7], [94, 93], [94, 92], [95, 111], [95, 56], [95, 85], [95, 94], [95, 25], [95, 18], [96, 95], [97, 3], [97, 96], [98, 112], [98, 10], [100, 92], [101, 9], [102, 100], [102, 101], [103, 102], [103, 111], [103, 56], [103, 85], [103, 25], [103, 18], [104, 4], [104, 103], [105, 10], [105, 112], [107, 100], [108, 9], [109, 108], [109, 107], [110, 104], [110, 97], [111, 110], [111, 109], [112, 10], [112, 112], [113, 10], [113, 112], [114, 113], [114, 2], [115, 114], [118, 0], [119, 113]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e22cac507349d4baa480009f8f08b92957eb910d3878917f90f7c2a9a1c18a13_e22cac507349d4baa480009f8f08b92957eb910d3878917f90f7c2a9a1c18a13.jsonl.gz", "strip_func_name": "sub_4016D0", "query": "\n\n\n__int64 __fastcall sub_4016D0(int a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, float a7, float a8)\n{\n__int64 result; // rax\nint j; // [rsp+40h] [rbp-8h]\nunsigned int i; // [rsp+44h] [rbp-4h]\n\nfor ( i = 0; ; ++i )\n{\nresult = i;\nif ( (int)i >= a1 )\nbreak;\n*(_DWORD *)(4LL * (int)i + a4) = 0;\n*(_DWORD *)(4LL * (int)i + a6) = 0;\nfor ( j = 0; j < a1; ++j )\n{\n*(float *)(4LL * (int)i + a4) = *(float *)(4LL * (int)i + a4)\n+ (float)(*(float *)(a2 + ((__int64)(int)i << 14) + 4LL * j)\n* *(float *)(4LL * j + a5));\n*(float *)(4LL * (int)i + a6) = *(float *)(4LL * (int)i + a6)\n+ (float)(*(float *)(a3 + ((__int64)(int)i << 14) + 4LL * j)\n* *(float *)(4LL * j + a5));\n}\n*(float *)(4LL * (int)i + a6) = (float)(*(float *)(4LL * (int)i + a6) * a8)\n+ (float)(*(float *)(4LL * (int)i + a4) * a7);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,sub_4016D0,]", "hints": "[]", "response": "{'a3': 'B', 'a4': 'tmp', 'a1': 'n', 'a2': 'A', 'a5': 'x', 'a6': 'y', 'a7': 'alpha', 'a8': 'beta', 'sub_4016D0': 'gesummv'}"} | [
[
0.82609623670578,
0.8254357576370239,
0.8162200450897217,
0.8107247352600098,
0.8087641596794128,
0.8079427480697632,
0.8075956106185913,
0.8068128824234009,
0.8065544366836548,
0.8052660822868347,
0.8022011518478394,
0.8017647862434387,
0.7965819835662842,
0.7931535243988037,
0.7898446321487427,
0.7892797589302063,
0.7817177772521973,
0.7809334993362427,
0.7786997556686401,
0.7778700590133667
],
[
135868,
140406,
13088,
95118,
229542,
188400,
262959,
53107,
177903,
150448,
29332,
262120,
11766,
175036,
217292,
37526,
106678,
98600,
179381,
186883
]
] |
|
arm_float_to_q7 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_float_to_q7(
const float32_t * pSrc,
q7_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
const float32_t *pIn = pSrc; /* Source pointer */
#ifdef ARM_MATH_ROUNDING
float32_t in;
#endif /* #ifdef ARM_MATH_ROUNDING */
#if defined (ARM_MATH_LOOPUNROLL)
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
while (blkCnt > 0U)
{
/* C = A * 128 */
/* Convert from float to q7 and store result in destination buffer */
#ifdef ARM_MATH_ROUNDING
in = (*pIn++ * 128);
in += in > 0.0f ? 0.5f : -0.5f;
*pDst++ = (q7_t) (__SSAT((q15_t) (in), 8));
in = (*pIn++ * 128);
in += in > 0.0f ? 0.5f : -0.5f;
*pDst++ = (q7_t) (__SSAT((q15_t) (in), 8));
in = (*pIn++ * 128);
in += in > 0.0f ? 0.5f : -0.5f;
*pDst++ = (q7_t) (__SSAT((q15_t) (in), 8));
in = (*pIn++ * 128);
in += in > 0.0f ? 0.5f : -0.5f;
*pDst++ = (q7_t) (__SSAT((q15_t) (in), 8));
#else
*pDst++ = __SSAT((q31_t) (*pIn++ * 128.0f), 8);
*pDst++ = __SSAT((q31_t) (*pIn++ * 128.0f), 8);
*pDst++ = __SSAT((q31_t) (*pIn++ * 128.0f), 8);
*pDst++ = __SSAT((q31_t) (*pIn++ * 128.0f), 8);
#endif /* #ifdef ARM_MATH_ROUNDING */
/* Decrement loop counter */
blkCnt--;
}
/* Loop unrolling: Compute remaining outputs */
blkCnt = blockSize % 0x4U;
#else
/* Initialize blkCnt with number of samples */
blkCnt = blockSize;
#endif /* #if defined (ARM_MATH_LOOPUNROLL) */
while (blkCnt > 0U)
{
/* C = A * 128 */
/* Convert from float to q7 and store result in destination buffer */
#ifdef ARM_MATH_ROUNDING
in = (*pIn++ * 128);
in += in > 0.0f ? 0.5f : -0.5f;
*pDst++ = (q7_t) (__SSAT((q15_t) (in), 8));
#else
*pDst++ = (q7_t) __SSAT((q31_t) (*pIn++ * 128.0f), 8);
#endif /* #ifdef ARM_MATH_ROUNDING */
/* Decrement loop counter */
blkCnt--;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4067FA", "function_addr": 4220922, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.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_34], edx"], [5, "mov rax, [rbp+var_28]"], [6, "mov [rbp+var_10], rax"], [7, "mov eax, [rbp+var_34]"], [8, "mov [rbp+var_4], eax"], [9, "jmp loc_4068A0"], [10, "mov rax, [rbp+var_10]"], [11, "lea rdx, [rax+4]"], [12, "mov [rbp+var_10], rdx"], [13, "movss xmm1, dword ptr [rax]"], [14, "movss xmm0, cs:dword_422B28"], [15, "mulss xmm0, xmm1"], [16, "cvttss2si eax, xmm0"], [17, "mov [rbp+var_14], eax"], [18, "mov [rbp+var_18], 8"], [19, "cmp [rbp+var_18], 0"], [20, "jz short loc_40688B"], [21, "cmp [rbp+var_18], 20h "], [22, "ja short loc_40688B"], [23, "mov eax, [rbp+var_18]"], [24, "sub eax, 1"], [25, "mov edx, 1"], [26, "mov ecx, eax"], [27, "shl edx, cl"], [28, "mov eax, edx"], [29, "sub eax, 1"], [30, "mov [rbp+var_1C], eax"], [31, "mov eax, [rbp+var_1C]"], [32, "not eax"], [33, "mov [rbp+var_20], eax"], [34, "mov eax, [rbp+var_14]"], [35, "cmp eax, [rbp+var_1C]"], [36, "jle short loc_40687E"], [37, "mov eax, [rbp+var_1C]"], [38, "jmp short loc_40688E"], [39, "mov eax, [rbp+var_14]"], [40, "cmp eax, [rbp+var_20]"], [41, "jge short loc_40688B"], [42, "mov eax, [rbp+var_20]"], [43, "jmp short loc_40688E"], [44, "mov eax, [rbp+var_14]"], [45, "mov rdx, [rbp+var_30]"], [46, "lea rcx, [rdx+1]"], [47, "mov [rbp+var_30], rcx"], [48, "mov [rdx], al"], [49, "sub [rbp+var_4], 1"], [50, "cmp [rbp+var_4], 0"], [51, "jnz loc_40681C"], [52, "nop"], [53, "nop"], [54, "pop rbp"], [55, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 4], [8, 7], [10, 6], [10, 12], [11, 45], [11, 48], [11, 10], [12, 11], [13, 48], [13, 10], [15, 14], [15, 13], [16, 10], [16, 15], [17, 16], [19, 18], [20, 19], [21, 18], [22, 21], [23, 18], [24, 23], [26, 24], [27, 25], [27, 26], [28, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 32], [34, 17], [35, 30], [35, 34], [36, 35], [37, 30], [39, 17], [40, 33], [40, 39], [41, 40], [42, 33], [44, 17], [45, 3], [45, 47], [46, 45], [46, 48], [46, 26], [46, 46], [47, 46], [48, 42], [48, 45], [48, 44], [48, 37], [49, 49], [49, 8], [50, 49], [50, 8], [51, 50], [54, 0], [55, 44], [55, 7], [55, 37], [55, 42]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_4067FA", "query": "\n\n\n__int64 __fastcall sub_4067FA(float *a1, _BYTE *a2, unsigned int a3)\n{\n__int64 result; // rax\nfloat *v4; // rax\n_BYTE *v5; // rdx\nint v7; // [rsp+20h] [rbp-14h]\nunsigned int i; // [rsp+30h] [rbp-4h]\n\nresult = a3;\nfor ( i = a3; i; --i )\n{\nv4 = a1++;\nv7 = (int)(float)(128.0 * *v4);\nif ( v7 <= 127 )\n{\nif ( v7 >= -128 )\nresult = (unsigned int)v7;\nelse\nresult = 4294967168LL;\n}\nelse\n{\nresult = 127LL;\n}\nv5 = a2++;\n*v5 = result;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_4067FA,]", "hints": "[]", "response": "{'a3': 'blockSize', 'a1': 'pSrc', 'a2': 'pDst', 'sub_4067FA': 'arm_float_to_q7'}"} | [
[
0.7795571088790894,
0.7354946136474609,
0.7145084142684937,
0.7122558951377869,
0.6978459358215332,
0.6941336393356323,
0.6880838871002197,
0.685723066329956,
0.6847764253616333,
0.6832786798477173,
0.6831949949264526,
0.680155336856842,
0.6793028116226196,
0.6777371764183044,
0.676423966884613,
0.6763449311256409,
0.6759597063064575,
0.675929605960846,
0.6719107627868652,
0.6712074279785156
],
[
43845,
175995,
63939,
31104,
121668,
89719,
97233,
196789,
254024,
203599,
87976,
96078,
24772,
105898,
262386,
195528,
235334,
52410,
21500,
189751
]
] |
|
config_glob_parse_range | f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7 | cbdevnet | midimonster | NA | static int config_glob_parse_range(channel_glob* glob, char* spec, size_t length){
//FIXME might want to allow negative delimiters at some point
char* parse_offset = NULL;
glob->type = glob_range;
//first interval member
glob->limits.u64[0] = strtoul(spec, &parse_offset, 10);
if(!parse_offset || parse_offset - spec >= length || strncmp(parse_offset, "..", 2)){
return 1;
}
parse_offset += 2;
//second interval member
glob->limits.u64[1] = strtoul(parse_offset, &parse_offset, 10);
if(!parse_offset || parse_offset - spec != length || *parse_offset != '}'){
return 1;
}
//calculate number of channels within interval
if(glob->limits.u64[0] < glob->limits.u64[1]){
glob->values = glob->limits.u64[1] - glob->limits.u64[0] + 1;
}
else if(glob->limits.u64[0] > glob->limits.u64[1]){
glob->values = glob->limits.u64[0] - glob->limits.u64[1] + 1;
}
else{
glob->values = 1;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4035ED", "function_addr": 4208109, "binary_name": "f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+nptr], rsi"], [5, "mov [rbp+var_28], rdx"], [6, "mov [rbp+endptr], 0"], [7, "mov rax, [rbp+var_18]"], [8, "mov byte ptr [rax+20h], 0"], [9, "lea rcx, [rbp+endptr]"], [10, "mov rax, [rbp+nptr]"], [11, "mov edx, 0Ah"], [12, "mov rsi, rcx"], [13, "mov rdi, rax"], [14, "call _strtoul"], [15, "mov rdx, [rbp+var_18]"], [16, "mov [rdx+10h], rax"], [17, "mov rax, [rbp+endptr]"], [18, "test rax, rax"], [19, "jz short loc_403662"], [20, "mov rax, [rbp+endptr]"], [21, "sub rax, [rbp+nptr]"], [22, "cmp [rbp+var_28], rax"], [23, "jbe short loc_403662"], [24, "mov rax, [rbp+endptr]"], [25, "mov edx, 2"], [26, "mov esi, offset asc_4083A0"], [27, "mov rdi, rax"], [28, "call _strncmp"], [29, "test eax, eax"], [30, "jz short loc_40366C"], [31, "mov eax, 1"], [32, "jmp locret_40374D"], [33, "mov rax, [rbp+endptr]"], [34, "add rax, 2"], [35, "mov [rbp+endptr], rax"], [36, "mov rax, [rbp+endptr]"], [37, "lea rcx, [rbp+endptr]"], [38, "mov edx, 0Ah"], [39, "mov rsi, rcx"], [40, "mov rdi, rax"], [41, "call _strtoul"], [42, "mov rdx, [rbp+var_18]"], [43, "mov [rdx+18h], rax"], [44, "mov rax, [rbp+endptr]"], [45, "test rax, rax"], [46, "jz short loc_4036C0"], [47, "mov rax, [rbp+endptr]"], [48, "sub rax, [rbp+nptr]"], [49, "mov rdx, rax"], [50, "mov rax, [rbp+var_28]"], [51, "cmp rdx, rax"], [52, "jnz short loc_4036C0"], [53, "mov rax, [rbp+endptr]"], [54, "movzx eax, byte ptr [rax]"], [55, "cmp al, 7Dh "], [56, "jz short loc_4036CA"], [57, "mov eax, 1"], [58, "jmp locret_40374D"], [59, "mov rax, [rbp+var_18]"], [60, "mov rdx, [rax+10h]"], [61, "mov rax, [rbp+var_18]"], [62, "mov rax, [rax+18h]"], [63, "cmp rdx, rax"], [64, "jnb short loc_403703"], [65, "mov rax, [rbp+var_18]"], [66, "mov rdx, [rax+18h]"], [67, "mov rax, [rbp+var_18]"], [68, "mov rcx, [rax+10h]"], [69, "mov rax, rdx"], [70, "sub rax, rcx"], [71, "lea rdx, [rax+1]"], [72, "mov rax, [rbp+var_18]"], [73, "mov [rax+28h], rdx"], [74, "jmp short loc_403748"], [75, "mov rax, [rbp+var_18]"], [76, "mov rdx, [rax+10h]"], [77, "mov rax, [rbp+var_18]"], [78, "mov rax, [rax+18h]"], [79, "cmp rdx, rax"], [80, "jbe short loc_40373C"], [81, "mov rax, [rbp+var_18]"], [82, "mov rdx, [rax+10h]"], [83, "mov rax, [rbp+var_18]"], [84, "mov rcx, [rax+18h]"], [85, "mov rax, rdx"], [86, "sub rax, rcx"], [87, "lea rdx, [rax+1]"], [88, "mov rax, [rbp+var_18]"], [89, "mov [rax+28h], rdx"], [90, "jmp short loc_403748"], [91, "mov rax, [rbp+var_18]"], [92, "mov qword ptr [rax+28h], 1"], [93, "mov eax, 0"], [94, "leave"], [95, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 6], [10, 4], [12, 9], [13, 10], [15, 3], [16, 15], [16, 14], [17, 6], [18, 17], [19, 18], [20, 6], [21, 4], [21, 20], [22, 21], [22, 5], [23, 22], [24, 6], [27, 24], [29, 28], [30, 29], [33, 6], [34, 33], [35, 34], [36, 35], [37, 35], [37, 9], [39, 37], [40, 36], [42, 3], [43, 41], [43, 42], [44, 35], [45, 44], [46, 45], [47, 35], [48, 47], [48, 4], [49, 48], [50, 5], [51, 50], [51, 49], [52, 51], [53, 35], [54, 8], [54, 53], [54, 16], [54, 43], [55, 54], [56, 55], [59, 3], [60, 16], [60, 59], [60, 43], [60, 8], [61, 3], [62, 8], [62, 16], [62, 43], [62, 61], [63, 60], [63, 62], [64, 63], [65, 3], [66, 16], [66, 73], [66, 43], [66, 8], [66, 65], [67, 3], [68, 43], [68, 8], [68, 67], [68, 16], [68, 73], [69, 66], [70, 68], [70, 69], [71, 8], [71, 16], [71, 73], [71, 66], [71, 43], [71, 70], [72, 3], [73, 71], [73, 72], [75, 3], [76, 43], [76, 8], [76, 16], [76, 75], [77, 3], [78, 77], [78, 43], [78, 8], [78, 16], [79, 76], [79, 78], [80, 79], [81, 3], [82, 8], [82, 81], [82, 16], [82, 89], [82, 43], [83, 3], [84, 43], [84, 8], [84, 83], [84, 16], [84, 89], [85, 82], [86, 85], [86, 84], [87, 16], [87, 89], [87, 82], [87, 43], [87, 86], [87, 8], [88, 3], [89, 88], [89, 87], [91, 3], [92, 91], [95, 93], [95, 31], [95, 57]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7_f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7.jsonl.gz", "strip_func_name": "sub_4035ED", "query": "\n\n\n__int64 __fastcall sub_4035ED(__int64 a1, const char *a2, char *a3)\n{\nchar *endptr; // [rsp+28h] [rbp-8h] BYREF\n\nendptr = 0LL;\n*(_BYTE *)(a1 + 32) = 0;\n*(_QWORD *)(a1 + 16) = strtoul(a2, &endptr, 10);\nif ( !endptr || (unsigned __int64)a3 <= endptr - a2 || strncmp(endptr, \"..\", 2uLL) )\nreturn 1LL;\nendptr += 2;\n*(_QWORD *)(a1 + 24) = strtoul(endptr, &endptr, 10);\nif ( !endptr || (char *)(endptr - a2) != a3 || *endptr != 125 )\nreturn 1LL;\nif ( *(_QWORD *)(a1 + 16) >= *(_QWORD *)(a1 + 24) )\n{\nif ( *(_QWORD *)(a1 + 16) <= *(_QWORD *)(a1 + 24) )\n*(_QWORD *)(a1 + 40) = 1LL;\nelse\n*(_QWORD *)(a1 + 40) = *(_QWORD *)(a1 + 16) - *(_QWORD *)(a1 + 24) + 1LL;\n}\nelse\n{\n*(_QWORD *)(a1 + 40) = *(_QWORD *)(a1 + 24) - *(_QWORD *)(a1 + 16) + 1LL;\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,endptr,sub_4035ED,]", "hints": "[]", "response": "{'a3': 'length', 'a1': 'glob', 'a2': 'spec', 'endptr': 'parse_offset', 'sub_4035ED': 'config_glob_parse_range'}"} | [
[
0.7446540594100952,
0.737615168094635,
0.7301304340362549,
0.7251700758934021,
0.7182896137237549,
0.7104218006134033,
0.7008121609687805,
0.6995359063148499,
0.6994661688804626,
0.6917831301689148,
0.6907294988632202,
0.6892104148864746,
0.687903642654419,
0.684488832950592,
0.6823855638504028,
0.6817470788955688,
0.6815205216407776,
0.6803762912750244,
0.6781615614891052,
0.6770118474960327
],
[
87651,
90053,
131165,
248069,
57042,
143775,
70946,
103903,
150847,
18516,
77191,
90885,
67630,
13356,
26745,
201960,
36693,
101854,
243820,
141995
]
] |
|
gnode_is_equal | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | bool gnode_is_equal (gnode_t *node1, gnode_t *node2) {
// very simple gnode verification for map key uniqueness
gnode_base_t *_node1 = (gnode_base_t *)node1;
gnode_base_t *_node2 = (gnode_base_t *)node2;
if (_node1->base.tag != _node2->base.tag) return false;
if (gnode_is_literal(node1)) {
gnode_literal_expr_t *e1 = (gnode_literal_expr_t *)node1;
gnode_literal_expr_t *e2 = (gnode_literal_expr_t *)node2;
if (e1->type != e2->type) return false;
// LITERAL_STRING, LITERAL_FLOAT, LITERAL_INT, LITERAL_BOOL, LITERAL_STRING_INTERPOLATED
if (e1->type == LITERAL_BOOL) return (e1->value.n64 == e2->value.n64);
if (e1->type == LITERAL_INT) return (e1->value.n64 == e2->value.n64);
if (e1->type == LITERAL_FLOAT) return (e1->value.d == e2->value.d);
if (e1->type == LITERAL_STRING) return (strcmp(e1->value.str, e2->value.str)==0);
// there is no way to check node equality for a LITERAL_STRING_INTERPOLATED at compile time
}
return false;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_422ED3", "function_addr": 4337363, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.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_30], rsi"], [5, "mov rax, [rbp+var_28]"], [6, "mov [rbp+var_8], rax"], [7, "mov rax, [rbp+var_30]"], [8, "mov [rbp+var_10], rax"], [9, "mov rax, [rbp+var_8]"], [10, "mov edx, [rax]"], [11, "mov rax, [rbp+var_10]"], [12, "mov eax, [rax]"], [13, "cmp edx, eax"], [14, "jz short loc_422F0D"], [15, "mov eax, 0"], [16, "jmp locret_422FFD"], [17, "mov rax, [rbp+var_28]"], [18, "mov rdi, rax"], [19, "call sub_423036"], [20, "test al, al"], [21, "jz loc_422FF8"], [22, "mov rax, [rbp+var_28]"], [23, "mov [rbp+var_18], rax"], [24, "mov rax, [rbp+var_30]"], [25, "mov [rbp+var_20], rax"], [26, "mov rax, [rbp+var_18]"], [27, "mov edx, [rax+48h]"], [28, "mov rax, [rbp+var_20]"], [29, "mov eax, [rax+48h]"], [30, "cmp edx, eax"], [31, "jz short loc_422F4D"], [32, "mov eax, 0"], [33, "jmp locret_422FFD"], [34, "mov rax, [rbp+var_18]"], [35, "mov eax, [rax+48h]"], [36, "cmp eax, 3"], [37, "jnz short loc_422F74"], [38, "mov rax, [rbp+var_18]"], [39, "mov rdx, [rax+50h]"], [40, "mov rax, [rbp+var_20]"], [41, "mov rax, [rax+50h]"], [42, "cmp rdx, rax"], [43, "setz al"], [44, "jmp locret_422FFD"], [45, "mov rax, [rbp+var_18]"], [46, "mov eax, [rax+48h]"], [47, "cmp eax, 2"], [48, "jnz short loc_422F98"], [49, "mov rax, [rbp+var_18]"], [50, "mov rdx, [rax+50h]"], [51, "mov rax, [rbp+var_20]"], [52, "mov rax, [rax+50h]"], [53, "cmp rdx, rax"], [54, "setz al"], [55, "jmp short locret_422FFD"], [56, "mov rax, [rbp+var_18]"], [57, "mov eax, [rax+48h]"], [58, "cmp eax, 1"], [59, "jnz short loc_422FCB"], [60, "mov rax, [rbp+var_18]"], [61, "movsd xmm0, qword ptr [rax+50h]"], [62, "mov rax, [rbp+var_20]"], [63, "movsd xmm1, qword ptr [rax+50h]"], [64, "ucomisd xmm0, xmm1"], [65, "setnp al"], [66, "mov edx, 0"], [67, "ucomisd xmm0, xmm1"], [68, "cmovnz eax, edx"], [69, "jmp short locret_422FFD"], [70, "mov rax, [rbp+var_18]"], [71, "mov eax, [rax+48h]"], [72, "test eax, eax"], [73, "jnz short loc_422FF8"], [74, "mov rax, [rbp+var_20]"], [75, "mov rdx, [rax+50h]"], [76, "mov rax, [rbp+var_18]"], [77, "mov rax, [rax+50h]"], [78, "mov rsi, rdx"], [79, "mov rdi, rax"], [80, "call _strcmp"], [81, "test eax, eax"], [82, "setz al"], [83, "jmp short locret_422FFD"], [84, "mov eax, 0"], [85, "leave"], [86, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [8, 7], [9, 6], [10, 9], [11, 8], [12, 11], [13, 10], [13, 12], [14, 13], [17, 3], [18, 17], [20, 19], [21, 20], [22, 3], [23, 22], [24, 4], [25, 24], [26, 23], [27, 26], [28, 25], [29, 28], [30, 27], [30, 29], [31, 30], [34, 23], [35, 34], [36, 35], [37, 36], [38, 23], [39, 38], [40, 25], [41, 40], [42, 39], [42, 41], [43, 41], [43, 42], [45, 23], [46, 45], [47, 46], [48, 47], [49, 23], [50, 49], [51, 25], [52, 51], [53, 50], [53, 52], [54, 53], [54, 52], [56, 23], [57, 56], [58, 57], [59, 58], [60, 23], [61, 60], [62, 25], [63, 62], [64, 61], [64, 63], [65, 58], [65, 62], [67, 63], [67, 64], [68, 66], [68, 58], [70, 23], [71, 70], [72, 71], [73, 72], [74, 25], [75, 74], [76, 23], [77, 76], [78, 75], [79, 77], [81, 80], [82, 81], [86, 32], [86, 82], [86, 84], [86, 68], [86, 43], [86, 15], [86, 54]]}
| {"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_422ED3", "query": "\n\n\nbool __fastcall sub_422ED3(__int64 a1, __int64 a2)\n{\nbool result; // al\n\nif ( *(_DWORD *)a1 != *(_DWORD *)a2 )\nreturn 0;\nif ( !(unsigned __int8)sub_423036(a1) )\ngoto LABEL_14;\nif ( *(_DWORD *)(a1 + 72) != *(_DWORD *)(a2 + 72) )\nreturn 0;\nswitch ( *(_DWORD *)(a1 + 72) )\n{\ncase 3:\nreturn *(_QWORD *)(a1 + 80) == *(_QWORD *)(a2 + 80);\ncase 2:\nreturn *(_QWORD *)(a1 + 80) == *(_QWORD *)(a2 + 80);\ncase 1:\nreturn *(double *)(a1 + 80) == *(double *)(a2 + 80);\n}\nif ( *(_DWORD *)(a1 + 72) )\nLABEL_14:\nresult = 0;\nelse\nresult = strcmp(*(const char **)(a1 + 80), *(const char **)(a2 + 80)) == 0;\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_422ED3,sub_423036,]", "hints": "[]", "response": "{'a1': 'node1', 'a2': 'node2', 'sub_422ED3': 'gnode_is_equal', 'sub_423036': 'gnode_is_literal'}"} | [
[
0.8427848815917969,
0.8369868993759155,
0.8358389139175415,
0.8264607787132263,
0.8236047625541687,
0.8099362254142761,
0.7800219655036926,
0.7634772658348083,
0.7601431012153625,
0.7585216164588928,
0.7544847726821899,
0.7544148564338684,
0.7526030540466309,
0.7516466379165649,
0.7482016682624817,
0.7455835938453674,
0.7442140579223633,
0.7387157678604126,
0.7368138432502747,
0.7364338636398315
],
[
168277,
61532,
67360,
166516,
229624,
213572,
93817,
183289,
218856,
147508,
60694,
234260,
236281,
161854,
111555,
29961,
54990,
141518,
20958,
168999
]
] |
|
Rule_free | d1eb74e45825051b29b029f5aac65fd1993d19e9afb5460ce1a61c9d0580a560 | perl11 | potion | NA | void Rule_free(Node *node)
{
switch (node->type)
{
case Freed: return;
case Rule:
{
Node *var= node->rule.variables;
#ifdef DEBUG
//Rule_print(node);
fprintf(stderr, "free Rule %s.%d\n", node->rule.name, node->rule.id);
#endif
free(node->rule.name);
while (var) {
Node *tmp= var->any.next; Rule_free(var); var= tmp;
}
if (node->rule.expression)
Rule_free(node->rule.expression);
break;
}
case Name: break;
case Variable: free(node->variable.name); break;
case Dot: break;
case Character: free(node->character.value); break;
case String: free(node->string.value); break;
case Class: free(node->cclass.value); break;
case Action:
#ifdef DEBUG
fprintf(stderr, "free Action %s\n", node->action.name);
#endif
free(node->action.text); free(node->action.name); break;
case Predicate: free(node->predicate.text); break;
case Error: free(node->error.text); break;
case Alternate:
{
Node *root= node;
#ifdef DEBUG
fprintf(stderr, "free Alternate %p\n", node);
#endif
node= node->alternate.first;
while (node->any.next) {
Node *tmp= node->any.next; Rule_free(node); node= tmp;
}
Rule_free(node);
node= root;
break;
}
case Sequence:
{
Node *root= node;
#ifdef DEBUG
fprintf(stderr, "free Sequence %p\n", node);
#endif
node= node->sequence.first;
while (node->any.next) {
Node *tmp= node->any.next; Rule_free(node); node= tmp;
}
Rule_free(node);
node= root;
break;
}
case PeekFor: break;
case PeekNot: break;
case Query: break;
case Star: break;
case Plus: break;
default:
fprintf(stderr, "\nunknown node type %d\n", node->type);
return;
}
assert(node);
node->type = Freed;
#ifndef DD_CYCLE
free(node);
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40733E", "function_addr": 4223806, "binary_name": "d1eb74e45825051b29b029f5aac65fd1993d19e9afb5460ce1a61c9d0580a560.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+ptr], rdi"], [4, "mov rax, [rbp+ptr]"], [5, "mov eax, [rax]"], [6, "add eax, 1"], [7, "cmp eax, 12h"], [8, "ja def_407366"], [9, "mov eax, eax"], [10, "mov rax, ds:jpt_407366[rax*8]"], [11, "jmp rax"], [12, "mov rax, [rbp+ptr]"], [13, "mov rax, [rax+18h]"], [14, "mov [rbp+var_8], rax"], [15, "mov rax, [rbp+ptr]"], [16, "mov rax, [rax+10h]"], [17, "mov rdi, rax"], [18, "call _free"], [19, "jmp short loc_4073A6"], [20, "mov rax, [rbp+var_8]"], [21, "mov rax, [rax+8]"], [22, "mov [rbp+var_30], rax"], [23, "mov rax, [rbp+var_8]"], [24, "mov rdi, rax"], [25, "call sub_40733E"], [26, "mov rax, [rbp+var_30]"], [27, "mov [rbp+var_8], rax"], [28, "cmp [rbp+var_8], 0"], [29, "jnz short loc_407386"], [30, "mov rax, [rbp+ptr]"], [31, "mov rax, [rax+20h]"], [32, "test rax, rax"], [33, "jz loc_40754C"], [34, "mov rax, [rbp+ptr]"], [35, "mov rax, [rax+20h]"], [36, "mov rdi, rax"], [37, "call sub_40733E"], [38, "jmp loc_40754C"], [39, "mov rax, [rbp+ptr]"], [40, "mov rax, [rax+10h]"], [41, "mov rdi, rax"], [42, "call _free"], [43, "jmp loc_40754D"], [44, "mov rax, [rbp+ptr]"], [45, "mov rax, [rax+10h]"], [46, "mov rdi, rax"], [47, "call _free"], [48, "jmp loc_40754D"], [49, "mov rax, [rbp+ptr]"], [50, "mov rax, [rax+10h]"], [51, "mov rdi, rax"], [52, "call _free"], [53, "jmp loc_40754D"], [54, "mov rax, [rbp+ptr]"], [55, "mov rax, [rax+10h]"], [56, "mov rdi, rax"], [57, "call _free"], [58, "jmp loc_40754D"], [59, "mov rax, [rbp+ptr]"], [60, "mov rax, [rax+10h]"], [61, "mov rdi, rax"], [62, "call _free"], [63, "mov rax, [rbp+ptr]"], [64, "mov rax, [rax+20h]"], [65, "mov rdi, rax"], [66, "call _free"], [67, "jmp loc_40754D"], [68, "mov rax, [rbp+ptr]"], [69, "mov rax, [rax+10h]"], [70, "mov rdi, rax"], [71, "call _free"], [72, "jmp loc_40754D"], [73, "mov rax, [rbp+ptr]"], [74, "mov rax, [rax+18h]"], [75, "mov rdi, rax"], [76, "call _free"], [77, "jmp loc_40754D"], [78, "mov rax, [rbp+ptr]"], [79, "mov [rbp+var_20], rax"], [80, "mov rax, [rbp+ptr]"], [81, "mov rax, [rax+10h]"], [82, "mov [rbp+ptr], rax"], [83, "jmp short loc_4074AC"], [84, "mov rax, [rbp+ptr]"], [85, "mov rax, [rax+8]"], [86, "mov [rbp+var_28], rax"], [87, "mov rax, [rbp+ptr]"], [88, "mov rdi, rax"], [89, "call sub_40733E"], [90, "mov rax, [rbp+var_28]"], [91, "mov [rbp+ptr], rax"], [92, "mov rax, [rbp+ptr]"], [93, "mov rax, [rax+8]"], [94, "test rax, rax"], [95, "jnz short loc_40748C"], [96, "mov rax, [rbp+ptr]"], [97, "mov rdi, rax"], [98, "call sub_40733E"], [99, "mov rax, [rbp+var_20]"], [100, "mov [rbp+ptr], rax"], [101, "jmp short loc_40754D"], [102, "mov rax, [rbp+ptr]"], [103, "mov [rbp+var_10], rax"], [104, "mov rax, [rbp+ptr]"], [105, "mov rax, [rax+10h]"], [106, "mov [rbp+ptr], rax"], [107, "jmp short loc_407505"], [108, "mov rax, [rbp+ptr]"], [109, "mov rax, [rax+8]"], [110, "mov [rbp+var_18], rax"], [111, "mov rax, [rbp+ptr]"], [112, "mov rdi, rax"], [113, "call sub_40733E"], [114, "mov rax, [rbp+var_18]"], [115, "mov [rbp+ptr], rax"], [116, "mov rax, [rbp+ptr]"], [117, "mov rax, [rax+8]"], [118, "test rax, rax"], [119, "jnz short loc_4074E5"], [120, "mov rax, [rbp+ptr]"], [121, "mov rdi, rax"], [122, "call sub_40733E"], [123, "mov rax, [rbp+var_10]"], [124, "mov [rbp+ptr], rax"], [125, "jmp short loc_40754D"], [126, "mov rax, [rbp+ptr]"], [127, "mov edx, [rax]"], [128, "mov rax, cs:stderr"], [129, "mov esi, offset aUnknownNodeTyp"], [130, "mov rdi, rax"], [131, "mov eax, 0"], [132, "call _fprintf"], [133, "jmp short locret_407566"], [134, "nop"], [135, "jmp short loc_40754D"], [136, "nop"], [137, "mov rax, [rbp+ptr]"], [138, "mov dword ptr [rax], 0FFFFFFFFh"], [139, "mov rax, [rbp+ptr]"], [140, "mov rdi, rax"], [141, "call _free"], [142, "jmp short locret_407566"], [143, "nop"], [144, "leave"], [145, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 6], [11, 10], [12, 3], [13, 12], [14, 13], [15, 3], [16, 15], [17, 16], [20, 14], [20, 27], [21, 20], [22, 21], [23, 27], [23, 14], [24, 23], [26, 22], [27, 26], [28, 14], [28, 27], [29, 28], [30, 3], [31, 30], [32, 31], [33, 32], [34, 3], [35, 34], [36, 35], [39, 3], [40, 39], [41, 40], [44, 3], [45, 44], [46, 45], [49, 3], [50, 49], [51, 50], [54, 3], [55, 54], [56, 55], [59, 3], [60, 59], [61, 60], [63, 3], [64, 63], [65, 64], [68, 3], [69, 68], [70, 69], [73, 3], [74, 73], [75, 74], [78, 3], [79, 78], [80, 3], [81, 80], [82, 81], [84, 82], [84, 91], [85, 84], [86, 85], [87, 82], [87, 91], [88, 87], [90, 86], [91, 90], [92, 82], [92, 91], [93, 92], [94, 93], [95, 94], [96, 82], [96, 91], [97, 96], [99, 79], [100, 99], [102, 3], [103, 102], [104, 3], [105, 104], [106, 105], [108, 106], [108, 115], [109, 108], [110, 109], [111, 106], [111, 115], [112, 111], [114, 110], [115, 114], [116, 106], [116, 115], [117, 116], [118, 117], [119, 118], [120, 106], [120, 115], [121, 120], [123, 103], [124, 123], [126, 3], [127, 126], [130, 128], [137, 3], [137, 124], [137, 100], [138, 137], [139, 100], [139, 3], [139, 124], [140, 139], [145, 132], [145, 141], [145, 10]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d1eb74e45825051b29b029f5aac65fd1993d19e9afb5460ce1a61c9d0580a560_d1eb74e45825051b29b029f5aac65fd1993d19e9afb5460ce1a61c9d0580a560.jsonl.gz", "strip_func_name": "sub_40733E", "query": "\n\n\nvoid __fastcall sub_40733E(unsigned int *a1)\n{\nunsigned int *ptr; // [rsp+8h] [rbp-38h]\n_QWORD *ptra; // [rsp+8h] [rbp-38h]\n__int64 v3; // [rsp+10h] [rbp-30h]\n_QWORD *v4; // [rsp+18h] [rbp-28h]\n_QWORD *v5; // [rsp+28h] [rbp-18h]\n__int64 v6; // [rsp+38h] [rbp-8h]\n\nptr = a1;\nswitch ( *a1 )\n{\ncase 0xFFFFFFFF:\nreturn;\ncase 1u:\nv6 = *((_QWORD *)a1 + 3);\nfree(*((void **)a1 + 2));\nwhile ( v6 )\n{\nv3 = *(_QWORD *)(v6 + 8);\nsub_40733E(v6);\nv6 = v3;\n}\nif ( *((_QWORD *)a1 + 4) )\nsub_40733E(*((_QWORD *)a1 + 4));\ngoto LABEL_19;\ncase 2u:\ncase 5u:\ncase 6u:\ncase 7u:\ncase 9u:\nfree(*((void **)a1 + 2));\ngoto LABEL_19;\ncase 3u:\ncase 4u:\ncase 0xDu:\ncase 0xEu:\ncase 0xFu:\ncase 0x10u:\ncase 0x11u:\ngoto LABEL_19;\ncase 8u:\nfree(*((void **)a1 + 2));\nfree(*((void **)a1 + 4));\ngoto LABEL_19;\ncase 0xAu:\nfree(*((void **)a1 + 3));\ngoto LABEL_19;\ncase 0xBu:\nfor ( ptra = (_QWORD *)*((_QWORD *)a1 + 2); ptra[1]; ptra = v4 )\n{\nv4 = (_QWORD *)ptra[1];\nsub_40733E(ptra);\n}\ngoto LABEL_13;\ncase 0xCu:\nfor ( ptra = (_QWORD *)*((_QWORD *)a1 + 2); ptra[1]; ptra = v5 )\n{\nv5 = (_QWORD *)ptra[1];\nsub_40733E(ptra);\n}\nLABEL_13:\nsub_40733E(ptra);\nptr = a1;\nLABEL_19:\n*ptr = -1;\nfree(ptr);\nbreak;\ndefault:\nfprintf(stderr, \"\\nunknown node type %d\\n\", *a1);\nbreak;\n}\n}\n\n\n\nQ:[a1,ptra,v3,v4,v5,v6,sub_40733E,]", "hints": "[]", "response": "{'a1': 'node', 'ptra': 'nodea', 'v3': 'tmp', 'v4': 'tmp_0', 'v5': 'tmp_1', 'v6': 'var', 'sub_40733E': 'Rule_free'}"} | [
[
0.8486636281013489,
0.8344319462776184,
0.8255867958068848,
0.8236780762672424,
0.8174523115158081,
0.8091259002685547,
0.7881470322608948,
0.7853635549545288,
0.7807374000549316,
0.7783409953117371,
0.7772754430770874,
0.7755290269851685,
0.7711669206619263,
0.7707581520080566,
0.7664769291877747,
0.7660574316978455,
0.7659618258476257,
0.7651911973953247,
0.7645909786224365,
0.7645166516304016
],
[
198881,
261954,
230204,
224364,
118279,
202357,
206122,
34586,
32664,
93434,
128317,
65584,
42662,
110751,
183980,
221472,
213438,
12714,
75648,
19782
]
] |
|
print_version | 23c8d2ee21d5b657bbc121fdb9d154232447728183b46f7c5868121d35569893 | pbatard | ms-sys | NA | void print_version(void)
{
printf(_("ms-sys version %s\n"), VERSION);
printf(_("Written by Henrik Carlqvist\n\n"));
printf(_("Copyright (C) 2009-2016 Free Software Foundation, Inc.\n"));
printf(_("This is free software; see the source for copying conditions. There is NO\n"));
printf(_("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"));
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404E33", "function_addr": 4214323, "binary_name": "23c8d2ee21d5b657bbc121fdb9d154232447728183b46f7c5868121d35569893.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov edi, offset aMsSysVersionS"], [3, "call _gettext"], [4, "mov esi, offset a260"], [5, "mov rdi, rax"], [6, "mov eax, 0"], [7, "call _printf"], [8, "mov edi, offset aWrittenByHenri"], [9, "call _gettext"], [10, "mov rdi, rax"], [11, "mov eax, 0"], [12, "call _printf"], [13, "mov edi, offset aCopyrightC2009"], [14, "call _gettext"], [15, "mov rdi, rax"], [16, "mov eax, 0"], [17, "call _printf"], [18, "mov edi, offset aThisIsFreeSoft"], [19, "call _gettext"], [20, "mov rdi, rax"], [21, "mov eax, 0"], [22, "call _printf"], [23, "mov edi, offset aWarrantyNotEve"], [24, "call _gettext"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _printf"], [28, "nop"], [29, "pop rbp"], [30, "retn"]], "data_dep": [[5, 3], [10, 9], [15, 14], [20, 19], [25, 24], [29, 0], [30, 27]]}
| {"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_404E33", "query": "\n\n\nint sub_404E33()\n{\nchar *v0; // rax\nchar *v1; // rax\nchar *v2; // rax\nchar *v3; // rax\nchar *v4; // rax\n\nv0 = gettext(\"ms-sys version %s\\n\");\nprintf(v0, \"2.6.0\");\nv1 = gettext(\"Written by Henrik Carlqvist\\n\\n\");\nprintf(v1);\nv2 = gettext(\"Copyright (C) 2009-2016 Free Software Foundation, Inc.\\n\");\nprintf(v2);\nv3 = gettext(\"This is free software; see the source for copying conditions. There is NO\\n\");\nprintf(v3);\nv4 = gettext(\"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\\n\\n\");\nreturn printf(v4);\n}\n\n\n\nQ:[sub_404E33,]", "hints": "[]", "response": "{'sub_404E33': 'print_version'}"} | [
[
0.7418577671051025,
0.738396406173706,
0.7372621893882751,
0.7284619808197021,
0.7191197872161865,
0.717715322971344,
0.7096361517906189,
0.7089881896972656,
0.7082988023757935,
0.7078818082809448,
0.7072382569313049,
0.7069388628005981,
0.7061579823493958,
0.7056329250335693,
0.7045294046401978,
0.7042946219444275,
0.7012275457382202,
0.7001575827598572,
0.6993674635887146,
0.6987473964691162
],
[
48222,
101596,
189949,
215760,
107943,
75809,
119193,
243058,
6269,
130073,
244821,
191586,
160068,
205369,
142126,
61487,
8907,
230929,
237563,
49105
]
] |
|
fill_random | ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9 | google | neper | NA | void fill_random(char *buf, int size)
{
int fd, chunk, done = 0;
fd = open("/dev/urandom", O_RDONLY);
if (fd == -1)
return;
while (done < size) {
chunk = read(fd, buf + done, size - done);
if (chunk <= 0)
break;
done += chunk;
}
close(fd);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_406126", "function_addr": 4219174, "binary_name": "ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.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_4], 0"], [6, "mov esi, 0"], [7, "mov edi, offset file"], [8, "mov eax, 0"], [9, "call _open"], [10, "mov [rbp+fd], eax"], [11, "cmp [rbp+fd], 0FFFFFFFFh"], [12, "jz short loc_4061A4"], [13, "jmp short loc_40618D"], [14, "mov eax, [rbp+var_1C]"], [15, "sub eax, [rbp+var_4]"], [16, "movsxd rdx, eax"], [17, "mov eax, [rbp+var_4]"], [18, "movsxd rcx, eax"], [19, "mov rax, [rbp+var_18]"], [20, "add rcx, rax"], [21, "mov eax, [rbp+fd]"], [22, "mov rsi, rcx"], [23, "mov edi, eax"], [24, "call _read"], [25, "mov [rbp+var_C], eax"], [26, "cmp [rbp+var_C], 0"], [27, "jle short loc_406197"], [28, "mov eax, [rbp+var_C]"], [29, "add [rbp+var_4], eax"], [30, "mov eax, [rbp+var_4]"], [31, "cmp eax, [rbp+var_1C]"], [32, "jl short loc_40615B"], [33, "jmp short loc_406198"], [34, "nop"], [35, "mov eax, [rbp+fd]"], [36, "mov edi, eax"], [37, "call _close"], [38, "jmp short locret_4061A5"], [39, "nop"], [40, "leave"], [41, "retn"]], "data_dep": [[10, 9], [11, 10], [12, 11], [14, 4], [15, 5], [15, 14], [15, 29], [16, 15], [17, 5], [17, 29], [18, 17], [19, 3], [20, 19], [20, 18], [21, 10], [22, 20], [23, 21], [25, 24], [26, 25], [27, 26], [28, 25], [29, 29], [29, 28], [29, 5], [30, 5], [30, 29], [31, 4], [31, 30], [32, 31], [35, 10], [36, 35], [41, 9], [41, 37]]}
| {"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_406126", "query": "\n\n\nint __fastcall sub_406126(__int64 a1, int a2)\n{\nint result; // eax\nint v3; // [rsp+14h] [rbp-Ch]\nint fd; // [rsp+18h] [rbp-8h]\nint v5; // [rsp+1Ch] [rbp-4h]\n\nv5 = 0;\nresult = open(\"/dev/urandom\", 0);\nfd = result;\nif ( result != -1 )\n{\nwhile ( v5 < a2 )\n{\nv3 = read(fd, (void *)(a1 + v5), a2 - v5);\nif ( v3 <= 0 )\nbreak;\nv5 += v3;\n}\nresult = close(fd);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,v5,sub_406126,]", "hints": "[]", "response": "{'a1': 'buf', 'a2': 'size', 'v3': 'chunk', 'v5': 'done', 'sub_406126': 'fill_random'}"} | [
[
0.8296096324920654,
0.8118158578872681,
0.8105225563049316,
0.8061491847038269,
0.8011685609817505,
0.7989317178726196,
0.7823699116706848,
0.7769924402236938,
0.7724398970603943,
0.7697662711143494,
0.7675541639328003,
0.760596513748169,
0.7546614408493042,
0.7529639601707458,
0.7452922463417053,
0.7445632219314575,
0.7444053888320923,
0.7435669898986816,
0.7416551113128662,
0.7413156628608704
],
[
103679,
116229,
201618,
249148,
255822,
94762,
75158,
153185,
18936,
19259,
104710,
92253,
97897,
262552,
28978,
5194,
24309,
140013,
223190,
11586
]
] |
|
uv5r_read_image | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void uv5r_read_image(FILE *img, unsigned char *ident)
{
if (fread(ident, 1, 8, img) != 8) {
fprintf(stderr, "Error reading image header.\n");
exit(-1);
}
if (fread(&radio_mem[0], 1, 0x1800, img) != 0x1800) {
fprintf(stderr, "Error reading image data.\n");
exit(-1);
}
if (fread(&radio_mem[0x1EC0], 1, 0x2000 - 0x1EC0, img) != 0x2000 - 0x1EC0) {
fprintf(stderr, "Error reading image footer.\n");
exit(-1);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407309", "function_addr": 4223753, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+ptr], rsi"], [5, "mov rdx, [rbp+stream]"], [6, "mov rax, [rbp+ptr]"], [7, "mov rcx, rdx"], [8, "mov edx, 8"], [9, "mov esi, 1"], [10, "mov rdi, rax"], [11, "call _fread"], [12, "cmp rax, 8"], [13, "jz short loc_407364"], [14, "mov rax, cs:stderr"], [15, "mov rcx, rax"], [16, "mov edx, 1Ch"], [17, "mov esi, 1"], [18, "mov edi, offset aErrorReadingIm"], [19, "call _fwrite"], [20, "mov edi, 0FFFFFFFFh"], [21, "call _exit"], [22, "mov rax, [rbp+stream]"], [23, "mov rcx, rax"], [24, "mov edx, 1800h"], [25, "mov esi, 1"], [26, "mov edi, offset byte_41A9E0"], [27, "call _fread"], [28, "cmp rax, 1800h"], [29, "jz short loc_4073AF"], [30, "mov rax, cs:stderr"], [31, "mov rcx, rax"], [32, "mov edx, 1Ah"], [33, "mov esi, 1"], [34, "mov edi, offset aErrorReadingIm_0"], [35, "call _fwrite"], [36, "mov edi, 0FFFFFFFFh"], [37, "call _exit"], [38, "mov rax, [rbp+stream]"], [39, "mov rcx, rax"], [40, "mov edx, 140h"], [41, "mov esi, 1"], [42, "mov edi, offset unk_41C8A0"], [43, "call _fread"], [44, "cmp rax, 140h"], [45, "jz short loc_4073FA"], [46, "mov rax, cs:stderr"], [47, "mov rcx, rax"], [48, "mov edx, 1Ch"], [49, "mov esi, 1"], [50, "mov edi, offset aErrorReadingIm_1"], [51, "call _fwrite"], [52, "mov edi, 0FFFFFFFFh"], [53, "call _exit"], [54, "nop"], [55, "leave"], [56, "retn"]], "data_dep": [[5, 3], [6, 4], [7, 5], [10, 6], [12, 11], [13, 12], [15, 14], [22, 3], [23, 22], [28, 27], [29, 28], [31, 30], [38, 3], [39, 38], [44, 43], [45, 44], [47, 46], [56, 43]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_407309", "query": "\n\n\nsize_t __fastcall sub_407309(FILE *a1, void *a2)\n{\nsize_t result; // rax\n\nif ( fread(a2, 1uLL, 8uLL, a1) != 8 )\n{\nfwrite(\"Error reading image header.\\n\", 1uLL, 0x1CuLL, stderr);\nexit(-1);\n}\nif ( fread(byte_41A9E0, 1uLL, 0x1800uLL, a1) != 6144 )\n{\nfwrite(\"Error reading image data.\\n\", 1uLL, 0x1AuLL, stderr);\nexit(-1);\n}\nresult = fread(&unk_41C8A0, 1uLL, 0x140uLL, a1);\nif ( result != 320 )\n{\nfwrite(\"Error reading image footer.\\n\", 1uLL, 0x1CuLL, stderr);\nexit(-1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_407309,]", "hints": "[]", "response": "{'a1': 'img', 'a2': 'ident', 'sub_407309': 'uv5r_read_image'}"} | [
[
0.886039674282074,
0.8738948702812195,
0.8616235256195068,
0.8596697449684143,
0.859563410282135,
0.859398365020752,
0.7853467464447021,
0.7721898555755615,
0.7703922390937805,
0.756980836391449,
0.7505894899368286,
0.7419729232788086,
0.7307797074317932,
0.7284286022186279,
0.7239722609519958,
0.7224148511886597,
0.7209197282791138,
0.7173370718955994,
0.7163668274879456,
0.7136626839637756
],
[
126274,
251498,
193204,
263119,
158586,
215277,
84751,
161520,
54251,
121815,
97704,
115691,
104504,
90066,
239057,
224024,
194031,
31506,
108753,
208768
]
] |
|
num_of_digits | 6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172 | noporpoise | seq-align | NA | size_t num_of_digits(size_t num)
{
size_t digits = 1;
while(1) {
if(num < 10) return digits;
if(num < 100) return digits+1;
if(num < 1000) return digits+2;
if(num < 10000) return digits+3;
num /= 10000;
digits += 4;
}
return digits;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40640A", "function_addr": 4219914, "binary_name": "6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_8], 1"], [4, "cmp [rbp+var_18], 9"], [5, "ja short loc_406427"], [6, "mov rax, [rbp+var_8]"], [7, "jmp short loc_406483"], [8, "cmp [rbp+var_18], 63h "], [9, "ja short loc_406438"], [10, "mov rax, [rbp+var_8]"], [11, "add rax, 1"], [12, "jmp short loc_406483"], [13, "cmp [rbp+var_18], 3E7h"], [14, "ja short loc_40644C"], [15, "mov rax, [rbp+var_8]"], [16, "add rax, 2"], [17, "jmp short loc_406483"], [18, "cmp [rbp+var_18], 270Fh"], [19, "ja short loc_406460"], [20, "mov rax, [rbp+var_8]"], [21, "add rax, 3"], [22, "jmp short loc_406483"], [23, "mov rax, [rbp+var_18]"], [24, "mov rdx, 346DC5D63886594Bh"], [25, "mul rdx"], [26, "mov rax, rdx"], [27, "shr rax, 0Bh"], [28, "mov [rbp+var_18], rax"], [29, "add [rbp+var_8], 4"], [30, "jmp short loc_40641A"], [31, "pop rbp"], [32, "retn"]], "data_dep": [[4, 2], [4, 28], [5, 4], [6, 29], [6, 3], [8, 2], [8, 28], [9, 8], [10, 3], [10, 29], [11, 10], [13, 2], [13, 28], [14, 13], [15, 29], [15, 3], [16, 15], [18, 28], [18, 2], [19, 18], [20, 29], [20, 3], [21, 20], [23, 28], [23, 2], [25, 24], [26, 25], [27, 26], [28, 27], [29, 29], [29, 3], [31, 0], [32, 6], [32, 21], [32, 11], [32, 16]]}
| {"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_40640A", "query": "\n\n\n__int64 __fastcall sub_40640A(unsigned __int64 a1)\n{\n__int64 i; // [rsp+10h] [rbp-8h]\n\nfor ( i = 1LL; ; i += 4LL )\n{\nif ( a1 <= 9 )\nreturn i;\nif ( a1 <= 0x63 )\nreturn i + 1;\nif ( a1 <= 0x3E7 )\nreturn i + 2;\nif ( a1 <= 0x270F )\nbreak;\na1 /= 0x2710uLL;\n}\nreturn i + 3;\n}\n\n\n\nQ:[a1,i,sub_40640A,]", "hints": "[]", "response": "{'a1': 'num', 'i': 'digits', 'sub_40640A': 'num_of_digits'}"} | [
[
0.7683499455451965,
0.7673124670982361,
0.7643589377403259,
0.7543015480041504,
0.7495770454406738,
0.7377113103866577,
0.7282416820526123,
0.7153602242469788,
0.7047233581542969,
0.6979937553405762,
0.6965230107307434,
0.6900660991668701,
0.688313364982605,
0.685537576675415,
0.6841250658035278,
0.6801744699478149,
0.679845929145813,
0.6747945547103882,
0.6725440621376038,
0.6707557439804077
],
[
145496,
190008,
90525,
63370,
227361,
156066,
98445,
54597,
18213,
144909,
73605,
2179,
162219,
156803,
253312,
181676,
261913,
95109,
4921,
172301
]
] |
|
lstack_init | 374c5f9d0a6bbf24d9ba5762a4810bbd644beddbafd8cc159556d79a0a8d9064 | skeeto | lstack | NA | int lstack_init(lstack_t *lstack, size_t max_size)
{
struct lstack_head head_init = {0, NULL};
lstack->head = ATOMIC_VAR_INIT(head_init);
lstack->size = ATOMIC_VAR_INIT(0);
/* Pre-allocate all nodes. */
lstack->node_buffer = malloc(max_size * sizeof(struct lstack_node));
if (lstack->node_buffer == NULL)
return ENOMEM;
for (size_t i = 0; i < max_size - 1; i++)
lstack->node_buffer[i].next = lstack->node_buffer + i + 1;
lstack->node_buffer[max_size - 1].next = NULL;
struct lstack_head free_init = {0, lstack->node_buffer};
lstack->free = ATOMIC_VAR_INIT(free_init);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40168F", "function_addr": 4200079, "binary_name": "374c5f9d0a6bbf24d9ba5762a4810bbd644beddbafd8cc159556d79a0a8d9064.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 78h"], [4, "mov [rbp+var_78], rdi"], [5, "mov [rbp+var_80], rsi"], [6, "mov [rbp+var_60], 0"], [7, "mov [rbp+var_58], 0"], [8, "mov rax, [rbp+var_60]"], [9, "mov rdx, [rbp+var_58]"], [10, "mov [rbp+var_50], rax"], [11, "mov [rbp+var_48], rdx"], [12, "mov rax, [rbp+var_50]"], [13, "mov rdx, [rbp+var_48]"], [14, "mov rcx, [rbp+var_78]"], [15, "lea rdi, [rcx+10h]"], [16, "mov rcx, rax"], [17, "mov rbx, rdx"], [18, "mov rsi, rcx"], [19, "mov rax, rdx"], [20, "mov ecx, 5"], [21, "mov rdx, rax"], [22, "call ___atomic_store_16"], [23, "mov [rbp+var_38], 0"], [24, "mov rax, [rbp+var_38]"], [25, "mov rdx, [rbp+var_78]"], [26, "add rdx, 30h "], [27, "xchg rax, [rdx]"], [28, "mov rax, [rbp+var_80]"], [29, "shl rax, 4"], [30, "mov rdi, rax"], [31, "call _malloc"], [32, "mov rdx, rax"], [33, "mov rax, [rbp+var_78]"], [34, "mov [rax], rdx"], [35, "mov rax, [rbp+var_78]"], [36, "mov rax, [rax]"], [37, "test rax, rax"], [38, "jnz short loc_401730"], [39, "mov eax, 0Ch"], [40, "jmp loc_4017EB"], [41, "mov [rbp+var_18], 0"], [42, "jmp short loc_40176E"], [43, "mov rax, [rbp+var_78]"], [44, "mov rdx, [rax]"], [45, "mov rax, [rbp+var_18]"], [46, "add rax, 1"], [47, "shl rax, 4"], [48, "mov rsi, rax"], [49, "mov rax, [rbp+var_78]"], [50, "mov rcx, [rax]"], [51, "mov rax, [rbp+var_18]"], [52, "shl rax, 4"], [53, "add rax, rcx"], [54, "add rdx, rsi"], [55, "mov [rax+8], rdx"], [56, "add [rbp+var_18], 1"], [57, "mov rax, [rbp+var_80]"], [58, "sub rax, 1"], [59, "cmp [rbp+var_18], rax"], [60, "jb short loc_40173A"], [61, "mov rax, [rbp+var_78]"], [62, "mov rdx, [rax]"], [63, "mov rax, [rbp+var_80]"], [64, "shl rax, 4"], [65, "sub rax, 10h"], [66, "add rax, rdx"], [67, "mov qword ptr [rax+8], 0"], [68, "mov [rbp+var_70], 0"], [69, "mov rax, [rbp+var_78]"], [70, "mov rax, [rax]"], [71, "mov [rbp+var_68], rax"], [72, "mov rax, [rbp+var_70]"], [73, "mov rdx, [rbp+var_68]"], [74, "mov [rbp+var_30], rax"], [75, "mov [rbp+var_28], rdx"], [76, "mov rax, [rbp+var_30]"], [77, "mov rdx, [rbp+var_28]"], [78, "mov rcx, [rbp+var_78]"], [79, "lea rdi, [rcx+20h]"], [80, "mov rcx, rax"], [81, "mov rbx, rdx"], [82, "mov rsi, rcx"], [83, "mov rax, rdx"], [84, "mov ecx, 5"], [85, "mov rdx, rax"], [86, "call ___atomic_store_16"], [87, "mov eax, 0"], [88, "mov rbx, [rbp+var_8]"], [89, "leave"], [90, "retn"]], "data_dep": [[8, 6], [9, 7], [10, 8], [11, 9], [12, 10], [13, 11], [14, 4], [15, 14], [16, 12], [17, 13], [18, 16], [19, 13], [21, 19], [24, 23], [25, 4], [26, 25], [27, 24], [27, 26], [28, 5], [29, 28], [30, 29], [32, 31], [33, 4], [34, 32], [34, 33], [35, 4], [36, 34], [36, 35], [37, 36], [38, 37], [43, 4], [44, 55], [44, 34], [44, 43], [45, 41], [45, 56], [46, 45], [47, 46], [48, 47], [49, 4], [50, 49], [50, 55], [50, 34], [51, 56], [51, 41], [52, 51], [53, 50], [53, 52], [54, 44], [54, 48], [55, 54], [55, 53], [56, 41], [56, 56], [57, 5], [58, 57], [59, 41], [59, 56], [59, 58], [60, 59], [61, 4], [62, 67], [62, 55], [62, 34], [62, 61], [63, 5], [64, 63], [65, 64], [66, 62], [66, 65], [67, 66], [69, 4], [70, 34], [70, 67], [70, 69], [71, 70], [72, 68], [73, 71], [74, 72], [75, 73], [76, 74], [77, 75], [78, 4], [79, 67], [79, 30], [79, 78], [80, 76], [81, 77], [82, 80], [83, 77], [85, 83], [90, 39], [90, 87]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/374c5f9d0a6bbf24d9ba5762a4810bbd644beddbafd8cc159556d79a0a8d9064_374c5f9d0a6bbf24d9ba5762a4810bbd644beddbafd8cc159556d79a0a8d9064.jsonl.gz", "strip_func_name": "sub_40168F", "query": "\n\n\n__int64 __fastcall sub_40168F(__int64 a1, __int64 a2)\n{\nunsigned __int64 i; // [rsp+68h] [rbp-18h]\n\n__atomic_store_16();\n_InterlockedExchange64((volatile __int64 *)(a1 + 48), 0LL);\n*(_QWORD *)a1 = malloc(16 * a2);\nif ( !*(_QWORD *)a1 )\nreturn 12LL;\nfor ( i = 0LL; i < a2 - 1; ++i )\n*(_QWORD *)(*(_QWORD *)a1 + 16 * i + 8) = 16 * (i + 1) + *(_QWORD *)a1;\n*(_QWORD *)(*(_QWORD *)a1 + 16 * a2 - 16 + 8) = 0LL;\n__atomic_store_16();\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,sub_40168F,]", "hints": "[]", "response": "{'a1': 'lstack', 'a2': 'max_size', 'sub_40168F': 'lstack_init'}"} | [
[
0.7136474251747131,
0.7074291706085205,
0.7000744342803955,
0.6929385662078857,
0.686829686164856,
0.6758975982666016,
0.670297384262085,
0.6698178052902222,
0.6687728762626648,
0.6676074266433716,
0.6674397587776184,
0.661125659942627,
0.6598362922668457,
0.6580725908279419,
0.6570203900337219,
0.654157280921936,
0.6529496908187866,
0.6473096609115601,
0.6465521454811096,
0.6433231830596924
],
[
77771,
85139,
264661,
91927,
233206,
173284,
73828,
172311,
255928,
248663,
180700,
159116,
259730,
71515,
85774,
130244,
130079,
8357,
193954,
163458
]
] |
|
ascii_to_unicode | 6e45e74c0044ccf4864d3a6078cdb530d7a63a35a924c748ca11bd686a2b0b5e | legitbs | quals-2013 | NA | int ascii_to_unicode( char * in, int in_sz, char *out, int out_sz)
{
int out_count = 0;
int in_count = 0;
if ( in == NULL || in_sz == 0 || out == NULL || out_sz == 0 )
{
return -1;
}
if ( out_sz >> 1 < in_sz )
{
return -1;
}
memset( out, 0x00, out_sz );
while ( in_count < in_sz )
{
if ( in[in_count] == 0x00 )
{
return 0;
}
if ( (in[in_count] <0x20 || in[in_count] > 0x7f) && in[in_count] !=0x0a )
{
return -1;
}
out[out_count] = in[in_count];
out_count += 2;
in_count++;
}
return in_count;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40158A", "function_addr": 4199818, "binary_name": "6e45e74c0044ccf4864d3a6078cdb530d7a63a35a924c748ca11bd686a2b0b5e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov [rbp+s], rdx"], [6, "mov [rbp+var_20], ecx"], [7, "mov [rbp+var_4], 0"], [8, "mov [rbp+var_8], 0"], [9, "cmp [rbp+var_18], 0"], [10, "jz short loc_4015C8"], [11, "cmp [rbp+var_1C], 0"], [12, "jz short loc_4015C8"], [13, "cmp [rbp+s], 0"], [14, "jz short loc_4015C8"], [15, "cmp [rbp+var_20], 0"], [16, "jnz short loc_4015D2"], [17, "mov eax, 0FFFFFFFFh"], [18, "jmp locret_40167B"], [19, "mov eax, [rbp+var_20]"], [20, "sar eax, 1"], [21, "cmp [rbp+var_1C], eax"], [22, "jle short loc_4015E6"], [23, "mov eax, 0FFFFFFFFh"], [24, "jmp locret_40167B"], [25, "mov eax, [rbp+var_20]"], [26, "movsxd rdx, eax"], [27, "mov rax, [rbp+s]"], [28, "mov esi, 0"], [29, "mov rdi, rax"], [30, "call _memset"], [31, "jmp short loc_401670"], [32, "mov eax, [rbp+var_8]"], [33, "movsxd rdx, eax"], [34, "mov rax, [rbp+var_18]"], [35, "add rax, rdx"], [36, "movzx eax, byte ptr [rax]"], [37, "test al, al"], [38, "jnz short loc_40161A"], [39, "mov eax, 0"], [40, "jmp short locret_40167B"], [41, "mov eax, [rbp+var_8]"], [42, "movsxd rdx, eax"], [43, "mov rax, [rbp+var_18]"], [44, "add rax, rdx"], [45, "movzx eax, byte ptr [rax]"], [46, "cmp al, 1Fh"], [47, "jg short loc_401649"], [48, "mov eax, [rbp+var_8]"], [49, "movsxd rdx, eax"], [50, "mov rax, [rbp+var_18]"], [51, "add rax, rdx"], [52, "movzx eax, byte ptr [rax]"], [53, "cmp al, 0Ah"], [54, "jz short loc_401649"], [55, "mov eax, 0FFFFFFFFh"], [56, "jmp short locret_40167B"], [57, "mov eax, [rbp+var_8]"], [58, "movsxd rdx, eax"], [59, "mov rax, [rbp+var_18]"], [60, "add rax, rdx"], [61, "mov edx, [rbp+var_4]"], [62, "movsxd rcx, edx"], [63, "mov rdx, [rbp+s]"], [64, "add rdx, rcx"], [65, "movzx eax, byte ptr [rax]"], [66, "mov [rdx], al"], [67, "add [rbp+var_4], 2"], [68, "add [rbp+var_8], 1"], [69, "mov eax, [rbp+var_8]"], [70, "cmp eax, [rbp+var_1C]"], [71, "jl short loc_4015FF"], [72, "mov eax, [rbp+var_8]"], [73, "leave"], [74, "retn"]], "data_dep": [[9, 3], [10, 9], [11, 4], [12, 11], [13, 5], [14, 13], [15, 6], [16, 15], [19, 6], [20, 19], [21, 4], [21, 20], [22, 21], [25, 6], [26, 25], [27, 5], [29, 27], [32, 68], [32, 8], [33, 32], [34, 3], [35, 33], [35, 34], [36, 66], [36, 35], [37, 36], [38, 37], [41, 8], [41, 68], [42, 41], [43, 3], [44, 42], [44, 43], [45, 66], [45, 44], [46, 45], [47, 46], [48, 8], [48, 68], [49, 48], [50, 3], [51, 50], [51, 49], [52, 51], [52, 66], [53, 52], [54, 53], [57, 68], [57, 8], [58, 57], [59, 3], [60, 59], [60, 58], [61, 67], [61, 7], [62, 61], [63, 5], [64, 62], [64, 63], [65, 60], [65, 66], [66, 64], [66, 65], [67, 67], [67, 7], [68, 68], [68, 8], [69, 68], [69, 8], [70, 4], [70, 69], [71, 70], [72, 68], [72, 8], [74, 55], [74, 72], [74, 17], [74, 39], [74, 23]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/6e45e74c0044ccf4864d3a6078cdb530d7a63a35a924c748ca11bd686a2b0b5e_6e45e74c0044ccf4864d3a6078cdb530d7a63a35a924c748ca11bd686a2b0b5e.jsonl.gz", "strip_func_name": "sub_40158A", "query": "\n\n\n__int64 __fastcall sub_40158A(__int64 a1, int a2, void *a3, int a4)\n{\nint v6; // [rsp+28h] [rbp-8h]\nint v7; // [rsp+2Ch] [rbp-4h]\n\nv7 = 0;\nv6 = 0;\nif ( !a1 || !a2 || !a3 || !a4 )\nreturn 0xFFFFFFFFLL;\nif ( a2 > a4 >> 1 )\nreturn 0xFFFFFFFFLL;\nmemset(a3, 0, a4);\nwhile ( v6 < a2 )\n{\nif ( !*(_BYTE *)(v6 + a1) )\nreturn 0LL;\nif ( *(char *)(v6 + a1) <= 31 && *(_BYTE *)(v6 + a1) != 10 )\nreturn 0xFFFFFFFFLL;\n*((_BYTE *)a3 + v7) = *(_BYTE *)(v6 + a1);\nv7 += 2;\n++v6;\n}\nreturn (unsigned int)v6;\n}\n\n\n\nQ:[a3,a4,a1,a2,v6,v7,sub_40158A,]", "hints": "[]", "response": "{'a3': 'out', 'a4': 'out_sz', 'a1': 'in', 'a2': 'in_sz', 'v6': 'in_count', 'v7': 'out_count', 'sub_40158A': 'ascii_to_unicode'}"} | [
[
0.807995080947876,
0.8065997362136841,
0.7734202146530151,
0.7558326721191406,
0.7535783052444458,
0.7498350143432617,
0.7425631880760193,
0.7392228841781616,
0.7353729605674744,
0.7309004664421082,
0.7276225090026855,
0.723146915435791,
0.722693920135498,
0.7163966298103333,
0.7155454158782959,
0.7151506543159485,
0.7135428190231323,
0.7115429043769836,
0.7076019048690796,
0.7053717374801636
],
[
57789,
134950,
131207,
115194,
6246,
70313,
90986,
58745,
249109,
69022,
192989,
226954,
33053,
1310,
242374,
186360,
209319,
78586,
163111,
214425
]
] |
|
print_squelch | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void print_squelch(FILE *out, int ctcs, int dcs)
{
if (ctcs)
fprintf(out, "%5.1f", ctcs / 10.0);
else if (dcs > 0)
fprintf(out, "D%03dN", dcs);
else if (dcs < 0)
fprintf(out, "D%03dI", -dcs);
else
fprintf(out, " - ");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405D26", "function_addr": 4218150, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+var_C], esi"], [5, "mov [rbp+var_10], edx"], [6, "cmp [rbp+var_C], 0"], [7, "jz short loc_405D75"], [8, "pxor xmm0, xmm0"], [9, "cvtsi2sd xmm0, [rbp+var_C]"], [10, "movsd xmm1, cs:qword_413EA8"], [11, "divsd xmm0, xmm1"], [12, "movq rdx, xmm0"], [13, "mov rax, [rbp+stream]"], [14, "movq xmm0, rdx"], [15, "mov esi, offset a51f"], [16, "mov rdi, rax"], [17, "mov eax, 1"], [18, "call _fprintf"], [19, "jmp short loc_405DD6"], [20, "cmp [rbp+var_10], 0"], [21, "jle short loc_405D96"], [22, "mov edx, [rbp+var_10]"], [23, "mov rax, [rbp+stream]"], [24, "mov esi, offset aD03dn"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _fprintf"], [28, "jmp short loc_405DD6"], [29, "cmp [rbp+var_10], 0"], [30, "jns short loc_405DBB"], [31, "mov eax, [rbp+var_10]"], [32, "neg eax"], [33, "mov edx, eax"], [34, "mov rax, [rbp+stream]"], [35, "mov esi, offset aD03di_0"], [36, "mov rdi, rax"], [37, "mov eax, 0"], [38, "call _fprintf"], [39, "jmp short loc_405DD6"], [40, "mov rax, [rbp+stream]"], [41, "mov rcx, rax"], [42, "mov edx, 5"], [43, "mov esi, 1"], [44, "mov edi, offset asc_412BE0"], [45, "call _fwrite"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[6, 4], [7, 6], [9, 8], [9, 4], [11, 10], [11, 9], [12, 11], [13, 3], [14, 12], [16, 13], [20, 5], [21, 20], [22, 5], [23, 3], [25, 23], [29, 5], [30, 29], [31, 5], [32, 31], [33, 32], [34, 3], [36, 34], [40, 3], [41, 40], [48, 27], [48, 45], [48, 38], [48, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_405D26", "query": "\n\n\nint __fastcall sub_405D26(FILE *a1, int a2, int a3)\n{\nif ( a2 )\nreturn fprintf(a1, \"%5.1f\", (double)a2 / 10.0);\nif ( a3 > 0 )\nreturn fprintf(a1, \"D%03dN\", (unsigned int)a3);\nif ( a3 >= 0 )\nreturn fwrite(\" - \", 1uLL, 5uLL, a1);\nreturn fprintf(a1, \"D%03dI\", (unsigned int)-a3);\n}\n\n\n\nQ:[a3,a1,a2,sub_405D26,]", "hints": "[]", "response": "{'a3': 'dcs', 'a1': 'out', 'a2': 'ctcs', 'sub_405D26': 'print_squelch'}"} | [
[
0.8296103477478027,
0.7952328324317932,
0.7793523669242859,
0.7773702144622803,
0.7716987133026123,
0.7709165811538696,
0.7612277269363403,
0.7580981254577637,
0.7496395111083984,
0.7488479614257812,
0.7427133321762085,
0.7348244190216064,
0.7338308095932007,
0.7313052415847778,
0.7272199392318726,
0.7264530062675476,
0.7256789207458496,
0.7227334976196289,
0.7222305536270142,
0.7195333242416382
],
[
45277,
68183,
172711,
142936,
1243,
44205,
198720,
36700,
220523,
63762,
197757,
84484,
62003,
23074,
81667,
191413,
22925,
58016,
177979,
57033
]
] |
|
print_squelch | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void print_squelch(FILE *out, int ctcs, int dcs)
{
if (ctcs)
fprintf(out, "%5.1f", ctcs / 10.0);
else if (dcs > 0)
fprintf(out, "D%03dN", dcs);
else if (dcs < 0)
fprintf(out, "D%03dI", -dcs);
else
fprintf(out, " - ");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40F159", "function_addr": 4256089, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+var_C], esi"], [5, "mov [rbp+var_10], edx"], [6, "cmp [rbp+var_C], 0"], [7, "jz short loc_40F1A8"], [8, "pxor xmm0, xmm0"], [9, "cvtsi2sd xmm0, [rbp+var_C]"], [10, "movsd xmm1, cs:qword_416760"], [11, "divsd xmm0, xmm1"], [12, "movq rdx, xmm0"], [13, "mov rax, [rbp+stream]"], [14, "movq xmm0, rdx"], [15, "mov esi, offset a51f_2"], [16, "mov rdi, rax"], [17, "mov eax, 1"], [18, "call _fprintf"], [19, "jmp short loc_40F209"], [20, "cmp [rbp+var_10], 0"], [21, "jle short loc_40F1C9"], [22, "mov edx, [rbp+var_10]"], [23, "mov rax, [rbp+stream]"], [24, "mov esi, offset aD03dn_2"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _fprintf"], [28, "jmp short loc_40F209"], [29, "cmp [rbp+var_10], 0"], [30, "jns short loc_40F1EE"], [31, "mov eax, [rbp+var_10]"], [32, "neg eax"], [33, "mov edx, eax"], [34, "mov rax, [rbp+stream]"], [35, "mov esi, offset aD03di_3"], [36, "mov rdi, rax"], [37, "mov eax, 0"], [38, "call _fprintf"], [39, "jmp short loc_40F209"], [40, "mov rax, [rbp+stream]"], [41, "mov rcx, rax"], [42, "mov edx, 5"], [43, "mov esi, 1"], [44, "mov edi, offset asc_415CC8"], [45, "call _fwrite"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[6, 4], [7, 6], [9, 8], [9, 4], [11, 10], [11, 9], [12, 11], [13, 3], [14, 12], [16, 13], [20, 5], [21, 20], [22, 5], [23, 3], [25, 23], [29, 5], [30, 29], [31, 5], [32, 31], [33, 32], [34, 3], [36, 34], [40, 3], [41, 40], [48, 27], [48, 45], [48, 38], [48, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_40F159", "query": "\n\n\nint __fastcall sub_40F159(FILE *a1, int a2, int a3)\n{\nif ( a2 )\nreturn fprintf(a1, \"%5.1f\", (double)a2 / 10.0);\nif ( a3 > 0 )\nreturn fprintf(a1, \"D%03dN\", (unsigned int)a3);\nif ( a3 >= 0 )\nreturn fwrite(\" - \", 1uLL, 5uLL, a1);\nreturn fprintf(a1, \"D%03dI\", (unsigned int)-a3);\n}\n\n\n\nQ:[a3,a1,a2,sub_40F159,]", "hints": "[]", "response": "{'a3': 'dcs', 'a1': 'out', 'a2': 'ctcs', 'sub_40F159': 'print_squelch_2'}"} | [
[
0.8295215368270874,
0.7949239611625671,
0.7758222818374634,
0.7731651663780212,
0.770284116268158,
0.7691999673843384,
0.7591454982757568,
0.7564321160316467,
0.7543891668319702,
0.746128261089325,
0.7368246912956238,
0.735042929649353,
0.7323347330093384,
0.7316902875900269,
0.7296863794326782,
0.7236982583999634,
0.7229323387145996,
0.7222264409065247,
0.7214918732643127,
0.721240222454071
],
[
45277,
68183,
142936,
172711,
44205,
1243,
36700,
220523,
198720,
63762,
84484,
197757,
23074,
62003,
22925,
58016,
81667,
183872,
57033,
191413
]
] |
|
strntoupper | 3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413 | emikulic | darkhttpd | NA | static void strntoupper(char *str, const size_t length) {
size_t i;
for (i = 0; i < length; i++)
str[i] = (char)toupper(str[i]);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40F4FC", "function_addr": 4257020, "binary_name": "3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.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+var_28], rdi"], [6, "mov [rbp+var_30], rsi"], [7, "mov [rbp+var_18], 0"], [8, "jmp loc_40F64E"], [9, "mov rdx, [rbp+var_28]"], [10, "mov rax, [rbp+var_18]"], [11, "add rax, rdx"], [12, "mov rcx, [rbp+var_18]"], [13, "not rcx"], [14, "shr rcx, 3Fh"], [15, "test cl, cl"], [16, "jz short loc_40F551"], [17, "cmp rax, rdx"], [18, "jnb short loc_40F556"], [19, "mov rcx, [rbp+var_28]"], [20, "mov rdx, rax"], [21, "mov rsi, rcx"], [22, "mov edi, offset off_439B80"], [23, "call ___ubsan_handle_pointer_overflow"], [24, "jmp short loc_40F556"], [25, "cmp rax, rdx"], [26, "ja short loc_40F53B"], [27, "mov rdx, [rbp+var_28]"], [28, "mov rax, [rbp+var_18]"], [29, "lea rbx, [rdx+rax]"], [30, "test rbx, rbx"], [31, "jnz short loc_40F576"], [32, "mov esi, 0"], [33, "mov edi, offset off_439BC0"], [34, "call ___ubsan_handle_type_mismatch_v1"], [35, "mov rax, rbx"], [36, "mov rdx, rax"], [37, "shr rdx, 3"], [38, "add rdx, 7FFF8000h"], [39, "movzx edx, byte ptr [rdx]"], [40, "test dl, dl"], [41, "setnz cl"], [42, "mov rsi, rax"], [43, "and esi, 7"], [44, "cmp sil, dl"], [45, "setnl dl"], [46, "and edx, ecx"], [47, "test dl, dl"], [48, "jz short loc_40F5A9"], [49, "mov rdi, rax"], [50, "call ___asan_report_load1"], [51, "movzx eax, byte ptr [rbx]"], [52, "movsx eax, al"], [53, "mov edi, eax"], [54, "call _toupper"], [55, "mov r12d, eax"], [56, "mov rdx, [rbp+var_28]"], [57, "mov rax, [rbp+var_18]"], [58, "add rax, rdx"], [59, "mov rcx, [rbp+var_18]"], [60, "not rcx"], [61, "shr rcx, 3Fh"], [62, "test cl, cl"], [63, "jz short loc_40F5EE"], [64, "cmp rax, rdx"], [65, "jnb short loc_40F5F3"], [66, "mov rcx, [rbp+var_28]"], [67, "mov rdx, rax"], [68, "mov rsi, rcx"], [69, "mov edi, offset off_439C00"], [70, "call ___ubsan_handle_pointer_overflow"], [71, "jmp short loc_40F5F3"], [72, "cmp rax, rdx"], [73, "ja short loc_40F5D8"], [74, "mov rdx, [rbp+var_28]"], [75, "mov rax, [rbp+var_18]"], [76, "lea rbx, [rdx+rax]"], [77, "test rbx, rbx"], [78, "jnz short loc_40F613"], [79, "mov esi, 0"], [80, "mov edi, offset off_439C40"], [81, "call ___ubsan_handle_type_mismatch_v1"], [82, "mov rax, rbx"], [83, "mov rdx, rax"], [84, "shr rdx, 3"], [85, "add rdx, 7FFF8000h"], [86, "movzx edx, byte ptr [rdx]"], [87, "test dl, dl"], [88, "setnz cl"], [89, "mov rsi, rax"], [90, "and esi, 7"], [91, "cmp sil, dl"], [92, "setnl dl"], [93, "and edx, ecx"], [94, "test dl, dl"], [95, "jz short loc_40F646"], [96, "mov rdi, rax"], [97, "call ___asan_report_store1"], [98, "mov [rbx], r12b"], [99, "add [rbp+var_18], 1"], [100, "mov rax, [rbp+var_18]"], [101, "cmp rax, [rbp+var_30]"], [102, "jb loc_40F51C"], [103, "nop"], [104, "nop"], [105, "add rsp, 20h"], [106, "pop rbx"], [107, "pop r12"], [108, "pop rbp"], [109, "retn"]], "data_dep": [[9, 5], [10, 99], [10, 7], [11, 9], [11, 10], [12, 99], [12, 7], [13, 12], [14, 13], [15, 14], [16, 15], [17, 9], [17, 11], [18, 17], [19, 5], [20, 11], [21, 19], [25, 11], [25, 9], [26, 25], [27, 5], [28, 7], [28, 99], [29, 98], [29, 77], [29, 28], [30, 29], [31, 30], [35, 30], [36, 35], [37, 36], [38, 37], [39, 98], [39, 38], [40, 39], [41, 40], [41, 15], [41, 19], [42, 35], [43, 42], [44, 40], [44, 43], [45, 40], [45, 44], [46, 41], [46, 45], [47, 46], [48, 47], [49, 35], [51, 98], [51, 30], [52, 51], [53, 52], [55, 54], [56, 5], [57, 99], [57, 7], [58, 56], [58, 57], [59, 99], [59, 7], [60, 59], [61, 60], [62, 61], [63, 62], [64, 56], [64, 58], [65, 64], [66, 5], [67, 58], [68, 66], [72, 56], [72, 58], [73, 72], [74, 5], [75, 99], [75, 7], [76, 30], [76, 98], [76, 75], [77, 76], [78, 77], [82, 77], [83, 82], [84, 83], [85, 84], [86, 85], [86, 98], [87, 86], [88, 87], [88, 62], [88, 66], [89, 82], [90, 89], [91, 90], [91, 87], [92, 87], [92, 91], [93, 88], [93, 92], [94, 93], [95, 94], [96, 82], [98, 55], [98, 77], [99, 99], [99, 7], [100, 7], [100, 99], [101, 6], [101, 100], [102, 101], [105, 4], [106, 3], [107, 2], [108, 0], [109, 100]]}
| {"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_40F4FC", "query": "\n\n\n__int64 __fastcall sub_40F4FC(unsigned __int64 a1, unsigned __int64 a2)\n{\nunsigned __int64 v2; // rax\nunsigned __int64 v3; // rbx\nchar v4; // r12\nunsigned __int64 v5; // rax\nunsigned __int64 v6; // rbx\n__int64 result; // rax\n__int64 i; // [rsp+18h] [rbp-18h]\n\nfor ( i = 0LL; ; ++i )\n{\nresult = i;\nif ( i >= a2 )\nbreak;\nv2 = a1 + i;\nif ( i >= 0 )\n{\nif ( v2 >= a1 )\ngoto LABEL_6;\nLABEL_4:\n__ubsan_handle_pointer_overflow();\ngoto LABEL_6;\n}\nif ( v2 > a1 )\ngoto LABEL_4;\nLABEL_6:\nv3 = a1 + i;\nif ( !(a1 + i) )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v3 >> 3) + 0x7FFF8000) != 0 && (char)(v3 & 7) >= *(_BYTE *)((v3 >> 3) + 0x7FFF8000) )\n__asan_report_load1();\nv4 = toupper(*(char *)v3);\nv5 = a1 + i;\nif ( i >= 0 )\n{\nif ( v5 >= a1 )\ngoto LABEL_14;\nLABEL_12:\n__ubsan_handle_pointer_overflow();\ngoto LABEL_14;\n}\nif ( v5 > a1 )\ngoto LABEL_12;\nLABEL_14:\nv6 = a1 + i;\nif ( !(a1 + i) )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v6 >> 3) + 0x7FFF8000) != 0 && (char)(v6 & 7) >= *(_BYTE *)((v6 >> 3) + 0x7FFF8000) )\n__asan_report_store1();\n*(_BYTE *)v6 = v4;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_40F4FC,]", "hints": "[]", "response": "{'a1': 'str', 'a2': 'length', 'sub_40F4FC': 'strntoupper'}"} | [
[
0.7229450941085815,
0.704123854637146,
0.702093780040741,
0.7003361582756042,
0.6982343792915344,
0.6968327760696411,
0.6783139109611511,
0.6730785369873047,
0.6724909543991089,
0.6675536036491394,
0.6669613718986511,
0.6637516021728516,
0.6596471071243286,
0.6583420634269714,
0.6521840691566467,
0.6515401601791382,
0.65104079246521,
0.6496464014053345,
0.6493781805038452,
0.6488261818885803
],
[
206523,
111358,
149517,
49442,
55200,
188812,
184773,
180889,
14767,
169855,
211648,
109484,
222652,
85717,
161429,
21738,
151827,
47883,
200109,
87195
]
] |
|
handle_errors | aeb8f877645222af4b18d656ffba4acd16fb2773a7c764a123fc8855a08b4ac1 | KnightOS | scas | NA | static void
handle_errors(list_t *errors, list_t *warnings)
{
for (unsigned int i = 0; i < errors->length; ++i) {
error_t *error = errors->items[i];
fprintf(stderr, "%s:%lu:%lu: error #%d: %s\n", error->file_name,
error->line_number, error->column, error->code,
error->message);
if(error->line != NULL){
fputs(error->line, stderr);
if(error->column != 0){
for(unsigned int j = error->column; j > 0; j -= 1)
fputc('.', stderr);
fputs("^", stderr);
} else
fputc('\n', stderr);
free(error->line);
}
free(error->file_name);
free(error->message);
free(error);
}
// when handle_errors is called, the output fd shall already have been closed
if(errors->length > 0 && out_name != NULL){
remove(out_name);
out_name = NULL;
}
for (unsigned int i = 0; i < warnings->length; ++i) {
warning_t *warning = warnings->items[i];
fprintf(stderr, "%s:%lu:%lu: warning #%d: %s\n", warning->file_name,
warning->line_number, warning->column, warning->code,
get_warning_string(warning));
if(warning->line != NULL){
fputs(warning->line, stderr);
if(warning->column != 0){
for (unsigned int j = warning->column; j > 0; --j)
fputc('.', stderr);
fputs("^", stderr);
}
free(warning->line);
}
free(warning->message);
free(warning->file_name);
free(warning);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403A42", "function_addr": 4209218, "binary_name": "aeb8f877645222af4b18d656ffba4acd16fb2773a7c764a123fc8855a08b4ac1.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_30], rsi"], [5, "mov [rbp+var_4], 0"], [6, "jmp loc_403B93"], [7, "mov rax, [rbp+var_28]"], [8, "mov rdx, [rax+8]"], [9, "mov eax, [rbp+var_4]"], [10, "shl rax, 3"], [11, "add rax, rdx"], [12, "mov rax, [rax]"], [13, "mov [rbp+ptr], rax"], [14, "mov rax, [rbp+ptr]"], [15, "mov rsi, [rax+20h]"], [16, "mov rax, [rbp+ptr]"], [17, "mov r8d, [rax]"], [18, "mov rax, [rbp+ptr]"], [19, "mov rdi, [rax+28h]"], [20, "mov rax, [rbp+ptr]"], [21, "mov rcx, [rax+8]"], [22, "mov rax, [rbp+ptr]"], [23, "mov rdx, [rax+10h]"], [24, "mov rax, cs:stderr"], [25, "sub rsp, 8"], [26, "push rsi"], [27, "mov r9d, r8d"], [28, "mov r8, rdi"], [29, "mov esi, offset format"], [30, "mov rdi, rax"], [31, "mov eax, 0"], [32, "call _fprintf"], [33, "add rsp, 10h"], [34, "mov rax, [rbp+ptr]"], [35, "mov rax, [rax+18h]"], [36, "test rax, rax"], [37, "jz loc_403B63"], [38, "mov rdx, cs:stderr"], [39, "mov rax, [rbp+ptr]"], [40, "mov rax, [rax+18h]"], [41, "mov rsi, rdx"], [42, "mov rdi, rax"], [43, "call _fputs"], [44, "mov rax, [rbp+ptr]"], [45, "mov rax, [rax+28h]"], [46, "test rax, rax"], [47, "jz short loc_403B3F"], [48, "mov rax, [rbp+ptr]"], [49, "mov rax, [rax+28h]"], [50, "mov [rbp+var_8], eax"], [51, "jmp short loc_403B23"], [52, "mov rax, cs:stderr"], [53, "mov rsi, rax"], [54, "mov edi, 2Eh "], [55, "call _fputc"], [56, "sub [rbp+var_8], 1"], [57, "cmp [rbp+var_8], 0"], [58, "jnz short loc_403B0B"], [59, "mov rax, cs:stderr"], [60, "mov rsi, rax"], [61, "mov edi, 5Eh "], [62, "call _fputc"], [63, "jmp short loc_403B53"], [64, "mov rax, cs:stderr"], [65, "mov rsi, rax"], [66, "mov edi, 0Ah"], [67, "call _fputc"], [68, "mov rax, [rbp+ptr]"], [69, "mov rax, [rax+18h]"], [70, "mov rdi, rax"], [71, "call _free"], [72, "mov rax, [rbp+ptr]"], [73, "mov rax, [rax+10h]"], [74, "mov rdi, rax"], [75, "call _free"], [76, "mov rax, [rbp+ptr]"], [77, "mov rax, [rax+20h]"], [78, "mov rdi, rax"], [79, "call _free"], [80, "mov rax, [rbp+ptr]"], [81, "mov rdi, rax"], [82, "call _free"], [83, "add [rbp+var_4], 1"], [84, "mov rax, [rbp+var_28]"], [85, "mov eax, [rax+4]"], [86, "cmp [rbp+var_4], eax"], [87, "jb loc_403A5E"], [88, "mov rax, [rbp+var_28]"], [89, "mov eax, [rax+4]"], [90, "test eax, eax"], [91, "jz short loc_403BD4"], [92, "mov rax, cs:filename"], [93, "test rax, rax"], [94, "jz short loc_403BD4"], [95, "mov rax, cs:filename"], [96, "mov rdi, rax"], [97, "call _remove"], [98, "mov cs:filename, 0"], [99, "mov [rbp+var_C], 0"], [100, "jmp loc_403D02"], [101, "mov rax, [rbp+var_30]"], [102, "mov rdx, [rax+8]"], [103, "mov eax, [rbp+var_C]"], [104, "shl rax, 3"], [105, "add rax, rdx"], [106, "mov rax, [rax]"], [107, "mov [rbp+var_18], rax"], [108, "mov rax, [rbp+var_18]"], [109, "mov rdi, rax"], [110, "call sub_4092CF"], [111, "mov rsi, rax"], [112, "mov rax, [rbp+var_18]"], [113, "mov r8d, [rax]"], [114, "mov rax, [rbp+var_18]"], [115, "mov rdi, [rax+28h]"], [116, "mov rax, [rbp+var_18]"], [117, "mov rcx, [rax+8]"], [118, "mov rax, [rbp+var_18]"], [119, "mov rdx, [rax+10h]"], [120, "mov rax, cs:stderr"], [121, "sub rsp, 8"], [122, "push rsi"], [123, "mov r9d, r8d"], [124, "mov r8, rdi"], [125, "mov esi, offset aSLuLuWarningDS"], [126, "mov rdi, rax"], [127, "mov eax, 0"], [128, "call _fprintf"], [129, "add rsp, 10h"], [130, "mov rax, [rbp+var_18]"], [131, "mov rax, [rax+18h]"], [132, "test rax, rax"], [133, "jz short loc_403CD2"], [134, "mov rdx, cs:stderr"], [135, "mov rax, [rbp+var_18]"], [136, "mov rax, [rax+18h]"], [137, "mov rsi, rdx"], [138, "mov rdi, rax"], [139, "call _fputs"], [140, "mov rax, [rbp+var_18]"], [141, "mov rax, [rax+28h]"], [142, "test rax, rax"], [143, "jz short loc_403CC2"], [144, "mov rax, [rbp+var_18]"], [145, "mov rax, [rax+28h]"], [146, "mov [rbp+var_10], eax"], [147, "jmp short loc_403CA8"], [148, "mov rax, cs:stderr"], [149, "mov rsi, rax"], [150, "mov edi, 2Eh "], [151, "call _fputc"], [152, "sub [rbp+var_10], 1"], [153, "cmp [rbp+var_10], 0"], [154, "jnz short loc_403C90"], [155, "mov rax, cs:stderr"], [156, "mov rsi, rax"], [157, "mov edi, 5Eh "], [158, "call _fputc"], [159, "mov rax, [rbp+var_18]"], [160, "mov rax, [rax+18h]"], [161, "mov rdi, rax"], [162, "call _free"], [163, "mov rax, [rbp+var_18]"], [164, "mov rax, [rax+20h]"], [165, "mov rdi, rax"], [166, "call _free"], [167, "mov rax, [rbp+var_18]"], [168, "mov rax, [rax+10h]"], [169, "mov rdi, rax"], [170, "call _free"], [171, "mov rax, [rbp+var_18]"], [172, "mov rdi, rax"], [173, "call _free"], [174, "add [rbp+var_C], 1"], [175, "mov rax, [rbp+var_30]"], [176, "mov eax, [rax+4]"], [177, "cmp [rbp+var_C], eax"], [178, "jb loc_403BE0"], [179, "nop"], [180, "nop"], [181, "leave"], [182, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 83], [9, 5], [10, 9], [11, 8], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 13], [17, 16], [18, 13], [19, 18], [20, 13], [21, 20], [22, 13], [23, 22], [25, 33], [25, 2], [26, 15], [27, 17], [28, 19], [30, 24], [33, 25], [34, 13], [35, 34], [36, 35], [37, 36], [39, 13], [40, 39], [41, 38], [42, 40], [44, 13], [45, 44], [46, 45], [47, 46], [48, 13], [49, 48], [50, 49], [53, 52], [56, 50], [56, 56], [57, 50], [57, 56], [58, 57], [60, 59], [65, 64], [68, 13], [69, 68], [70, 69], [72, 13], [73, 72], [74, 73], [76, 13], [77, 76], [78, 77], [80, 13], [81, 80], [83, 5], [83, 83], [84, 3], [85, 84], [86, 83], [86, 85], [86, 5], [87, 86], [88, 3], [89, 88], [90, 89], [91, 90], [93, 92], [94, 93], [96, 95], [101, 4], [102, 101], [103, 99], [103, 174], [104, 103], [105, 102], [105, 104], [106, 105], [107, 106], [108, 107], [109, 108], [111, 110], [112, 107], [113, 112], [114, 107], [115, 114], [116, 107], [117, 116], [118, 107], [119, 118], [121, 2], [121, 129], [121, 33], [122, 111], [123, 113], [124, 115], [126, 120], [129, 121], [130, 107], [131, 130], [132, 131], [133, 132], [135, 107], [136, 135], [137, 134], [138, 136], [140, 107], [141, 140], [142, 141], [143, 142], [144, 107], [145, 144], [146, 145], [149, 148], [152, 146], [152, 152], [153, 146], [153, 152], [154, 153], [156, 155], [159, 107], [160, 159], [161, 160], [163, 107], [164, 163], [165, 164], [167, 107], [168, 167], [169, 168], [171, 107], [172, 171], [174, 99], [174, 174], [175, 4], [176, 175], [177, 174], [177, 176], [177, 99], [178, 177], [182, 176]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/aeb8f877645222af4b18d656ffba4acd16fb2773a7c764a123fc8855a08b4ac1_aeb8f877645222af4b18d656ffba4acd16fb2773a7c764a123fc8855a08b4ac1.jsonl.gz", "strip_func_name": "sub_403A42", "query": "\n\n\n__int64 __fastcall sub_403A42(__int64 a1, __int64 a2)\n{\nconst char *v2; // rax\n__int64 result; // rax\nunsigned int *ptr; // [rsp+10h] [rbp-20h]\nunsigned int *v5; // [rsp+18h] [rbp-18h]\nint l; // [rsp+20h] [rbp-10h]\nunsigned int k; // [rsp+24h] [rbp-Ch]\nint j; // [rsp+28h] [rbp-8h]\nunsigned int i; // [rsp+2Ch] [rbp-4h]\n\nfor ( i = 0; i < *(_DWORD *)(a1 + 4); ++i )\n{\nptr = *(unsigned int **)(*(_QWORD *)(a1 + 8) + 8LL * i);\nfprintf(\nstderr,\n\"%s:%lu:%lu: error #%d: %s\\n\",\n*((const char **)ptr + 2),\n*((_QWORD *)ptr + 1),\n*((_QWORD *)ptr + 5),\n*ptr,\n*((const char **)ptr + 4));\nif ( *((_QWORD *)ptr + 3) )\n{\nfputs(*((const char **)ptr + 3), stderr);\nif ( *((_QWORD *)ptr + 5) )\n{\nfor ( j = *((_QWORD *)ptr + 5); j; --j )\nfputc(46, stderr);\nfputc(94, stderr);\n}\nelse\n{\nfputc(10, stderr);\n}\nfree(*((void **)ptr + 3));\n}\nfree(*((void **)ptr + 2));\nfree(*((void **)ptr + 4));\nfree(ptr);\n}\nif ( *(_DWORD *)(a1 + 4) && filename )\n{\nremove(filename);\nfilename = 0LL;\n}\nfor ( k = 0; ; ++k )\n{\nresult = *(unsigned int *)(a2 + 4);\nif ( k >= (unsigned int)result )\nbreak;\nv5 = *(unsigned int **)(*(_QWORD *)(a2 + 8) + 8LL * k);\nv2 = (const char *)sub_4092CF(v5);\nfprintf(\nstderr,\n\"%s:%lu:%lu: warning #%d: %s\\n\",\n*((const char **)v5 + 2),\n*((_QWORD *)v5 + 1),\n*((_QWORD *)v5 + 5),\n*v5,\nv2);\nif ( *((_QWORD *)v5 + 3) )\n{\nfputs(*((const char **)v5 + 3), stderr);\nif ( *((_QWORD *)v5 + 5) )\n{\nfor ( l = *((_QWORD *)v5 + 5); l; --l )\nfputc(46, stderr);\nfputc(94, stderr);\n}\nfree(*((void **)v5 + 3));\n}\nfree(*((void **)v5 + 4));\nfree(*((void **)v5 + 2));\nfree(v5);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,ptr,v5,l,k,sub_403A42,sub_4092CF,]", "hints": "[]", "response": "{'a1': 'errors', 'a2': 'warnings', 'ptr': 'error', 'v5': 'warning', 'l': 'j_0', 'k': 'i_0', 'sub_403A42': 'handle_errors', 'sub_4092CF': 'get_warning_string'}"} | [
[
0.6753790974617004,
0.6723015904426575,
0.6611074209213257,
0.6609088182449341,
0.655937671661377,
0.6418785452842712,
0.6377353072166443,
0.6363749504089355,
0.6325601935386658,
0.6302022933959961,
0.6285810470581055,
0.6267980933189392,
0.6255016326904297,
0.623741865158081,
0.6212242245674133,
0.6175535917282104,
0.6154116988182068,
0.6114929914474487,
0.6089879274368286,
0.6089606285095215
],
[
200512,
220080,
135637,
195274,
127774,
181776,
197322,
255817,
21891,
104946,
23550,
169481,
250700,
66020,
122483,
7406,
34978,
164589,
258881,
10366
]
] |
|
CompressRow | f56ce0bb9be1bedbe410ba89a54b52ea26395ad28d49265589dcb44a213e6c22 | sezero | uhexen2 | NA | static int CompressRow (byte *vis, byte *dest)
{
int j;
int rep;
int visrow;
byte *dest_p;
dest_p = dest;
visrow = (portalleafs + 7)>>3;
for (j = 0 ; j < visrow ; j++)
{
*dest_p++ = vis[j];
if (vis[j])
continue;
rep = 1;
for (j++; j < visrow ; j++)
{
if (vis[j] || rep == 255)
break;
else
rep++;
}
*dest_p++ = rep;
j--;
}
return dest_p - dest;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_408D9E", "function_addr": 4230558, "binary_name": "f56ce0bb9be1bedbe410ba89a54b52ea26395ad28d49265589dcb44a213e6c22.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 [rbp+var_10], rax"], [6, "mov eax, cs:dword_19889CC"], [7, "add eax, 7"], [8, "sar eax, 3"], [9, "mov [rbp+var_14], eax"], [10, "mov [rbp+var_4], 0"], [11, "jmp loc_408E56"], [12, "mov eax, [rbp+var_4]"], [13, "movsxd rdx, eax"], [14, "mov rax, [rbp+var_28]"], [15, "lea rcx, [rdx+rax]"], [16, "mov rax, [rbp+var_10]"], [17, "lea rdx, [rax+1]"], [18, "mov [rbp+var_10], rdx"], [19, "movzx edx, byte ptr [rcx]"], [20, "mov [rax], dl"], [21, "mov eax, [rbp+var_4]"], [22, "movsxd rdx, eax"], [23, "mov rax, [rbp+var_28]"], [24, "add rax, rdx"], [25, "movzx eax, byte ptr [rax]"], [26, "test al, al"], [27, "jnz short loc_408E51"], [28, "mov [rbp+var_8], 1"], [29, "add [rbp+var_4], 1"], [30, "jmp short loc_408E32"], [31, "mov eax, [rbp+var_4]"], [32, "movsxd rdx, eax"], [33, "mov rax, [rbp+var_28]"], [34, "add rax, rdx"], [35, "movzx eax, byte ptr [rax]"], [36, "test al, al"], [37, "jnz short loc_408E3A"], [38, "cmp [rbp+var_8], 0FFh"], [39, "jz short loc_408E3A"], [40, "add [rbp+var_8], 1"], [41, "add [rbp+var_4], 1"], [42, "mov eax, [rbp+var_4]"], [43, "cmp eax, [rbp+var_14]"], [44, "jl short loc_408E0D"], [45, "mov rax, [rbp+var_10]"], [46, "lea rdx, [rax+1]"], [47, "mov [rbp+var_10], rdx"], [48, "mov edx, [rbp+var_8]"], [49, "mov [rax], dl"], [50, "sub [rbp+var_4], 1"], [51, "jmp short loc_408E52"], [52, "nop"], [53, "add [rbp+var_4], 1"], [54, "mov eax, [rbp+var_4]"], [55, "cmp eax, [rbp+var_14]"], [56, "jl loc_408DCD"], [57, "mov rax, [rbp+var_10]"], [58, "sub rax, [rbp+var_30]"], [59, "pop rbp"], [60, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 8], [12, 10], [12, 53], [13, 12], [14, 2], [15, 14], [15, 20], [15, 49], [15, 15], [16, 47], [16, 5], [16, 18], [17, 16], [17, 20], [17, 13], [17, 49], [18, 17], [19, 20], [19, 49], [19, 15], [20, 19], [20, 16], [21, 10], [21, 53], [22, 21], [23, 2], [24, 23], [24, 22], [25, 20], [25, 24], [26, 25], [27, 26], [29, 10], [29, 53], [31, 29], [31, 41], [32, 31], [33, 2], [34, 32], [34, 33], [35, 34], [35, 20], [35, 49], [36, 35], [37, 36], [38, 40], [38, 28], [39, 38], [40, 40], [40, 28], [41, 41], [41, 29], [42, 41], [42, 29], [43, 9], [43, 42], [44, 43], [45, 18], [46, 20], [46, 45], [46, 22], [46, 49], [46, 32], [47, 46], [48, 40], [48, 28], [49, 48], [49, 45], [50, 29], [50, 41], [53, 50], [53, 53], [53, 10], [54, 10], [54, 53], [55, 54], [55, 9], [56, 55], [57, 18], [57, 47], [57, 5], [58, 3], [58, 57], [59, 0], [60, 58]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f56ce0bb9be1bedbe410ba89a54b52ea26395ad28d49265589dcb44a213e6c22_f56ce0bb9be1bedbe410ba89a54b52ea26395ad28d49265589dcb44a213e6c22.jsonl.gz", "strip_func_name": "sub_408D9E", "query": "\n\n\n_BYTE *__fastcall sub_408D9E(__int64 a1, _BYTE *a2)\n{\n_BYTE *v2; // rax\n_BYTE *v3; // rax\nint v5; // [rsp+1Ch] [rbp-14h]\n_BYTE *v6; // [rsp+20h] [rbp-10h]\nint v7; // [rsp+28h] [rbp-8h]\nint i; // [rsp+2Ch] [rbp-4h]\nint j; // [rsp+2Ch] [rbp-4h]\n\nv6 = a2;\nv5 = (dword_19889CC + 7) >> 3;\nfor ( i = 0; i < v5; ++i )\n{\nv2 = v6++;\n*v2 = *(_BYTE *)(i + a1);\nif ( !*(_BYTE *)(i + a1) )\n{\nv7 = 1;\nfor ( j = i + 1; j < v5 && !*(_BYTE *)(j + a1) && v7 != 255; ++j )\n++v7;\nv3 = v6++;\n*v3 = v7;\ni = j - 1;\n}\n}\nreturn (_BYTE *)(v6 - a2);\n}\n\n\n\nQ:[a1,a2,v5,v6,v7,sub_408D9E,]", "hints": "[]", "response": "{'a1': 'vis', 'a2': 'dest', 'v5': 'visrow', 'v6': 'dest_p', 'v7': 'rep', 'sub_408D9E': 'CompressRow'}"} | [
[
0.7547502517700195,
0.7474574446678162,
0.7457957863807678,
0.7448979616165161,
0.7423977255821228,
0.7409125566482544,
0.7399916648864746,
0.736627995967865,
0.7089481949806213,
0.7049529552459717,
0.7031874656677246,
0.7018918991088867,
0.6947417855262756,
0.6946127414703369,
0.6938015222549438,
0.6918237805366516,
0.6894639730453491,
0.6887726783752441,
0.687974214553833,
0.6872233152389526
],
[
17986,
151278,
158648,
214598,
219006,
15897,
245146,
58694,
42814,
27552,
74983,
226578,
57136,
135671,
15419,
202101,
130080,
53711,
255149,
262412
]
] |
|
print_squelch | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void print_squelch(FILE *out, int ctcs, int dcs)
{
if (ctcs)
fprintf(out, "%5.1f", ctcs / 10.0);
else if (dcs > 0)
fprintf(out, "D%03dN", dcs);
else if (dcs < 0)
fprintf(out, "D%03dI", -dcs);
else
fprintf(out, " - ");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40D08E", "function_addr": 4247694, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+var_C], esi"], [5, "mov [rbp+var_10], edx"], [6, "cmp [rbp+var_C], 0"], [7, "jz short loc_40D0DD"], [8, "pxor xmm0, xmm0"], [9, "cvtsi2sd xmm0, [rbp+var_C]"], [10, "movsd xmm1, cs:qword_415AC0"], [11, "divsd xmm0, xmm1"], [12, "movq rdx, xmm0"], [13, "mov rax, [rbp+stream]"], [14, "movq xmm0, rdx"], [15, "mov esi, offset a51f_1"], [16, "mov rdi, rax"], [17, "mov eax, 1"], [18, "call _fprintf"], [19, "jmp short loc_40D13E"], [20, "cmp [rbp+var_10], 0"], [21, "jle short loc_40D0FE"], [22, "mov edx, [rbp+var_10]"], [23, "mov rax, [rbp+stream]"], [24, "mov esi, offset aD03dn_1"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _fprintf"], [28, "jmp short loc_40D13E"], [29, "cmp [rbp+var_10], 0"], [30, "jns short loc_40D123"], [31, "mov eax, [rbp+var_10]"], [32, "neg eax"], [33, "mov edx, eax"], [34, "mov rax, [rbp+stream]"], [35, "mov esi, offset aD03di_2"], [36, "mov rdi, rax"], [37, "mov eax, 0"], [38, "call _fprintf"], [39, "jmp short loc_40D13E"], [40, "mov rax, [rbp+stream]"], [41, "mov rcx, rax"], [42, "mov edx, 5"], [43, "mov esi, 1"], [44, "mov edi, offset asc_415267"], [45, "call _fwrite"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[6, 4], [7, 6], [9, 8], [9, 4], [11, 10], [11, 9], [12, 11], [13, 3], [14, 12], [16, 13], [20, 5], [21, 20], [22, 5], [23, 3], [25, 23], [29, 5], [30, 29], [31, 5], [32, 31], [33, 32], [34, 3], [36, 34], [40, 3], [41, 40], [48, 27], [48, 45], [48, 38], [48, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_40D08E", "query": "\n\n\nint __fastcall sub_40D08E(FILE *a1, int a2, int a3)\n{\nif ( a2 )\nreturn fprintf(a1, \"%5.1f\", (double)a2 / 10.0);\nif ( a3 > 0 )\nreturn fprintf(a1, \"D%03dN\", (unsigned int)a3);\nif ( a3 >= 0 )\nreturn fwrite(\" - \", 1uLL, 5uLL, a1);\nreturn fprintf(a1, \"D%03dI\", (unsigned int)-a3);\n}\n\n\n\nQ:[a3,a1,a2,sub_40D08E,]", "hints": "[]", "response": "{'a3': 'dcs', 'a1': 'out', 'a2': 'ctcs', 'sub_40D08E': 'print_squelch_1'}"} | [
[
0.8292165398597717,
0.7946680784225464,
0.7760431170463562,
0.771689236164093,
0.7715530395507812,
0.7714418768882751,
0.76076340675354,
0.7576994895935059,
0.7561953067779541,
0.7459912300109863,
0.7385988235473633,
0.7377023696899414,
0.7323153018951416,
0.7322056889533997,
0.7268515825271606,
0.7243876457214355,
0.723939061164856,
0.7236566543579102,
0.7230733633041382,
0.7194545269012451
],
[
45277,
68183,
142936,
44205,
1243,
172711,
36700,
220523,
198720,
63762,
84484,
197757,
62003,
23074,
81667,
58016,
22925,
191413,
57033,
183872
]
] |
|
extract_compressed | c137d2e1de0eb5fa8b6d0867b12f020688b47a2ce12e25753c30d5076b60dbca | yquake2 | pakextract | NA | static void
extract_compressed(FILE* in, directory *d)
{
FILE *out;
if ((out = fopen(d->file_name, "w")) == NULL)
{
perror("Couldn't open outputfile");
return;
}
unsigned char *in_buf;
if ((in_buf = malloc(d->compressed_length)) == NULL)
{
perror("Couldn't allocate memory");
return;
}
unsigned char *out_buf;
if ((out_buf = calloc(1, d->file_length)) == NULL)
{
perror("Couldn't allocate memory");
return;
}
fseek(in, d->file_pos, SEEK_SET);
fread(in_buf, d->compressed_length, 1, in);
int read = 0;
int written = 0;
while (read < d->compressed_length)
{
unsigned char x = in_buf[read];
++read;
// x + 1 bytes of uncompressed data
if (x < 64)
{
memmove(out_buf + written, in_buf + read, x + 1);
read += x + 1;
written += x + 1;
}
// x - 62 zeros
else if (x < 128)
{
memset(out_buf + written, 0, x - 62);
written += x - 62;
}
// x - 126 times the next byte
else if (x < 192)
{
memset(out_buf + written, in_buf[read], x - 126);
++read;
written += x - 126;
}
// Reference previously uncompressed data
else if (x < 254)
{
memmove(out_buf + written, (out_buf + written) - ((int)in_buf[read] + 2), x - 190);
++read;
written += x - 190;
}
// Terminate
else if (x == 255)
{
break;
}
}
fwrite(out_buf, d->file_length, 1, out);
fclose(out);
free(in_buf);
free(out_buf);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40182A", "function_addr": 4200490, "binary_name": "c137d2e1de0eb5fa8b6d0867b12f020688b47a2ce12e25753c30d5076b60dbca.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+filename], rsi"], [5, "mov rax, [rbp+filename]"], [6, "mov esi, offset modes"], [7, "mov rdi, rax"], [8, "call _fopen"], [9, "mov [rbp+s], rax"], [10, "cmp [rbp+s], 0"], [11, "jnz short loc_401865"], [12, "mov edi, offset aCouldnTOpenOut"], [13, "call _perror"], [14, "jmp locret_401ACA"], [15, "mov rax, [rbp+filename]"], [16, "mov eax, [rax+80h]"], [17, "cdqe"], [18, "mov rdi, rax"], [19, "call _malloc"], [20, "mov [rbp+ptr], rax"], [21, "cmp [rbp+ptr], 0"], [22, "jnz short loc_401893"], [23, "mov edi, offset aCouldnTAllocat"], [24, "call _perror"], [25, "jmp locret_401ACA"], [26, "mov rax, [rbp+filename]"], [27, "mov eax, [rax+7Ch]"], [28, "cdqe"], [29, "mov rsi, rax"], [30, "mov edi, 1"], [31, "call _calloc"], [32, "mov [rbp+var_20], rax"], [33, "cmp [rbp+var_20], 0"], [34, "jnz short loc_4018C3"], [35, "mov edi, offset aCouldnTAllocat"], [36, "call _perror"], [37, "jmp locret_401ACA"], [38, "mov rax, [rbp+filename]"], [39, "mov eax, [rax+78h]"], [40, "movsxd rcx, eax"], [41, "mov rax, [rbp+stream]"], [42, "mov edx, 0"], [43, "mov rsi, rcx"], [44, "mov rdi, rax"], [45, "call _fseek"], [46, "mov rax, [rbp+filename]"], [47, "mov eax, [rax+80h]"], [48, "movsxd rsi, eax"], [49, "mov rdx, [rbp+stream]"], [50, "mov rax, [rbp+ptr]"], [51, "mov rcx, rdx"], [52, "mov edx, 1"], [53, "mov rdi, rax"], [54, "call _fread"], [55, "mov [rbp+var_4], 0"], [56, "mov [rbp+var_8], 0"], [57, "jmp loc_401A6E"], [58, "mov eax, [rbp+var_4]"], [59, "movsxd rdx, eax"], [60, "mov rax, [rbp+ptr]"], [61, "add rax, rdx"], [62, "movzx eax, byte ptr [rax]"], [63, "mov [rbp+var_21], al"], [64, "add [rbp+var_4], 1"], [65, "cmp [rbp+var_21], 3Fh "], [66, "ja short loc_40197E"], [67, "movzx eax, [rbp+var_21]"], [68, "add eax, 1"], [69, "cdqe"], [70, "mov edx, [rbp+var_4]"], [71, "movsxd rcx, edx"], [72, "mov rdx, [rbp+ptr]"], [73, "lea rsi, [rcx+rdx]"], [74, "mov edx, [rbp+var_8]"], [75, "movsxd rcx, edx"], [76, "mov rdx, [rbp+var_20]"], [77, "add rcx, rdx"], [78, "mov rdx, rax"], [79, "mov rdi, rcx"], [80, "call _memmove"], [81, "movzx eax, [rbp+var_21]"], [82, "add eax, 1"], [83, "add [rbp+var_4], eax"], [84, "movzx eax, [rbp+var_21]"], [85, "add eax, 1"], [86, "add [rbp+var_8], eax"], [87, "jmp loc_401A6E"], [88, "movzx eax, [rbp+var_21]"], [89, "test al, al"], [90, "js short loc_4019BB"], [91, "movzx eax, [rbp+var_21]"], [92, "sub eax, 3Eh "], [93, "cdqe"], [94, "mov edx, [rbp+var_8]"], [95, "movsxd rcx, edx"], [96, "mov rdx, [rbp+var_20]"], [97, "add rcx, rdx"], [98, "mov rdx, rax"], [99, "mov esi, 0"], [100, "mov rdi, rcx"], [101, "call _memset"], [102, "movzx eax, [rbp+var_21]"], [103, "sub eax, 3Eh "], [104, "add [rbp+var_8], eax"], [105, "jmp loc_401A6E"], [106, "cmp [rbp+var_21], 0BFh"], [107, "ja short loc_401A05"], [108, "movzx eax, [rbp+var_21]"], [109, "sub eax, 7Eh "], [110, "movsxd rdx, eax"], [111, "mov eax, [rbp+var_4]"], [112, "movsxd rcx, eax"], [113, "mov rax, [rbp+ptr]"], [114, "add rax, rcx"], [115, "movzx eax, byte ptr [rax]"], [116, "movzx eax, al"], [117, "mov ecx, [rbp+var_8]"], [118, "movsxd rsi, ecx"], [119, "mov rcx, [rbp+var_20]"], [120, "add rcx, rsi"], [121, "mov esi, eax"], [122, "mov rdi, rcx"], [123, "call _memset"], [124, "add [rbp+var_4], 1"], [125, "movzx eax, [rbp+var_21]"], [126, "sub eax, 7Eh "], [127, "add [rbp+var_8], eax"], [128, "jmp short loc_401A6E"], [129, "cmp [rbp+var_21], 0FDh"], [130, "ja short loc_401A68"], [131, "movzx eax, [rbp+var_21]"], [132, "sub eax, 0BEh"], [133, "cdqe"], [134, "mov edx, [rbp+var_8]"], [135, "movsxd rdx, edx"], [136, "mov ecx, [rbp+var_4]"], [137, "movsxd rsi, ecx"], [138, "mov rcx, [rbp+ptr]"], [139, "add rcx, rsi"], [140, "movzx ecx, byte ptr [rcx]"], [141, "movzx ecx, cl"], [142, "sub rdx, rcx"], [143, "lea rcx, [rdx-2]"], [144, "mov rdx, [rbp+var_20]"], [145, "lea rsi, [rcx+rdx]"], [146, "mov edx, [rbp+var_8]"], [147, "movsxd rcx, edx"], [148, "mov rdx, [rbp+var_20]"], [149, "add rcx, rdx"], [150, "mov rdx, rax"], [151, "mov rdi, rcx"], [152, "call _memmove"], [153, "add [rbp+var_4], 1"], [154, "movzx eax, [rbp+var_21]"], [155, "sub eax, 0BEh"], [156, "add [rbp+var_8], eax"], [157, "jmp short loc_401A6E"], [158, "cmp [rbp+var_21], 0FFh"], [159, "jz short loc_401A83"], [160, "mov rax, [rbp+filename]"], [161, "mov eax, [rax+80h]"], [162, "cmp [rbp+var_4], eax"], [163, "jl loc_401919"], [164, "jmp short loc_401A84"], [165, "nop"], [166, "mov rax, [rbp+filename]"], [167, "mov eax, [rax+7Ch]"], [168, "movsxd rsi, eax"], [169, "mov rdx, [rbp+s]"], [170, "mov rax, [rbp+var_20]"], [171, "mov rcx, rdx"], [172, "mov edx, 1"], [173, "mov rdi, rax"], [174, "call _fwrite"], [175, "mov rax, [rbp+s]"], [176, "mov rdi, rax"], [177, "call _fclose"], [178, "mov rax, [rbp+ptr]"], [179, "mov rdi, rax"], [180, "call _free"], [181, "mov rax, [rbp+var_20]"], [182, "mov rdi, rax"], [183, "call _free"], [184, "leave"], [185, "retn"]], "data_dep": [[5, 4], [7, 5], [9, 8], [10, 9], [11, 10], [15, 4], [16, 15], [18, 16], [20, 19], [21, 20], [22, 21], [26, 4], [27, 26], [29, 27], [32, 31], [33, 32], [34, 33], [38, 4], [39, 38], [40, 39], [41, 3], [43, 40], [44, 41], [46, 4], [47, 46], [48, 47], [49, 3], [50, 20], [51, 49], [53, 50], [58, 124], [58, 83], [58, 153], [58, 55], [58, 64], [59, 58], [60, 20], [61, 60], [61, 59], [62, 61], [63, 62], [64, 153], [64, 55], [64, 64], [64, 124], [64, 83], [65, 63], [66, 65], [67, 63], [68, 67], [70, 64], [71, 70], [72, 20], [73, 145], [73, 99], [73, 71], [73, 73], [73, 48], [73, 121], [74, 127], [74, 56], [74, 86], [74, 104], [74, 156], [75, 74], [76, 32], [77, 76], [77, 75], [78, 68], [79, 77], [81, 63], [82, 81], [83, 64], [83, 82], [84, 63], [85, 84], [86, 127], [86, 56], [86, 104], [86, 156], [86, 85], [86, 86], [88, 63], [89, 88], [90, 89], [91, 63], [92, 91], [94, 127], [94, 56], [94, 86], [94, 104], [94, 156], [95, 94], [96, 32], [97, 95], [97, 96], [98, 92], [100, 97], [102, 63], [103, 102], [104, 127], [104, 56], [104, 86], [104, 104], [104, 156], [104, 103], [106, 63], [107, 106], [108, 63], [109, 108], [110, 109], [111, 64], [112, 111], [113, 20], [114, 113], [114, 112], [115, 114], [116, 115], [117, 156], [117, 86], [117, 127], [117, 56], [117, 104], [118, 117], [119, 32], [120, 119], [120, 118], [121, 116], [122, 120], [124, 64], [125, 63], [126, 125], [127, 127], [127, 56], [127, 104], [127, 126], [127, 156], [127, 86], [129, 63], [130, 129], [131, 63], [132, 131], [134, 127], [134, 56], [134, 86], [134, 104], [134, 156], [135, 134], [136, 64], [137, 136], [138, 20], [139, 137], [139, 138], [140, 139], [141, 140], [142, 135], [142, 141], [143, 142], [143, 141], [144, 32], [145, 137], [145, 143], [146, 86], [146, 127], [146, 56], [146, 104], [146, 156], [147, 146], [148, 32], [149, 148], [149, 147], [150, 132], [151, 149], [153, 64], [154, 63], [155, 154], [156, 156], [156, 155], [156, 86], [156, 127], [156, 56], [156, 104], [158, 63], [159, 158], [160, 4], [161, 160], [162, 161], [162, 124], [162, 55], [162, 64], [162, 153], [162, 83], [163, 162], [166, 4], [167, 166], [168, 167], [169, 9], [170, 32], [171, 169], [173, 170], [175, 9], [176, 175], [178, 20], [179, 178], [181, 32], [182, 181], [185, 36], [185, 13], [185, 24], [185, 183]]}
| {"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_40182A", "query": "\n\n\nvoid __fastcall sub_40182A(FILE *a1, __int64 a2)\n{\nunsigned __int8 v2; // [rsp+1Fh] [rbp-21h]\nchar *v3; // [rsp+20h] [rbp-20h]\nunsigned __int8 *ptr; // [rsp+28h] [rbp-18h]\nFILE *s; // [rsp+30h] [rbp-10h]\nint v6; // [rsp+38h] [rbp-8h]\nint v7; // [rsp+3Ch] [rbp-4h]\n\ns = fopen((const char *)a2, \"w\");\nif ( s )\n{\nptr = (unsigned __int8 *)malloc(*(int *)(a2 + 128));\nif ( ptr && (v3 = (char *)calloc(1uLL, *(int *)(a2 + 124))) != 0LL )\n{\nfseek(a1, *(int *)(a2 + 120), 0);\nfread(ptr, *(int *)(a2 + 128), 1uLL, a1);\nv7 = 0;\nv6 = 0;\nwhile ( v7 < *(_DWORD *)(a2 + 128) )\n{\nv2 = ptr[v7++];\nif ( v2 > 0x3Fu )\n{\nif ( (v2 & 0x80u) != 0 )\n{\nif ( v2 > 0xBFu )\n{\nif ( v2 > 0xFDu )\n{\nif ( v2 == 0xFF )\nbreak;\n}\nelse\n{\nmemmove(&v3[v6], &v3[v6 - (unsigned __int64)ptr[v7++] - 2], v2 - 190);\nv6 += v2 - 190;\n}\n}\nelse\n{\nmemset(&v3[v6], ptr[v7++], v2 - 126);\nv6 += v2 - 126;\n}\n}\nelse\n{\nmemset(&v3[v6], 0, v2 - 62);\nv6 += v2 - 62;\n}\n}\nelse\n{\nmemmove(&v3[v6], &ptr[v7], v2 + 1);\nv7 += v2 + 1;\nv6 += v2 + 1;\n}\n}\nfwrite(v3, *(int *)(a2 + 124), 1uLL, s);\nfclose(s);\nfree(ptr);\nfree(v3);\n}\nelse\n{\nperror(\"Couldn't allocate memory\");\n}\n}\nelse\n{\nperror(\"Couldn't open outputfile\");\n}\n}\n\n\n\nQ:[a1,a2,v2,v3,ptr,s,v6,v7,sub_40182A,]", "hints": "[]", "response": "{'a1': 'in', 'a2': 'd', 'v2': 'x', 'v3': 'out_buf', 'ptr': 'in_buf', 's': 'out', 'v6': 'written', 'v7': 'read', 'sub_40182A': 'extract_compressed'}"} | [
[
0.7730808258056641,
0.7258918881416321,
0.7138122916221619,
0.7127344608306885,
0.711814284324646,
0.7105697989463806,
0.7103375196456909,
0.7083048224449158,
0.7031638622283936,
0.7024019956588745,
0.7013983726501465,
0.69912189245224,
0.6957907676696777,
0.6932386755943298,
0.692556619644165,
0.6902629137039185,
0.6848487854003906,
0.6847498416900635,
0.6841380596160889,
0.683400571346283
],
[
222597,
109039,
115647,
226113,
108150,
163316,
174130,
58247,
193465,
155441,
166454,
105620,
179160,
91920,
82505,
202684,
23629,
221732,
199405,
78937
]
] |
|
init_upvals | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static void init_upvals(bvm *vm, bntvclos *f)
{
int count = f->nupvals;
bupval **upvals = &be_ntvclos_upval(f, 0);
while (count--) {
bupval *uv = be_malloc(vm, sizeof(bupval)); /* was closed */
uv->value = &uv->u.value;
uv->refcnt = 1;
var_setnil(uv->value);
*upvals++ = uv;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41B123", "function_addr": 4305187, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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_30], rsi"], [5, "mov rax, [rbp+var_30]"], [6, "movzx eax, byte ptr [rax+0Ah]"], [7, "movzx eax, al"], [8, "mov [rbp+var_4], eax"], [9, "mov rax, [rbp+var_30]"], [10, "add rax, 20h "], [11, "mov [rbp+var_10], rax"], [12, "jmp short loc_41B1A9"], [13, "mov rax, [rbp+var_28]"], [14, "mov ecx, 20h "], [15, "mov edx, 0"], [16, "mov esi, 0"], [17, "mov rdi, rax"], [18, "call be_realloc"], [19, "mov [rbp+var_18], rax"], [20, "mov rax, [rbp+var_18]"], [21, "lea rdx, [rax+8]"], [22, "mov rax, [rbp+var_18]"], [23, "mov [rax], rdx"], [24, "mov rax, [rbp+var_18]"], [25, "mov dword ptr [rax+18h], 1"], [26, "mov rax, [rbp+var_18]"], [27, "mov rax, [rax]"], [28, "mov dword ptr [rax+8], 0"], [29, "mov rax, [rbp+var_10]"], [30, "lea rdx, [rax+8]"], [31, "mov [rbp+var_10], rdx"], [32, "mov rdx, [rbp+var_18]"], [33, "mov [rax], rdx"], [34, "mov eax, [rbp+var_4]"], [35, "lea edx, [rax-1]"], [36, "mov [rbp+var_4], edx"], [37, "test eax, eax"], [38, "jnz short loc_41B14F"], [39, "nop"], [40, "nop"], [41, "leave"], [42, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [8, 7], [9, 4], [10, 9], [11, 10], [13, 3], [17, 13], [19, 18], [20, 19], [21, 28], [21, 25], [21, 15], [21, 33], [21, 23], [21, 20], [22, 19], [23, 22], [23, 21], [24, 19], [25, 24], [26, 19], [27, 25], [27, 23], [27, 26], [28, 27], [29, 31], [29, 11], [30, 21], [30, 29], [30, 28], [31, 30], [32, 19], [33, 29], [33, 32], [34, 36], [34, 8], [35, 33], [35, 23], [35, 32], [35, 25], [35, 28], [35, 34], [36, 35], [37, 34], [38, 37], [42, 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_41B123", "query": "\n\n\n__int64 __fastcall sub_41B123(__int64 a1, __int64 a2)\n{\n_QWORD *v2; // rax\n__int64 result; // rax\n_DWORD *v4; // [rsp+18h] [rbp-18h]\n_QWORD *i; // [rsp+20h] [rbp-10h]\nunsigned int v6; // [rsp+2Ch] [rbp-4h]\n\nv6 = *(unsigned __int8 *)(a2 + 10);\nfor ( i = (_QWORD *)(a2 + 32); ; ++i )\n{\nresult = v6--;\nif ( !(_DWORD)result )\nbreak;\nv4 = be_realloc(a1, 0LL, 0LL, 0x20uLL);\n*(_QWORD *)v4 = v4 + 2;\nv4[6] = 1;\n*(_DWORD *)(*(_QWORD *)v4 + 8LL) = 0;\nv2 = i;\n*v2 = v4;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v4,i,v6,sub_41B123,]", "hints": "[]", "response": "{'a1': 'vm', 'a2': 'f', 'v4': 'uv', 'i': 'upvals', 'v6': 'count', 'sub_41B123': 'init_upvals'}"} | [
[
0.7779169678688049,
0.7433642148971558,
0.7335229516029358,
0.7287338972091675,
0.7257400155067444,
0.7161847352981567,
0.7141728401184082,
0.7038925886154175,
0.6999180316925049,
0.6968895196914673,
0.6946466565132141,
0.6907336711883545,
0.689505934715271,
0.6847312450408936,
0.6834825277328491,
0.6832382678985596,
0.6819179058074951,
0.6792200207710266,
0.6770302653312683,
0.6748930811882019
],
[
70986,
183377,
212958,
48290,
250382,
98448,
159377,
206086,
43463,
148251,
151056,
208561,
25199,
165437,
223466,
26747,
216960,
206685,
223024,
173918
]
] |
|
checksum | a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40 | vanhauser-thc | thc-hydra | NA | uint32_t checksum(struct rmessage *msg) {
int32_t blen;
uint8_t *stream;
uint32_t sum;
blen = msg->length; // Get the real length.
blen += (4 - (blen % 4));
// Allocate a worksapce.
stream = calloc(blen, sizeof(uint8_t));
memcpy(stream, &msg->type, sizeof(uint8_t));
memcpy(stream + 1, msg->data, blen - 1);
sum = 0;
for (blen -= sizeof(uint32_t); blen > 0; blen -= sizeof(uint32_t)) {
sum += *(uint32_t *)(stream + blen);
}
sum += *(uint32_t *)stream;
// Free the workspace.
free(stream);
return sum;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4434F8", "function_addr": 4470008, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov rax, fs:28h"], [5, "mov [rbp+var_8], rax"], [6, "xor eax, eax"], [7, "mov rax, [rbp+var_28]"], [8, "mov eax, [rax+4]"], [9, "mov [rbp+var_18], eax"], [10, "mov eax, [rbp+var_18]"], [11, "cdq"], [12, "shr edx, 1Eh"], [13, "add eax, edx"], [14, "and eax, 3"], [15, "sub eax, edx"], [16, "mov edx, eax"], [17, "mov eax, 4"], [18, "sub eax, edx"], [19, "add [rbp+var_18], eax"], [20, "mov eax, [rbp+var_18]"], [21, "cdqe"], [22, "mov esi, 1"], [23, "mov rdi, rax"], [24, "call _calloc"], [25, "mov [rbp+ptr], rax"], [26, "mov rax, [rbp+var_28]"], [27, "add rax, 0Ch"], [28, "movzx edx, byte ptr [rax]"], [29, "mov rax, [rbp+ptr]"], [30, "mov [rax], dl"], [31, "mov eax, [rbp+var_18]"], [32, "sub eax, 1"], [33, "cdqe"], [34, "mov rdx, [rbp+var_28]"], [35, "lea rsi, [rdx+0Dh]"], [36, "mov rdx, [rbp+ptr]"], [37, "lea rcx, [rdx+1]"], [38, "mov rdx, rax"], [39, "mov rdi, rcx"], [40, "call _memcpy"], [41, "mov [rbp+var_14], 0"], [42, "mov eax, [rbp+var_18]"], [43, "sub eax, 4"], [44, "mov [rbp+var_18], eax"], [45, "jmp short loc_4435AE"], [46, "mov eax, [rbp+var_18]"], [47, "movsxd rdx, eax"], [48, "mov rax, [rbp+ptr]"], [49, "add rax, rdx"], [50, "mov eax, [rax]"], [51, "add [rbp+var_14], eax"], [52, "mov eax, [rbp+var_18]"], [53, "sub eax, 4"], [54, "mov [rbp+var_18], eax"], [55, "cmp [rbp+var_18], 0"], [56, "jg short loc_443593"], [57, "mov rax, [rbp+ptr]"], [58, "mov eax, [rax]"], [59, "add [rbp+var_14], eax"], [60, "mov rax, [rbp+ptr]"], [61, "mov rdi, rax"], [62, "call _free"], [63, "mov eax, [rbp+var_14]"], [64, "mov rcx, [rbp+var_8]"], [65, "sub rcx, fs:28h"], [66, "jz short locret_4435E0"], [67, "call ___stack_chk_fail"], [68, "leave"], [69, "retn"]], "data_dep": [[5, 4], [7, 3], [8, 7], [9, 8], [10, 9], [13, 10], [13, 12], [14, 13], [15, 14], [15, 12], [16, 15], [18, 17], [18, 16], [19, 9], [19, 18], [20, 19], [23, 20], [25, 24], [26, 3], [27, 26], [28, 27], [29, 25], [30, 29], [30, 28], [31, 19], [32, 31], [34, 3], [35, 30], [35, 22], [35, 34], [36, 25], [37, 30], [37, 36], [38, 32], [39, 37], [42, 19], [43, 42], [44, 43], [46, 54], [46, 44], [47, 46], [48, 25], [49, 47], [49, 48], [50, 49], [50, 30], [51, 50], [51, 51], [51, 41], [52, 54], [52, 44], [53, 52], [54, 53], [55, 44], [55, 54], [56, 55], [57, 25], [58, 30], [58, 57], [59, 58], [59, 51], [59, 41], [60, 25], [61, 60], [63, 59], [64, 5], [65, 64], [66, 65], [69, 63]]}
| {"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_4434F8", "query": "\n\n\n__int64 __fastcall sub_4434F8(__int64 a1)\n{\nint v2; // [rsp+18h] [rbp-18h]\nint i; // [rsp+18h] [rbp-18h]\nint v4; // [rsp+1Ch] [rbp-14h]\nunsigned int v5; // [rsp+1Ch] [rbp-14h]\n_BYTE *ptr; // [rsp+20h] [rbp-10h]\n\nv2 = 4 - *(_DWORD *)(a1 + 4) % 4 + *(_DWORD *)(a1 + 4);\nptr = calloc(v2, 1uLL);\n*ptr = *(_BYTE *)(a1 + 12);\nmemcpy(ptr + 1, (const void *)(a1 + 13), v2 - 1);\nv4 = 0;\nfor ( i = v2 - 4; i > 0; i -= 4 )\nv4 += *(_DWORD *)&ptr[i];\nv5 = *(_DWORD *)ptr + v4;\nfree(ptr);\nreturn v5;\n}\n\n\n\nQ:[a1,v2,v4,ptr,sub_4434F8,]", "hints": "[]", "response": "{'a1': 'msg', 'v2': 'blen', 'v4': 'sum', 'ptr': 'stream', 'sub_4434F8': 'checksum'}"} | [
[
0.7625802755355835,
0.7541263103485107,
0.7396706342697144,
0.733069896697998,
0.7278815507888794,
0.7271532416343689,
0.7268173098564148,
0.7230286598205566,
0.7209651470184326,
0.7174983620643616,
0.717427134513855,
0.7155288457870483,
0.7147119045257568,
0.7137534022331238,
0.71292644739151,
0.7113187313079834,
0.7093318104743958,
0.7080725431442261,
0.7063375115394592,
0.7036610841751099
],
[
231884,
149110,
65869,
222258,
34645,
141597,
8139,
219306,
54358,
132174,
15088,
256701,
147782,
249703,
190172,
30353,
235644,
118281,
196622,
170153
]
] |
|
domain_compare | 89a9c1b8f9af20ca6897667f072aa5900d78d8b0e43ebee937509ffa8143ac6f | DNSPod | dnspod-sr | NA | int
domain_compare(const void *k1, const void *k2)
{
uchar *itor1 = NULL, *itor2 = NULL;
if (k1 == NULL)
return -1;
if (k2 == NULL)
return 1;
itor1 = (uchar *) k1;
itor2 = (uchar *) k2;
while (itor1[0] != 0) {
if (itor1[0] > itor2[0])
return 1;
if (itor1[0] < itor2[0])
return -1;
itor1++;
itor2++;
}
if (itor2[0] != 0)
return -1;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402829", "function_addr": 4204585, "binary_name": "89a9c1b8f9af20ca6897667f072aa5900d78d8b0e43ebee937509ffa8143ac6f.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_8], 0"], [5, "mov [rbp+var_10], 0"], [6, "cmp [rbp+var_18], 0"], [7, "jnz short loc_402853"], [8, "mov eax, 0FFFFFFFFh"], [9, "jmp short loc_4028D1"], [10, "cmp [rbp+var_20], 0"], [11, "jnz short loc_402861"], [12, "mov eax, 1"], [13, "jmp short loc_4028D1"], [14, "mov rax, [rbp+var_18]"], [15, "mov [rbp+var_8], rax"], [16, "mov rax, [rbp+var_20]"], [17, "mov [rbp+var_10], rax"], [18, "jmp short loc_4028AF"], [19, "mov rax, [rbp+var_8]"], [20, "movzx edx, byte ptr [rax]"], [21, "mov rax, [rbp+var_10]"], [22, "movzx eax, byte ptr [rax]"], [23, "cmp dl, al"], [24, "jbe short loc_40288C"], [25, "mov eax, 1"], [26, "jmp short loc_4028D1"], [27, "mov rax, [rbp+var_8]"], [28, "movzx edx, byte ptr [rax]"], [29, "mov rax, [rbp+var_10]"], [30, "movzx eax, byte ptr [rax]"], [31, "cmp dl, al"], [32, "jnb short loc_4028A5"], [33, "mov eax, 0FFFFFFFFh"], [34, "jmp short loc_4028D1"], [35, "add [rbp+var_8], 1"], [36, "add [rbp+var_10], 1"], [37, "mov rax, [rbp+var_8]"], [38, "movzx eax, byte ptr [rax]"], [39, "test al, al"], [40, "jnz short loc_402873"], [41, "mov rax, [rbp+var_10]"], [42, "movzx eax, byte ptr [rax]"], [43, "test al, al"], [44, "jz short loc_4028CC"], [45, "mov eax, 0FFFFFFFFh"], [46, "jmp short loc_4028D1"], [47, "mov eax, 0"], [48, "pop rbp"], [49, "retn"]], "data_dep": [[6, 2], [7, 6], [10, 3], [11, 10], [14, 2], [15, 14], [16, 3], [17, 16], [19, 15], [19, 35], [20, 19], [21, 36], [21, 17], [22, 21], [23, 22], [23, 20], [24, 23], [27, 15], [27, 35], [28, 27], [29, 17], [29, 36], [30, 29], [31, 28], [31, 30], [32, 31], [35, 35], [35, 15], [36, 36], [36, 17], [37, 15], [37, 35], [38, 37], [39, 38], [40, 39], [41, 36], [41, 17], [42, 41], [43, 42], [44, 43], [48, 0], [49, 47], [49, 25], [49, 8], [49, 12], [49, 33], [49, 45]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89a9c1b8f9af20ca6897667f072aa5900d78d8b0e43ebee937509ffa8143ac6f_89a9c1b8f9af20ca6897667f072aa5900d78d8b0e43ebee937509ffa8143ac6f.jsonl.gz", "strip_func_name": "sub_402829", "query": "\n\n\n__int64 __fastcall sub_402829(_BYTE *a1, _BYTE *a2)\n{\n__int64 result; // rax\n_BYTE *v3; // [rsp+10h] [rbp-10h]\n_BYTE *v4; // [rsp+18h] [rbp-8h]\n\nif ( !a1 )\nreturn 0xFFFFFFFFLL;\nif ( !a2 )\nreturn 1LL;\nv4 = a1;\nv3 = a2;\nwhile ( *v4 )\n{\nif ( *v4 > *v3 )\nreturn 1LL;\nif ( *v4 < *v3 )\nreturn 0xFFFFFFFFLL;\n++v4;\n++v3;\n}\nif ( *v3 )\nresult = 0xFFFFFFFFLL;\nelse\nresult = 0LL;\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,v4,sub_402829,]", "hints": "[]", "response": "{'a1': 'k1_0', 'a2': 'k2_0', 'v3': 'itor2', 'v4': 'itor1', 'sub_402829': 'domain_compare'}"} | [
[
0.8462299704551697,
0.844176709651947,
0.8243547677993774,
0.7959242463111877,
0.793199896812439,
0.7891539335250854,
0.7875242233276367,
0.7786361575126648,
0.7780304551124573,
0.7746745347976685,
0.7743664979934692,
0.7724858522415161,
0.7658986449241638,
0.7552486658096313,
0.754599392414093,
0.7503708004951477,
0.7483552694320679,
0.7464118599891663,
0.7449926137924194,
0.7445788383483887
],
[
63880,
96520,
41452,
87783,
197724,
66743,
261074,
160461,
158559,
78671,
112482,
241789,
58203,
23779,
80722,
7141,
134245,
61124,
31190,
75093
]
] |
|
ros_add_event | 163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad | haakonnessjoen | librouteros-api | NA | void ros_add_event(struct ros_connection *conn, struct ros_event *event) {
int idx = 0;
char isnew = 0;
if (conn->events == NULL) {
conn->max_events = 1;
conn->events = malloc(sizeof(struct ros_event **));
idx = 0;
isnew = 1;
} else {
int i;
idx = -1;
for (i = 0; i < conn->max_events; ++i) {
if (conn->events[i]->inuse == 0) {
idx = i;
break;
}
}
if (idx == -1) {
isnew = 1;
idx = conn->max_events++;
conn->events = realloc(conn->events, sizeof(struct ros_event **) * conn->max_events);
if (conn->events == NULL) {
fprintf(stderr, "Error allocating memory\n");
exit(1);
}
}
}
if (isnew) {
conn->events[idx] = malloc(sizeof(struct ros_event));
if (conn->events[idx] == NULL) {
fprintf(stderr, "Error allocating memory\n");
}
}
memcpy(conn->events[idx], event, sizeof(struct ros_event));
conn->events[idx]->inuse = 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402C37", "function_addr": 4205623, "binary_name": "163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 28h"], [4, "mov [rbp+var_28], rdi"], [5, "mov [rbp+src], rsi"], [6, "mov [rbp+var_14], 0"], [7, "mov [rbp+var_15], 0"], [8, "mov rax, [rbp+var_28]"], [9, "mov rax, [rax+10h]"], [10, "test rax, rax"], [11, "jnz short loc_402C90"], [12, "mov rax, [rbp+var_28]"], [13, "mov dword ptr [rax+18h], 1"], [14, "mov edi, 8"], [15, "call _malloc"], [16, "mov rdx, rax"], [17, "mov rax, [rbp+var_28]"], [18, "mov [rax+10h], rdx"], [19, "mov [rbp+var_14], 0"], [20, "mov [rbp+var_15], 1"], [21, "jmp loc_402D56"], [22, "mov [rbp+var_14], 0FFFFFFFFh"], [23, "mov [rbp+var_1C], 0"], [24, "jmp short loc_402CCB"], [25, "mov rax, [rbp+var_28]"], [26, "mov rdx, [rax+10h]"], [27, "mov eax, [rbp+var_1C]"], [28, "cdqe"], [29, "shl rax, 3"], [30, "add rax, rdx"], [31, "mov rax, [rax]"], [32, "movzx eax, byte ptr [rax+70h]"], [33, "test al, al"], [34, "jnz short loc_402CC7"], [35, "mov eax, [rbp+var_1C]"], [36, "mov [rbp+var_14], eax"], [37, "jmp short loc_402CD7"], [38, "add [rbp+var_1C], 1"], [39, "mov rax, [rbp+var_28]"], [40, "mov eax, [rax+18h]"], [41, "cmp [rbp+var_1C], eax"], [42, "jl short loc_402CA0"], [43, "cmp [rbp+var_14], 0FFFFFFFFh"], [44, "jnz short loc_402D56"], [45, "mov [rbp+var_15], 1"], [46, "mov rax, [rbp+var_28]"], [47, "mov eax, [rax+18h]"], [48, "lea ecx, [rax+1]"], [49, "mov rdx, [rbp+var_28]"], [50, "mov [rdx+18h], ecx"], [51, "mov [rbp+var_14], eax"], [52, "mov rax, [rbp+var_28]"], [53, "mov eax, [rax+18h]"], [54, "cdqe"], [55, "lea rdx, ds:0[rax*8]"], [56, "mov rax, [rbp+var_28]"], [57, "mov rax, [rax+10h]"], [58, "mov rsi, rdx"], [59, "mov rdi, rax"], [60, "call _realloc"], [61, "mov rdx, [rbp+var_28]"], [62, "mov [rdx+10h], rax"], [63, "mov rax, [rbp+var_28]"], [64, "mov rax, [rax+10h]"], [65, "test rax, rax"], [66, "jnz short loc_402D56"], [67, "mov rax, cs:stderr"], [68, "mov rcx, rax"], [69, "mov edx, 18h"], [70, "mov esi, 1"], [71, "mov edi, offset aErrorAllocatin_0"], [72, "call _fwrite"], [73, "mov edi, 1"], [74, "call _exit"], [75, "cmp [rbp+var_15], 0"], [76, "jz short loc_402DB8"], [77, "mov rax, [rbp+var_28]"], [78, "mov rdx, [rax+10h]"], [79, "mov eax, [rbp+var_14]"], [80, "cdqe"], [81, "shl rax, 3"], [82, "lea rbx, [rdx+rax]"], [83, "mov edi, 78h "], [84, "call _malloc"], [85, "mov [rbx], rax"], [86, "mov rax, [rbp+var_28]"], [87, "mov rdx, [rax+10h]"], [88, "mov eax, [rbp+var_14]"], [89, "cdqe"], [90, "shl rax, 3"], [91, "add rax, rdx"], [92, "mov rax, [rax]"], [93, "test rax, rax"], [94, "jnz short loc_402DB8"], [95, "mov rax, cs:stderr"], [96, "mov rcx, rax"], [97, "mov edx, 18h"], [98, "mov esi, 1"], [99, "mov edi, offset aErrorAllocatin_0"], [100, "call _fwrite"], [101, "mov rax, [rbp+var_28]"], [102, "mov rdx, [rax+10h]"], [103, "mov eax, [rbp+var_14]"], [104, "cdqe"], [105, "shl rax, 3"], [106, "add rax, rdx"], [107, "mov rax, [rax]"], [108, "mov rcx, [rbp+src]"], [109, "mov edx, 78h "], [110, "mov rsi, rcx"], [111, "mov rdi, rax"], [112, "call _memcpy"], [113, "mov rax, [rbp+var_28]"], [114, "mov rdx, [rax+10h]"], [115, "mov eax, [rbp+var_14]"], [116, "cdqe"], [117, "shl rax, 3"], [118, "add rax, rdx"], [119, "mov rax, [rax]"], [120, "mov byte ptr [rax+70h], 1"], [121, "nop"], [122, "mov rbx, [rbp+var_8]"], [123, "leave"], [124, "retn"]], "data_dep": [[8, 4], [9, 8], [10, 9], [11, 10], [12, 4], [13, 12], [16, 15], [17, 4], [18, 17], [18, 16], [25, 4], [26, 25], [27, 38], [27, 23], [29, 27], [30, 29], [30, 26], [31, 30], [32, 31], [33, 32], [34, 33], [35, 23], [35, 38], [36, 35], [38, 23], [38, 38], [39, 4], [40, 39], [41, 40], [41, 23], [41, 38], [42, 41], [43, 36], [43, 22], [44, 43], [46, 4], [47, 46], [48, 47], [49, 4], [50, 49], [50, 48], [51, 47], [52, 4], [53, 50], [53, 52], [55, 49], [56, 4], [57, 50], [57, 56], [58, 55], [59, 57], [61, 4], [62, 60], [62, 61], [63, 4], [64, 62], [64, 63], [65, 64], [66, 65], [68, 67], [75, 7], [75, 45], [75, 20], [76, 75], [77, 4], [78, 13], [78, 77], [78, 85], [78, 62], [78, 18], [78, 50], [79, 51], [79, 19], [79, 36], [79, 22], [81, 79], [82, 81], [82, 85], [82, 62], [82, 18], [82, 50], [82, 13], [85, 82], [85, 84], [86, 4], [87, 18], [87, 86], [87, 85], [88, 36], [88, 22], [88, 51], [88, 19], [90, 88], [91, 90], [91, 87], [92, 85], [92, 91], [93, 92], [94, 93], [96, 95], [101, 4], [102, 62], [102, 18], [102, 50], [102, 13], [102, 120], [102, 101], [102, 85], [103, 51], [103, 19], [103, 36], [103, 22], [105, 103], [106, 102], [106, 105], [107, 106], [107, 85], [107, 62], [107, 18], [107, 50], [107, 13], [107, 120], [108, 5], [110, 108], [111, 107], [113, 4], [114, 120], [114, 113], [114, 62], [114, 85], [114, 50], [114, 18], [114, 13], [115, 22], [115, 36], [115, 51], [115, 19], [117, 115], [118, 117], [118, 114], [119, 50], [119, 18], [119, 13], [119, 118], [119, 120], [119, 62], [119, 85], [120, 119], [124, 119]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad_163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad.jsonl.gz", "strip_func_name": "sub_402C37", "query": "\n\n\n__int64 __fastcall sub_402C37(__int64 a1, const void *a2)\n{\nint v2; // eax\nvoid **v3; // rbx\n__int64 result; // rax\nint i; // [rsp+14h] [rbp-1Ch]\nchar v6; // [rsp+1Bh] [rbp-15h]\nint v7; // [rsp+1Ch] [rbp-14h]\n\nv6 = 0;\nif ( *(_QWORD *)(a1 + 16) )\n{\nv7 = -1;\nfor ( i = 0; i < *(_DWORD *)(a1 + 24); ++i )\n{\nif ( !*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 16) + 8LL * i) + 112LL) )\n{\nv7 = i;\nbreak;\n}\n}\nif ( v7 == -1 )\n{\nv6 = 1;\nv2 = *(_DWORD *)(a1 + 24);\n*(_DWORD *)(a1 + 24) = v2 + 1;\nv7 = v2;\n*(_QWORD *)(a1 + 16) = realloc(*(void **)(a1 + 16), 8LL * *(int *)(a1 + 24));\nif ( !*(_QWORD *)(a1 + 16) )\n{\nfwrite(\"Error allocating memory\\n\", 1uLL, 0x18uLL, stderr);\nexit(1);\n}\n}\n}\nelse\n{\n*(_DWORD *)(a1 + 24) = 1;\n*(_QWORD *)(a1 + 16) = malloc(8uLL);\nv7 = 0;\nv6 = 1;\n}\nif ( v6 )\n{\nv3 = (void **)(*(_QWORD *)(a1 + 16) + 8LL * v7);\n*v3 = malloc(0x78uLL);\nif ( !*(_QWORD *)(*(_QWORD *)(a1 + 16) + 8LL * v7) )\nfwrite(\"Error allocating memory\\n\", 1uLL, 0x18uLL, stderr);\n}\nmemcpy(*(void **)(*(_QWORD *)(a1 + 16) + 8LL * v7), a2, 0x78uLL);\nresult = *(_QWORD *)(*(_QWORD *)(a1 + 16) + 8LL * v7);\n*(_BYTE *)(result + 112) = 1;\nreturn result;\n}\n\n\n\nQ:[a1,a2,v6,v7,sub_402C37,]", "hints": "[]", "response": "{'a1': 'conn', 'a2': 'event', 'v6': 'isnew', 'v7': 'idx', 'sub_402C37': 'ros_add_event'}"} | [
[
0.7949103116989136,
0.7891953587532043,
0.7388884425163269,
0.7176982164382935,
0.7173722982406616,
0.7112088203430176,
0.7111345529556274,
0.7107400894165039,
0.7107400894165039,
0.7107400894165039,
0.7107400894165039,
0.709022581577301,
0.7037577629089355,
0.70229172706604,
0.70038902759552,
0.6985821723937988,
0.6955528259277344,
0.6949843764305115,
0.6927733421325684,
0.6925803422927856
],
[
29207,
103080,
231245,
228944,
99172,
40520,
155904,
114252,
241828,
30667,
82841,
155748,
100530,
180328,
150681,
174435,
214295,
112696,
32738,
97535
]
] |
|
acpi_os_get_line | a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c | mandiant | rvmi-kvm | NA | acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read)
{
int input_char;
u32 end_of_line;
/* Standard acpi_os_get_line for all utilities except acpi_exec */
for (end_of_line = 0;; end_of_line++) {
if (end_of_line >= buffer_length) {
return (AE_BUFFER_OVERFLOW);
}
if ((input_char = getchar()) == EOF) {
return (AE_ERROR);
}
if (!input_char || input_char == _ASCII_NEWLINE) {
break;
}
buffer[end_of_line] = (char)input_char;
}
/* Null terminate the buffer */
buffer[end_of_line] = 0;
/* Return the number of bytes in the string */
if (bytes_read) {
*bytes_read = end_of_line;
}
return (AE_OK);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402B1A", "function_addr": 4205338, "binary_name": "a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov [rbp+var_28], rdx"], [6, "mov [rbp+var_4], 0"], [7, "mov eax, [rbp+var_4]"], [8, "cmp eax, [rbp+var_1C]"], [9, "jb short loc_402B43"], [10, "mov eax, 0Bh"], [11, "jmp short locret_402B9B"], [12, "call _getchar"], [13, "mov [rbp+var_8], eax"], [14, "cmp [rbp+var_8], 0FFFFFFFFh"], [15, "jnz short loc_402B58"], [16, "mov eax, 1"], [17, "jmp short locret_402B9B"], [18, "cmp [rbp+var_8], 0"], [19, "jz short loc_402B79"], [20, "cmp [rbp+var_8], 0Ah"], [21, "jz short loc_402B79"], [22, "mov edx, [rbp+var_4]"], [23, "mov rax, [rbp+var_18]"], [24, "add rax, rdx"], [25, "mov edx, [rbp+var_8]"], [26, "mov [rax], dl"], [27, "add [rbp+var_4], 1"], [28, "jmp short loc_402B34"], [29, "mov edx, [rbp+var_4]"], [30, "mov rax, [rbp+var_18]"], [31, "add rax, rdx"], [32, "mov byte ptr [rax], 0"], [33, "cmp [rbp+var_28], 0"], [34, "jz short loc_402B96"], [35, "mov rax, [rbp+var_28]"], [36, "mov edx, [rbp+var_4]"], [37, "mov [rax], edx"], [38, "mov eax, 0"], [39, "leave"], [40, "retn"]], "data_dep": [[7, 6], [7, 27], [8, 4], [8, 7], [9, 8], [13, 12], [14, 13], [15, 14], [18, 13], [19, 18], [20, 13], [21, 20], [22, 6], [22, 27], [23, 3], [24, 23], [24, 22], [25, 13], [26, 24], [26, 25], [27, 6], [27, 27], [29, 6], [29, 27], [30, 3], [31, 29], [31, 30], [32, 31], [33, 5], [34, 33], [35, 5], [36, 6], [36, 27], [37, 36], [37, 35], [40, 38], [40, 10], [40, 16]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c_a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c.jsonl.gz", "strip_func_name": "sub_402B1A", "query": "\n\n\n__int64 __fastcall sub_402B1A(__int64 a1, unsigned int a2, unsigned int *a3)\n{\nint v5; // [rsp+28h] [rbp-8h]\nunsigned int i; // [rsp+2Ch] [rbp-4h]\n\nfor ( i = 0; ; ++i )\n{\nif ( i >= a2 )\nreturn 11LL;\nv5 = getchar();\nif ( v5 == -1 )\nreturn 1LL;\nif ( !v5 || v5 == 10 )\nbreak;\n*(_BYTE *)(i + a1) = v5;\n}\n*(_BYTE *)(i + a1) = 0;\nif ( a3 )\n*a3 = i;\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,v5,i,sub_402B1A,]", "hints": "[]", "response": "{'a3': 'bytes_read', 'a1': 'buffer', 'a2': 'buffer_length', 'v5': 'input_char', 'i': 'end_of_line', 'sub_402B1A': 'acpi_os_get_line'}"} | [
[
0.9193446636199951,
0.7804639339447021,
0.7785042524337769,
0.7737494111061096,
0.740881621837616,
0.7256448268890381,
0.7219903469085693,
0.7211946845054626,
0.7179091572761536,
0.7123318910598755,
0.7110319137573242,
0.7074484825134277,
0.7073224782943726,
0.7013291120529175,
0.7004724144935608,
0.7003785371780396,
0.7002601623535156,
0.6997249126434326,
0.6971350908279419,
0.6960456967353821
],
[
102602,
241921,
82626,
146421,
204244,
46010,
84718,
198777,
103016,
65679,
190066,
105594,
53252,
27203,
172137,
128113,
88896,
238455,
175612,
11442
]
] |
|
buf_add4_le | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static size_t buf_add4_le(buf_impl* attr, const uint32_t data) // append 32 bits value
{
if (attr->len < attr->size - 3) { // do we have room for 4 bytes
attr->bufptr[attr->len++] = data;
attr->bufptr[attr->len++] = data >> 8;
attr->bufptr[attr->len++] = data >> 16;
attr->bufptr[attr->len++] = data >> 24;
}
return attr->len;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4157B8", "function_addr": 4282296, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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, "mov rax, [rbp+var_8]"], [5, "mov edx, [rax+4]"], [6, "mov rax, [rbp+var_8]"], [7, "mov eax, [rax]"], [8, "sub eax, 3"], [9, "cmp edx, eax"], [10, "jge loc_41587C"], [11, "mov rax, [rbp+var_8]"], [12, "mov rsi, [rax+8]"], [13, "mov rax, [rbp+var_8]"], [14, "mov eax, [rax+4]"], [15, "lea ecx, [rax+1]"], [16, "mov rdx, [rbp+var_8]"], [17, "mov [rdx+4], ecx"], [18, "cdqe"], [19, "add rax, rsi"], [20, "mov edx, [rbp+var_C]"], [21, "mov [rax], dl"], [22, "mov eax, [rbp+var_C]"], [23, "shr eax, 8"], [24, "mov edi, eax"], [25, "mov rax, [rbp+var_8]"], [26, "mov rsi, [rax+8]"], [27, "mov rax, [rbp+var_8]"], [28, "mov eax, [rax+4]"], [29, "lea ecx, [rax+1]"], [30, "mov rdx, [rbp+var_8]"], [31, "mov [rdx+4], ecx"], [32, "cdqe"], [33, "add rax, rsi"], [34, "mov edx, edi"], [35, "mov [rax], dl"], [36, "mov eax, [rbp+var_C]"], [37, "shr eax, 10h"], [38, "mov edi, eax"], [39, "mov rax, [rbp+var_8]"], [40, "mov rsi, [rax+8]"], [41, "mov rax, [rbp+var_8]"], [42, "mov eax, [rax+4]"], [43, "lea ecx, [rax+1]"], [44, "mov rdx, [rbp+var_8]"], [45, "mov [rdx+4], ecx"], [46, "cdqe"], [47, "add rax, rsi"], [48, "mov edx, edi"], [49, "mov [rax], dl"], [50, "mov eax, [rbp+var_C]"], [51, "shr eax, 18h"], [52, "mov edi, eax"], [53, "mov rax, [rbp+var_8]"], [54, "mov rsi, [rax+8]"], [55, "mov rax, [rbp+var_8]"], [56, "mov eax, [rax+4]"], [57, "lea ecx, [rax+1]"], [58, "mov rdx, [rbp+var_8]"], [59, "mov [rdx+4], ecx"], [60, "cdqe"], [61, "add rax, rsi"], [62, "mov edx, edi"], [63, "mov [rax], dl"], [64, "mov rax, [rbp+var_8]"], [65, "mov eax, [rax+4]"], [66, "cdqe"], [67, "pop rbp"], [68, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 2], [7, 6], [8, 7], [9, 8], [9, 5], [10, 9], [11, 2], [12, 11], [13, 2], [14, 13], [15, 14], [16, 2], [17, 16], [17, 15], [19, 12], [19, 14], [20, 3], [21, 20], [21, 19], [22, 3], [23, 22], [24, 23], [25, 2], [26, 21], [26, 25], [27, 2], [28, 21], [28, 27], [29, 15], [29, 28], [29, 21], [30, 2], [31, 29], [31, 30], [33, 26], [33, 28], [34, 24], [35, 33], [35, 34], [36, 3], [37, 36], [38, 37], [39, 2], [40, 35], [40, 39], [41, 2], [42, 41], [42, 35], [43, 29], [43, 42], [43, 35], [44, 2], [45, 43], [45, 44], [47, 40], [47, 42], [48, 38], [49, 48], [49, 47], [50, 3], [51, 50], [52, 51], [53, 2], [54, 49], [54, 53], [55, 2], [56, 55], [56, 49], [57, 43], [57, 56], [57, 49], [58, 2], [59, 57], [59, 58], [61, 54], [61, 56], [62, 52], [63, 61], [63, 62], [64, 2], [65, 45], [65, 63], [65, 31], [65, 49], [65, 17], [65, 35], [65, 21], [65, 64], [65, 59], [67, 0], [68, 65]]}
| {"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_4157B8", "query": "\n\n\n__int64 __fastcall sub_4157B8(__int64 a1, int a2)\n{\n__int64 v2; // rsi\nint v3; // eax\n__int64 v4; // rsi\nint v5; // eax\n__int64 v6; // rsi\nint v7; // eax\n__int64 v8; // rsi\nint v9; // eax\n\nif ( *(_DWORD *)(a1 + 4) < *(_DWORD *)a1 - 3 )\n{\nv2 = *(_QWORD *)(a1 + 8);\nv3 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v3 + 1;\n*(_BYTE *)(v2 + v3) = a2;\nv4 = *(_QWORD *)(a1 + 8);\nv5 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v5 + 1;\n*(_BYTE *)(v4 + v5) = BYTE1(a2);\nv6 = *(_QWORD *)(a1 + 8);\nv7 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v7 + 1;\n*(_BYTE *)(v6 + v7) = BYTE2(a2);\nv8 = *(_QWORD *)(a1 + 8);\nv9 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v9 + 1;\n*(_BYTE *)(v8 + v9) = HIBYTE(a2);\n}\nreturn *(int *)(a1 + 4);\n}\n\n\n\nQ:[a1,a2,sub_4157B8,]", "hints": "[]", "response": "{'a1': 'attr', 'a2': 'data', 'sub_4157B8': 'buf_add4_le'}"} | [
[
0.7737672924995422,
0.7491739988327026,
0.7457693815231323,
0.7434700727462769,
0.7312015295028687,
0.7169666290283203,
0.7136549949645996,
0.7094274759292603,
0.7046427726745605,
0.7035486698150635,
0.7028256058692932,
0.7016122937202454,
0.6992185711860657,
0.697380542755127,
0.697136402130127,
0.6970521211624146,
0.6969606280326843,
0.6961666345596313,
0.6956221461296082,
0.6946864128112793
],
[
40234,
118778,
254074,
118147,
80370,
20812,
75793,
160510,
107806,
38883,
123929,
81091,
163971,
213592,
168004,
134547,
177923,
102314,
239926,
127197
]
] |
|
parse_jobs | 07e2460f20c06c51008613ae4c4151a3c37cc679cbc844ff54fad72c4e2075d5 | leahneukirchen | xe | NA | int
parse_jobs(char *s)
{
char *e;
int n;
if (*s && s[strlen(s) - 1] == 'x') {
#ifdef _SC_NPROCESSORS_ONLN
n = (int)sysconf(_SC_NPROCESSORS_ONLN);
#else
n = 1;
#endif
double d = 0.0;
errno = 0;
d = strtod(s, &e);
if (errno != 0 || *e != 'x' || d <= 0) {
fprintf(stderr, "xe: can't parse multiplier '%s'.\n", s);
exit(1);
}
n = (int)(d * n);
if (n < 1)
n = 1;
} else if (strcmp(s, "j") == 0) {
n = -1;
} else {
errno = 0;
n = strtol(s, &e, 10);
if (errno != 0 || *e) {
fprintf(stderr, "xe: can't parse number '%s'.\n", s);
exit(1);
}
}
#ifdef _SC_NPROCESSORS_ONLN
if (n <= 0)
n = (int)sysconf(_SC_NPROCESSORS_ONLN);
#endif
if (n <= 0)
n = 1;
return n;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401EA8", "function_addr": 4202152, "binary_name": "07e2460f20c06c51008613ae4c4151a3c37cc679cbc844ff54fad72c4e2075d5.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, "movzx eax, byte ptr [rax]"], [6, "test al, al"], [7, "jz loc_401F95"], [8, "mov rax, [rbp+s]"], [9, "mov rdi, rax"], [10, "call _strlen"], [11, "lea rdx, [rax-1]"], [12, "mov rax, [rbp+s]"], [13, "add rax, rdx"], [14, "movzx eax, byte ptr [rax]"], [15, "cmp al, 78h "], [16, "jnz loc_401F95"], [17, "mov edi, 54h "], [18, "call _sysconf"], [19, "mov [rbp+var_4], eax"], [20, "pxor xmm0, xmm0"], [21, "movsd [rbp+var_10], xmm0"], [22, "call ___errno_location"], [23, "mov dword ptr [rax], 0"], [24, "lea rdx, [rbp+endptr]"], [25, "mov rax, [rbp+s]"], [26, "mov rsi, rdx"], [27, "mov rdi, rax"], [28, "call _strtod"], [29, "movq rax, xmm0"], [30, "mov [rbp+var_10], rax"], [31, "call ___errno_location"], [32, "mov eax, [rax]"], [33, "test eax, eax"], [34, "jnz short loc_401F43"], [35, "mov rax, [rbp+endptr]"], [36, "movzx eax, byte ptr [rax]"], [37, "cmp al, 78h "], [38, "jnz short loc_401F43"], [39, "pxor xmm0, xmm0"], [40, "comisd xmm0, [rbp+var_10]"], [41, "jb short loc_401F6A"], [42, "mov rax, cs:stderr"], [43, "mov rdx, [rbp+s]"], [44, "mov esi, offset aXeCanTParseMul"], [45, "mov rdi, rax"], [46, "mov eax, 0"], [47, "call _fprintf"], [48, "mov edi, 1"], [49, "call _exit"], [50, "pxor xmm0, xmm0"], [51, "cvtsi2sd xmm0, [rbp+var_4]"], [52, "mulsd xmm0, [rbp+var_10]"], [53, "cvttsd2si eax, xmm0"], [54, "mov [rbp+var_4], eax"], [55, "cmp [rbp+var_4], 0"], [56, "jg loc_402016"], [57, "mov [rbp+var_4], 1"], [58, "jmp loc_402016"], [59, "mov rax, [rbp+s]"], [60, "mov esi, offset s2"], [61, "mov rdi, rax"], [62, "call _strcmp"], [63, "test eax, eax"], [64, "jnz short loc_401FB3"], [65, "mov [rbp+var_4], 0FFFFFFFFh"], [66, "jmp short loc_402017"], [67, "call ___errno_location"], [68, "mov dword ptr [rax], 0"], [69, "lea rcx, [rbp+endptr]"], [70, "mov rax, [rbp+s]"], [71, "mov edx, 0Ah"], [72, "mov rsi, rcx"], [73, "mov rdi, rax"], [74, "call _strtol"], [75, "mov [rbp+var_4], eax"], [76, "call ___errno_location"], [77, "mov eax, [rax]"], [78, "test eax, eax"], [79, "jnz short loc_401FEF"], [80, "mov rax, [rbp+endptr]"], [81, "movzx eax, byte ptr [rax]"], [82, "test al, al"], [83, "jz short loc_402017"], [84, "mov rax, cs:stderr"], [85, "mov rdx, [rbp+s]"], [86, "mov esi, offset aXeCanTParseNum"], [87, "mov rdi, rax"], [88, "mov eax, 0"], [89, "call _fprintf"], [90, "mov edi, 1"], [91, "call _exit"], [92, "nop"], [93, "cmp [rbp+var_4], 0"], [94, "jg short loc_40202A"], [95, "mov edi, 54h "], [96, "call _sysconf"], [97, "mov [rbp+var_4], eax"], [98, "cmp [rbp+var_4], 0"], [99, "jg short loc_402037"], [100, "mov [rbp+var_4], 1"], [101, "mov eax, [rbp+var_4]"], [102, "leave"], [103, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [11, 10], [12, 3], [13, 12], [13, 11], [14, 13], [15, 14], [16, 15], [19, 18], [21, 20], [23, 22], [24, 11], [25, 3], [26, 24], [27, 25], [29, 20], [30, 29], [32, 23], [32, 31], [33, 32], [34, 33], [36, 35], [36, 23], [37, 36], [38, 37], [40, 30], [40, 39], [41, 37], [43, 3], [45, 42], [51, 50], [51, 19], [52, 51], [52, 30], [53, 52], [53, 36], [54, 53], [55, 54], [56, 55], [59, 3], [61, 59], [63, 62], [64, 63], [68, 67], [70, 3], [72, 69], [73, 70], [75, 74], [77, 76], [77, 68], [78, 77], [79, 78], [81, 80], [81, 68], [82, 81], [83, 82], [85, 3], [87, 84], [93, 54], [93, 65], [93, 57], [93, 75], [94, 93], [97, 96], [98, 57], [98, 75], [98, 54], [98, 65], [98, 97], [99, 98], [101, 97], [101, 57], [101, 75], [101, 100], [101, 54], [101, 65], [103, 101]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/07e2460f20c06c51008613ae4c4151a3c37cc679cbc844ff54fad72c4e2075d5_07e2460f20c06c51008613ae4c4151a3c37cc679cbc844ff54fad72c4e2075d5.jsonl.gz", "strip_func_name": "sub_401EA8", "query": "\n\n\n__int64 __fastcall sub_401EA8(const char *a1)\n{\nchar *endptr; // [rsp+18h] [rbp-18h] BYREF\ndouble v3; // [rsp+20h] [rbp-10h]\nint v4; // [rsp+2Ch] [rbp-4h]\n\nif ( *a1 && a1[strlen(a1) - 1] == 120 )\n{\nv4 = sysconf(84);\nv3 = 0.0;\n*__errno_location() = 0;\nv3 = strtod(a1, &endptr);\nif ( *__errno_location() || *endptr != 120 || v3 <= 0.0 )\n{\nfprintf(stderr, \"xe: can't parse multiplier '%s'.\\n\", a1);\nexit(1);\n}\nv4 = (int)((double)v4 * v3);\nif ( v4 <= 0 )\nv4 = 1;\n}\nelse if ( !strcmp(a1, \"j\") )\n{\nv4 = -1;\n}\nelse\n{\n*__errno_location() = 0;\nv4 = strtol(a1, &endptr, 10);\nif ( *__errno_location() || *endptr )\n{\nfprintf(stderr, \"xe: can't parse number '%s'.\\n\", a1);\nexit(1);\n}\n}\nif ( v4 <= 0 )\nv4 = sysconf(84);\nif ( v4 <= 0 )\nv4 = 1;\nreturn (unsigned int)v4;\n}\n\n\n\nQ:[a1,endptr,v3,v4,sub_401EA8,]", "hints": "[]", "response": "{'a1': 's', 'endptr': 'e', 'v3': 'd', 'v4': 'n', 'sub_401EA8': 'parse_jobs'}"} | [
[
0.7556212544441223,
0.7256355881690979,
0.7056536078453064,
0.7023235559463501,
0.6994001865386963,
0.6907970905303955,
0.6891311407089233,
0.6853342056274414,
0.6828739643096924,
0.6825637817382812,
0.671332597732544,
0.6650252342224121,
0.664091169834137,
0.6636552214622498,
0.6636303067207336,
0.6629505157470703,
0.6565583944320679,
0.6560996770858765,
0.6555935144424438,
0.6536319255828857
],
[
216503,
128419,
149345,
19806,
2206,
23808,
47724,
147895,
43595,
47320,
1428,
199975,
240835,
264061,
143319,
46047,
130822,
7723,
194317,
120589
]
] |
|
set_port | 8e54b9327a785ddec9542c4e806305e774a10a46bc1e2b094d53b7c5d2a9cefe | marcomorain | garcon | NA | static void set_port(command_t *self) {
struct options* options = self->data;
char* endptr = 0;
options->port = strtol(self->arg, &endptr, 10);
if (*endptr) {
fprintf(stderr, "Error: invalid port number: %s\n", self->arg);
exit(EXIT_FAILURE);
}
if (options->port > USHRT_MAX) {
fprintf(stderr, "Error: port number %ld is larger than the max %d\n",
options->port,
USHRT_MAX);
exit(EXIT_FAILURE);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407E40", "function_addr": 4226624, "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 [rbp+var_8], rax"], [7, "mov [rbp+endptr], 0"], [8, "mov rax, [rbp+var_18]"], [9, "mov rax, [rax+10h]"], [10, "lea rcx, [rbp+endptr]"], [11, "mov edx, 0Ah"], [12, "mov rsi, rcx"], [13, "mov rdi, rax"], [14, "call _strtol"], [15, "mov rdx, [rbp+var_8]"], [16, "mov [rdx+8], rax"], [17, "mov rax, [rbp+endptr]"], [18, "movzx eax, byte ptr [rax]"], [19, "test al, al"], [20, "jz short loc_407EB9"], [21, "mov rax, [rbp+var_18]"], [22, "mov rdx, [rax+10h]"], [23, "mov rax, cs:stderr"], [24, "mov esi, offset aErrorInvalidPo"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _fprintf"], [28, "mov edi, 1"], [29, "call _exit"], [30, "mov rax, [rbp+var_8]"], [31, "mov rax, [rax+8]"], [32, "cmp rax, 0FFFFh"], [33, "jle short loc_407EF9"], [34, "mov rax, [rbp+var_8]"], [35, "mov rdx, [rax+8]"], [36, "mov rax, cs:stderr"], [37, "mov ecx, 0FFFFh"], [38, "mov esi, offset aErrorPortNumbe"], [39, "mov rdi, rax"], [40, "mov eax, 0"], [41, "call _fprintf"], [42, "mov edi, 1"], [43, "call _exit"], [44, "nop"], [45, "leave"], [46, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [8, 3], [9, 8], [10, 7], [12, 10], [13, 9], [15, 6], [16, 15], [16, 14], [17, 7], [18, 17], [18, 16], [19, 18], [20, 19], [21, 3], [22, 16], [22, 21], [25, 23], [30, 6], [31, 16], [31, 30], [32, 31], [33, 32], [34, 6], [35, 16], [35, 34], [39, 36], [46, 31]]}
| {"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_407E40", "query": "\n\n\n__int64 __fastcall sub_407E40(__int64 a1)\n{\n__int64 v1; // rax\n__int64 result; // rax\nchar *endptr; // [rsp+10h] [rbp-10h] BYREF\n__int64 v4; // [rsp+18h] [rbp-8h]\n\nv4 = *(_QWORD *)a1;\nendptr = 0LL;\nv1 = strtol(*(const char **)(a1 + 16), &endptr, 10);\n*(_QWORD *)(v4 + 8) = v1;\nif ( *endptr )\n{\nfprintf(stderr, \"Error: invalid port number: %s\\n\", *(const char **)(a1 + 16));\nexit(1);\n}\nresult = *(_QWORD *)(v4 + 8);\nif ( result > 0xFFFF )\n{\nfprintf(stderr, \"Error: port number %ld is larger than the max %d\\n\", *(_QWORD *)(v4 + 8), 0xFFFFLL);\nexit(1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,v4,sub_407E40,]", "hints": "[]", "response": "{'a1': 'self', 'v4': 'options', 'sub_407E40': 'set_port'}"} | [
[
0.744024395942688,
0.7141364216804504,
0.7129639983177185,
0.7122810482978821,
0.7061326503753662,
0.7032694816589355,
0.7026242613792419,
0.6903403997421265,
0.6770631074905396,
0.6714479923248291,
0.6651361584663391,
0.6628116369247437,
0.6619223952293396,
0.6594561338424683,
0.6589353084564209,
0.6582359671592712,
0.6561071872711182,
0.6541779041290283,
0.6528017520904541,
0.652351975440979
],
[
237387,
59843,
47437,
176496,
147545,
239016,
151118,
39808,
180403,
20538,
155125,
3464,
259913,
8443,
59867,
82540,
173401,
154734,
37553,
231734
]
] |
|
lf_queue_push | 02ee8dd89a5a3f1bd68df2894715cd27f937b8d721d3a7b42127aff74759f7cc | haipome | lock_free_queue | NA | int lf_queue_push(lf_queue queue, void *unit)
{
if (!queue || !unit)
return -2;
volatile queue_head * head = queue;
volatile unit_head * u_head;
/* 检查队列是否可写 */
int32_t w_len;
do
{
if ((w_len = head->w_len) >= head->max_unit_num)
return -1;
} while (!__sync_bool_compare_and_swap(&head->w_len, w_len, w_len + 1));
/* 为新单元分配内存 */
int32_t w_tail, old_w_tail;
do
{
do
{
old_w_tail = w_tail = head->w_tail;
w_tail %= (head->max_unit_num + 1);
} while (!__sync_bool_compare_and_swap(&head->w_tail, old_w_tail, w_tail + 1));
u_head = UNIT_HEAD(queue, w_tail);
} while (u_head->use_flag);
/* 写单元头 */
u_head->next = LIST_END;
u_head->use_flag = true;
/* 写数据 */
memcpy(UNIT_DATA(queue, w_tail), unit, head->unit_size);
/* 将写完的单元插入链表尾 */
int32_t p_tail, old_p_tail;
int try_times = 0;
do
{
old_p_tail = p_tail = head->p_tail;
u_head = UNIT_HEAD(queue, p_tail);
if ((++try_times) >= 3)
{
while (u_head->next != LIST_END)
{
p_tail = u_head->next;
u_head = UNIT_HEAD(queue, p_tail);
}
}
} while (!__sync_bool_compare_and_swap(&u_head->next, LIST_END, w_tail));
/* 更新链表尾 */
__sync_val_compare_and_swap(&head->p_tail, old_p_tail, w_tail);
/* 更新读计数器 */
__sync_fetch_and_add(&head->r_len, 1);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40148F", "function_addr": 4199567, "binary_name": "02ee8dd89a5a3f1bd68df2894715cd27f937b8d721d3a7b42127aff74759f7cc.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+src], rsi"], [5, "cmp [rbp+var_38], 0"], [6, "jz short loc_4014AD"], [7, "cmp [rbp+src], 0"], [8, "jnz short loc_4014B7"], [9, "mov eax, 0FFFFFFFEh"], [10, "jmp locret_401694"], [11, "mov rax, [rbp+var_38]"], [12, "mov [rbp+var_18], rax"], [13, "mov rax, [rbp+var_18]"], [14, "mov eax, [rax+14h]"], [15, "mov [rbp+var_1C], eax"], [16, "mov rax, [rbp+var_18]"], [17, "mov eax, [rax+4]"], [18, "cmp [rbp+var_1C], eax"], [19, "jl short loc_4014DF"], [20, "mov eax, 0FFFFFFFFh"], [21, "jmp locret_401694"], [22, "mov eax, [rbp+var_1C]"], [23, "add eax, 1"], [24, "mov ecx, eax"], [25, "mov eax, [rbp+var_1C]"], [26, "mov rdx, [rbp+var_18]"], [27, "add rdx, 14h"], [28, "lock cmpxchg [rdx], ecx"], [29, "setz al"], [30, "xor eax, 1"], [31, "test al, al"], [32, "jnz short loc_4014BF"], [33, "mov rax, [rbp+var_18]"], [34, "mov eax, [rax+10h]"], [35, "mov [rbp+var_20], eax"], [36, "mov eax, [rbp+var_20]"], [37, "mov [rbp+var_24], eax"], [38, "mov rax, [rbp+var_18]"], [39, "mov eax, [rax+4]"], [40, "lea ecx, [rax+1]"], [41, "mov eax, [rbp+var_20]"], [42, "cdq"], [43, "idiv ecx"], [44, "mov [rbp+var_20], edx"], [45, "mov eax, [rbp+var_20]"], [46, "add eax, 1"], [47, "mov ecx, eax"], [48, "mov eax, [rbp+var_24]"], [49, "mov rdx, [rbp+var_18]"], [50, "add rdx, 10h"], [51, "lock cmpxchg [rdx], ecx"], [52, "setz al"], [53, "xor eax, 1"], [54, "test al, al"], [55, "jnz short loc_401500"], [56, "mov eax, [rbp+var_20]"], [57, "add eax, 1"], [58, "movsxd rdx, eax"], [59, "mov rax, [rbp+var_38]"], [60, "mov eax, [rax]"], [61, "cdqe"], [62, "add rax, 8"], [63, "imul rax, rdx"], [64, "lea rdx, [rax+1Ch]"], [65, "mov rax, [rbp+var_38]"], [66, "add rax, rdx"], [67, "mov [rbp+var_8], rax"], [68, "mov rax, [rbp+var_8]"], [69, "mov eax, [rax+4]"], [70, "test eax, eax"], [71, "jnz short loc_401500"], [72, "mov rax, [rbp+var_8]"], [73, "mov dword ptr [rax], 0FFFFFFFFh"], [74, "mov rax, [rbp+var_8]"], [75, "mov dword ptr [rax+4], 1"], [76, "mov rax, [rbp+var_18]"], [77, "mov eax, [rax]"], [78, "movsxd rdx, eax"], [79, "mov eax, [rbp+var_20]"], [80, "add eax, 1"], [81, "movsxd rcx, eax"], [82, "mov rax, [rbp+var_38]"], [83, "mov eax, [rax]"], [84, "cdqe"], [85, "add rax, 8"], [86, "imul rax, rcx"], [87, "lea rcx, [rax+1Ch]"], [88, "mov rax, [rbp+var_38]"], [89, "add rax, rcx"], [90, "lea rcx, [rax+8]"], [91, "mov rax, [rbp+src]"], [92, "mov rsi, rax"], [93, "mov rdi, rcx"], [94, "call _memcpy"], [95, "mov [rbp+var_C], 0"], [96, "mov rax, [rbp+var_18]"], [97, "mov eax, [rax+0Ch]"], [98, "mov [rbp+var_28], eax"], [99, "mov eax, [rbp+var_28]"], [100, "mov [rbp+var_2C], eax"], [101, "mov eax, [rbp+var_28]"], [102, "add eax, 1"], [103, "movsxd rdx, eax"], [104, "mov rax, [rbp+var_38]"], [105, "mov eax, [rax]"], [106, "cdqe"], [107, "add rax, 8"], [108, "imul rax, rdx"], [109, "lea rdx, [rax+1Ch]"], [110, "mov rax, [rbp+var_38]"], [111, "add rax, rdx"], [112, "mov [rbp+var_8], rax"], [113, "add [rbp+var_C], 1"], [114, "cmp [rbp+var_C], 2"], [115, "jle short loc_401653"], [116, "jmp short loc_401648"], [117, "mov rax, [rbp+var_8]"], [118, "mov eax, [rax]"], [119, "mov [rbp+var_28], eax"], [120, "mov eax, [rbp+var_28]"], [121, "add eax, 1"], [122, "movsxd rdx, eax"], [123, "mov rax, [rbp+var_38]"], [124, "mov eax, [rax]"], [125, "cdqe"], [126, "add rax, 8"], [127, "imul rax, rdx"], [128, "lea rdx, [rax+1Ch]"], [129, "mov rax, [rbp+var_38]"], [130, "add rax, rdx"], [131, "mov [rbp+var_8], rax"], [132, "mov rax, [rbp+var_8]"], [133, "mov eax, [rax]"], [134, "cmp eax, 0FFFFFFFFh"], [135, "jnz short loc_401617"], [136, "mov ecx, [rbp+var_20]"], [137, "mov rdx, [rbp+var_8]"], [138, "mov eax, 0FFFFFFFFh"], [139, "lock cmpxchg [rdx], ecx"], [140, "setz al"], [141, "xor eax, 1"], [142, "test al, al"], [143, "jnz loc_4015D3"], [144, "mov edx, [rbp+var_20]"], [145, "mov eax, [rbp+var_2C]"], [146, "mov rcx, [rbp+var_18]"], [147, "add rcx, 0Ch"], [148, "lock cmpxchg [rcx], edx"], [149, "mov rax, [rbp+var_18]"], [150, "add rax, 18h"], [151, "lock add dword ptr [rax], 1"], [152, "mov eax, 0"], [153, "leave"], [154, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [8, 7], [11, 3], [12, 11], [13, 12], [14, 13], [15, 14], [16, 12], [17, 16], [18, 17], [18, 15], [19, 18], [22, 15], [23, 22], [24, 23], [25, 15], [26, 12], [27, 26], [28, 24], [28, 28], [29, 27], [29, 25], [30, 29], [31, 30], [32, 31], [33, 12], [34, 33], [35, 34], [36, 35], [37, 36], [38, 12], [39, 38], [40, 47], [40, 24], [40, 39], [41, 35], [43, 40], [44, 64], [44, 50], [44, 27], [45, 44], [46, 45], [47, 46], [48, 37], [49, 12], [50, 49], [51, 47], [51, 51], [51, 28], [52, 48], [52, 50], [53, 52], [54, 53], [55, 54], [56, 44], [57, 56], [58, 57], [59, 3], [60, 59], [62, 60], [63, 58], [63, 62], [64, 63], [64, 58], [65, 3], [66, 64], [66, 65], [67, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 67], [73, 72], [74, 67], [75, 74], [76, 12], [77, 76], [77, 73], [77, 75], [78, 77], [79, 44], [80, 79], [81, 80], [82, 3], [83, 73], [83, 82], [83, 75], [85, 83], [86, 81], [86, 85], [87, 75], [87, 86], [87, 81], [88, 3], [89, 88], [89, 87], [90, 87], [90, 89], [90, 75], [91, 4], [92, 91], [93, 90], [96, 12], [97, 96], [97, 73], [97, 75], [98, 97], [99, 98], [100, 99], [101, 98], [102, 101], [103, 102], [104, 3], [105, 104], [105, 73], [105, 75], [107, 105], [108, 107], [108, 103], [109, 108], [109, 103], [109, 73], [109, 75], [110, 3], [111, 110], [111, 109], [112, 111], [113, 95], [113, 113], [114, 113], [115, 114], [117, 112], [117, 131], [118, 117], [118, 73], [118, 75], [119, 118], [120, 119], [121, 120], [122, 121], [123, 3], [124, 73], [124, 75], [124, 123], [126, 124], [127, 122], [127, 126], [128, 73], [128, 75], [128, 127], [128, 122], [129, 3], [130, 128], [130, 129], [131, 130], [132, 112], [132, 131], [133, 132], [133, 73], [133, 75], [134, 133], [135, 134], [136, 44], [137, 131], [137, 112], [139, 139], [139, 136], [139, 51], [140, 134], [140, 138], [140, 114], [141, 140], [142, 141], [143, 142], [144, 44], [145, 100], [146, 12], [147, 146], [148, 144], [149, 12], [150, 149], [154, 9], [154, 20], [154, 152]]}
| {"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_40148F", "query": "\n\n\n__int64 __fastcall sub_40148F(volatile signed __int32 *a1, const void *a2)\n{\nsigned __int32 v3; // [rsp+14h] [rbp-2Ch]\nsigned __int32 v4; // [rsp+1Ch] [rbp-24h]\nint v5; // [rsp+20h] [rbp-20h]\nsigned __int32 v6; // [rsp+24h] [rbp-1Ch]\nint v7; // [rsp+34h] [rbp-Ch]\n_DWORD *v8; // [rsp+38h] [rbp-8h]\nvolatile signed __int32 *v9; // [rsp+38h] [rbp-8h]\n\nif ( !a1 || !a2 )\nreturn 4294967294LL;\ndo\n{\nv6 = *((_DWORD *)a1 + 5);\nif ( v6 >= *((_DWORD *)a1 + 1) )\nreturn 0xFFFFFFFFLL;\n}\nwhile ( v6 != _InterlockedCompareExchange(a1 + 5, v6 + 1, v6) );\ndo\n{\ndo\n{\nv4 = *((_DWORD *)a1 + 4);\nv5 = v4 % (*((_DWORD *)a1 + 1) + 1);\n}\nwhile ( v4 != _InterlockedCompareExchange(a1 + 4, v5 + 1, v4) );\nv8 = (_DWORD *)((char *)a1 + (v5 + 1) * (*(int *)a1 + 8LL) + 28);\n}\nwhile ( v8[1] );\n*v8 = -1;\nv8[1] = 1;\nmemcpy((char *)a1 + (v5 + 1) * (*(int *)a1 + 8LL) + 36, a2, *(int *)a1);\nv7 = 0;\ndo\n{\nv3 = *((_DWORD *)a1 + 3);\nv9 = (volatile signed __int32 *)((char *)a1 + (v3 + 1) * (*(int *)a1 + 8LL) + 28);\nif ( ++v7 > 2 )\n{\nwhile ( *v9 != -1 )\nv9 = (volatile signed __int32 *)((char *)a1 + (*v9 + 1) * (*(int *)a1 + 8LL) + 28);\n}\n}\nwhile ( _InterlockedCompareExchange(v9, v5, -1) != -1 );\n_InterlockedCompareExchange(a1 + 3, v5, v3);\n_InterlockedAdd(a1 + 6, 1u);\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,v6,v7,v8,sub_40148F,]", "hints": "[]", "response": "{'a1': 'queue', 'a2': 'unit', 'v3': 'old_p_tail', 'v4': 'old_w_tail', 'v5': 'w_tail', 'v6': 'w_len', 'v7': 'try_times', 'v8': 'u_heada', 'sub_40148F': 'lf_queue_push'}"} | [
[
0.7785930633544922,
0.7398730516433716,
0.718066394329071,
0.7064638137817383,
0.6936037540435791,
0.6814709901809692,
0.6811545491218567,
0.6739559769630432,
0.6738384366035461,
0.6737465262413025,
0.6731639504432678,
0.671524703502655,
0.6701218485832214,
0.6687169671058655,
0.6673201322555542,
0.6672441363334656,
0.6663716435432434,
0.6646553874015808,
0.6634349822998047,
0.6620479822158813
],
[
16450,
129523,
252595,
213611,
259927,
215926,
54464,
37364,
160141,
176043,
16569,
47173,
2831,
163194,
49161,
143859,
138767,
35227,
154857,
76938
]
] |
|
begin_block | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static void begin_block(bfuncinfo *finfo, bblockinfo *binfo, int type)
{
binfo->prev = finfo->binfo; /* save previous block */
finfo->binfo = binfo; /* tell parser this is the current block */
binfo->type = (bbyte)type;
binfo->hasupval = 0;
binfo->sideeffect = 0;
binfo->beginpc = finfo->pc; /* set starting pc for this block */
binfo->nactlocals = (bbyte)be_list_count(finfo->local); /* count number of local variables in previous block */
if (type & BLOCK_LOOP) {
binfo->breaklist = NO_JUMP;
binfo->continuelist = NO_JUMP;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_431379", "function_addr": 4395897, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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_14], edx"], [5, "mov rax, [rbp+var_8]"], [6, "mov rdx, [rax+10h]"], [7, "mov rax, [rbp+var_10]"], [8, "mov [rax], rdx"], [9, "mov rax, [rbp+var_8]"], [10, "mov rdx, [rbp+var_10]"], [11, "mov [rax+10h], rdx"], [12, "mov eax, [rbp+var_14]"], [13, "mov edx, eax"], [14, "mov rax, [rbp+var_10]"], [15, "mov [rax+9], dl"], [16, "mov rax, [rbp+var_10]"], [17, "mov byte ptr [rax+0Ah], 0"], [18, "mov rax, [rbp+var_8]"], [19, "mov edx, [rax+90h]"], [20, "mov rax, [rbp+var_10]"], [21, "mov [rax+10h], edx"], [22, "mov rax, [rbp+var_8]"], [23, "mov rax, [rax+20h]"], [24, "mov eax, [rax+18h]"], [25, "mov edx, eax"], [26, "mov rax, [rbp+var_10]"], [27, "mov [rax+8], dl"], [28, "mov eax, [rbp+var_14]"], [29, "and eax, 1"], [30, "test eax, eax"], [31, "jz short loc_4313FC"], [32, "mov rax, [rbp+var_10]"], [33, "mov dword ptr [rax+0Ch], 0FFFFFFFFh"], [34, "mov rax, [rbp+var_10]"], [35, "mov dword ptr [rax+14h], 0FFFFFFFFh"], [36, "nop"], [37, "pop rbp"], [38, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 3], [8, 6], [8, 7], [9, 2], [10, 3], [11, 10], [11, 9], [12, 4], [13, 12], [14, 3], [15, 14], [15, 13], [16, 3], [17, 16], [18, 2], [19, 18], [19, 17], [20, 3], [21, 19], [21, 20], [22, 2], [23, 22], [23, 21], [24, 23], [24, 21], [25, 24], [26, 3], [27, 25], [27, 26], [28, 4], [29, 28], [30, 29], [31, 30], [32, 3], [33, 32], [34, 3], [35, 34], [37, 0], [38, 34], [38, 30]]}
| {"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_431379", "query": "\n\n\n__int64 __fastcall sub_431379(__int64 a1, __int64 a2, unsigned __int8 a3)\n{\n__int64 result; // rax\n\n*(_QWORD *)a2 = *(_QWORD *)(a1 + 16);\n*(_QWORD *)(a1 + 16) = a2;\n*(_WORD *)(a2 + 9) = a3;\n*(_DWORD *)(a2 + 16) = *(_DWORD *)(a1 + 144);\n*(_BYTE *)(a2 + 8) = *(_DWORD *)(*(_QWORD *)(a1 + 32) + 24LL);\nresult = a3 & 1;\nif ( (a3 & 1) != 0 )\n{\n*(_DWORD *)(a2 + 12) = -1;\nresult = a2;\n*(_DWORD *)(a2 + 20) = -1;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_431379,]", "hints": "[]", "response": "{'a3': 'type', 'a1': 'finfo', 'a2': 'binfo', 'sub_431379': 'begin_block'}"} | [
[
0.7523139119148254,
0.7508837580680847,
0.7349988222122192,
0.7347346544265747,
0.7330327033996582,
0.7272888422012329,
0.7271133661270142,
0.7269678711891174,
0.7223978638648987,
0.7220820784568787,
0.7140565514564514,
0.7131540179252625,
0.7075679302215576,
0.7044232487678528,
0.7023723721504211,
0.7007266879081726,
0.6978644132614136,
0.6950445175170898,
0.6933225393295288,
0.6928316950798035
],
[
28788,
138459,
101430,
75108,
73730,
25892,
144837,
79416,
187130,
112224,
82487,
238748,
24106,
92918,
221573,
146003,
255365,
24755,
109260,
184123
]
] |
|
read_events | 994a98b83871aeefd80b5c457febff9397911ef8d4d74123c545d6fe38796bf6 | troydhanson | examples | NA | int read_events(int fd, struct inotify_event *eb) {
struct inotify_event *ev, *nx;
char *dir = "<dir>", *name;
size_t sz;
int rc;
while ( (rc=read(fd,eb,eb_sz)) > 0) {
for(ev = eb; rc > 0; ev = nx) {
sz = sizeof(*ev) + ev->len;
nx = (struct inotify_event*)((char*)ev + sz);
rc -= sz;
name = (ev->len ? ev->name : dir);
printf("%s ", name);
if (ev->mask & IN_ACCESS) printf(" IN_ACCESS");
if (ev->mask & IN_MODIFY) printf(" IN_MODIFY");
if (ev->mask & IN_ATTRIB) printf(" IN_ATTRIB");
if (ev->mask & IN_CLOSE_WRITE) printf(" IN_CLOSE_WRITE");
if (ev->mask & IN_CLOSE_NOWRITE) printf(" IN_CLOSE_NOWRITE");
if (ev->mask & IN_OPEN) printf(" IN_OPEN");
if (ev->mask & IN_MOVED_FROM) printf(" IN_MOVED_FROM");
if (ev->mask & IN_MOVED_TO) printf(" IN_MOVED_TO");
if (ev->mask & IN_CREATE) printf(" IN_CREATE");
if (ev->mask & IN_DELETE) printf(" IN_DELETE");
if (ev->mask & IN_DELETE_SELF) printf(" IN_DELETE_SELF");
if (ev->mask & IN_MOVE_SELF) printf(" IN_MOVE_SELF");
printf("\n");
}
}
return rc;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401371", "function_addr": 4199281, "binary_name": "994a98b83871aeefd80b5c457febff9397911ef8d4d74123c545d6fe38796bf6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+buf], rsi"], [5, "mov [rbp+var_18], offset aDir"], [6, "jmp loc_40157B"], [7, "mov rax, [rbp+buf]"], [8, "mov [rbp+var_8], rax"], [9, "jmp loc_401571"], [10, "mov rax, [rbp+var_8]"], [11, "mov eax, [rax+0Ch]"], [12, "mov eax, eax"], [13, "add rax, 10h"], [14, "mov [rbp+var_20], rax"], [15, "mov rdx, [rbp+var_8]"], [16, "mov rax, [rbp+var_20]"], [17, "add rax, rdx"], [18, "mov [rbp+var_28], rax"], [19, "mov eax, [rbp+var_C]"], [20, "mov rdx, [rbp+var_20]"], [21, "sub eax, edx"], [22, "mov [rbp+var_C], eax"], [23, "mov rax, [rbp+var_8]"], [24, "mov eax, [rax+0Ch]"], [25, "test eax, eax"], [26, "jz short loc_4013DB"], [27, "mov rax, [rbp+var_8]"], [28, "add rax, 10h"], [29, "jmp short loc_4013DF"], [30, "mov rax, [rbp+var_18]"], [31, "mov [rbp+var_30], rax"], [32, "mov rax, [rbp+var_30]"], [33, "mov rsi, rax"], [34, "mov edi, offset aS"], [35, "mov eax, 0"], [36, "call _printf"], [37, "mov rax, [rbp+var_8]"], [38, "mov eax, [rax+4]"], [39, "and eax, 1"], [40, "test eax, eax"], [41, "jz short loc_401416"], [42, "mov edi, offset aInAccess"], [43, "mov eax, 0"], [44, "call _printf"], [45, "mov rax, [rbp+var_8]"], [46, "mov eax, [rax+4]"], [47, "and eax, 2"], [48, "test eax, eax"], [49, "jz short loc_401433"], [50, "mov edi, offset aInModify"], [51, "mov eax, 0"], [52, "call _printf"], [53, "mov rax, [rbp+var_8]"], [54, "mov eax, [rax+4]"], [55, "and eax, 4"], [56, "test eax, eax"], [57, "jz short loc_401450"], [58, "mov edi, offset aInAttrib"], [59, "mov eax, 0"], [60, "call _printf"], [61, "mov rax, [rbp+var_8]"], [62, "mov eax, [rax+4]"], [63, "and eax, 8"], [64, "test eax, eax"], [65, "jz short loc_40146D"], [66, "mov edi, offset aInCloseWrite"], [67, "mov eax, 0"], [68, "call _printf"], [69, "mov rax, [rbp+var_8]"], [70, "mov eax, [rax+4]"], [71, "and eax, 10h"], [72, "test eax, eax"], [73, "jz short loc_40148A"], [74, "mov edi, offset aInCloseNowrite"], [75, "mov eax, 0"], [76, "call _printf"], [77, "mov rax, [rbp+var_8]"], [78, "mov eax, [rax+4]"], [79, "and eax, 20h"], [80, "test eax, eax"], [81, "jz short loc_4014A7"], [82, "mov edi, offset aInOpen"], [83, "mov eax, 0"], [84, "call _printf"], [85, "mov rax, [rbp+var_8]"], [86, "mov eax, [rax+4]"], [87, "and eax, 40h"], [88, "test eax, eax"], [89, "jz short loc_4014C4"], [90, "mov edi, offset aInMovedFrom"], [91, "mov eax, 0"], [92, "call _printf"], [93, "mov rax, [rbp+var_8]"], [94, "mov eax, [rax+4]"], [95, "and eax, 80h"], [96, "test eax, eax"], [97, "jz short loc_4014E3"], [98, "mov edi, offset aInMovedTo"], [99, "mov eax, 0"], [100, "call _printf"], [101, "mov rax, [rbp+var_8]"], [102, "mov eax, [rax+4]"], [103, "and eax, 100h"], [104, "test eax, eax"], [105, "jz short loc_401502"], [106, "mov edi, offset aInCreate"], [107, "mov eax, 0"], [108, "call _printf"], [109, "mov rax, [rbp+var_8]"], [110, "mov eax, [rax+4]"], [111, "and eax, 200h"], [112, "test eax, eax"], [113, "jz short loc_401521"], [114, "mov edi, offset aInDelete"], [115, "mov eax, 0"], [116, "call _printf"], [117, "mov rax, [rbp+var_8]"], [118, "mov eax, [rax+4]"], [119, "and eax, 400h"], [120, "test eax, eax"], [121, "jz short loc_401540"], [122, "mov edi, offset aInDeleteSelf"], [123, "mov eax, 0"], [124, "call _printf"], [125, "mov rax, [rbp+var_8]"], [126, "mov eax, [rax+4]"], [127, "and eax, 800h"], [128, "test eax, eax"], [129, "jz short loc_40155F"], [130, "mov edi, offset aInMoveSelf"], [131, "mov eax, 0"], [132, "call _printf"], [133, "mov edi, 0Ah"], [134, "call _putchar"], [135, "mov rax, [rbp+var_28]"], [136, "mov [rbp+var_8], rax"], [137, "cmp [rbp+var_C], 0"], [138, "jg loc_40139A"], [139, "mov edx, 1010h"], [140, "mov rcx, [rbp+buf]"], [141, "mov eax, [rbp+fd]"], [142, "mov rsi, rcx"], [143, "mov edi, eax"], [144, "call _read"], [145, "mov [rbp+var_C], eax"], [146, "cmp [rbp+var_C], 0"], [147, "jg loc_40138D"], [148, "mov eax, [rbp+var_C]"], [149, "leave"], [150, "retn"]], "data_dep": [[7, 4], [8, 7], [10, 8], [10, 136], [11, 10], [12, 11], [13, 12], [14, 13], [15, 8], [15, 136], [16, 14], [17, 16], [17, 15], [18, 17], [19, 22], [19, 145], [20, 14], [21, 20], [21, 19], [22, 21], [23, 8], [23, 136], [24, 23], [25, 24], [26, 25], [27, 8], [27, 136], [28, 27], [30, 5], [31, 28], [31, 30], [32, 31], [33, 32], [37, 8], [37, 136], [38, 37], [39, 38], [40, 39], [41, 40], [45, 8], [45, 136], [46, 45], [47, 46], [48, 47], [49, 48], [53, 8], [53, 136], [54, 53], [55, 54], [56, 55], [57, 56], [61, 8], [61, 136], [62, 61], [63, 62], [64, 63], [65, 64], [69, 8], [69, 136], [70, 69], [71, 70], [72, 71], [73, 72], [77, 8], [77, 136], [78, 77], [79, 78], [80, 79], [81, 80], [85, 8], [85, 136], [86, 85], [87, 86], [88, 87], [89, 88], [93, 8], [93, 136], [94, 93], [95, 94], [96, 95], [97, 96], [101, 8], [101, 136], [102, 101], [103, 102], [104, 103], [105, 104], [109, 8], [109, 136], [110, 109], [111, 110], [112, 111], [113, 112], [117, 8], [117, 136], [118, 117], [119, 118], [120, 119], [121, 120], [125, 8], [125, 136], [126, 125], [127, 126], [128, 127], [129, 128], [135, 18], [136, 135], [137, 145], [137, 22], [138, 137], [140, 4], [141, 3], [142, 140], [143, 141], [145, 144], [146, 145], [147, 146], [148, 145], [150, 148]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/994a98b83871aeefd80b5c457febff9397911ef8d4d74123c545d6fe38796bf6_994a98b83871aeefd80b5c457febff9397911ef8d4d74123c545d6fe38796bf6.jsonl.gz", "strip_func_name": "sub_401371", "query": "\n\n\n__int64 __fastcall sub_401371(int a1, unsigned int *a2)\n{\nconst char *v2; // rax\n__int64 result; // rax\n__int64 v4; // [rsp+20h] [rbp-20h]\nint v5; // [rsp+34h] [rbp-Ch]\nunsigned int *v6; // [rsp+38h] [rbp-8h]\n\nwhile ( 1 )\n{\nLODWORD(result) = read(a1, a2, 0x1010uLL);\nv5 = result;\nif ( (int)result <= 0 )\nbreak;\nv6 = a2;\nwhile ( v5 > 0 )\n{\nv4 = v6[3] + 16LL;\nv5 -= v4;\nif ( v6[3] )\nv2 = (const char *)(v6 + 4);\nelse\nv2 = \"<dir>\";\nprintf(\"%s \", v2);\nif ( (v6[1] & 1) != 0 )\nprintf(\" IN_ACCESS\");\nif ( (v6[1] & 2) != 0 )\nprintf(\" IN_MODIFY\");\nif ( (v6[1] & 4) != 0 )\nprintf(\" IN_ATTRIB\");\nif ( (v6[1] & 8) != 0 )\nprintf(\" IN_CLOSE_WRITE\");\nif ( (v6[1] & 0x10) != 0 )\nprintf(\" IN_CLOSE_NOWRITE\");\nif ( (v6[1] & 0x20) != 0 )\nprintf(\" IN_OPEN\");\nif ( (v6[1] & 0x40) != 0 )\nprintf(\" IN_MOVED_FROM\");\nif ( (v6[1] & 0x80) != 0 )\nprintf(\" IN_MOVED_TO\");\nif ( (v6[1] & 0x100) != 0 )\nprintf(\" IN_CREATE\");\nif ( (v6[1] & 0x200) != 0 )\nprintf(\" IN_DELETE\");\nif ( (v6[1] & 0x400) != 0 )\nprintf(\" IN_DELETE_SELF\");\nif ( (v6[1] & 0x800) != 0 )\nprintf(\" IN_MOVE_SELF\");\nputchar(10);\nv6 = (unsigned int *)((char *)v6 + v4);\n}\n}\nreturn (unsigned int)result;\n}\n\n\n\nQ:[a1,a2,v4,v5,v6,sub_401371,]", "hints": "[]", "response": "{'a1': 'fd', 'a2': 'eb', 'v4': 'sz', 'v5': 'rc', 'v6': 'ev', 'sub_401371': 'read_events'}"} | [
[
0.7056789398193359,
0.6963435411453247,
0.6930351853370667,
0.6610064506530762,
0.6581507921218872,
0.6526267528533936,
0.6522942781448364,
0.6508533358573914,
0.6491671800613403,
0.6476582288742065,
0.6467334032058716,
0.6441863179206848,
0.6406257152557373,
0.6393527984619141,
0.6382201910018921,
0.6369754672050476,
0.6272714734077454,
0.6255009174346924,
0.6243464350700378,
0.6236781477928162
],
[
220107,
205495,
14535,
82413,
238177,
126352,
139907,
119405,
139609,
136661,
209233,
252919,
127452,
62846,
164941,
180345,
115502,
12250,
52548,
55322
]
] |
|
init_sockin | 3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413 | emikulic | darkhttpd | NA | static void init_sockin(void) {
struct sockaddr_in addrin;
#ifdef HAVE_INET6
struct sockaddr_in6 addrin6;
#endif
socklen_t addrin_len;
int sockopt;
#ifdef HAVE_INET6
if (inet6) {
memset(&addrin6, 0, sizeof(addrin6));
if (inet_pton(AF_INET6, bindaddr ? bindaddr : "::",
&addrin6.sin6_addr) == -1) {
errx(1, "malformed --addr argument");
}
sockin = socket(PF_INET6, SOCK_STREAM, 0);
} else
#endif
{
memset(&addrin, 0, sizeof(addrin));
addrin.sin_addr.s_addr = bindaddr ? inet_addr(bindaddr) : INADDR_ANY;
if (addrin.sin_addr.s_addr == (in_addr_t)INADDR_NONE)
errx(1, "malformed --addr argument");
sockin = socket(PF_INET, SOCK_STREAM, 0);
}
if (sockin == -1)
err(1, "socket()");
/* reuse address */
sockopt = 1;
if (setsockopt(sockin, SOL_SOCKET, SO_REUSEADDR,
&sockopt, sizeof(sockopt)) == -1)
err(1, "setsockopt(SO_REUSEADDR)");
/* disable Nagle since we buffer everything ourselves */
sockopt = 1;
if (setsockopt(sockin, IPPROTO_TCP, TCP_NODELAY,
&sockopt, sizeof(sockopt)) == -1)
err(1, "setsockopt(TCP_NODELAY)");
#ifdef TORTURE
/* torture: cripple the kernel-side send buffer so we can only squeeze out
* one byte at a time (this is for debugging)
*/
sockopt = 1;
if (setsockopt(sockin, SOL_SOCKET, SO_SNDBUF,
&sockopt, sizeof(sockopt)) == -1)
err(1, "setsockopt(SO_SNDBUF)");
#endif
/* bind socket */
#ifdef HAVE_INET6
if (inet6) {
addrin6.sin6_family = AF_INET6;
addrin6.sin6_port = htons(bindport);
if (bind(sockin, (struct sockaddr *)&addrin6,
sizeof(struct sockaddr_in6)) == -1)
err(1, "bind(port %u)", bindport);
addrin_len = sizeof(addrin6);
if (getsockname(sockin, (struct sockaddr *)&addrin6, &addrin_len) == -1)
err(1, "getsockname()");
printf("listening on: http://[%s]:%u/\n",
get_address_text(&addrin6.sin6_addr), bindport);
} else
#endif
{
addrin.sin_family = (u_char)PF_INET;
addrin.sin_port = htons(bindport);
if (bind(sockin, (struct sockaddr *)&addrin,
sizeof(struct sockaddr_in)) == -1)
err(1, "bind(port %u)", bindport);
addrin_len = sizeof(addrin);
if (getsockname(sockin, (struct sockaddr *)&addrin, &addrin_len) == -1)
err(1, "getsockname()");
printf("listening on: http://%s:%u/\n",
get_address_text(&addrin.sin_addr), bindport);
}
/* listen on socket */
if (listen(sockin, max_connections) == -1)
err(1, "listen()");
/* enable acceptfilter (this is only available on FreeBSD) */
if (want_accf) {
#if defined(__FreeBSD__)
struct accept_filter_arg filt = {"httpready", ""};
if (setsockopt(sockin, SOL_SOCKET, SO_ACCEPTFILTER,
&filt, sizeof(filt)) == -1)
fprintf(stderr, "cannot enable acceptfilter: %s\n",
strerror(errno));
else
printf("enabled acceptfilter\n");
#else
printf("this platform doesn't support acceptfilter\n");
#endif
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_406958", "function_addr": 4221272, "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, 0A8h"], [8, "lea r12, [rbp+var_D0]"], [9, "mov r15, r12"], [10, "cmp cs:__asan_option_detect_stack_use_after_return, 0"], [11, "jz short loc_406991"], [12, "mov edi, 0A0h"], [13, "call ___asan_stack_malloc_2"], [14, "test rax, rax"], [15, "jz short loc_406991"], [16, "mov r12, rax"], [17, "lea rax, [r12+0A0h]"], [18, "mov rbx, rax"], [19, "mov qword ptr [r12], 41B58AB3h"], [20, "mov qword ptr [r12+8], offset a432414AddrinLe"], [21, "mov qword ptr [r12+10h], offset sub_406958"], [22, "mov r13, r12"], [23, "shr r13, 3"], [24, "mov dword ptr [r13+7FFF8000h], 0F1F1F1F1h"], [25, "mov dword ptr [r13+7FFF8004h], 0F204F204h"], [26, "mov dword ptr [r13+7FFF8008h], 0F2F20000h"], [27, "mov dword ptr [r13+7FFF800Ch], 4000000h"], [28, "mov dword ptr [r13+7FFF8010h], 0F3F3F3F3h"], [29, "mov eax, cs:dword_4653E0"], [30, "test eax, eax"], [31, "jz loc_406A84"], [32, "lea rax, [rbx-40h]"], [33, "mov edx, 1Ch"], [34, "mov esi, 0"], [35, "mov rdi, rax"], [36, "call _memset"], [37, "mov rax, cs:cp"], [38, "test rax, rax"], [39, "jz short loc_406A2D"], [40, "mov rax, cs:cp"], [41, "jmp short loc_406A32"], [42, "mov eax, offset asc_420CC0"], [43, "lea rdx, [rbx-40h]"], [44, "add rdx, 8"], [45, "mov rsi, rax"], [46, "mov edi, 0Ah"], [47, "call _inet_pton"], [48, "cmp eax, 0FFFFFFFFh"], [49, "jnz short loc_406A65"], [50, "call ___asan_handle_no_return"], [51, "mov esi, offset aMalformedAddrA"], [52, "mov edi, 1"], [53, "mov eax, 0"], [54, "call _errx"], [55, "mov edx, 0"], [56, "mov esi, 1"], [57, "mov edi, 0Ah"], [58, "call _socket"], [59, "mov cs:fd, eax"], [60, "jmp loc_406B38"], [61, "lea rax, [rbx-60h]"], [62, "mov edx, 10h"], [63, "mov esi, 0"], [64, "mov rdi, rax"], [65, "call _memset"], [66, "mov rax, cs:cp"], [67, "test rax, rax"], [68, "jz short loc_406AB9"], [69, "mov rax, cs:cp"], [70, "mov rdi, rax"], [71, "call _inet_addr"], [72, "mov ecx, eax"], [73, "jmp short loc_406ABE"], [74, "mov ecx, 0"], [75, "lea rax, [rbx-60h]"], [76, "add rax, 4"], [77, "mov rdx, rax"], [78, "shr rdx, 3"], [79, "add rdx, 7FFF8000h"], [80, "movzx edx, byte ptr [rdx]"], [81, "test dl, dl"], [82, "setnz dil"], [83, "mov rsi, rax"], [84, "and esi, 7"], [85, "add esi, 3"], [86, "cmp sil, dl"], [87, "setnl dl"], [88, "and edx, edi"], [89, "test dl, dl"], [90, "jz short loc_406AFA"], [91, "mov rdi, rax"], [92, "call ___asan_report_store4"], [93, "mov [rbx-5Ch], ecx"], [94, "mov eax, [rbx-5Ch]"], [95, "cmp eax, 0FFFFFFFFh"], [96, "jnz short loc_406B1E"], [97, "call ___asan_handle_no_return"], [98, "mov esi, offset aMalformedAddrA"], [99, "mov edi, 1"], [100, "mov eax, 0"], [101, "call _errx"], [102, "mov edx, 0"], [103, "mov esi, 1"], [104, "mov edi, 2"], [105, "call _socket"], [106, "mov cs:fd, eax"], [107, "mov eax, cs:fd"], [108, "cmp eax, 0FFFFFFFFh"], [109, "jnz short loc_406B5C"], [110, "call ___asan_handle_no_return"], [111, "mov esi, offset aSocket_0"], [112, "mov edi, 1"], [113, "mov eax, 0"], [114, "call _err"], [115, "lea rax, [rbx-70h]"], [116, "mov rdx, rax"], [117, "mov rax, rdx"], [118, "shr rax, 3"], [119, "add rax, 7FFF8000h"], [120, "movzx eax, byte ptr [rax]"], [121, "test al, al"], [122, "setnz cl"], [123, "cmp al, 3"], [124, "setle al"], [125, "and eax, ecx"], [126, "test al, al"], [127, "jz short loc_406B8B"], [128, "mov rdi, rdx"], [129, "call ___asan_report_store4"], [130, "mov dword ptr [rbx-70h], 1"], [131, "mov eax, cs:fd"], [132, "lea rdx, [rbx-70h]"], [133, "mov r8d, 4"], [134, "mov rcx, rdx"], [135, "mov edx, 2"], [136, "mov esi, 1"], [137, "mov edi, eax"], [138, "call _setsockopt"], [139, "cmp eax, 0FFFFFFFFh"], [140, "jnz short loc_406BD4"], [141, "call ___asan_handle_no_return"], [142, "mov esi, offset aSetsockoptSoRe"], [143, "mov edi, 1"], [144, "mov eax, 0"], [145, "call _err"], [146, "lea rax, [rbx-70h]"], [147, "mov rdx, rax"], [148, "mov rax, rdx"], [149, "shr rax, 3"], [150, "add rax, 7FFF8000h"], [151, "movzx eax, byte ptr [rax]"], [152, "test al, al"], [153, "setnz cl"], [154, "cmp al, 3"], [155, "setle al"], [156, "and eax, ecx"], [157, "test al, al"], [158, "jz short loc_406C03"], [159, "mov rdi, rdx"], [160, "call ___asan_report_store4"], [161, "mov dword ptr [rbx-70h], 1"], [162, "mov eax, cs:fd"], [163, "lea rdx, [rbx-70h]"], [164, "mov r8d, 4"], [165, "mov rcx, rdx"], [166, "mov edx, 1"], [167, "mov esi, 6"], [168, "mov edi, eax"], [169, "call _setsockopt"], [170, "cmp eax, 0FFFFFFFFh"], [171, "jnz short loc_406C4C"], [172, "call ___asan_handle_no_return"], [173, "mov esi, offset aSetsockoptTcpN"], [174, "mov edi, 1"], [175, "mov eax, 0"], [176, "call _err"], [177, "mov eax, cs:dword_4653E0"], [178, "test eax, eax"], [179, "jz loc_406DCC"], [180, "lea rax, [rbx-40h]"], [181, "mov rdx, rax"], [182, "mov rax, rdx"], [183, "shr rax, 3"], [184, "add rax, 7FFF8000h"], [185, "movzx eax, byte ptr [rax]"], [186, "test al, al"], [187, "setnz cl"], [188, "cmp al, 1"], [189, "setle al"], [190, "and eax, ecx"], [191, "test al, al"], [192, "jz short loc_406C89"], [193, "mov rdi, rdx"], [194, "call ___asan_report_store2"], [195, "mov word ptr [rbx-40h], 0Ah"], [196, "movzx eax, cs:word_430460"], [197, "movzx eax, ax"], [198, "mov edi, eax"], [199, "call _htons"], [200, "mov ecx, eax"], [201, "lea rax, [rbx-40h]"], [202, "add rax, 2"], [203, "mov rdx, rax"], [204, "shr rdx, 3"], [205, "add rdx, 7FFF8000h"], [206, "movzx edx, byte ptr [rdx]"], [207, "test dl, dl"], [208, "setnz dil"], [209, "mov rsi, rax"], [210, "and esi, 7"], [211, "add esi, 1"], [212, "cmp sil, dl"], [213, "setnl dl"], [214, "and edx, edi"], [215, "test dl, dl"], [216, "jz short loc_406CDE"], [217, "mov rdi, rax"], [218, "call ___asan_report_store2"], [219, "mov [rbx-3Eh], cx"], [220, "lea rax, [rbx-40h]"], [221, "mov rcx, rax"], [222, "mov eax, cs:fd"], [223, "mov edx, 1Ch"], [224, "mov rsi, rcx"], [225, "mov edi, eax"], [226, "call _bind"], [227, "cmp eax, 0FFFFFFFFh"], [228, "jnz short loc_406D28"], [229, "movzx eax, cs:word_430460"], [230, "movzx ebx, ax"], [231, "call ___asan_handle_no_return"], [232, "mov edx, ebx"], [233, "mov esi, offset aBindPortU"], [234, "mov edi, 1"], [235, "mov eax, 0"], [236, "call _err"], [237, "lea rax, [rbx-80h]"], [238, "mov rdx, rax"], [239, "mov rax, rdx"], [240, "shr rax, 3"], [241, "add rax, 7FFF8000h"], [242, "movzx eax, byte ptr [rax]"], [243, "test al, al"], [244, "setnz cl"], [245, "cmp al, 3"], [246, "setle al"], [247, "and eax, ecx"], [248, "test al, al"], [249, "jz short loc_406D57"], [250, "mov rdi, rdx"], [251, "call ___asan_report_store4"], [252, "mov dword ptr [rbx-80h], 1Ch"], [253, "lea rax, [rbx-40h]"], [254, "mov rcx, rax"], [255, "mov eax, cs:fd"], [256, "lea rdx, [rbx-80h]"], [257, "mov rsi, rcx"], [258, "mov edi, eax"], [259, "call _getsockname"], [260, "cmp eax, 0FFFFFFFFh"], [261, "jnz short loc_406D97"], [262, "call ___asan_handle_no_return"], [263, "mov esi, offset aGetsockname_0"], [264, "mov edi, 1"], [265, "mov eax, 0"], [266, "call _err"], [267, "movzx eax, cs:word_430460"], [268, "movzx r14d, ax"], [269, "lea rax, [rbx-40h]"], [270, "add rax, 8"], [271, "mov rdi, rax"], [272, "call sub_4068B9"], [273, "mov edx, r14d"], [274, "mov rsi, rax"], [275, "mov edi, offset aListeningOnHtt"], [276, "mov eax, 0"], [277, "call _printf"], [278, "jmp loc_406F39"], [279, "lea rax, [rbx-60h]"], [280, "mov rdx, rax"], [281, "mov rax, rdx"], [282, "shr rax, 3"], [283, "add rax, 7FFF8000h"], [284, "movzx eax, byte ptr [rax]"], [285, "test al, al"], [286, "setnz cl"], [287, "cmp al, 1"], [288, "setle al"], [289, "and eax, ecx"], [290, "test al, al"], [291, "jz short loc_406DFB"], [292, "mov rdi, rdx"], [293, "call ___asan_report_store2"], [294, "mov word ptr [rbx-60h], 2"], [295, "movzx eax, cs:word_430460"], [296, "movzx eax, ax"], [297, "mov edi, eax"], [298, "call _htons"], [299, "mov ecx, eax"], [300, "lea rax, [rbx-60h]"], [301, "add rax, 2"], [302, "mov rdx, rax"], [303, "shr rdx, 3"], [304, "add rdx, 7FFF8000h"], [305, "movzx edx, byte ptr [rdx]"], [306, "test dl, dl"], [307, "setnz dil"], [308, "mov rsi, rax"], [309, "and esi, 7"], [310, "add esi, 1"], [311, "cmp sil, dl"], [312, "setnl dl"], [313, "and edx, edi"], [314, "test dl, dl"], [315, "jz short loc_406E50"], [316, "mov rdi, rax"], [317, "call ___asan_report_store2"], [318, "mov [rbx-5Eh], cx"], [319, "lea rax, [rbx-60h]"], [320, "mov rcx, rax"], [321, "mov eax, cs:fd"], [322, "mov edx, 10h"], [323, "mov rsi, rcx"], [324, "mov edi, eax"], [325, "call _bind"], [326, "cmp eax, 0FFFFFFFFh"], [327, "jnz short loc_406E9A"], [328, "movzx eax, cs:word_430460"], [329, "movzx ebx, ax"], [330, "call ___asan_handle_no_return"], [331, "mov edx, ebx"], [332, "mov esi, offset aBindPortU"], [333, "mov edi, 1"], [334, "mov eax, 0"], [335, "call _err"], [336, "lea rax, [rbx-80h]"], [337, "mov rdx, rax"], [338, "mov rax, rdx"], [339, "shr rax, 3"], [340, "add rax, 7FFF8000h"], [341, "movzx eax, byte ptr [rax]"], [342, "test al, al"], [343, "setnz cl"], [344, "cmp al, 3"], [345, "setle al"], [346, "and eax, ecx"], [347, "test al, al"], [348, "jz short loc_406EC9"], [349, "mov rdi, rdx"], [350, "call ___asan_report_store4"], [351, "mov dword ptr [rbx-80h], 10h"], [352, "lea rax, [rbx-60h]"], [353, "mov rcx, rax"], [354, "mov eax, cs:fd"], [355, "lea rdx, [rbx-80h]"], [356, "mov rsi, rcx"], [357, "mov edi, eax"], [358, "call _getsockname"], [359, "cmp eax, 0FFFFFFFFh"], [360, "jnz short loc_406F09"], [361, "call ___asan_handle_no_return"], [362, "mov esi, offset aGetsockname_0"], [363, "mov edi, 1"], [364, "mov eax, 0"], [365, "call _err"], [366, "movzx eax, cs:word_430460"], [367, "movzx r14d, ax"], [368, "lea rax, [rbx-60h]"], [369, "add rax, 4"], [370, "mov rdi, rax"], [371, "call sub_4068B9"], [372, "mov edx, r14d"], [373, "mov rsi, rax"], [374, "mov edi, offset aListeningOnHtt_0"], [375, "mov eax, 0"], [376, "call _printf"], [377, "mov edx, cs:n"], [378, "mov eax, cs:fd"], [379, "mov esi, edx"], [380, "mov edi, eax"], [381, "call _listen"], [382, "cmp eax, 0FFFFFFFFh"], [383, "jnz short loc_406F6C"], [384, "call ___asan_handle_no_return"], [385, "mov esi, offset aListen_0"], [386, "mov edi, 1"], [387, "mov eax, 0"], [388, "call _err"], [389, "mov eax, cs:dword_4655A0"], [390, "test eax, eax"], [391, "jz short loc_406F80"], [392, "mov edi, offset s"], [393, "call _puts"], [394, "nop"], [395, "cmp r15, r12"], [396, "jz short loc_406FC8"], [397, "mov qword ptr [r12], 45E0360Eh"], [398, "mov rax, 0F5F5F5F5F5F5F5F5h"], [399, "mov rdx, 0F5F5F5F5F5F5F5F5h"], [400, "mov [r13+7FFF8000h], rax"], [401, "mov [r13+7FFF8008h], rdx"], [402, "mov dword ptr [r13+7FFF8010h], 0F5F5F5F5h"], [403, "mov rax, [r12+0F8h]"], [404, "mov byte ptr [rax], 0"], [405, "jmp short loc_406FE9"], [406, "mov qword ptr [r13+7FFF8000h], 0"], [407, "mov qword ptr [r13+7FFF8008h], 0"], [408, "mov dword ptr [r13+7FFF8010h], 0"], [409, "add rsp, 0A8h"], [410, "pop rbx"], [411, "pop r12"], [412, "pop r13"], [413, "pop r14"], [414, "pop r15"], [415, "pop rbp"], [416, "retn"]], "data_dep": [[9, 8], [11, 10], [14, 13], [15, 14], [16, 14], [17, 14], [17, 8], [17, 16], [18, 17], [19, 8], [19, 16], [20, 8], [20, 16], [21, 8], [21, 16], [22, 8], [22, 16], [23, 22], [24, 23], [25, 23], [26, 23], [27, 23], [28, 23], [30, 29], [31, 30], [32, 26], [32, 21], [32, 30], [32, 25], [32, 20], [32, 24], [32, 19], [32, 28], [32, 18], [32, 27], [35, 32], [38, 37], [39, 38], [43, 26], [43, 21], [43, 25], [43, 20], [43, 24], [43, 33], [43, 19], [43, 28], [43, 18], [43, 27], [44, 43], [45, 42], [45, 40], [48, 47], [49, 48], [59, 58], [61, 20], [61, 24], [61, 19], [61, 28], [61, 18], [61, 27], [61, 26], [61, 21], [61, 30], [61, 25], [64, 61], [67, 66], [68, 67], [70, 69], [72, 71], [75, 26], [75, 21], [75, 25], [75, 67], [75, 71], [75, 20], [75, 24], [75, 19], [75, 28], [75, 18], [75, 27], [76, 75], [77, 76], [78, 77], [79, 78], [80, 79], [80, 24], [80, 19], [80, 28], [80, 27], [80, 26], [80, 21], [80, 25], [80, 20], [81, 80], [82, 64], [82, 81], [82, 70], [83, 76], [84, 83], [85, 84], [86, 81], [86, 85], [87, 86], [87, 81], [88, 87], [88, 82], [89, 88], [90, 89], [91, 76], [93, 74], [93, 18], [93, 72], [94, 18], [94, 93], [95, 94], [96, 95], [106, 105], [107, 106], [107, 59], [108, 107], [109, 108], [115, 24], [115, 19], [115, 28], [115, 18], [115, 27], [115, 107], [115, 93], [115, 26], [115, 21], [115, 25], [115, 20], [116, 115], [117, 116], [118, 117], [119, 118], [120, 24], [120, 19], [120, 28], [120, 27], [120, 93], [120, 26], [120, 21], [120, 25], [120, 119], [120, 20], [121, 120], [122, 72], [122, 121], [122, 74], [123, 121], [124, 121], [125, 124], [125, 122], [126, 125], [127, 126], [128, 116], [130, 18], [131, 106], [131, 59], [132, 18], [132, 130], [132, 116], [134, 132], [137, 131], [139, 138], [140, 139], [146, 26], [146, 21], [146, 25], [146, 20], [146, 93], [146, 24], [146, 19], [146, 28], [146, 18], [146, 27], [146, 130], [146, 138], [147, 146], [148, 147], [149, 148], [150, 149], [151, 20], [151, 150], [151, 24], [151, 19], [151, 93], [151, 28], [151, 27], [151, 130], [151, 26], [151, 21], [151, 25], [152, 151], [153, 134], [153, 152], [154, 152], [155, 152], [156, 153], [156, 155], [157, 156], [158, 157], [159, 147], [161, 18], [162, 106], [162, 59], [163, 161], [163, 147], [163, 18], [165, 163], [168, 162], [170, 169], [171, 170], [178, 177], [179, 178], [180, 93], [180, 19], [180, 28], [180, 18], [180, 27], [180, 130], [180, 161], [180, 26], [180, 21], [180, 178], [180, 25], [180, 20], [180, 24], [181, 180], [182, 181], [183, 182], [184, 183], [185, 27], [185, 161], [185, 26], [185, 21], [185, 184], [185, 25], [185, 20], [185, 24], [185, 19], [185, 130], [185, 93], [185, 28], [186, 185], [187, 165], [187, 186], [188, 186], [189, 186], [190, 189], [190, 187], [191, 190], [192, 191], [193, 181], [195, 18], [197, 196], [198, 197], [200, 199], [201, 199], [201, 195], [201, 18], [202, 201], [203, 202], [204, 203], [205, 204], [206, 205], [206, 195], [207, 206], [208, 198], [208, 207], [209, 202], [210, 209], [211, 210], [212, 207], [212, 211], [213, 212], [213, 207], [214, 213], [214, 208], [215, 214], [216, 215], [217, 202], [219, 200], [219, 18], [220, 202], [220, 219], [220, 218], [220, 195], [220, 18], [221, 220], [222, 59], [222, 106], [224, 221], [225, 222], [227, 226], [228, 227], [230, 229], [232, 230], [237, 195], [237, 18], [237, 27], [237, 161], [237, 26], [237, 21], [237, 226], [237, 25], [237, 20], [237, 24], [237, 19], [237, 28], [237, 130], [237, 219], [237, 93], [238, 237], [239, 238], [240, 239], [241, 240], [242, 27], [242, 161], [242, 26], [242, 241], [242, 21], [242, 25], [242, 20], [242, 24], [242, 19], [242, 28], [242, 130], [242, 219], [242, 93], [242, 195], [243, 242], [244, 221], [244, 243], [245, 243], [246, 243], [247, 244], [247, 246], [248, 247], [249, 248], [250, 238], [252, 18], [253, 18], [253, 248], [253, 252], [253, 251], [253, 195], [254, 253], [255, 59], [255, 106], [256, 18], [256, 252], [256, 238], [257, 254], [258, 255], [260, 259], [261, 260], [268, 267], [269, 26], [269, 21], [269, 267], [269, 25], [269, 20], [269, 24], [269, 19], [269, 28], [269, 252], [269, 130], [269, 219], [269, 93], [269, 195], [269, 18], [269, 27], [269, 161], [270, 269], [271, 270], [273, 268], [274, 272], [279, 178], [279, 25], [279, 20], [279, 24], [279, 19], [279, 28], [279, 130], [279, 93], [279, 18], [279, 27], [279, 161], [279, 26], [279, 21], [280, 279], [281, 280], [282, 281], [283, 282], [284, 20], [284, 24], [284, 19], [284, 28], [284, 130], [284, 93], [284, 27], [284, 283], [284, 161], [284, 26], [284, 21], [284, 25], [285, 284], [286, 165], [286, 285], [287, 285], [288, 285], [289, 286], [289, 288], [290, 289], [291, 290], [292, 280], [294, 18], [296, 295], [297, 296], [299, 298], [300, 18], [300, 294], [300, 298], [301, 300], [302, 301], [303, 302], [304, 303], [305, 304], [305, 294], [306, 305], [307, 297], [307, 306], [308, 301], [309, 308], [310, 309], [311, 306], [311, 310], [312, 311], [312, 306], [313, 312], [313, 307], [314, 313], [315, 314], [316, 301], [318, 299], [318, 18], [319, 301], [319, 318], [319, 317], [319, 294], [319, 18], [320, 319], [321, 59], [321, 106], [323, 320], [324, 321], [326, 325], [327, 326], [329, 328], [331, 329], [336, 294], [336, 24], [336, 19], [336, 28], [336, 18], [336, 130], [336, 93], [336, 325], [336, 27], [336, 161], [336, 26], [336, 21], [336, 25], [336, 20], [336, 318], [337, 336], [338, 337], [339, 338], [340, 339], [341, 19], [341, 28], [341, 130], [341, 93], [341, 27], [341, 161], [341, 26], [341, 21], [341, 25], [341, 20], [341, 318], [341, 340], [341, 294], [341, 24], [342, 341], [343, 320], [343, 342], [344, 342], [345, 342], [346, 343], [346, 345], [347, 346], [348, 347], [349, 337], [351, 18], [352, 18], [352, 347], [352, 351], [352, 350], [352, 294], [353, 352], [354, 106], [354, 59], [355, 18], [355, 351], [355, 337], [356, 353], [357, 354], [359, 358], [360, 359], [367, 366], [368, 19], [368, 28], [368, 18], [368, 27], [368, 130], [368, 93], [368, 366], [368, 161], [368, 26], [368, 21], [368, 25], [368, 20], [368, 351], [368, 318], [368, 294], [368, 24], [369, 368], [370, 369], [372, 367], [373, 371], [378, 106], [378, 59], [379, 377], [380, 378], [382, 381], [383, 382], [390, 389], [391, 390], [395, 8], [395, 16], [395, 9], [396, 395], [397, 8], [397, 16], [400, 398], [400, 23], [401, 23], [401, 399], [402, 23], [403, 16], [403, 402], [403, 8], [404, 403], [406, 23], [407, 23], [408, 23], [409, 7], [410, 6], [411, 5], [412, 4], [413, 3], [414, 2], [415, 0], [416, 403], [416, 393], [416, 390]]}
| {"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_406958", "query": "\n\n\nint sub_406958()\n{\nunsigned __int64 v0; // r12\n__int64 v1; // rax\n_DWORD *v2; // r13\nconst char *v3; // rax\nin_addr_t v4; // ecx\nuint16_t v5; // cx\nunsigned int v6; // ebx\nunsigned int v7; // er14\nchar *v8; // rax\nuint16_t v9; // cx\nunsigned int v10; // ebx\nunsigned int v11; // er14\nchar *v12; // rax\n_BYTE *v13; // rax\nchar v15[208]; // [rsp+0h] [rbp-D0h] BYREF\n\nv0 = (unsigned __int64)v15;\nif ( _asan_option_detect_stack_use_after_return )\n{\nv1 = __asan_stack_malloc_2();\nif ( v1 )\nv0 = v1;\n}\n*(_QWORD *)v0 = 1102416563LL;\n*(_QWORD *)(v0 + 8) = \"4 32 4 14 addrin_len:793 48 4 11 sockopt:794 64 16 10 addrin:789 96 28 11 addrin6:791\";\n*(_QWORD *)(v0 + 16) = sub_406958;\nv2 = (_DWORD *)(v0 >> 3);\nv2[536862720] = -235802127;\nv2[536862721] = -234556924;\nv2[536862722] = -219021312;\nv2[536862723] = 0x4000000;\nv2[536862724] = -202116109;\nif ( dword_4653E0 )\n{\nmemset((void *)(v0 + 96), 0, 0x1CuLL);\nif ( cp )\nv3 = cp;\nelse\nv3 = \"::\";\nif ( inet_pton(10, v3, (void *)(v0 + 104)) == -1 )\n{\n__asan_handle_no_return();\nerrx(1, \"malformed --addr argument\");\n}\nfd = socket(10, 1, 0);\n}\nelse\n{\nmemset((void *)(v0 + 64), 0, 0x10uLL);\nif ( cp )\nv4 = inet_addr(cp);\nelse\nv4 = 0;\nif ( *(_BYTE *)(((v0 + 68) >> 3) + 0x7FFF8000) != 0\n&& (char)(((v0 + 68) & 7) + 3) >= *(_BYTE *)(((v0 + 68) >> 3) + 0x7FFF8000) )\n{\n__asan_report_store4();\n}\n*(_DWORD *)(v0 + 68) = v4;\nif ( *(_DWORD *)(v0 + 68) == -1 )\n{\n__asan_handle_no_return();\nerrx(1, \"malformed --addr argument\");\n}\nfd = socket(2, 1, 0);\n}\nif ( fd == -1 )\n{\n__asan_handle_no_return();\nerr(1, \"socket()\");\n}\nif ( *(_BYTE *)(((v0 + 48) >> 3) + 0x7FFF8000) != 0 && *(_BYTE *)(((v0 + 48) >> 3) + 0x7FFF8000) <= 3 )\n__asan_report_store4();\n*(_DWORD *)(v0 + 48) = 1;\nif ( setsockopt(fd, 1, 2, (const void *)(v0 + 48), 4u) == -1 )\n{\n__asan_handle_no_return();\nerr(1, \"setsockopt(SO_REUSEADDR)\");\n}\nif ( *(_BYTE *)(((v0 + 48) >> 3) + 0x7FFF8000) != 0 && *(_BYTE *)(((v0 + 48) >> 3) + 0x7FFF8000) <= 3 )\n__asan_report_store4();\n*(_DWORD *)(v0 + 48) = 1;\nif ( setsockopt(fd, 6, 1, (const void *)(v0 + 48), 4u) == -1 )\n{\n__asan_handle_no_return();\nerr(1, \"setsockopt(TCP_NODELAY)\");\n}\nif ( dword_4653E0 )\n{\nif ( *(_BYTE *)(((v0 + 96) >> 3) + 0x7FFF8000) != 0 && *(_BYTE *)(((v0 + 96) >> 3) + 0x7FFF8000) <= 1 )\n__asan_report_store2();\n*(_WORD *)(v0 + 96) = 10;\nv5 = htons(word_430460);\nif ( *(_BYTE *)(((v0 + 98) >> 3) + 0x7FFF8000) != 0\n&& (char)(((v0 + 98) & 7) + 1) >= *(_BYTE *)(((v0 + 98) >> 3) + 0x7FFF8000) )\n{\n__asan_report_store2();\n}\n*(_WORD *)(v0 + 98) = v5;\nif ( bind(fd, (const struct sockaddr *)(v0 + 96), 0x1Cu) == -1 )\n{\nv6 = (unsigned __int16)word_430460;\n__asan_handle_no_return();\nerr(1, \"bind(port %u)\", v6);\n}\nif ( *(_BYTE *)(((v0 + 32) >> 3) + 0x7FFF8000) != 0 && *(_BYTE *)(((v0 + 32) >> 3) + 0x7FFF8000) <= 3 )\n__asan_report_store4();\n*(_DWORD *)(v0 + 32) = 28;\nif ( getsockname(fd, (struct sockaddr *)(v0 + 96), (socklen_t *)(v0 + 32)) == -1 )\n{\n__asan_handle_no_return();\nerr(1, \"getsockname()\");\n}\nv7 = (unsigned __int16)word_430460;\nv8 = sub_4068B9(v0 + 104);\nprintf(\"listening on: http://[%s]:%u/\\n\", v8, v7);\n}\nelse\n{\nif ( *(_BYTE *)(((v0 + 64) >> 3) + 0x7FFF8000) != 0 && *(_BYTE *)(((v0 + 64) >> 3) + 0x7FFF8000) <= 1 )\n__asan_report_store2();\n*(_WORD *)(v0 + 64) = 2;\nv9 = htons(word_430460);\nif ( *(_BYTE *)(((v0 + 66) >> 3) + 0x7FFF8000) != 0\n&& (char)(((v0 + 66) & 7) + 1) >= *(_BYTE *)(((v0 + 66) >> 3) + 0x7FFF8000) )\n{\n__asan_report_store2();\n}\n*(_WORD *)(v0 + 66) = v9;\nif ( bind(fd, (const struct sockaddr *)(v0 + 64), 0x10u) == -1 )\n{\nv10 = (unsigned __int16)word_430460;\n__asan_handle_no_return();\nerr(1, \"bind(port %u)\", v10);\n}\nif ( *(_BYTE *)(((v0 + 32) >> 3) + 0x7FFF8000) != 0 && *(_BYTE *)(((v0 + 32) >> 3) + 0x7FFF8000) <= 3 )\n__asan_report_store4();\n*(_DWORD *)(v0 + 32) = 16;\nif ( getsockname(fd, (struct sockaddr *)(v0 + 64), (socklen_t *)(v0 + 32)) == -1 )\n{\n__asan_handle_no_return();\nerr(1, \"getsockname()\");\n}\nv11 = (unsigned __int16)word_430460;\nv12 = sub_4068B9(v0 + 68);\nprintf(\"listening on: http://%s:%u/\\n\", v12, v11);\n}\nif ( listen(fd, n) == -1 )\n{\n__asan_handle_no_return();\nerr(1, \"listen()\");\n}\nLODWORD(v13) = dword_4655A0;\nif ( dword_4655A0 )\nLODWORD(v13) = puts(\"this platform doesn't support acceptfilter\");\nif ( v15 == (char *)v0 )\n{\n*(_QWORD *)((v0 >> 3) + 0x7FFF8000) = 0LL;\n*(_QWORD *)((v0 >> 3) + 0x7FFF8008) = 0LL;\n*(_DWORD *)((v0 >> 3) + 0x7FFF8010) = 0;\n}\nelse\n{\n*(_QWORD *)v0 = 1172321806LL;\n*(_QWORD *)((v0 >> 3) + 0x7FFF8000) = 0xF5F5F5F5F5F5F5F5LL;\n*(_QWORD *)((v0 >> 3) + 0x7FFF8008) = 0xF5F5F5F5F5F5F5F5LL;\n*(_DWORD *)((v0 >> 3) + 0x7FFF8010) = -168430091;\nv13 = *(_BYTE **)(v0 + 248);\n*v13 = 0;\n}\nreturn (int)v13;\n}\n\n\n\nQ:[sub_406958,sub_4068B9,]", "hints": "[]", "response": "{'sub_406958': 'init_sockin', 'sub_4068B9': 'get_address_text'}"} | [
[
0.7701338529586792,
0.7617480754852295,
0.7561529278755188,
0.7497634887695312,
0.7469611763954163,
0.7443364858627319,
0.7419291138648987,
0.7401069402694702,
0.7349866628646851,
0.7307240962982178,
0.7278895378112793,
0.7261813282966614,
0.7259931564331055,
0.7139122486114502,
0.7120043039321899,
0.7099442481994629,
0.7090972065925598,
0.7042045593261719,
0.7039939761161804,
0.7020736932754517
],
[
149844,
156726,
86212,
183160,
22107,
141948,
23272,
150362,
24953,
242759,
164324,
85713,
27845,
18739,
252731,
173856,
125916,
157471,
200762,
185527
]
] |
|
JSON_value | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static gravity_value_t JSON_value (gravity_vm *vm, json_value *json) {
switch (json->type) {
case json_none:
case json_null:
return VALUE_FROM_NULL;
case json_object: {
gravity_object_t *obj = gravity_object_deserialize(vm, json);
gravity_value_t objv = (obj) ? VALUE_FROM_OBJECT(obj) : VALUE_FROM_NULL;
return objv;
}
case json_array: {
unsigned int length = json->u.array.length;
gravity_list_t *list = gravity_list_new(vm, length);
for (unsigned int i = 0; i < length; ++i) {
gravity_value_t value = JSON_value(vm, json->u.array.values[i]);
marray_push(gravity_value_t, list->array, value);
}
return VALUE_FROM_OBJECT(list);
}
case json_integer:
return VALUE_FROM_INT(json->u.integer);
case json_double:
return VALUE_FROM_FLOAT(json->u.dbl);
case json_string:
return VALUE_FROM_STRING(vm, json->u.string.ptr, json->u.string.length);
case json_boolean:
return VALUE_FROM_BOOL(json->u.boolean);
}
return VALUE_FROM_NULL;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_465A36", "function_addr": 4610614, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r13"], [3, "push r12"], [4, "sub rsp, 50h"], [5, "mov [rbp+var_58], rdi"], [6, "mov [rbp+var_60], rsi"], [7, "mov rax, [rbp+var_60]"], [8, "mov eax, [rax+8]"], [9, "cmp eax, 7"], [10, "ja def_465A7A"], [11, "mov eax, eax"], [12, "lea rdx, ds:0[rax*4]"], [13, "lea rax, jpt_465A7A"], [14, "mov eax, ds:(jpt_465A7A - 46F960h)[rdx+rax]"], [15, "cdqe"], [16, "lea rdx, jpt_465A7A"], [17, "add rax, rdx"], [18, "jmp rax"], [19, "mov rax, offset unk_47D898"], [20, "mov rax, [rax]"], [21, "mov r12, rax"], [22, "mov r13d, 0"], [23, "jmp loc_465C89"], [24, "mov rdx, [rbp+var_60]"], [25, "mov rax, [rbp+var_58]"], [26, "mov rsi, rdx"], [27, "mov rdi, rax"], [28, "call sub_456AF0"], [29, "mov [rbp+var_28], rax"], [30, "cmp [rbp+var_28], 0"], [31, "jz short loc_465AC7"], [32, "mov rax, [rbp+var_28]"], [33, "mov rax, [rax]"], [34, "mov [rbp+var_40], rax"], [35, "mov rax, [rbp+var_28]"], [36, "mov [rbp+var_38], rax"], [37, "jmp short loc_465ADD"], [38, "mov rax, offset unk_47D898"], [39, "mov rax, [rax]"], [40, "mov [rbp+var_40], rax"], [41, "mov [rbp+var_38], 0"], [42, "mov r12, [rbp+var_40]"], [43, "mov r13, [rbp+var_38]"], [44, "jmp loc_465C89"], [45, "mov rax, [rbp+var_60]"], [46, "mov eax, [rax+10h]"], [47, "mov [rbp+var_18], eax"], [48, "mov edx, [rbp+var_18]"], [49, "mov rax, [rbp+var_58]"], [50, "mov esi, edx"], [51, "mov rdi, rax"], [52, "call sub_45979F"], [53, "mov [rbp+var_20], rax"], [54, "mov [rbp+var_14], 0"], [55, "jmp loc_465BDF"], [56, "mov rax, [rbp+var_60]"], [57, "mov rdx, [rax+18h]"], [58, "mov eax, [rbp+var_14]"], [59, "shl rax, 3"], [60, "add rax, rdx"], [61, "mov rdx, [rax]"], [62, "mov rax, [rbp+var_58]"], [63, "mov rsi, rdx"], [64, "mov rdi, rax"], [65, "call sub_465A36"], [66, "mov [rbp+var_50], rax"], [67, "mov [rbp+var_48], rdx"], [68, "mov rax, [rbp+var_20]"], [69, "mov rdx, [rax+30h]"], [70, "mov rax, [rbp+var_20]"], [71, "mov rax, [rax+38h]"], [72, "cmp rdx, rax"], [73, "jnz short loc_465BA8"], [74, "mov rax, [rbp+var_20]"], [75, "mov rax, [rax+38h]"], [76, "test rax, rax"], [77, "jz short loc_465B71"], [78, "mov rax, [rbp+var_20]"], [79, "mov rax, [rax+38h]"], [80, "lea rdx, [rax+rax]"], [81, "jmp short loc_465B76"], [82, "mov edx, 8"], [83, "mov rax, [rbp+var_20]"], [84, "mov [rax+38h], rdx"], [85, "mov rax, [rbp+var_20]"], [86, "mov rax, [rax+38h]"], [87, "shl rax, 4"], [88, "mov rdx, rax"], [89, "mov rax, [rbp+var_20]"], [90, "mov rax, [rax+40h]"], [91, "mov rsi, rdx"], [92, "mov rdi, rax"], [93, "call _realloc"], [94, "mov rdx, [rbp+var_20]"], [95, "mov [rdx+40h], rax"], [96, "mov rax, [rbp+var_20]"], [97, "mov rsi, [rax+40h]"], [98, "mov rax, [rbp+var_20]"], [99, "mov rax, [rax+30h]"], [100, "lea rcx, [rax+1]"], [101, "mov rdx, [rbp+var_20]"], [102, "mov [rdx+30h], rcx"], [103, "shl rax, 4"], [104, "lea rcx, [rsi+rax]"], [105, "mov rax, [rbp+var_50]"], [106, "mov rdx, [rbp+var_48]"], [107, "mov [rcx], rax"], [108, "mov [rcx+8], rdx"], [109, "add [rbp+var_14], 1"], [110, "mov eax, [rbp+var_14]"], [111, "cmp eax, [rbp+var_18]"], [112, "jb loc_465B15"], [113, "mov rax, [rbp+var_20]"], [114, "mov rax, [rax]"], [115, "mov r12, rax"], [116, "mov r13, [rbp+var_20]"], [117, "jmp loc_465C89"], [118, "mov rax, offset unk_47D880"], [119, "mov rdx, [rax]"], [120, "mov rax, [rbp+var_60]"], [121, "mov rax, [rax+10h]"], [122, "mov r12, rdx"], [123, "mov r13, rax"], [124, "jmp short loc_465C89"], [125, "mov rax, offset unk_47D888"], [126, "mov rdx, [rax]"], [127, "mov rax, [rbp+var_60]"], [128, "movsd xmm0, qword ptr [rax+10h]"], [129, "mov r12, rdx"], [130, "movq r13, xmm0"], [131, "jmp short loc_465C89"], [132, "mov rax, [rbp+var_60]"], [133, "mov edx, [rax+10h]"], [134, "mov rax, [rbp+var_60]"], [135, "mov rcx, [rax+18h]"], [136, "mov rax, [rbp+var_58]"], [137, "mov rsi, rcx"], [138, "mov rdi, rax"], [139, "call sub_45A2B6"], [140, "mov r12, rax"], [141, "mov r13, rdx"], [142, "jmp short loc_465C89"], [143, "mov rax, offset unk_47D890"], [144, "mov rdx, [rax]"], [145, "mov rax, [rbp+var_60]"], [146, "mov eax, [rax+10h]"], [147, "cdqe"], [148, "mov r12, rdx"], [149, "mov r13, rax"], [150, "jmp short loc_465C89"], [151, "mov rax, offset unk_47D898"], [152, "mov rax, [rax]"], [153, "mov r12, rax"], [154, "mov r13d, 0"], [155, "mov rax, r12"], [156, "mov rdx, r13"], [157, "add rsp, 50h"], [158, "pop r12"], [159, "pop r13"], [160, "pop rbp"], [161, "retn"]], "data_dep": [[7, 6], [8, 7], [9, 8], [10, 9], [11, 8], [13, 11], [16, 12], [17, 14], [17, 16], [18, 17], [20, 19], [21, 20], [24, 6], [25, 5], [26, 24], [27, 25], [29, 28], [30, 29], [31, 30], [32, 29], [33, 32], [34, 33], [35, 29], [36, 35], [39, 38], [40, 39], [42, 34], [42, 40], [43, 41], [43, 36], [45, 6], [46, 45], [47, 46], [48, 47], [49, 5], [50, 48], [51, 49], [53, 52], [56, 6], [57, 84], [57, 107], [57, 102], [57, 56], [57, 95], [57, 108], [58, 109], [58, 54], [59, 58], [60, 57], [60, 59], [61, 107], [61, 102], [61, 95], [61, 108], [61, 60], [61, 84], [62, 5], [63, 61], [64, 62], [66, 65], [67, 61], [68, 53], [69, 95], [69, 108], [69, 84], [69, 68], [69, 107], [69, 102], [70, 53], [71, 102], [71, 95], [71, 108], [71, 84], [71, 107], [71, 70], [72, 69], [72, 71], [73, 72], [74, 53], [75, 108], [75, 74], [75, 107], [75, 84], [75, 102], [75, 95], [76, 75], [77, 76], [78, 53], [79, 108], [79, 78], [79, 84], [79, 107], [79, 102], [79, 95], [80, 102], [80, 95], [80, 108], [80, 69], [80, 84], [80, 107], [80, 79], [83, 53], [84, 83], [84, 80], [84, 82], [85, 53], [86, 85], [86, 84], [87, 86], [88, 87], [89, 53], [90, 89], [90, 84], [91, 88], [92, 90], [94, 53], [95, 93], [95, 94], [96, 53], [97, 102], [97, 95], [97, 108], [97, 96], [97, 84], [97, 107], [98, 53], [99, 102], [99, 95], [99, 108], [99, 98], [99, 84], [99, 107], [100, 84], [100, 107], [100, 102], [100, 95], [100, 104], [100, 99], [100, 108], [101, 53], [102, 100], [102, 101], [103, 99], [104, 100], [104, 102], [104, 103], [105, 66], [106, 67], [107, 104], [107, 105], [108, 104], [108, 106], [109, 109], [109, 54], [110, 109], [110, 54], [111, 110], [111, 47], [112, 111], [113, 53], [114, 102], [114, 113], [114, 108], [114, 107], [114, 84], [114, 95], [115, 114], [116, 53], [119, 118], [120, 6], [121, 120], [122, 119], [123, 121], [126, 125], [127, 6], [128, 127], [129, 126], [130, 128], [132, 6], [133, 132], [134, 6], [135, 134], [136, 5], [137, 135], [138, 136], [140, 139], [141, 133], [144, 143], [145, 6], [146, 145], [148, 144], [149, 146], [152, 151], [153, 152], [155, 21], [155, 153], [155, 148], [155, 129], [155, 122], [155, 140], [155, 42], [155, 115], [156, 154], [156, 149], [156, 43], [156, 130], [156, 123], [156, 22], [156, 141], [156, 116], [157, 4], [158, 3], [159, 2], [160, 0], [161, 155]]}
| {"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_465A36", "query": "\n\n\n__int64 __fastcall sub_465A36(__int64 a1, __int64 a2)\n{\n__int64 v2; // r12\n__int64 v3; // rdx\n__int64 v4; // rdx\n__int64 v5; // rsi\n__int64 v6; // rax\n__int64 *v7; // rcx\n__int64 v10; // [rsp+10h] [rbp-50h]\n__int64 v11; // [rsp+18h] [rbp-48h]\n__int64 v12; // [rsp+20h] [rbp-40h]\n__int64 *v13; // [rsp+38h] [rbp-28h]\nvoid *v14; // [rsp+40h] [rbp-20h]\nunsigned int v15; // [rsp+48h] [rbp-18h]\nunsigned int i; // [rsp+4Ch] [rbp-14h]\n\nswitch ( *(_DWORD *)(a2 + 8) )\n{\ncase 0:\ncase 7:\nv2 = qword_47D898;\nbreak;\ncase 1:\nv13 = sub_456AF0(a1, a2);\nif ( v13 )\nv12 = *v13;\nelse\nv12 = qword_47D898;\nv2 = v12;\nbreak;\ncase 2:\nv15 = *(_DWORD *)(a2 + 16);\nv14 = sub_45979F(a1, v15);\nfor ( i = 0; i < v15; ++i )\n{\nv10 = sub_465A36(a1, *(_QWORD *)(*(_QWORD *)(a2 + 24) + 8LL * i));\nv11 = v3;\nif ( *((_QWORD *)v14 + 6) == *((_QWORD *)v14 + 7) )\n{\nif ( *((_QWORD *)v14 + 7) )\nv4 = 2LL * *((_QWORD *)v14 + 7);\nelse\nv4 = 8LL;\n*((_QWORD *)v14 + 7) = v4;\n*((_QWORD *)v14 + 8) = realloc(*((void **)v14 + 8), 16LL * *((_QWORD *)v14 + 7));\n}\nv5 = *((_QWORD *)v14 + 8);\nv6 = *((_QWORD *)v14 + 6);\n*((_QWORD *)v14 + 6) = v6 + 1;\nv7 = (__int64 *)(v5 + 16 * v6);\n*v7 = v10;\nv7[1] = v11;\n}\nv2 = *(_QWORD *)v14;\nbreak;\ncase 3:\nv2 = qword_47D880;\nbreak;\ncase 4:\nv2 = qword_47D888;\nbreak;\ncase 5:\nv2 = sub_45A2B6(a1, *(const char **)(a2 + 24), *(_DWORD *)(a2 + 16));\nbreak;\ncase 6:\nv2 = qword_47D890;\nbreak;\ndefault:\nv2 = qword_47D898;\nbreak;\n}\nreturn v2;\n}\n\n\n\nQ:[a1,a2,v10,v12,v13,v14,v15,sub_465A36,sub_456AF0,sub_45979F,sub_45A2B6,]", "hints": "[]", "response": "{'a1': 'vm', 'a2': 'json', 'v10': 'value', 'v12': 'objv', 'v13': 'obj', 'v14': 'list', 'v15': 'length', 'sub_465A36': 'JSON_value', 'sub_456AF0': 'gravity_object_deserialize', 'sub_45979F': 'gravity_list_new', 'sub_45A2B6': 'gravity_string_to_value'}"} | [
[
0.7615441679954529,
0.7600042819976807,
0.7175564765930176,
0.7143504023551941,
0.7093713283538818,
0.7041336297988892,
0.7041336297988892,
0.7010817527770996,
0.6982388496398926,
0.6947668194770813,
0.6922011971473694,
0.6910198926925659,
0.687294602394104,
0.6868841052055359,
0.6868841052055359,
0.6856191754341125,
0.6822740435600281,
0.6782836318016052,
0.6761220693588257,
0.6759423613548279
],
[
113410,
170131,
72014,
171437,
94334,
11978,
38463,
103255,
38665,
62957,
201639,
165383,
170806,
153766,
40745,
209047,
168593,
223108,
161814,
210618
]
] |
|
ignotum_ptrace_read | 840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c | hc0d3r | alfheim | NA | ssize_t ignotum_ptrace_read(pid_t pid, void *buf, size_t n, long addr){
ssize_t ret;
size_t nread = 0, pos = 0, len;
long aligned, offset, bytes;
if(n == 0){
ret = 0;
goto end;
}
if(addr & (wordsize-1)){
aligned = addr & (long)(-wordsize);
offset = addr - aligned;
len = wordsize-offset;
addr = aligned;
} else {
len = wordsize;
offset = 0;
}
while(nread<n){
bytes = ptrace(PTRACE_PEEKDATA, pid, addr, 0L);
if(errno)
break;
nread += len;
if(nread > n){
len = n-(nread-len);
nread = n;
}
if(len == wordsize){
*(long *)(buf+pos) = bytes;
} else {
memcpy((char *)buf+pos, (char *)&bytes+offset, len);
len = wordsize;
offset = 0;
}
pos = nread;
addr += wordsize;
}
if(!nread){
ret = -1;
} else {
ret = (ssize_t)nread;
}
end:
return ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401F38", "function_addr": 4202296, "binary_name": "840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_44], edi"], [4, "mov [rbp+var_50], rsi"], [5, "mov [rbp+var_58], rdx"], [6, "mov [rbp+var_60], rcx"], [7, "mov [rbp+var_10], 0"], [8, "mov [rbp+var_18], 0"], [9, "cmp [rbp+var_58], 0"], [10, "jnz short loc_401F73"], [11, "mov [rbp+var_8], 0"], [12, "jmp loc_4020B9"], [13, "mov rax, [rbp+var_60]"], [14, "and eax, 7"], [15, "test rax, rax"], [16, "jz short loc_401FB4"], [17, "mov rax, [rbp+var_60]"], [18, "and rax, 0FFFFFFFFFFFFFFF8h"], [19, "mov [rbp+var_30], rax"], [20, "mov rax, [rbp+var_60]"], [21, "sub rax, [rbp+var_30]"], [22, "mov [rbp+var_28], rax"], [23, "mov rdx, [rbp+var_28]"], [24, "mov eax, 8"], [25, "sub rax, rdx"], [26, "mov [rbp+n], rax"], [27, "mov rax, [rbp+var_30]"], [28, "mov [rbp+var_60], rax"], [29, "jmp loc_40208F"], [30, "mov [rbp+n], 8"], [31, "mov [rbp+var_28], 0"], [32, "jmp loc_40208F"], [33, "mov rdx, [rbp+var_60]"], [34, "mov eax, [rbp+var_44]"], [35, "mov ecx, 0"], [36, "mov esi, eax"], [37, "mov edi, 2"], [38, "mov eax, 0"], [39, "call _ptrace"], [40, "mov [rbp+var_38], rax"], [41, "call ___errno_location"], [42, "mov eax, [rax]"], [43, "test eax, eax"], [44, "jnz loc_40209F"], [45, "mov rax, [rbp+n]"], [46, "add [rbp+var_10], rax"], [47, "mov rax, [rbp+var_10]"], [48, "cmp rax, [rbp+var_58]"], [49, "jbe short loc_402029"], [50, "mov rax, [rbp+n]"], [51, "sub rax, [rbp+var_10]"], [52, "mov rdx, rax"], [53, "mov rax, [rbp+var_58]"], [54, "add rax, rdx"], [55, "mov [rbp+n], rax"], [56, "mov rax, [rbp+var_58]"], [57, "mov [rbp+var_10], rax"], [58, "cmp [rbp+n], 8"], [59, "jnz short loc_402044"], [60, "mov rdx, [rbp+var_50]"], [61, "mov rax, [rbp+var_18]"], [62, "add rdx, rax"], [63, "mov rax, [rbp+var_38]"], [64, "mov [rdx], rax"], [65, "jmp short loc_40207B"], [66, "mov rax, [rbp+var_28]"], [67, "lea rdx, [rbp+var_38]"], [68, "lea rsi, [rdx+rax]"], [69, "mov rdx, [rbp+var_50]"], [70, "mov rax, [rbp+var_18]"], [71, "lea rcx, [rdx+rax]"], [72, "mov rax, [rbp+n]"], [73, "mov rdx, rax"], [74, "mov rdi, rcx"], [75, "call _memcpy"], [76, "mov [rbp+n], 8"], [77, "mov [rbp+var_28], 0"], [78, "mov rax, [rbp+var_10]"], [79, "mov [rbp+var_18], rax"], [80, "mov rax, [rbp+var_60]"], [81, "add rax, 8"], [82, "mov [rbp+var_60], rax"], [83, "mov rax, [rbp+var_10]"], [84, "cmp rax, [rbp+var_58]"], [85, "jb loc_401FC9"], [86, "jmp short loc_4020A0"], [87, "nop"], [88, "cmp [rbp+var_10], 0"], [89, "jnz short loc_4020B1"], [90, "mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh"], [91, "jmp short loc_4020B9"], [92, "mov rax, [rbp+var_10]"], [93, "mov [rbp+var_8], rax"], [94, "mov rax, [rbp+var_8]"], [95, "leave"], [96, "retn"]], "data_dep": [[9, 5], [10, 9], [13, 6], [14, 13], [15, 14], [16, 15], [17, 6], [18, 17], [19, 18], [20, 6], [21, 20], [21, 19], [22, 21], [23, 22], [25, 23], [25, 24], [26, 25], [27, 19], [28, 27], [33, 6], [33, 28], [33, 82], [34, 3], [36, 34], [40, 39], [42, 41], [42, 64], [43, 42], [44, 43], [45, 76], [45, 30], [45, 55], [45, 26], [46, 57], [46, 45], [46, 7], [46, 46], [47, 46], [48, 47], [48, 5], [49, 48], [50, 26], [50, 76], [50, 30], [50, 55], [51, 50], [51, 46], [52, 51], [53, 5], [54, 53], [54, 52], [55, 54], [56, 5], [57, 56], [58, 26], [58, 76], [58, 30], [58, 55], [59, 58], [60, 4], [61, 79], [61, 8], [62, 60], [62, 61], [63, 40], [64, 62], [64, 63], [66, 77], [66, 22], [66, 31], [67, 52], [67, 40], [67, 33], [68, 66], [68, 36], [68, 64], [69, 4], [70, 79], [70, 8], [71, 35], [71, 64], [71, 70], [72, 26], [72, 55], [72, 76], [72, 30], [73, 72], [74, 71], [78, 46], [78, 57], [79, 78], [80, 28], [80, 82], [80, 6], [81, 80], [82, 81], [83, 7], [83, 57], [83, 46], [84, 83], [84, 5], [85, 84], [88, 46], [88, 7], [88, 57], [89, 88], [92, 7], [92, 46], [92, 57], [93, 92], [94, 11], [94, 93], [94, 90], [96, 94]]}
| {"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_401F38", "query": "\n\n\nunsigned __int64 __fastcall sub_401F38(unsigned int a1, __int64 a2, unsigned __int64 a3, unsigned __int64 a4)\n{\nunsigned __int64 v5; // [rsp+0h] [rbp-60h]\n__int64 v7[2]; // [rsp+28h] [rbp-38h] BYREF\nunsigned __int64 v8; // [rsp+38h] [rbp-28h]\nsize_t n; // [rsp+40h] [rbp-20h]\nunsigned __int64 v10; // [rsp+48h] [rbp-18h]\nunsigned __int64 v11; // [rsp+50h] [rbp-10h]\nunsigned __int64 v12; // [rsp+58h] [rbp-8h]\n\nv5 = a4;\nv11 = 0LL;\nv10 = 0LL;\nif ( !a3 )\nreturn 0LL;\nif ( (a4 & 7) != 0 )\n{\nv7[1] = a4 & 0xFFFFFFFFFFFFFFF8LL;\nv8 = a4 - (a4 & 0xFFFFFFFFFFFFFFF8LL);\nn = 8 - v8;\nv5 = a4 & 0xFFFFFFFFFFFFFFF8LL;\n}\nelse\n{\nn = 8LL;\nv8 = 0LL;\n}\nwhile ( v11 < a3 )\n{\nv7[0] = ptrace(PTRACE_PEEKDATA, a1, v5, 0LL);\nif ( *__errno_location() )\nbreak;\nv11 += n;\nif ( v11 > a3 )\n{\nn = n - v11 + a3;\nv11 = a3;\n}\nif ( n == 8 )\n{\n*(_QWORD *)(v10 + a2) = v7[0];\n}\nelse\n{\nmemcpy((void *)(a2 + v10), (char *)v7 + v8, n);\nn = 8LL;\nv8 = 0LL;\n}\nv10 = v11;\nv5 += 8LL;\n}\nif ( v11 )\nv12 = v11;\nelse\nv12 = -1LL;\nreturn v12;\n}\n\n\n\nQ:[a3,a4,a1,a2,v5,v7,v8,n,v10,v11,sub_401F38,]", "hints": "[]", "response": "{'a3': 'n', 'a4': 'addr', 'a1': 'pid', 'a2': 'buf', 'v5': 'addra', 'v7': 'bytes', 'v8': 'offset', 'n': 'len', 'v10': 'pos', 'v11': 'nread', 'sub_401F38': 'ignotum_ptrace_read'}"} | [
[
0.7172295451164246,
0.7117639183998108,
0.7048583030700684,
0.701191246509552,
0.7001667022705078,
0.6995227336883545,
0.6993522047996521,
0.699116051197052,
0.6989680528640747,
0.6930232644081116,
0.6890062689781189,
0.6872342824935913,
0.6854045391082764,
0.6847543120384216,
0.6829013228416443,
0.6823557615280151,
0.68233323097229,
0.678098201751709,
0.6780562400817871,
0.677361011505127
],
[
231229,
169557,
238968,
128240,
40065,
12625,
219277,
98232,
147115,
258889,
130290,
23767,
135824,
74072,
25424,
22648,
188250,
55815,
43743,
101365
]
] |
|
spla_cumsum | bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2 | embotech | ecos | NA | void spla_cumsum(idxint* p, idxint* w, idxint m)
{
idxint cumsum = 0;
idxint i;
for( i=0; i < m; i++ ){
p[i] = cumsum;
cumsum += w[i];
w[i] = p[i];
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40F9CA", "function_addr": 4258250, "binary_name": "bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2.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_28], rdx"], [5, "mov [rbp+var_8], 0"], [6, "mov [rbp+var_10], 0"], [7, "jmp short loc_40FA51"], [8, "mov rax, [rbp+var_10]"], [9, "lea rdx, ds:0[rax*8]"], [10, "mov rax, [rbp+var_18]"], [11, "add rdx, rax"], [12, "mov rax, [rbp+var_8]"], [13, "mov [rdx], rax"], [14, "mov rax, [rbp+var_10]"], [15, "lea rdx, ds:0[rax*8]"], [16, "mov rax, [rbp+var_20]"], [17, "add rax, rdx"], [18, "mov rax, [rax]"], [19, "add [rbp+var_8], rax"], [20, "mov rax, [rbp+var_10]"], [21, "lea rdx, ds:0[rax*8]"], [22, "mov rax, [rbp+var_18]"], [23, "add rax, rdx"], [24, "mov rdx, [rbp+var_10]"], [25, "lea rcx, ds:0[rdx*8]"], [26, "mov rdx, [rbp+var_20]"], [27, "add rdx, rcx"], [28, "mov rax, [rax]"], [29, "mov [rdx], rax"], [30, "add [rbp+var_10], 1"], [31, "mov rax, [rbp+var_10]"], [32, "cmp rax, [rbp+var_28]"], [33, "jl short loc_40F9EC"], [34, "nop"], [35, "nop"], [36, "pop rbp"], [37, "retn"]], "data_dep": [[8, 6], [8, 30], [9, 27], [10, 2], [11, 10], [11, 9], [12, 19], [12, 5], [13, 11], [13, 12], [14, 6], [14, 30], [15, 11], [16, 3], [17, 15], [17, 16], [18, 17], [18, 13], [19, 18], [19, 5], [19, 19], [20, 6], [20, 30], [21, 15], [22, 2], [23, 22], [23, 21], [24, 30], [24, 6], [25, 25], [26, 3], [27, 25], [27, 26], [28, 23], [28, 13], [29, 28], [29, 27], [30, 6], [30, 30], [31, 6], [31, 30], [32, 31], [32, 4], [33, 32], [36, 0], [37, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2_bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2.jsonl.gz", "strip_func_name": "sub_40F9CA", "query": "\n\n\n__int64 __fastcall sub_40F9CA(__int64 a1, __int64 a2, __int64 a3)\n{\n__int64 result; // rax\n__int64 i; // [rsp+18h] [rbp-10h]\n__int64 v5; // [rsp+20h] [rbp-8h]\n\nv5 = 0LL;\nfor ( i = 0LL; ; ++i )\n{\nresult = i;\nif ( i >= a3 )\nbreak;\n*(_QWORD *)(a1 + 8 * i) = v5;\nv5 += *(_QWORD *)(8 * i + a2);\n*(_QWORD *)(8 * i + a2) = *(_QWORD *)(8 * i + a1);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v5,sub_40F9CA,]", "hints": "[]", "response": "{'a3': 'm', 'a1': 'p', 'a2': 'w', 'v5': 'cumsum', 'sub_40F9CA': 'spla_cumsum'}"} | [
[
0.8359271883964539,
0.8045769333839417,
0.8036686182022095,
0.8016365766525269,
0.7989583015441895,
0.7970056533813477,
0.7912690043449402,
0.7889194488525391,
0.7866668701171875,
0.775924801826477,
0.7753684520721436,
0.7748405933380127,
0.7630624175071716,
0.7614991068840027,
0.7591719031333923,
0.7487403750419617,
0.7380939722061157,
0.7376777529716492,
0.7375311851501465,
0.7357549667358398
],
[
211983,
68997,
185945,
160605,
257757,
158836,
56825,
180002,
172860,
245345,
220479,
98762,
87425,
258365,
197907,
143729,
109392,
81982,
194095,
48965
]
] |
|
allocstack | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static void allocstack(bfuncinfo *finfo, int count)
{
int nstack = finfo->freereg + count;
if (nstack > finfo->proto->nstack) {
if (nstack >= 255) {
be_lexerror(finfo->lexer, "register overflow (more than 255)");
}
finfo->proto->nstack = (bbyte)nstack;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42F013", "function_addr": 4386835, "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 [rbp+var_1C], esi"], [5, "mov rax, [rbp+var_18]"], [6, "movzx eax, byte ptr [rax+94h]"], [7, "movzx edx, al"], [8, "mov eax, [rbp+var_1C]"], [9, "add eax, edx"], [10, "mov [rbp+var_4], eax"], [11, "mov rax, [rbp+var_18]"], [12, "mov rax, [rax+8]"], [13, "movzx eax, byte ptr [rax+0Ah]"], [14, "movzx eax, al"], [15, "cmp [rbp+var_4], eax"], [16, "jle short loc_42F078"], [17, "cmp [rbp+var_4], 0FEh"], [18, "jle short loc_42F06A"], [19, "mov rax, [rbp+var_18]"], [20, "mov rax, [rax+18h]"], [21, "mov esi, offset aRegisterOverfl"], [22, "mov rdi, rax"], [23, "call be_lexerror"], [24, "mov rax, [rbp+var_18]"], [25, "mov rax, [rax+8]"], [26, "mov edx, [rbp+var_4]"], [27, "mov [rax+0Ah], dl"], [28, "nop"], [29, "leave"], [30, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 4], [9, 8], [9, 7], [10, 9], [11, 3], [12, 11], [13, 12], [14, 13], [15, 14], [15, 10], [16, 15], [17, 10], [18, 17], [19, 3], [20, 19], [22, 20], [24, 3], [25, 24], [26, 10], [27, 25], [27, 26], [30, 14], [30, 25]]}
| {"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_42F013", "query": "\n\n\n__int64 __fastcall sub_42F013(__int64 a1, int a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6)\n{\n__int64 v6; // rdx\n__int64 result; // rax\nint v8; // [rsp+1Ch] [rbp-4h]\n\nv6 = *(unsigned __int8 *)(a1 + 148);\nv8 = v6 + a2;\nresult = *(unsigned __int8 *)(*(_QWORD *)(a1 + 8) + 10LL);\nif ( (int)v6 + a2 > (int)result )\n{\nif ( v8 > 254 )\nbe_lexerror(*(_QWORD *)(a1 + 24), (__int64)\"register overflow (more than 255)\", v6, a4, a5, a6);\nresult = *(_QWORD *)(a1 + 8);\n*(_BYTE *)(result + 10) = v8;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v8,sub_42F013,]", "hints": "[]", "response": "{'a1': 'finfo', 'a2': 'count', 'v8': 'nstack', 'sub_42F013': 'allocstack'}"} | [
[
0.9050503373146057,
0.8943889141082764,
0.8943260312080383,
0.7976663112640381,
0.7723695635795593,
0.7706021070480347,
0.7699416279792786,
0.763308048248291,
0.7606945633888245,
0.7604168653488159,
0.7572878003120422,
0.7478126287460327,
0.7395813465118408,
0.7371946573257446,
0.734330415725708,
0.7320578098297119,
0.7310892343521118,
0.7274457812309265,
0.7260595560073853,
0.7255589962005615
],
[
46177,
69269,
61271,
208535,
105836,
160191,
190211,
20750,
263288,
106355,
219272,
2479,
158887,
85658,
176971,
31608,
14762,
56374,
180093,
135617
]
] |
|
is_integer | a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040 | ec- | Quake3e | NA | static int is_integer( const char *s )
{
int n = 0;
if ( *s == '-' )
++s;
while ( *s >= '0' && *s <= '9' )
{
++s; ++n;
}
if ( n == 0 || n > 24 || *s != '\0' )
return 0;
else
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B671", "function_addr": 4241009, "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_4], 0"], [4, "mov rax, [rbp+var_18]"], [5, "movzx eax, byte ptr [rax]"], [6, "cmp al, 2Dh "], [7, "jnz short loc_40B69B"], [8, "add [rbp+var_18], 1"], [9, "jmp short loc_40B69B"], [10, "add [rbp+var_18], 1"], [11, "add [rbp+var_4], 1"], [12, "mov rax, [rbp+var_18]"], [13, "movzx eax, byte ptr [rax]"], [14, "cmp al, 2Fh "], [15, "jle short loc_40B6B1"], [16, "mov rax, [rbp+var_18]"], [17, "movzx eax, byte ptr [rax]"], [18, "cmp al, 39h "], [19, "jle short loc_40B692"], [20, "cmp [rbp+var_4], 0"], [21, "jz short loc_40B6C8"], [22, "cmp [rbp+var_4], 18h"], [23, "jg short loc_40B6C8"], [24, "mov rax, [rbp+var_18]"], [25, "movzx eax, byte ptr [rax]"], [26, "test al, al"], [27, "jz short loc_40B6CF"], [28, "mov eax, 0"], [29, "jmp short loc_40B6D4"], [30, "mov eax, 1"], [31, "pop rbp"], [32, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 5], [7, 6], [8, 2], [10, 2], [10, 8], [10, 10], [11, 11], [11, 3], [12, 10], [12, 2], [12, 8], [13, 12], [14, 13], [15, 14], [16, 10], [16, 2], [16, 8], [17, 16], [18, 17], [19, 18], [20, 11], [20, 3], [21, 20], [22, 11], [22, 3], [23, 22], [24, 2], [24, 8], [24, 10], [25, 24], [26, 25], [27, 26], [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/a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040_a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.jsonl.gz", "strip_func_name": "sub_40B671", "query": "\n\n\n_BOOL8 __fastcall sub_40B671(char *a1)\n{\nchar *v2; // [rsp+0h] [rbp-18h]\nint v3; // [rsp+14h] [rbp-4h]\n\nv2 = a1;\nv3 = 0;\nif ( *a1 == 45 )\nv2 = a1 + 1;\nwhile ( *v2 > 47 && *v2 <= 57 )\n{\n++v2;\n++v3;\n}\nreturn v3 && v3 <= 24 && !*v2;\n}\n\n\n\nQ:[a1,v2,v3,sub_40B671,]", "hints": "[]", "response": "{'a1': 's', 'v2': 'sa', 'v3': 'n', 'sub_40B671': 'is_integer'}"} | [
[
0.8199560642242432,
0.7858784198760986,
0.782102108001709,
0.7706685662269592,
0.7652245163917542,
0.7602162957191467,
0.7592346668243408,
0.7553111910820007,
0.7461498975753784,
0.7406613230705261,
0.7397708296775818,
0.7397292852401733,
0.7355577945709229,
0.7354020476341248,
0.7324866652488708,
0.7296553254127502,
0.7293404340744019,
0.7291303873062134,
0.7274317145347595,
0.7272695302963257
],
[
182157,
84892,
229541,
198630,
121018,
174972,
170465,
28222,
187447,
264235,
44905,
260419,
7729,
216655,
145971,
204079,
261668,
219366,
41827,
34223
]
] |
|
check_cpuid_xsave | 7e4d48d3e470410ab6f608a6efa37f2e7e934463f558e9ab26ac5aec13f071c7 | marmolak | gray486linux | NA | static inline void check_cpuid_xsave(void)
{
uint32_t eax, ebx, ecx, edx;
/*
* CPUID.1:ECX.XSAVE[bit 26] enumerates general
* support for the XSAVE feature set, including
* XGETBV.
*/
__cpuid_count(1, 0, eax, ebx, ecx, edx);
if (!(ecx & CPUID_LEAF1_ECX_XSAVE_MASK))
fatal_error("cpuid: no CPU xsave support");
if (!(ecx & CPUID_LEAF1_ECX_OSXSAVE_MASK))
fatal_error("cpuid: no OS xsave support");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40145E", "function_addr": 4199518, "binary_name": "7e4d48d3e470410ab6f608a6efa37f2e7e934463f558e9ab26ac5aec13f071c7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 18h"], [4, "mov eax, 1"], [5, "mov edx, 0"], [6, "mov ecx, edx"], [7, "cpuid"], [8, "mov esi, ebx"], [9, "mov [rbp+var_14], eax"], [10, "mov [rbp+var_18], esi"], [11, "mov [rbp+var_1C], ecx"], [12, "mov [rbp+var_20], edx"], [13, "mov eax, [rbp+var_1C]"], [14, "and eax, 4000000h"], [15, "test eax, eax"], [16, "jnz short loc_4014A3"], [17, "mov esi, offset aFailCpuidNoCpu"], [18, "mov edi, 1"], [19, "mov eax, 0"], [20, "call _err"], [21, "mov eax, [rbp+var_1C]"], [22, "and eax, 8000000h"], [23, "test eax, eax"], [24, "jnz short loc_4014C3"], [25, "mov esi, offset aFailCpuidNoOsX"], [26, "mov edi, 1"], [27, "mov eax, 0"], [28, "call _err"], [29, "nop"], [30, "mov rbx, [rbp+var_8]"], [31, "leave"], [32, "retn"]], "data_dep": [[6, 5], [9, 4], [10, 8], [11, 6], [12, 5], [13, 11], [14, 13], [15, 14], [16, 15], [21, 11], [22, 21], [23, 22], [24, 23], [32, 23]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7e4d48d3e470410ab6f608a6efa37f2e7e934463f558e9ab26ac5aec13f071c7_7e4d48d3e470410ab6f608a6efa37f2e7e934463f558e9ab26ac5aec13f071c7.jsonl.gz", "strip_func_name": "sub_40145E", "query": "\n\n\n__int64 sub_40145E()\n{\n__int64 result; // rax\n\n_RAX = 1LL;\n__asm { cpuid }\nif ( (_RCX & 0x4000000) == 0 )\nerr(1, \"[FAIL]\\tcpuid: no CPU xsave support\");\nresult = _RCX & 0x8000000;\nif ( !(_DWORD)result )\nerr(1, \"[FAIL]\\tcpuid: no OS xsave support\");\nreturn result;\n}\n\n\n\nQ:[sub_40145E,]", "hints": "[]", "response": "{'sub_40145E': 'check_cpuid_xsave'}"} | [
[
0.7628549933433533,
0.750322699546814,
0.745841383934021,
0.7444806694984436,
0.7205904722213745,
0.7087551355361938,
0.7023298740386963,
0.7010177373886108,
0.6969790458679199,
0.6955565214157104,
0.6912881731987,
0.6900224685668945,
0.6894131898880005,
0.688948392868042,
0.6868623495101929,
0.6862087249755859,
0.6826707720756531,
0.6819917559623718,
0.6796736121177673,
0.6791960597038269
],
[
101509,
79546,
143605,
212007,
114053,
88149,
98042,
186383,
42741,
4196,
41942,
229496,
5910,
181387,
166367,
61170,
99658,
41605,
96707,
120472
]
] |
|
writen_ni | 7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e | OpenIPC | mini | NA | ssize_t
writen_ni(int fd, const void *buff, size_t n)
{
size_t nl;
ssize_t nw;
const char *p;
p = buff;
nl = n;
while (nl > 0) {
do {
nw = write(fd, p, nl);
} while ( nw < 0 && errno == EINTR );
if ( nw <= 0 ) break;
nl -= nw;
p += nw;
}
return n - nl;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402822", "function_addr": 4204578, "binary_name": "7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "mov rax, [rbp+var_30]"], [7, "mov [rbp+buf], rax"], [8, "mov rax, [rbp+var_38]"], [9, "mov [rbp+n], rax"], [10, "jmp short loc_40288A"], [11, "mov rdx, [rbp+n]"], [12, "mov rcx, [rbp+buf]"], [13, "mov eax, [rbp+fd]"], [14, "mov rsi, rcx"], [15, "mov edi, eax"], [16, "call _write"], [17, "mov [rbp+var_18], rax"], [18, "cmp [rbp+var_18], 0"], [19, "jns short loc_402873"], [20, "call ___errno_location"], [21, "mov eax, [rax]"], [22, "cmp eax, 4"], [23, "jz short loc_402847"], [24, "cmp [rbp+var_18], 0"], [25, "jle short loc_402893"], [26, "mov rax, [rbp+var_18]"], [27, "sub [rbp+n], rax"], [28, "mov rax, [rbp+var_18]"], [29, "add [rbp+buf], rax"], [30, "cmp [rbp+n], 0"], [31, "jnz short loc_402847"], [32, "jmp short loc_402894"], [33, "nop"], [34, "mov rax, [rbp+var_38]"], [35, "sub rax, [rbp+n]"], [36, "leave"], [37, "retn"]], "data_dep": [[6, 4], [7, 6], [8, 5], [9, 8], [11, 9], [11, 27], [12, 7], [12, 29], [13, 3], [14, 12], [15, 13], [17, 16], [18, 17], [19, 18], [21, 20], [22, 21], [23, 22], [24, 17], [25, 24], [26, 17], [27, 9], [27, 27], [27, 26], [28, 17], [29, 29], [29, 7], [29, 28], [30, 9], [30, 27], [31, 30], [34, 5], [35, 27], [35, 34], [35, 9], [37, 35]]}
| {"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_402822", "query": "\n\n\nsize_t __fastcall sub_402822(int a1, char *a2, size_t a3)\n{\nsize_t v4; // [rsp+8h] [rbp-38h]\nssize_t v5; // [rsp+28h] [rbp-18h]\nsize_t n; // [rsp+38h] [rbp-8h]\n\nv4 = a3;\nn = a3;\nwhile ( n )\n{\ndo\nv5 = write(a1, a2, n);\nwhile ( v5 < 0 && *__errno_location() == 4 );\nif ( v5 <= 0 )\nbreak;\nn -= v5;\na2 += v5;\n}\nreturn v4 - n;\n}\n\n\n\nQ:[a3,a1,a2,v4,v5,n,sub_402822,]", "hints": "[]", "response": "{'a3': 'n', 'a1': 'fd', 'a2': 'buff', 'v4': 'na', 'v5': 'nw', 'n': 'nl', 'sub_402822': 'writen_ni'}"} | [
[
0.8748092651367188,
0.8701037168502808,
0.8639391660690308,
0.8613221645355225,
0.8605514168739319,
0.8566961288452148,
0.8554459810256958,
0.8537293672561646,
0.8519724607467651,
0.8446515202522278,
0.8441801071166992,
0.8408003449440002,
0.8358544111251831,
0.8346982598304749,
0.8268213272094727,
0.8200509548187256,
0.8172852993011475,
0.8157642483711243,
0.8113770484924316,
0.810205340385437
],
[
116583,
67183,
81621,
40107,
104682,
186400,
27063,
157650,
158058,
96422,
8731,
98430,
57003,
224286,
254401,
22648,
84838,
20487,
117060,
242689
]
] |
|
add_arg | 91c27c4b198d479f83197334ca3cfad5aeda7f2303f857b076f5a3f408c494f7 | xyzz | psclassic-source | NA | static void add_arg(char **cmdp, const char *opt)
{
size_t optlen = strlen(opt);
size_t cmdlen = *cmdp ? strlen(*cmdp) : 0;
char *cmd = xrealloc(*cmdp, cmdlen + optlen * 4 + 4);
char *s;
s = cmd + cmdlen;
if (*cmdp)
*s++ = ' ';
*s++ = '\'';
for (; *opt; opt++) {
if (*opt == '\'') {
*s++ = '\'';
*s++ = '\\';
*s++ = '\'';
*s++ = '\'';
} else
*s++ = *opt;
}
*s++ = '\'';
*s = '\0';
*cmdp = cmd;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4012DD", "function_addr": 4199133, "binary_name": "91c27c4b198d479f83197334ca3cfad5aeda7f2303f857b076f5a3f408c494f7.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+s], rsi"], [5, "mov rax, [rbp+s]"], [6, "mov rdi, rax"], [7, "call _strlen"], [8, "mov [rbp+var_10], rax"], [9, "mov rax, [rbp+var_28]"], [10, "mov rax, [rax]"], [11, "test rax, rax"], [12, "jz short loc_40131A"], [13, "mov rax, [rbp+var_28]"], [14, "mov rax, [rax]"], [15, "mov rdi, rax"], [16, "call _strlen"], [17, "jmp short loc_40131F"], [18, "mov eax, 0"], [19, "mov [rbp+var_18], rax"], [20, "mov rax, [rbp+var_10]"], [21, "lea rdx, ds:0[rax*4]"], [22, "mov rax, [rbp+var_18]"], [23, "add rax, rdx"], [24, "lea rdx, [rax+4]"], [25, "mov rax, [rbp+var_28]"], [26, "mov rax, [rax]"], [27, "mov rsi, rdx"], [28, "mov rdi, rax"], [29, "call sub_40127A"], [30, "mov [rbp+var_20], rax"], [31, "mov rdx, [rbp+var_20]"], [32, "mov rax, [rbp+var_18]"], [33, "add rax, rdx"], [34, "mov [rbp+var_8], rax"], [35, "mov rax, [rbp+var_28]"], [36, "mov rax, [rax]"], [37, "test rax, rax"], [38, "jz short loc_40137A"], [39, "mov rax, [rbp+var_8]"], [40, "lea rdx, [rax+1]"], [41, "mov [rbp+var_8], rdx"], [42, "mov byte ptr [rax], 20h "], [43, "mov rax, [rbp+var_8]"], [44, "lea rdx, [rax+1]"], [45, "mov [rbp+var_8], rdx"], [46, "mov byte ptr [rax], 27h "], [47, "jmp short loc_4013EE"], [48, "mov rax, [rbp+s]"], [49, "movzx eax, byte ptr [rax]"], [50, "cmp al, 27h "], [51, "jnz short loc_4013D4"], [52, "mov rax, [rbp+var_8]"], [53, "lea rdx, [rax+1]"], [54, "mov [rbp+var_8], rdx"], [55, "mov byte ptr [rax], 27h "], [56, "mov rax, [rbp+var_8]"], [57, "lea rdx, [rax+1]"], [58, "mov [rbp+var_8], rdx"], [59, "mov byte ptr [rax], 5Ch "], [60, "mov rax, [rbp+var_8]"], [61, "lea rdx, [rax+1]"], [62, "mov [rbp+var_8], rdx"], [63, "mov byte ptr [rax], 27h "], [64, "mov rax, [rbp+var_8]"], [65, "lea rdx, [rax+1]"], [66, "mov [rbp+var_8], rdx"], [67, "mov byte ptr [rax], 27h "], [68, "jmp short loc_4013E9"], [69, "mov rax, [rbp+var_8]"], [70, "lea rdx, [rax+1]"], [71, "mov [rbp+var_8], rdx"], [72, "mov rdx, [rbp+s]"], [73, "movzx edx, byte ptr [rdx]"], [74, "mov [rax], dl"], [75, "add [rbp+s], 1"], [76, "mov rax, [rbp+s]"], [77, "movzx eax, byte ptr [rax]"], [78, "test al, al"], [79, "jnz short loc_40138B"], [80, "mov rax, [rbp+var_8]"], [81, "lea rdx, [rax+1]"], [82, "mov [rbp+var_8], rdx"], [83, "mov byte ptr [rax], 27h "], [84, "mov rax, [rbp+var_8]"], [85, "mov byte ptr [rax], 0"], [86, "mov rax, [rbp+var_28]"], [87, "mov rdx, [rbp+var_20]"], [88, "mov [rax], rdx"], [89, "nop"], [90, "leave"], [91, "retn"]], "data_dep": [[5, 4], [6, 5], [8, 7], [9, 3], [10, 9], [11, 10], [12, 11], [13, 3], [14, 13], [15, 14], [19, 18], [19, 16], [20, 8], [22, 19], [23, 22], [23, 21], [24, 21], [24, 23], [25, 3], [26, 25], [27, 24], [28, 26], [30, 29], [31, 30], [32, 19], [33, 31], [33, 32], [34, 33], [35, 3], [36, 35], [37, 36], [38, 37], [39, 34], [40, 31], [40, 39], [41, 40], [42, 39], [43, 34], [43, 41], [44, 31], [44, 40], [44, 42], [44, 46], [44, 43], [45, 44], [46, 43], [48, 75], [48, 4], [49, 46], [49, 55], [49, 48], [49, 59], [49, 63], [49, 42], [49, 74], [49, 67], [50, 49], [51, 50], [52, 71], [52, 66], [52, 45], [53, 55], [53, 73], [53, 59], [53, 52], [53, 63], [53, 65], [53, 42], [53, 44], [53, 74], [53, 46], [53, 67], [54, 53], [55, 52], [56, 54], [57, 56], [57, 53], [57, 55], [58, 57], [59, 56], [60, 58], [61, 60], [61, 57], [61, 59], [62, 61], [63, 60], [64, 62], [65, 61], [65, 63], [65, 64], [66, 65], [67, 64], [69, 71], [69, 66], [69, 45], [70, 55], [70, 73], [70, 59], [70, 63], [70, 42], [70, 44], [70, 65], [70, 74], [70, 67], [70, 69], [70, 46], [71, 70], [72, 75], [72, 4], [73, 74], [73, 46], [73, 67], [73, 55], [73, 59], [73, 63], [73, 72], [73, 42], [74, 73], [74, 69], [75, 75], [75, 4], [76, 75], [76, 4], [77, 46], [77, 55], [77, 76], [77, 59], [77, 63], [77, 74], [77, 67], [77, 42], [78, 77], [79, 78], [80, 71], [80, 66], [80, 45], [81, 85], [81, 80], [81, 73], [81, 59], [81, 63], [81, 65], [81, 74], [81, 67], [81, 88], [81, 42], [81, 44], [81, 83], [81, 46], [81, 55], [82, 81], [83, 80], [84, 82], [85, 84], [86, 3], [87, 30], [88, 86], [88, 87], [91, 86]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/91c27c4b198d479f83197334ca3cfad5aeda7f2303f857b076f5a3f408c494f7_91c27c4b198d479f83197334ca3cfad5aeda7f2303f857b076f5a3f408c494f7.jsonl.gz", "strip_func_name": "sub_4012DD", "query": "\n\n\nconst char **__fastcall sub_4012DD(const char **a1, const char *a2)\n{\nsize_t v2; // rax\n_BYTE *v3; // rax\n_BYTE *v4; // rax\nchar *v5; // rax\nconst char **result; // rax\nchar *s; // [rsp+0h] [rbp-30h]\nconst char *v8; // [rsp+10h] [rbp-20h]\nsize_t v9; // [rsp+18h] [rbp-18h]\nsize_t v10; // [rsp+20h] [rbp-10h]\nchar *v11; // [rsp+28h] [rbp-8h]\nchar *v12; // [rsp+28h] [rbp-8h]\n\ns = (char *)a2;\nv10 = strlen(a2);\nif ( *a1 )\nv2 = strlen(*a1);\nelse\nv2 = 0LL;\nv9 = v2;\nv8 = (const char *)sub_40127A((void *)*a1, 4 * v10 + v2 + 4);\nv11 = (char *)&v8[v9];\nif ( *a1 )\n{\n++v11;\nv8[v9] = 32;\n}\nv3 = v11;\nv12 = v11 + 1;\n*v3 = 39;\nwhile ( *s )\n{\nif ( *s == 39 )\n{\n*v12 = 39;\nv12[1] = 92;\nv12[2] = 39;\nv4 = v12 + 3;\nv12 += 4;\n*v4 = 39;\n}\nelse\n{\nv5 = v12++;\n*v5 = *s;\n}\n++s;\n}\n*v12 = 39;\nv12[1] = 0;\nresult = a1;\n*a1 = v8;\nreturn result;\n}\n\n\n\nQ:[a1,a2,s,v8,v9,v10,v11,sub_4012DD,sub_40127A,]", "hints": "[]", "response": "{'a1': 'cmdp', 'a2': 'opt', 's': 'opta', 'v8': 'cmd', 'v9': 'cmdlen', 'v10': 'optlen', 'v11': 's', 'sub_4012DD': 'add_arg', 'sub_40127A': 'xrealloc'}"} | [
[
0.7962592244148254,
0.7953845858573914,
0.7771108746528625,
0.767146110534668,
0.7563579082489014,
0.7381376028060913,
0.7350256443023682,
0.731508195400238,
0.7240857481956482,
0.7226592898368835,
0.7215425968170166,
0.7212123870849609,
0.7207944989204407,
0.7206928133964539,
0.7204899191856384,
0.7169163227081299,
0.7165367007255554,
0.7157945036888123,
0.7153329253196716,
0.7152472138404846
],
[
104511,
170872,
60930,
166094,
245387,
219285,
177720,
223247,
34563,
52951,
118297,
92730,
212207,
8922,
58885,
110262,
231079,
111290,
43510,
148261
]
] |
|
arm_mat_scale_f32 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | arm_status arm_mat_scale_f32(
const arm_matrix_instance_f32 * pSrc,
float32_t scale,
arm_matrix_instance_f32 * pDst)
{
float32_t *pIn = pSrc->pData; /* Input data matrix pointer */
float32_t *pOut = pDst->pData; /* Output data matrix pointer */
uint32_t numSamples; /* Total number of elements in the matrix */
uint32_t blkCnt; /* Loop counters */
arm_status status; /* Status of matrix scaling */
#ifdef ARM_MATH_MATRIX_CHECK
/* Check for matrix mismatch condition */
if ((pSrc->numRows != pDst->numRows) ||
(pSrc->numCols != pDst->numCols) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
}
else
#endif /* #ifdef ARM_MATH_MATRIX_CHECK */
{
/* Total number of samples in input matrix */
numSamples = (uint32_t) pSrc->numRows * pSrc->numCols;
#if defined (ARM_MATH_LOOPUNROLL)
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = numSamples >> 2U;
while (blkCnt > 0U)
{
/* C(m,n) = A(m,n) * scale */
/* Scale and store result in destination buffer. */
*pOut++ = (*pIn++) * scale;
*pOut++ = (*pIn++) * scale;
*pOut++ = (*pIn++) * scale;
*pOut++ = (*pIn++) * scale;
/* Decrement loop counter */
blkCnt--;
}
/* Loop unrolling: Compute remaining outputs */
blkCnt = numSamples % 0x4U;
#else
/* Initialize blkCnt with number of samples */
blkCnt = numSamples;
#endif /* #if defined (ARM_MATH_LOOPUNROLL) */
while (blkCnt > 0U)
{
/* C(m,n) = A(m,n) * scale */
/* Scale and store result in destination buffer. */
*pOut++ = (*pIn++) * scale;
/* Decrement loop counter */
blkCnt--;
}
/* Set status as ARM_MATH_SUCCESS */
status = ARM_MATH_SUCCESS;
}
/* Return to application */
return (status);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_408EF8", "function_addr": 4230904, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "movss [rbp+var_2C], xmm0"], [4, "mov [rbp+var_38], rsi"], [5, "mov rax, [rbp+var_28]"], [6, "mov rax, [rax+8]"], [7, "mov [rbp+var_8], rax"], [8, "mov rax, [rbp+var_38]"], [9, "mov rax, [rax+8]"], [10, "mov [rbp+var_10], rax"], [11, "mov rax, [rbp+var_28]"], [12, "movzx eax, word ptr [rax]"], [13, "movzx edx, ax"], [14, "mov rax, [rbp+var_28]"], [15, "movzx eax, word ptr [rax+2]"], [16, "movzx eax, ax"], [17, "imul eax, edx"], [18, "mov [rbp+var_18], eax"], [19, "mov eax, [rbp+var_18]"], [20, "mov [rbp+var_14], eax"], [21, "jmp short loc_408F6D"], [22, "mov rax, [rbp+var_8]"], [23, "lea rdx, [rax+4]"], [24, "mov [rbp+var_8], rdx"], [25, "movss xmm0, dword ptr [rax]"], [26, "mov rax, [rbp+var_10]"], [27, "lea rdx, [rax+4]"], [28, "mov [rbp+var_10], rdx"], [29, "mulss xmm0, [rbp+var_2C]"], [30, "movss dword ptr [rax], xmm0"], [31, "sub [rbp+var_14], 1"], [32, "cmp [rbp+var_14], 0"], [33, "jnz short loc_408F44"], [34, "mov [rbp+var_1C], 0"], [35, "mov eax, [rbp+var_1C]"], [36, "pop rbp"], [37, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 6], [8, 4], [9, 8], [10, 9], [11, 2], [12, 11], [13, 12], [14, 2], [15, 14], [16, 15], [17, 16], [17, 13], [18, 17], [19, 18], [20, 19], [22, 7], [22, 24], [23, 13], [23, 22], [23, 30], [23, 27], [24, 23], [25, 22], [25, 30], [26, 10], [26, 28], [27, 30], [27, 23], [27, 26], [28, 27], [29, 25], [29, 3], [30, 26], [30, 29], [31, 20], [31, 31], [32, 31], [32, 20], [33, 32], [35, 34], [36, 0], [37, 35]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_408EF8", "query": "\n\n\n__int64 __fastcall sub_408EF8(unsigned __int16 *a1, __int64 a2, float a3)\n{\nfloat *v3; // rax\nfloat v4; // xmm0_4\nfloat *v5; // rax\nint i; // [rsp+24h] [rbp-14h]\nfloat *v9; // [rsp+28h] [rbp-10h]\nfloat *v10; // [rsp+30h] [rbp-8h]\n\nv10 = (float *)*((_QWORD *)a1 + 1);\nv9 = *(float **)(a2 + 8);\nfor ( i = *a1 * a1[1]; i; --i )\n{\nv3 = v10++;\nv4 = *v3;\nv5 = v9++;\n*v5 = v4 * a3;\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,a3,i,v9,v10,sub_408EF8,]", "hints": "[]", "response": "{'a1': 'pSrc', 'a2': 'pDst', 'a3': 'scale', 'i': 'blkCnt', 'v9': 'pOut', 'v10': 'pIn', 'sub_408EF8': 'arm_mat_scale_f32'}"} | [
[
0.7992992401123047,
0.7790216207504272,
0.7687666416168213,
0.761378288269043,
0.7496688961982727,
0.745846152305603,
0.7452901005744934,
0.7448362708091736,
0.742203414440155,
0.7413089871406555,
0.7248908281326294,
0.7203423380851746,
0.7022196650505066,
0.6952801942825317,
0.6919348239898682,
0.6901329755783081,
0.6889304518699646,
0.6817108392715454,
0.6764190793037415,
0.6720510721206665
],
[
112963,
140602,
241030,
148127,
231904,
21543,
135157,
55890,
216699,
103902,
105989,
261515,
147598,
73239,
44333,
194765,
137052,
9783,
4996,
142282
]
] |
|
help_menu | bea9e3c5c56be407a0ab6aff114022f99955aa4e7206f03ce0f948c26c654647 | iankronquist | beeswax | NA | static void help_menu(char * file)
{
fprintf(stderr,"General: %s [w or t] [a] [n or e]"
"[directories to be watched]",file);
fprintf(stderr,"\n\t-w Watch Only, do NOT Traverse");
fprintf(stderr,"\n\t-t Traverse and Add Child Directories to Watch List");
fprintf(stderr,"\n\t-h Display this Help Menu");
fprintf(stderr,"\n\t-a Add Created Child Directories to Watch List");
fprintf(stderr,"\n\t-n Watch for Only Creation Events [DEFAULT]");
fprintf(stderr,"\n\t-e Watch for ALL Events\n");
return;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4026EA", "function_addr": 4204266, "binary_name": "bea9e3c5c56be407a0ab6aff114022f99955aa4e7206f03ce0f948c26c654647.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 aGeneralSWOrTAN"], [7, "mov rdi, rax"], [8, "mov eax, 0"], [9, "call _fprintf"], [10, "mov rax, cs:stderr"], [11, "mov rcx, rax"], [12, "mov edx, 20h "], [13, "mov esi, 1"], [14, "mov edi, offset aWWatchOnlyDoNo"], [15, "call _fwrite"], [16, "mov rax, cs:stderr"], [17, "mov rcx, rax"], [18, "mov edx, 35h "], [19, "mov esi, 1"], [20, "mov edi, offset aTTraverseAndAd"], [21, "call _fwrite"], [22, "mov rax, cs:stderr"], [23, "mov rcx, rax"], [24, "mov edx, 1Bh"], [25, "mov esi, 1"], [26, "mov edi, offset aHDisplayThisHe"], [27, "call _fwrite"], [28, "mov rax, cs:stderr"], [29, "mov rcx, rax"], [30, "mov edx, 30h "], [31, "mov esi, 1"], [32, "mov edi, offset aAAddCreatedChi"], [33, "call _fwrite"], [34, "mov rax, cs:stderr"], [35, "mov rcx, rax"], [36, "mov edx, 2Dh "], [37, "mov esi, 1"], [38, "mov edi, offset aNWatchForOnlyC"], [39, "call _fwrite"], [40, "mov rax, cs:stderr"], [41, "mov rcx, rax"], [42, "mov edx, 1Ah"], [43, "mov esi, 1"], [44, "mov edi, offset aEWatchForAllEv"], [45, "call _fwrite"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[5, 3], [7, 4], [11, 10], [17, 16], [23, 22], [29, 28], [35, 34], [41, 40], [48, 45]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bea9e3c5c56be407a0ab6aff114022f99955aa4e7206f03ce0f948c26c654647_bea9e3c5c56be407a0ab6aff114022f99955aa4e7206f03ce0f948c26c654647.jsonl.gz", "strip_func_name": "sub_4026EA", "query": "\n\n\nsize_t __fastcall sub_4026EA(const char *a1)\n{\nfprintf(stderr, \"General: %s [w or t] [a] [n or e][directories to be watched]\", a1);\nfwrite(\"\\n\\t-w Watch Only, do NOT Traverse\", 1uLL, 0x20uLL, stderr);\nfwrite(\"\\n\\t-t Traverse and Add Child Directories to Watch List\", 1uLL, 0x35uLL, stderr);\nfwrite(\"\\n\\t-h Display this Help Menu\", 1uLL, 0x1BuLL, stderr);\nfwrite(\"\\n\\t-a Add Created Child Directories to Watch List\", 1uLL, 0x30uLL, stderr);\nfwrite(\"\\n\\t-n Watch for Only Creation Events [DEFAULT]\", 1uLL, 0x2DuLL, stderr);\nreturn fwrite(\"\\n\\t-e Watch for ALL Events\\n\", 1uLL, 0x1AuLL, stderr);\n}\n\n\n\nQ:[a1,sub_4026EA,]", "hints": "[]", "response": "{'a1': 'file', 'sub_4026EA': 'help_menu'}"} | [
[
0.934550404548645,
0.9218057990074158,
0.919008731842041,
0.9179182648658752,
0.9164833426475525,
0.9144958853721619,
0.9132588505744934,
0.913209080696106,
0.9114004969596863,
0.9108821749687195,
0.9104993939399719,
0.9101355075836182,
0.9095228314399719,
0.9088318347930908,
0.9078669548034668,
0.9075943231582642,
0.9068201780319214,
0.9058425426483154,
0.9044697284698486,
0.9009564518928528
],
[
168448,
187859,
48862,
244587,
60341,
46781,
233964,
126484,
261475,
207935,
119442,
247140,
178997,
75172,
47463,
80709,
240059,
186716,
57687,
4500
]
] |
|
check_keyname_compliance | e359572e3834055cf3281edc6064fc6d544f23deafb76901d8ad7fc81afbecae | leahneukirchen | outils | NA | static void
check_keyname_compliance(const char *pubkeyfile, const char *seckeyfile)
{
const char *pos;
size_t len;
/* basename may or may not modify input */
pos = strrchr(seckeyfile, '/');
if (pos != NULL)
seckeyfile = pos + 1;
len = strlen(seckeyfile);
if (len < 5) /* ?.key */
goto bad;
if (strcmp(pubkeyfile + len - 4, ".pub") != 0 ||
strcmp(seckeyfile + len - 4, ".sec") != 0)
goto bad;
if (strncmp(pubkeyfile, seckeyfile, len - 4) != 0)
goto bad;
if (pubkeyfile != NULL) {
pos = strrchr(pubkeyfile, '/');
if (pos != NULL)
pubkeyfile = pos + 1;
if (strlen(pubkeyfile) != len)
goto bad;
if (strcmp(pubkeyfile + len - 4, ".pub") != 0)
goto bad;
if (strncmp(pubkeyfile, seckeyfile, len - 4) != 0)
goto bad;
}
return;
bad:
errx(1, "please use naming scheme of keyname.pub and keyname.sec");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4032E8", "function_addr": 4207336, "binary_name": "e359572e3834055cf3281edc6064fc6d544f23deafb76901d8ad7fc81afbecae.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+s1], rdi"], [4, "mov [rbp+s], rsi"], [5, "mov rax, [rbp+s]"], [6, "mov esi, 2Fh "], [7, "mov rdi, rax"], [8, "call _strrchr"], [9, "mov [rbp+var_8], rax"], [10, "cmp [rbp+var_8], 0"], [11, "jz short loc_403320"], [12, "mov rax, [rbp+var_8]"], [13, "add rax, 1"], [14, "mov [rbp+s], rax"], [15, "mov rax, [rbp+s]"], [16, "mov rdi, rax"], [17, "call _strlen"], [18, "mov [rbp+var_10], rax"], [19, "cmp [rbp+var_10], 4"], [20, "jbe loc_40342C"], [21, "mov rax, [rbp+var_10]"], [22, "lea rdx, [rax-4]"], [23, "mov rax, [rbp+s1]"], [24, "add rax, rdx"], [25, "mov esi, offset aPub"], [26, "mov rdi, rax"], [27, "call _strcmp"], [28, "test eax, eax"], [29, "jnz loc_40342F"], [30, "mov rax, [rbp+var_10]"], [31, "lea rdx, [rax-4]"], [32, "mov rax, [rbp+s]"], [33, "add rax, rdx"], [34, "mov esi, offset aSec"], [35, "mov rdi, rax"], [36, "call _strcmp"], [37, "test eax, eax"], [38, "jnz loc_40342F"], [39, "mov rax, [rbp+var_10]"], [40, "lea rdx, [rax-4]"], [41, "mov rcx, [rbp+s]"], [42, "mov rax, [rbp+s1]"], [43, "mov rsi, rcx"], [44, "mov rdi, rax"], [45, "call _strncmp"], [46, "test eax, eax"], [47, "jnz loc_403432"], [48, "cmp [rbp+s1], 0"], [49, "jz loc_40344D"], [50, "mov rax, [rbp+s1]"], [51, "mov esi, 2Fh "], [52, "mov rdi, rax"], [53, "call _strrchr"], [54, "mov [rbp+var_8], rax"], [55, "cmp [rbp+var_8], 0"], [56, "jz short loc_4033D9"], [57, "mov rax, [rbp+var_8]"], [58, "add rax, 1"], [59, "mov [rbp+s1], rax"], [60, "mov rax, [rbp+s1]"], [61, "mov rdi, rax"], [62, "call _strlen"], [63, "cmp [rbp+var_10], rax"], [64, "jnz short loc_403435"], [65, "mov rax, [rbp+var_10]"], [66, "lea rdx, [rax-4]"], [67, "mov rax, [rbp+s1]"], [68, "add rax, rdx"], [69, "mov esi, offset aPub"], [70, "mov rdi, rax"], [71, "call _strcmp"], [72, "test eax, eax"], [73, "jnz short loc_403438"], [74, "mov rax, [rbp+var_10]"], [75, "lea rdx, [rax-4]"], [76, "mov rcx, [rbp+s]"], [77, "mov rax, [rbp+s1]"], [78, "mov rsi, rcx"], [79, "mov rdi, rax"], [80, "call _strncmp"], [81, "test eax, eax"], [82, "jz short loc_40344D"], [83, "jmp short loc_403439"], [84, "nop"], [85, "jmp short loc_403439"], [86, "nop"], [87, "jmp short loc_403439"], [88, "nop"], [89, "jmp short loc_403439"], [90, "nop"], [91, "jmp short loc_403439"], [92, "nop"], [93, "mov esi, offset aPleaseUseNamin"], [94, "mov edi, 1"], [95, "mov eax, 0"], [96, "call _errx"], [97, "nop"], [98, "leave"], [99, "retn"]], "data_dep": [[5, 4], [7, 5], [9, 8], [10, 9], [11, 10], [12, 9], [13, 12], [14, 13], [15, 14], [15, 4], [16, 15], [18, 17], [19, 18], [20, 19], [21, 18], [22, 21], [23, 3], [24, 23], [24, 22], [26, 24], [28, 27], [29, 28], [30, 18], [31, 22], [31, 30], [32, 14], [32, 4], [33, 31], [33, 32], [35, 33], [37, 36], [38, 37], [39, 18], [40, 31], [40, 39], [41, 14], [41, 4], [42, 3], [43, 41], [44, 42], [46, 45], [47, 46], [48, 3], [49, 48], [50, 3], [52, 50], [54, 53], [55, 54], [56, 55], [57, 54], [58, 57], [59, 58], [60, 59], [60, 3], [61, 60], [63, 62], [63, 18], [64, 63], [65, 18], [66, 40], [66, 65], [67, 59], [67, 3], [68, 66], [68, 67], [70, 68], [72, 71], [73, 72], [74, 18], [75, 74], [75, 66], [76, 14], [76, 4], [77, 59], [77, 3], [78, 76], [79, 77], [81, 80], [82, 81], [99, 81], [99, 46]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e359572e3834055cf3281edc6064fc6d544f23deafb76901d8ad7fc81afbecae_e359572e3834055cf3281edc6064fc6d544f23deafb76901d8ad7fc81afbecae.jsonl.gz", "strip_func_name": "sub_4032E8", "query": "\n\n\nint __fastcall sub_4032E8(const char *a1, const char *a2)\n{\nint result; // eax\nchar *s; // [rsp+0h] [rbp-20h]\nchar *s1; // [rsp+8h] [rbp-18h]\nsize_t v5; // [rsp+10h] [rbp-10h]\nchar *v6; // [rsp+18h] [rbp-8h]\nchar *v7; // [rsp+18h] [rbp-8h]\n\ns1 = (char *)a1;\ns = (char *)a2;\nv6 = strrchr(a2, 47);\nif ( v6 )\ns = v6 + 1;\nv5 = strlen(s);\nif ( v5 <= 4 )\ngoto LABEL_13;\nif ( strcmp(&a1[v5 - 4], \".pub\") )\ngoto LABEL_13;\nif ( strcmp(&s[v5 - 4], \".sec\") )\ngoto LABEL_13;\nresult = strncmp(a1, s, v5 - 4);\nif ( result )\ngoto LABEL_13;\nif ( a1 )\n{\nv7 = strrchr(a1, 47);\nif ( v7 )\ns1 = v7 + 1;\nif ( v5 != strlen(s1) || strcmp(&s1[v5 - 4], \".pub\") || (result = strncmp(s1, s, v5 - 4)) != 0 )\nLABEL_13:\nerrx(1, \"please use naming scheme of keyname.pub and keyname.sec\");\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,s,s1,v5,v6,sub_4032E8,]", "hints": "[]", "response": "{'a1': 'pubkeyfile', 'a2': 'seckeyfile', 's': 'seckeyfilea', 's1': 'pubkeyfilea', 'v5': 'len', 'v6': 'pos', 'sub_4032E8': 'check_keyname_compliance'}"} | [
[
0.8635957837104797,
0.8433735370635986,
0.8424321413040161,
0.840589165687561,
0.8282545208930969,
0.7961348295211792,
0.7931694388389587,
0.7903326153755188,
0.7839017510414124,
0.7668619751930237,
0.7441526055335999,
0.7388692498207092,
0.7365294694900513,
0.7359803915023804,
0.7353286147117615,
0.7326132655143738,
0.7314442992210388,
0.7284144163131714,
0.7280558347702026,
0.7262997031211853
],
[
192399,
114174,
103607,
211852,
201364,
179179,
176367,
102184,
180253,
116471,
147575,
256203,
240998,
225089,
189094,
245200,
214133,
214127,
124107,
44257
]
] |
|
print | e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d | CCareaga | useless | NA | int print(cpu_t *cpu, int *ram, uint16_t type) {
int val = ram[++cpu->pc];
switch (type) {
case (ocode(L, 0, 0, 0)):
putchar(val);
break;
case (ocode(M, 0, 0, 0)):
putchar(ram[val]);
break;
case (ocode(R, 0, 0, 0)):
putchar(ram[ram[val]]);
break;
default:
return 0;
}
fflush(stdout);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403E52", "function_addr": 4210258, "binary_name": "e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov eax, edx"], [6, "mov [rbp+var_24], ax"], [7, "mov rax, [rbp+var_18]"], [8, "mov eax, [rax]"], [9, "lea edx, [rax+1]"], [10, "mov rax, [rbp+var_18]"], [11, "mov [rax], edx"], [12, "mov rax, [rbp+var_18]"], [13, "mov eax, [rax]"], [14, "cdqe"], [15, "lea rdx, ds:0[rax*4]"], [16, "mov rax, [rbp+var_20]"], [17, "add rax, rdx"], [18, "mov eax, [rax]"], [19, "mov [rbp+c], eax"], [20, "movzx eax, [rbp+var_24]"], [21, "cmp eax, 4"], [22, "jz short loc_403ED8"], [23, "cmp eax, 4"], [24, "jg short loc_403F0A"], [25, "cmp eax, 1"], [26, "jz short loc_403EAD"], [27, "cmp eax, 2"], [28, "jz short loc_403EB9"], [29, "jmp short loc_403F0A"], [30, "mov eax, [rbp+c]"], [31, "mov edi, eax"], [32, "call _putchar"], [33, "jmp short loc_403F11"], [34, "mov eax, [rbp+c]"], [35, "cdqe"], [36, "lea rdx, ds:0[rax*4]"], [37, "mov rax, [rbp+var_20]"], [38, "add rax, rdx"], [39, "mov eax, [rax]"], [40, "mov edi, eax"], [41, "call _putchar"], [42, "jmp short loc_403F11"], [43, "mov eax, [rbp+c]"], [44, "cdqe"], [45, "lea rdx, ds:0[rax*4]"], [46, "mov rax, [rbp+var_20]"], [47, "add rax, rdx"], [48, "mov eax, [rax]"], [49, "cdqe"], [50, "lea rdx, ds:0[rax*4]"], [51, "mov rax, [rbp+var_20]"], [52, "add rax, rdx"], [53, "mov eax, [rax]"], [54, "mov edi, eax"], [55, "call _putchar"], [56, "jmp short loc_403F11"], [57, "mov eax, 0"], [58, "jmp short locret_403F25"], [59, "mov rax, cs:stdout"], [60, "mov rdi, rax"], [61, "call _fflush"], [62, "mov eax, 1"], [63, "leave"], [64, "retn"]], "data_dep": [[6, 5], [7, 3], [8, 7], [9, 8], [10, 3], [11, 10], [11, 9], [12, 3], [13, 11], [13, 12], [15, 9], [16, 4], [17, 15], [17, 16], [18, 17], [18, 11], [19, 18], [20, 6], [21, 20], [22, 21], [23, 20], [24, 23], [25, 20], [26, 25], [27, 20], [28, 27], [30, 19], [31, 30], [34, 19], [36, 15], [37, 4], [38, 37], [38, 36], [39, 11], [39, 38], [40, 39], [43, 19], [45, 15], [46, 4], [47, 46], [47, 45], [48, 11], [48, 47], [50, 45], [51, 4], [52, 51], [52, 50], [53, 11], [53, 52], [54, 53], [60, 59], [64, 62], [64, 57]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d_e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d.jsonl.gz", "strip_func_name": "sub_403E52", "query": "\n\n\n__int64 __fastcall sub_403E52(_DWORD *a1, __int64 a2, unsigned __int16 a3)\n{\nint c; // [rsp+2Ch] [rbp-4h]\n\nc = *(_DWORD *)(4LL * (int)++*a1 + a2);\nif ( a3 == 4 )\n{\nputchar(*(_DWORD *)(4LL * *(int *)(4LL * c + a2) + a2));\n}\nelse\n{\nif ( a3 > 4u )\nreturn 0LL;\nif ( a3 == 1 )\n{\nputchar(c);\n}\nelse\n{\nif ( a3 != 2 )\nreturn 0LL;\nputchar(*(_DWORD *)(4LL * c + a2));\n}\n}\nfflush(stdout);\nreturn 1LL;\n}\n\n\n\nQ:[a3,a1,a2,c,sub_403E52,]", "hints": "[]", "response": "{'a3': 'type', 'a1': 'cpu', 'a2': 'ram', 'c': 'val', 'sub_403E52': 'print'}"} | [
[
0.6416008472442627,
0.6321033835411072,
0.6294980645179749,
0.6229933500289917,
0.5945248007774353,
0.5853953957557678,
0.584563672542572,
0.5844048261642456,
0.5832906365394592,
0.5826025605201721,
0.5796439051628113,
0.5782520771026611,
0.5773310661315918,
0.5771627426147461,
0.5759721398353577,
0.5753082633018494,
0.5749009251594543,
0.5731778144836426,
0.5706415176391602,
0.5632452368736267
],
[
228963,
207279,
41608,
15498,
145924,
108878,
260661,
136589,
111723,
176854,
202150,
39003,
86962,
150913,
260494,
257211,
163382,
250411,
192064,
166707
]
] |
|
mlx_int_anti_resize_win | d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f | 42Paris | minilibx-linux | NA | int mlx_int_anti_resize_win(t_xvar *xvar,Window win,int w,int h)
{
XSizeHints hints;
long toto;
XGetWMNormalHints(xvar->display,win,&hints,&toto);
hints.width = w;
hints.height = h;
hints.min_width = w;
hints.min_height = h;
hints.max_width = w;
hints.max_height = h;
hints.flags = PPosition | PSize | PMinSize | PMaxSize;
XSetWMNormalHints(xvar->display,win,&hints);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403CF7", "function_addr": 4209911, "binary_name": "d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "add rsp, 0FFFFFFFFFFFFFF80h"], [3, "mov [rbp+var_68], rdi"], [4, "mov [rbp+var_70], rsi"], [5, "mov [rbp+var_74], edx"], [6, "mov [rbp+var_78], ecx"], [7, "mov rax, [rbp+var_68]"], [8, "mov rax, [rax]"], [9, "lea rcx, [rbp+var_58]"], [10, "lea rdx, [rbp+var_50]"], [11, "mov rsi, [rbp+var_70]"], [12, "mov rdi, rax"], [13, "call _XGetWMNormalHints"], [14, "mov eax, [rbp+var_74]"], [15, "mov [rbp+var_50.width], eax"], [16, "mov eax, [rbp+var_78]"], [17, "mov [rbp+var_50.height], eax"], [18, "mov eax, [rbp+var_74]"], [19, "mov [rbp+var_50.min_width], eax"], [20, "mov eax, [rbp+var_78]"], [21, "mov [rbp+var_50.min_height], eax"], [22, "mov eax, [rbp+var_74]"], [23, "mov [rbp+var_50.max_width], eax"], [24, "mov eax, [rbp+var_78]"], [25, "mov [rbp+var_50.max_height], eax"], [26, "mov [rbp+var_50.flags], 3Ch "], [27, "mov rax, [rbp+var_68]"], [28, "mov rax, [rax]"], [29, "lea rdx, [rbp+var_50]"], [30, "mov rcx, [rbp+var_70]"], [31, "mov rsi, rcx"], [32, "mov rdi, rax"], [33, "call _XSetWMNormalHints"], [34, "nop"], [35, "leave"], [36, "retn"]], "data_dep": [[7, 3], [8, 7], [11, 4], [12, 8], [14, 5], [15, 14], [16, 6], [17, 16], [18, 5], [19, 18], [20, 6], [21, 20], [22, 5], [23, 22], [24, 6], [25, 24], [27, 3], [28, 27], [29, 10], [30, 4], [31, 30], [32, 28], [36, 33]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f_d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f.jsonl.gz", "strip_func_name": "sub_403CF7", "query": "\n\n\nvoid __fastcall sub_403CF7(Display **a1, Window a2, int a3, int a4)\n{\n__int64 v6; // [rsp+28h] [rbp-58h] BYREF\nXSizeHints v7; // [rsp+30h] [rbp-50h] BYREF\n\nXGetWMNormalHints(*a1, a2, &v7, &v6);\nv7.width = a3;\nv7.height = a4;\nv7.min_width = a3;\nv7.min_height = a4;\nv7.max_width = a3;\nv7.max_height = a4;\nv7.flags = 60LL;\nXSetWMNormalHints(*a1, a2, &v7);\n}\n\n\n\nQ:[a3,a4,a1,a2,v6,v7,sub_403CF7,]", "hints": "[]", "response": "{'a3': 'w', 'a4': 'h', 'a1': 'xvar', 'a2': 'win', 'v6': 'toto', 'v7': 'hints', 'sub_403CF7': 'mlx_int_anti_resize_win'}"} | [
[
0.7489197254180908,
0.7470439672470093,
0.7201852202415466,
0.7177236080169678,
0.7100611329078674,
0.7094355821609497,
0.7088654041290283,
0.7006609439849854,
0.7004108428955078,
0.6900060772895813,
0.6872072219848633,
0.6808609366416931,
0.6804432272911072,
0.6771116256713867,
0.6763349771499634,
0.674068033695221,
0.6674820780754089,
0.6660646796226501,
0.6656711101531982,
0.6647790670394897
],
[
106630,
152682,
228623,
209454,
195374,
191439,
256647,
212917,
126709,
99264,
129744,
129250,
62215,
17684,
11642,
253819,
135818,
247627,
167731,
62677
]
] |
|
array_remove | 4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370 | kgabis | raytracer | NA | void array_remove(Array *a, unsigned int index) {
void *itemToRemove, *itemToMove;
if (index >= a->count) {
return;
}
if (a->count == 1) {
a->count--;
return;
}
itemToRemove = a->items + (index * a->itemSize);
itemToMove = a->items + (a->count * a->itemSize);
memmove(itemToRemove, itemToMove, a->itemSize);
a->count--;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40150E", "function_addr": 4199694, "binary_name": "4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370.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 rax, [rbp+var_18]"], [6, "mov eax, [rax+0Ch]"], [7, "cmp [rbp+var_1C], eax"], [8, "jnb loc_4015B7"], [9, "mov rax, [rbp+var_18]"], [10, "mov eax, [rax+0Ch]"], [11, "cmp eax, 1"], [12, "jnz short loc_40154C"], [13, "mov rax, [rbp+var_18]"], [14, "mov eax, [rax+0Ch]"], [15, "lea edx, [rax-1]"], [16, "mov rax, [rbp+var_18]"], [17, "mov [rax+0Ch], edx"], [18, "jmp short locret_4015B8"], [19, "mov rax, [rbp+var_18]"], [20, "mov rdx, [rax]"], [21, "mov rax, [rbp+var_18]"], [22, "mov eax, [rax+8]"], [23, "imul eax, [rbp+var_1C]"], [24, "mov eax, eax"], [25, "add rax, rdx"], [26, "mov [rbp+dest], rax"], [27, "mov rax, [rbp+var_18]"], [28, "mov rcx, [rax]"], [29, "mov rax, [rbp+var_18]"], [30, "mov edx, [rax+0Ch]"], [31, "mov rax, [rbp+var_18]"], [32, "mov eax, [rax+8]"], [33, "imul eax, edx"], [34, "mov eax, eax"], [35, "add rax, rcx"], [36, "mov [rbp+src], rax"], [37, "mov rax, [rbp+var_18]"], [38, "mov eax, [rax+8]"], [39, "mov edx, eax"], [40, "mov rcx, [rbp+src]"], [41, "mov rax, [rbp+dest]"], [42, "mov rsi, rcx"], [43, "mov rdi, rax"], [44, "call _memmove"], [45, "mov rax, [rbp+var_18]"], [46, "mov eax, [rax+0Ch]"], [47, "lea edx, [rax-1]"], [48, "mov rax, [rbp+var_18]"], [49, "mov [rax+0Ch], edx"], [50, "jmp short locret_4015B8"], [51, "nop"], [52, "leave"], [53, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [7, 6], [8, 7], [9, 3], [10, 9], [11, 10], [12, 11], [13, 3], [14, 13], [15, 14], [16, 3], [17, 15], [17, 16], [19, 3], [20, 19], [21, 3], [22, 21], [23, 4], [23, 22], [24, 23], [25, 24], [25, 20], [26, 25], [27, 3], [28, 27], [29, 3], [30, 29], [31, 3], [32, 31], [33, 32], [33, 30], [34, 33], [35, 28], [35, 34], [36, 35], [37, 3], [38, 37], [39, 38], [40, 36], [41, 26], [42, 40], [43, 41], [45, 3], [46, 45], [47, 46], [47, 39], [48, 3], [49, 47], [49, 48], [53, 16], [53, 6], [53, 48]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370_4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370.jsonl.gz", "strip_func_name": "sub_40150E", "query": "\n\n\n__int64 __fastcall sub_40150E(__int64 a1, unsigned int a2)\n{\n__int64 result; // rax\n\nresult = *(unsigned int *)(a1 + 12);\nif ( a2 < (unsigned int)result )\n{\nif ( *(_DWORD *)(a1 + 12) != 1 )\nmemmove(\n(void *)(*(_QWORD *)a1 + a2 * *(_DWORD *)(a1 + 8)),\n(const void *)(*(_QWORD *)a1 + (unsigned int)(*(_DWORD *)(a1 + 12) * *(_DWORD *)(a1 + 8))),\n*(unsigned int *)(a1 + 8));\nresult = a1;\n--*(_DWORD *)(a1 + 12);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_40150E,]", "hints": "[]", "response": "{'a1': 'a', 'a2': 'index', 'sub_40150E': 'array_remove'}"} | [
[
0.7481762170791626,
0.7446257472038269,
0.7419799566268921,
0.7327305674552917,
0.7239757776260376,
0.7235047817230225,
0.7202011942863464,
0.7171682119369507,
0.7168112993240356,
0.7167226076126099,
0.7146491408348083,
0.7135733962059021,
0.7120473384857178,
0.7073774337768555,
0.7042343616485596,
0.7039182186126709,
0.7018329501152039,
0.7018232941627502,
0.7016851305961609,
0.6970838904380798
],
[
37055,
251924,
227937,
67742,
136295,
211196,
206279,
211387,
211511,
41341,
145631,
32060,
105432,
186151,
114788,
219648,
160299,
225761,
208354,
162445
]
] |
|
add_label | e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d | CCareaga | useless | NA | void add_label(executable_t *exec, char *name, int addr) {
lnode_t *lbl = malloc(sizeof(lnode_t));
char *lbl_name = strdup(++name);
lbl->name = lbl_name;
lbl->address = addr;
lbl->next = NULL;
lnode_t *head = exec->labels;
exec->labels = lbl;
lbl->next = head;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40146A", "function_addr": 4199530, "binary_name": "e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d.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+s], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov edi, 18h"], [7, "call _malloc"], [8, "mov [rbp+var_8], rax"], [9, "add [rbp+s], 1"], [10, "mov rax, [rbp+s]"], [11, "mov rdi, rax"], [12, "call _strdup"], [13, "mov [rbp+var_10], rax"], [14, "mov rax, [rbp+var_8]"], [15, "mov rdx, [rbp+var_10]"], [16, "mov [rax], rdx"], [17, "mov rax, [rbp+var_8]"], [18, "mov edx, [rbp+var_34]"], [19, "mov [rax+8], edx"], [20, "mov rax, [rbp+var_8]"], [21, "mov qword ptr [rax+10h], 0"], [22, "mov rax, [rbp+var_28]"], [23, "mov rax, [rax+18h]"], [24, "mov [rbp+var_18], rax"], [25, "mov rax, [rbp+var_28]"], [26, "mov rdx, [rbp+var_8]"], [27, "mov [rax+18h], rdx"], [28, "mov rax, [rbp+var_8]"], [29, "mov rdx, [rbp+var_18]"], [30, "mov [rax+10h], rdx"], [31, "nop"], [32, "leave"], [33, "retn"]], "data_dep": [[8, 7], [9, 4], [10, 9], [11, 10], [13, 12], [14, 8], [15, 13], [16, 14], [16, 15], [17, 8], [18, 5], [19, 18], [19, 17], [20, 8], [21, 20], [22, 3], [23, 22], [23, 21], [24, 23], [25, 3], [26, 8], [27, 25], [27, 26], [28, 8], [29, 24], [30, 29], [30, 28], [33, 28]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d_e010df96f3cdef0246535d118a0927b04105062742aa1adcc03cd3a861f7601d.jsonl.gz", "strip_func_name": "sub_40146A", "query": "\n\n\n_DWORD *__fastcall sub_40146A(__int64 a1, __int64 a2, int a3)\n{\n_DWORD *result; // rax\n__int64 v5; // [rsp+28h] [rbp-18h]\n_DWORD *v6; // [rsp+38h] [rbp-8h]\n\nv6 = malloc(0x18uLL);\n*(_QWORD *)v6 = strdup((const char *)(a2 + 1));\nv6[2] = a3;\n*((_QWORD *)v6 + 2) = 0LL;\nv5 = *(_QWORD *)(a1 + 24);\n*(_QWORD *)(a1 + 24) = v6;\nresult = v6;\n*((_QWORD *)v6 + 2) = v5;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v5,v6,sub_40146A,]", "hints": "[]", "response": "{'a3': 'addr', 'a1': 'exec', 'a2': 'name', 'v5': 'head', 'v6': 'lbl', 'sub_40146A': 'add_label'}"} | [
[
0.8067841529846191,
0.7776893377304077,
0.761124849319458,
0.738390326499939,
0.7375969886779785,
0.7272167205810547,
0.7261624336242676,
0.7261569499969482,
0.7236819863319397,
0.7204874753952026,
0.718403697013855,
0.7163309454917908,
0.7155110836029053,
0.7141557931900024,
0.7120872735977173,
0.7080875635147095,
0.7080698609352112,
0.7064570784568787,
0.7018409967422485,
0.7010630369186401
],
[
33636,
263426,
36824,
258092,
240562,
125651,
264155,
165753,
112824,
226292,
122034,
112700,
40572,
143420,
2495,
207500,
207031,
263961,
250685,
241940
]
] |
|
dump_patch_header | 56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b | peterbjornx | patchtools_pub | NA | void dump_patch_header( const patch_hdr_t *hdr ) {
printf("Header version: %08X\n", hdr->header_ver);
printf("Update revision: %08X\n", hdr->update_rev);
printf("Date: %08X\n", hdr->date_bcd);
printf("Processor sign.: %08X\n", hdr->proc_sig);
printf("Checksum: %08X\n", hdr->checksum);
printf("Loader revision: %08X\n", hdr->loader_ver);
printf("Processor flags: %08X\n", hdr->proc_flags);
printf("Data size: %08X\n", hdr->data_size);
printf("Total size: %08X\n", hdr->total_size);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40292D", "function_addr": 4204845, "binary_name": "56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.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 eax, [rax]"], [6, "mov esi, eax"], [7, "mov edi, offset aHeaderVersion0"], [8, "mov eax, 0"], [9, "call _printf"], [10, "mov rax, [rbp+var_8]"], [11, "mov eax, [rax+4]"], [12, "mov esi, eax"], [13, "mov edi, offset aUpdateRevision"], [14, "mov eax, 0"], [15, "call _printf"], [16, "mov rax, [rbp+var_8]"], [17, "mov eax, [rax+8]"], [18, "mov esi, eax"], [19, "mov edi, offset aDate08x"], [20, "mov eax, 0"], [21, "call _printf"], [22, "mov rax, [rbp+var_8]"], [23, "mov eax, [rax+0Ch]"], [24, "mov esi, eax"], [25, "mov edi, offset aProcessorSign0"], [26, "mov eax, 0"], [27, "call _printf"], [28, "mov rax, [rbp+var_8]"], [29, "mov eax, [rax+10h]"], [30, "mov esi, eax"], [31, "mov edi, offset aChecksum08x"], [32, "mov eax, 0"], [33, "call _printf"], [34, "mov rax, [rbp+var_8]"], [35, "mov eax, [rax+14h]"], [36, "mov esi, eax"], [37, "mov edi, offset aLoaderRevision"], [38, "mov eax, 0"], [39, "call _printf"], [40, "mov rax, [rbp+var_8]"], [41, "mov eax, [rax+18h]"], [42, "mov esi, eax"], [43, "mov edi, offset aProcessorFlags"], [44, "mov eax, 0"], [45, "call _printf"], [46, "mov rax, [rbp+var_8]"], [47, "mov eax, [rax+1Ch]"], [48, "mov esi, eax"], [49, "mov edi, offset aDataSize08x"], [50, "mov eax, 0"], [51, "call _printf"], [52, "mov rax, [rbp+var_8]"], [53, "mov eax, [rax+20h]"], [54, "mov esi, eax"], [55, "mov edi, offset aTotalSize08x"], [56, "mov eax, 0"], [57, "call _printf"], [58, "nop"], [59, "leave"], [60, "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], [60, 57]]}
| {"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_40292D", "query": "\n\n\nint __fastcall sub_40292D(unsigned int *a1)\n{\nprintf(\"Header version: %08X\\n\", *a1);\nprintf(\"Update revision: %08X\\n\", a1[1]);\nprintf(\"Date: %08X\\n\", a1[2]);\nprintf(\"Processor sign.: %08X\\n\", a1[3]);\nprintf(\"Checksum: %08X\\n\", a1[4]);\nprintf(\"Loader revision: %08X\\n\", a1[5]);\nprintf(\"Processor flags: %08X\\n\", a1[6]);\nprintf(\"Data size: %08X\\n\", a1[7]);\nreturn printf(\"Total size: %08X\\n\", a1[8]);\n}\n\n\n\nQ:[a1,sub_40292D,]", "hints": "[]", "response": "{'a1': 'hdr', 'sub_40292D': 'dump_patch_header'}"} | [
[
0.9305558800697327,
0.9110227823257446,
0.9060187339782715,
0.9052544832229614,
0.8958871960639954,
0.8921509981155396,
0.8772734999656677,
0.8765360116958618,
0.8671955466270447,
0.866262674331665,
0.8662599325180054,
0.8631554841995239,
0.8602948784828186,
0.8601054549217224,
0.8578200340270996,
0.8572215437889099,
0.8483644723892212,
0.844836950302124,
0.8443824052810669,
0.8431519865989685
],
[
173666,
25927,
25668,
11139,
237316,
237323,
50614,
71720,
247658,
221334,
73756,
193592,
89745,
241117,
106110,
226375,
114131,
31727,
221705,
167282
]
] |
|
vperror | 79db7bd47e1d61124837565c2eb93f655f96daceb6833f3e80704ac257944506 | Qihoo360 | kmemcache | NA | static void vperror(const char *fmt, ...)
{
int old_errno = errno;
char buf[1024];
va_list ap;
va_start(ap, fmt);
if (vsnprintf(buf, sizeof(buf), fmt, ap) == -1) {
buf[sizeof(buf) - 1] = '\0';
}
va_end(ap);
errno = old_errno;
perror(buf);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4024D2", "function_addr": 4203730, "binary_name": "79db7bd47e1d61124837565c2eb93f655f96daceb6833f3e80704ac257944506.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 4F0h"], [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_40252B"], [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, "call ___errno_location"], [20, "mov eax, [rax]"], [21, "mov [rbp+var_B4], eax"], [22, "mov [rbp+arg], 8"], [23, "mov [rbp+var_4D4], 30h "], [24, "lea rax, [rbp+arg_0]"], [25, "mov [rbp+var_4D0], rax"], [26, "lea rax, [rbp+var_B0]"], [27, "mov [rbp+var_4C8], rax"], [28, "lea rcx, [rbp+arg]"], [29, "mov rdx, [rbp+format]"], [30, "lea rax, [rbp+s]"], [31, "mov esi, 400h"], [32, "mov rdi, rax"], [33, "call _vsnprintf"], [34, "cmp eax, 0FFFFFFFFh"], [35, "jnz short loc_402593"], [36, "mov [rbp+var_C1], 0"], [37, "call ___errno_location"], [38, "mov edx, [rbp+var_B4]"], [39, "mov [rax], edx"], [40, "lea rax, [rbp+s]"], [41, "mov rdi, rax"], [42, "call _perror"], [43, "nop"], [44, "leave"], [45, "retn"]], "data_dep": [[10, 9], [20, 19], [21, 20], [24, 20], [25, 24], [26, 24], [27, 26], [28, 22], [29, 3], [30, 26], [32, 30], [34, 33], [35, 34], [38, 21], [39, 38], [39, 37], [40, 37], [41, 40], [45, 42]]}
| {"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_4024D2", "query": "\n\n\nvoid sub_4024D2(const char *a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, ...)\n{\ngcc_va_list arg; // [rsp+18h] [rbp-4D8h] BYREF\nchar s[1036]; // [rsp+30h] [rbp-4C0h] BYREF\nint v8; // [rsp+43Ch] [rbp-B4h]\n__int64 v9; // [rsp+448h] [rbp-A8h]\n__int64 v10; // [rsp+450h] [rbp-A0h]\n__int64 v11; // [rsp+458h] [rbp-98h]\n__int64 v12; // [rsp+460h] [rbp-90h]\n__int64 v13; // [rsp+468h] [rbp-88h]\n\nva_start(arg, a6);\nv9 = a2;\nv10 = a3;\nv11 = a4;\nv12 = a5;\nv13 = a6;\nv8 = *__errno_location();\narg[0].gp_offset = 8;\nif ( vsnprintf(s, 0x400uLL, a1, arg) == -1 )\ns[1023] = 0;\n*__errno_location() = v8;\nperror(s);\n}\n\n\n\nQ:[a1,arg,s,v8,sub_4024D2,]", "hints": "[]", "response": "{'a1': 'fmt', 'arg': 'ap', 's': 'buf', 'v8': 'old_errno', 'sub_4024D2': 'vperror'}"} | [
[
0.7582910060882568,
0.7477089166641235,
0.7332616448402405,
0.7145490050315857,
0.6969593167304993,
0.6934902667999268,
0.6933973431587219,
0.6691532135009766,
0.6638991236686707,
0.6574072241783142,
0.6537293791770935,
0.6517288684844971,
0.6501132249832153,
0.6469659805297852,
0.644028902053833,
0.6405162215232849,
0.6404938101768494,
0.632977306842804,
0.6324889659881592,
0.6309909224510193
],
[
14977,
191401,
224315,
51453,
34328,
209339,
104864,
63290,
239865,
72946,
68333,
236190,
133228,
124233,
152992,
15431,
154837,
90871,
57181,
9760
]
] |
|
mapfile | 840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c | hc0d3r | alfheim | NA | int mapfile(const char *filename, map_t *out){
int fd, serr, ret = 1;
char buf[1024];
ssize_t n;
fd = open(filename, O_RDONLY);
if(fd == -1)
goto end;
out->size = getfdsize(fd);
out->ptr = mmap(NULL, (size_t)out->size, PROT_READ, MAP_PRIVATE, fd, 0);
if(out->ptr == MAP_FAILED){
out->ptr = NULL;
out->size = 0;
while((n = read(fd, buf, sizeof(buf))) > 0){
out->ptr = realloc(out->ptr, n+out->size);
if(out->ptr == NULL){
break;
}
memcpy(out->ptr+out->size, buf, n);
out->size += (size_t)n;
}
out->type = map_heap;
} else {
out->type = map_mmap;
}
if(out->ptr){
ret = 0;
}
/* save errno to error reporting */
serr = errno;
close(fd);
errno = serr;
end:
return ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401593", "function_addr": 4199827, "binary_name": "840024130aa81fce40b4f746d52930401c7b68736ef0412f82d9af4913fe282c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 430h"], [3, "mov [rbp+file], rdi"], [4, "mov [rbp+var_430], rsi"], [5, "mov [rbp+var_4], 1"], [6, "mov rax, [rbp+file]"], [7, "mov esi, 0"], [8, "mov rdi, rax"], [9, "mov eax, 0"], [10, "call _open"], [11, "mov [rbp+fd], eax"], [12, "cmp [rbp+fd], 0FFFFFFFFh"], [13, "jz loc_40176F"], [14, "mov eax, [rbp+fd]"], [15, "mov edi, eax"], [16, "call sub_4012D2"], [17, "mov rdx, [rbp+var_430]"], [18, "mov [rdx+8], rax"], [19, "mov rax, [rbp+var_430]"], [20, "mov rax, [rax+8]"], [21, "mov rsi, rax"], [22, "mov eax, [rbp+fd]"], [23, "mov r9d, 0"], [24, "mov r8d, eax"], [25, "mov ecx, 2"], [26, "mov edx, 1"], [27, "mov edi, 0"], [28, "call _mmap"], [29, "mov rdx, [rbp+var_430]"], [30, "mov [rdx], rax"], [31, "mov rax, [rbp+var_430]"], [32, "mov rax, [rax]"], [33, "cmp rax, 0FFFFFFFFFFFFFFFFh"], [34, "jnz loc_40172B"], [35, "mov rax, [rbp+var_430]"], [36, "mov qword ptr [rax], 0"], [37, "mov rax, [rbp+var_430]"], [38, "mov qword ptr [rax+8], 0"], [39, "jmp loc_4016F0"], [40, "mov rax, [rbp+var_430]"], [41, "mov rdx, [rax+8]"], [42, "mov rax, [rbp+n]"], [43, "add rax, rdx"], [44, "mov rdx, rax"], [45, "mov rax, [rbp+var_430]"], [46, "mov rax, [rax]"], [47, "mov rsi, rdx"], [48, "mov rdi, rax"], [49, "call _realloc"], [50, "mov rdx, [rbp+var_430]"], [51, "mov [rdx], rax"], [52, "mov rax, [rbp+var_430]"], [53, "mov rax, [rax]"], [54, "test rax, rax"], [55, "jz short loc_40171A"], [56, "mov rdx, [rbp+n]"], [57, "mov rax, [rbp+var_430]"], [58, "mov rcx, [rax]"], [59, "mov rax, [rbp+var_430]"], [60, "mov rax, [rax+8]"], [61, "add rcx, rax"], [62, "lea rax, [rbp+src]"], [63, "mov rsi, rax"], [64, "mov rdi, rcx"], [65, "call _memcpy"], [66, "mov rax, [rbp+var_430]"], [67, "mov rax, [rax+8]"], [68, "mov rdx, rax"], [69, "mov rax, [rbp+n]"], [70, "add rax, rdx"], [71, "mov rdx, rax"], [72, "mov rax, [rbp+var_430]"], [73, "mov [rax+8], rdx"], [74, "lea rcx, [rbp+src]"], [75, "mov eax, [rbp+fd]"], [76, "mov edx, 400h"], [77, "mov rsi, rcx"], [78, "mov edi, eax"], [79, "call _read"], [80, "mov [rbp+n], rax"], [81, "cmp [rbp+n], 0"], [82, "jg loc_40165C"], [83, "jmp short loc_40171B"], [84, "nop"], [85, "mov rax, [rbp+var_430]"], [86, "mov dword ptr [rax+10h], 1"], [87, "jmp short loc_401739"], [88, "mov rax, [rbp+var_430]"], [89, "mov dword ptr [rax+10h], 0"], [90, "mov rax, [rbp+var_430]"], [91, "mov rax, [rax]"], [92, "test rax, rax"], [93, "jz short loc_40174F"], [94, "mov [rbp+var_4], 0"], [95, "call ___errno_location"], [96, "mov eax, [rax]"], [97, "mov [rbp+var_14], eax"], [98, "mov eax, [rbp+fd]"], [99, "mov edi, eax"], [100, "call _close"], [101, "call ___errno_location"], [102, "mov edx, [rbp+var_14]"], [103, "mov [rax], edx"], [104, "jmp short loc_401770"], [105, "nop"], [106, "mov eax, [rbp+var_4]"], [107, "leave"], [108, "retn"]], "data_dep": [[6, 3], [8, 6], [11, 10], [12, 11], [13, 12], [14, 11], [15, 14], [17, 4], [18, 17], [18, 16], [19, 4], [20, 19], [20, 18], [21, 20], [22, 11], [24, 22], [29, 4], [30, 29], [30, 28], [31, 4], [32, 30], [32, 31], [33, 32], [34, 33], [35, 4], [36, 35], [37, 4], [38, 37], [40, 4], [41, 40], [41, 51], [41, 30], [41, 73], [41, 18], [41, 36], [41, 38], [42, 80], [43, 41], [43, 42], [44, 43], [45, 4], [46, 36], [46, 45], [46, 38], [46, 51], [46, 30], [46, 73], [46, 18], [47, 44], [48, 46], [50, 4], [51, 50], [51, 49], [52, 4], [53, 52], [53, 36], [53, 51], [54, 53], [55, 54], [56, 80], [57, 4], [58, 51], [58, 30], [58, 73], [58, 18], [58, 57], [58, 36], [58, 38], [59, 4], [60, 30], [60, 73], [60, 18], [60, 59], [60, 36], [60, 38], [60, 51], [61, 58], [61, 60], [62, 60], [63, 62], [64, 61], [66, 4], [67, 36], [67, 38], [67, 51], [67, 30], [67, 73], [67, 18], [67, 66], [68, 67], [69, 80], [70, 68], [70, 69], [71, 70], [72, 4], [73, 71], [73, 72], [74, 61], [74, 25], [75, 11], [77, 74], [78, 75], [80, 79], [81, 80], [82, 81], [85, 4], [86, 85], [88, 4], [89, 88], [90, 4], [91, 89], [91, 73], [91, 18], [91, 86], [91, 36], [91, 38], [91, 51], [91, 90], [91, 30], [92, 91], [93, 92], [96, 95], [96, 51], [96, 30], [96, 103], [96, 89], [96, 73], [96, 18], [96, 86], [96, 36], [96, 38], [97, 96], [98, 11], [99, 98], [102, 97], [103, 102], [103, 101], [106, 94], [106, 5], [108, 106]]}
| {"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_401593", "query": "\n\n\n__int64 __fastcall sub_401593(const char *a1, __int64 a2)\n{\nchar src[1036]; // [rsp+10h] [rbp-420h] BYREF\nint v4; // [rsp+41Ch] [rbp-14h]\nsize_t n; // [rsp+420h] [rbp-10h]\nint fd; // [rsp+428h] [rbp-8h]\nunsigned int v7; // [rsp+42Ch] [rbp-4h]\n\nv7 = 1;\nfd = open(a1, 0);\nif ( fd != -1 )\n{\n*(_QWORD *)(a2 + 8) = sub_4012D2(fd);\n*(_QWORD *)a2 = mmap(0LL, *(_QWORD *)(a2 + 8), 1, 2, fd, 0LL);\nif ( *(_QWORD *)a2 == -1LL )\n{\n*(_QWORD *)a2 = 0LL;\nfor ( *(_QWORD *)(a2 + 8) = 0LL; ; *(_QWORD *)(a2 + 8) += n )\n{\nn = read(fd, src, 0x400uLL);\nif ( (__int64)n <= 0 )\nbreak;\n*(_QWORD *)a2 = realloc(*(void **)a2, *(_QWORD *)(a2 + 8) + n);\nif ( !*(_QWORD *)a2 )\nbreak;\nmemcpy((void *)(*(_QWORD *)(a2 + 8) + *(_QWORD *)a2), src, n);\n}\n*(_DWORD *)(a2 + 16) = 1;\n}\nelse\n{\n*(_DWORD *)(a2 + 16) = 0;\n}\nif ( *(_QWORD *)a2 )\nv7 = 0;\nv4 = *__errno_location();\nclose(fd);\n*__errno_location() = v4;\n}\nreturn v7;\n}\n\n\n\nQ:[a1,a2,src,v4,sub_401593,sub_4012D2,]", "hints": "[]", "response": "{'a1': 'filename', 'a2': 'out', 'src': 'buf', 'v4': 'serr', 'sub_401593': 'mapfile', 'sub_4012D2': 'getfdsize'}"} | [
[
0.7745472192764282,
0.7680647373199463,
0.7427768707275391,
0.7342998385429382,
0.7320236563682556,
0.7293828725814819,
0.7214111089706421,
0.7182519435882568,
0.7170298099517822,
0.7162014245986938,
0.7138833403587341,
0.7138489484786987,
0.7133492231369019,
0.712950587272644,
0.7120863795280457,
0.7109700441360474,
0.7057697176933289,
0.7017873525619507,
0.6968914270401001,
0.6930962800979614
],
[
180009,
89090,
220353,
58612,
192721,
208501,
119679,
179886,
211321,
159364,
3808,
212119,
114986,
263401,
220314,
19088,
199388,
36765,
167190,
125139
]
] |
|
send_from_file | 3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413 | emikulic | darkhttpd | NA | static ssize_t send_from_file(const int s, const int fd,
off_t ofs, size_t size) {
#ifdef __FreeBSD__
off_t sent;
int ret = sendfile(fd, s, ofs, size, NULL, &sent, 0);
/* It is possible for sendfile to send zero bytes due to a blocking
* condition. Handle this correctly.
*/
if (ret == -1)
if (errno == EAGAIN)
if (sent == 0)
return -1;
else
return sent;
else
return -1;
else
return size;
#else
#if defined(__linux) || defined(__sun__)
/* Limit truly ridiculous (LARGEFILE) requests. */
if (size > 1<<20)
size = 1<<20;
return sendfile(s, fd, &ofs, size);
#else
/* Fake sendfile() with read(). */
# ifndef min
# define min(a,b) ( ((a)<(b)) ? (a) : (b) )
# endif
char buf[1<<15];
size_t amount = min(sizeof(buf), size);
ssize_t numread;
if (lseek(fd, ofs, SEEK_SET) == -1)
err(1, "fseek(%d)", (int)ofs);
numread = read(fd, buf, amount);
if (numread == 0) {
fprintf(stderr, "premature eof on fd %d\n", fd);
return -1;
}
else if (numread == -1) {
fprintf(stderr, "error reading on fd %d: %s", fd, strerror(errno));
return -1;
}
else if ((size_t)numread != amount) {
fprintf(stderr, "read %zd bytes, expecting %zu bytes on fd %d\n",
numread, amount, fd);
return -1;
}
else
return send(s, buf, amount, 0);
#endif
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41AD1E", "function_addr": 4304158, "binary_name": "3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r13"], [3, "push r12"], [4, "push rbx"], [5, "sub rsp, 68h"], [6, "mov [rbp+out_fd], edi"], [7, "mov [rbp+in_fd], esi"], [8, "mov [rbp+var_70], rdx"], [9, "mov [rbp+count], rcx"], [10, "lea rbx, [rbp+var_60]"], [11, "mov r13, rbx"], [12, "cmp cs:__asan_option_detect_stack_use_after_return, 0"], [13, "jz short loc_41AD5B"], [14, "mov edi, 40h "], [15, "call ___asan_stack_malloc_0"], [16, "test rax, rax"], [17, "jz short loc_41AD5B"], [18, "mov rbx, rax"], [19, "lea rax, [rbx+40h]"], [20, "mov qword ptr [rbx], 41B58AB3h"], [21, "mov qword ptr [rbx+8], offset a13288Ofs2442"], [22, "mov qword ptr [rbx+10h], offset sub_41AD1E"], [23, "mov r12, rbx"], [24, "shr r12, 3"], [25, "mov dword ptr [r12+7FFF8000h], 0F1F1F1F1h"], [26, "mov dword ptr [r12+7FFF8004h], 0F3F3F300h"], [27, "mov rdx, [rbp+var_70]"], [28, "mov [rax-20h], rdx"], [29, "cmp [rbp+count], 100000h"], [30, "jbe short loc_41ADAF"], [31, "mov [rbp+count], 100000h"], [32, "mov rdx, [rbp+count]"], [33, "lea rdi, [rax-20h]"], [34, "mov esi, [rbp+in_fd]"], [35, "mov eax, [rbp+out_fd]"], [36, "mov rcx, rdx"], [37, "mov rdx, rdi"], [38, "mov edi, eax"], [39, "call _sendfile64"], [40, "mov rdx, rax"], [41, "cmp r13, rbx"], [42, "jz short loc_41ADF4"], [43, "mov qword ptr [rbx], 45E0360Eh"], [44, "mov rax, 0F5F5F5F5F5F5F5F5h"], [45, "mov [r12+7FFF8000h], rax"], [46, "mov rax, [rbx+38h]"], [47, "mov byte ptr [rax], 0"], [48, "jmp short loc_41AE00"], [49, "mov qword ptr [r12+7FFF8000h], 0"], [50, "mov rax, rdx"], [51, "add rsp, 68h"], [52, "pop rbx"], [53, "pop r12"], [54, "pop r13"], [55, "pop rbp"], [56, "retn"]], "data_dep": [[11, 10], [13, 12], [16, 15], [17, 16], [18, 16], [19, 18], [19, 10], [19, 16], [20, 10], [20, 18], [21, 10], [21, 18], [22, 10], [22, 18], [23, 10], [23, 18], [24, 23], [25, 24], [26, 24], [27, 8], [28, 27], [28, 19], [29, 9], [30, 29], [32, 31], [32, 9], [33, 14], [33, 20], [33, 26], [33, 19], [33, 28], [33, 22], [33, 25], [33, 21], [34, 7], [35, 6], [36, 32], [37, 33], [38, 35], [40, 39], [41, 18], [41, 11], [41, 10], [42, 41], [43, 18], [43, 10], [45, 24], [45, 44], [46, 45], [46, 10], [46, 18], [47, 46], [49, 24], [50, 40], [51, 5], [52, 4], [53, 3], [54, 2], [55, 0], [56, 50]]}
| {"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_41AD1E", "query": "\n\n\nssize_t __fastcall sub_41AD1E(int a1, int a2, __int64 a3, size_t a4)\n{\nunsigned __int64 v4; // rbx\n__int64 v5; // rax\nunsigned __int64 v6; // r12\nssize_t result; // rax\nchar v10[96]; // [rsp+20h] [rbp-60h] BYREF\n\nv4 = (unsigned __int64)v10;\nif ( _asan_option_detect_stack_use_after_return )\n{\nv5 = __asan_stack_malloc_0();\nif ( v5 )\nv4 = v5;\n}\n*(_QWORD *)v4 = 1102416563LL;\n*(_QWORD *)(v4 + 8) = \"1 32 8 8 ofs:2442\";\n*(_QWORD *)(v4 + 16) = sub_41AD1E;\nv6 = v4 >> 3;\n*(_DWORD *)(v6 + 2147450880) = -235802127;\n*(_DWORD *)(v6 + 2147450884) = -202116352;\n*(_QWORD *)(v4 + 32) = a3;\nif ( a4 > 0x100000 )\na4 = 0x100000LL;\nresult = sendfile64(a1, a2, (__off64_t *)(v4 + 32), a4);\nif ( v10 == (char *)v4 )\n{\n*(_QWORD *)((v4 >> 3) + 0x7FFF8000) = 0LL;\n}\nelse\n{\n*(_QWORD *)v4 = 1172321806LL;\n*(_QWORD *)((v4 >> 3) + 0x7FFF8000) = 0xF5F5F5F5F5F5F5F5LL;\n**(_BYTE **)(v4 + 56) = 0;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_41AD1E,]", "hints": "[]", "response": "{'a3': 'ofs', 'a4': 'size', 'a1': 's', 'a2': 'fd', 'sub_41AD1E': 'send_from_file'}"} | [
[
0.6877508759498596,
0.6467910408973694,
0.6465904712677002,
0.6463797092437744,
0.6393800973892212,
0.6388794779777527,
0.6370024681091309,
0.6343133449554443,
0.6312126517295837,
0.627891480922699,
0.6277949810028076,
0.6248666048049927,
0.6247351765632629,
0.621292233467102,
0.621019721031189,
0.6195942759513855,
0.6195560097694397,
0.6193856000900269,
0.6188268065452576,
0.6187851428985596
],
[
63478,
112917,
50967,
194487,
224433,
116540,
259319,
81997,
189530,
15431,
227837,
45690,
88800,
247368,
38913,
9605,
150267,
6088,
36876,
185911
]
] |
|
vhostlist | afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4 | michael-lazar | hn-gopher | NA | void vhostlist(state *st)
{
sdirent dir[MAX_SDIRENT];
struct tm *ltime;
char timestr[20];
char buf[BUFSIZE];
int width;
int num;
int i;
/* Scan the root dir for vhost dirs */
num = sortdir(st->server_root, dir, MAX_SDIRENT);
if (num < 0) die(st, ERR_NOTFOUND, "WTF?");
/* Width of filenames for fancy listing */
width = st->out_width - DATE_WIDTH - 15;
/* Loop through the directory entries */
for (i = 0; i < num; i++) {
/* Skip dotfiles */
if (dir[i].name[0] == '.') continue;
/* Require FQDN */
if (!strchr(dir[i].name, '.')) continue;
/* We only want world-readable directories */
if ((dir[i].mode & S_IROTH) == 0) continue;
if ((dir[i].mode & S_IFMT) != S_IFDIR) continue;
/* Generate display string for vhost */
snprintf(buf, sizeof(buf), VHOST_FORMAT, dir[i].name);
/* Fancy listing */
if (st->opt_date) {
ltime = localtime(&dir[i].mtime);
strftime(timestr, sizeof(timestr), DATE_FORMAT, ltime);
printf("1%-*.*s %s - \t/;%s\t%s\t%i" CRLF,
width, width, buf, timestr, dir[i].name,
dir[i].name, st->server_port);
}
/* Teh boring version */
else {
printf("1%.*s\t/;%s\t%s\t%i" CRLF, st->out_width, buf,
dir[i].name, dir[i].name, st->server_port);
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405A3D", "function_addr": 4217405, "binary_name": "afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 28450h"], [3, "mov [rbp+var_28448], rdi"], [4, "mov rax, [rbp+var_28448]"], [5, "lea rcx, [rax+1198h]"], [6, "lea rax, [rbp+var_28020]"], [7, "mov edx, 400h"], [8, "mov rsi, rax"], [9, "mov rdi, rcx"], [10, "call sub_405600"], [11, "mov [rbp+var_8], eax"], [12, "cmp [rbp+var_8], 0"], [13, "jns short loc_405A96"], [14, "mov rax, [rbp+var_28448]"], [15, "mov edx, offset aWtf"], [16, "mov esi, offset aFileOrDirector_2"], [17, "mov rdi, rax"], [18, "call sub_402796"], [19, "mov rax, [rbp+var_28448]"], [20, "mov eax, [rax+1090h]"], [21, "sub eax, 20h "], [22, "mov [rbp+var_C], eax"], [23, "mov [rbp+var_4], 0"], [24, "jmp loc_405D14"], [25, "mov eax, [rbp+var_4]"], [26, "movsxd rdx, eax"], [27, "mov rax, rdx"], [28, "shl rax, 2"], [29, "add rax, rdx"], [30, "shl rax, 5"], [31, "add rax, rbp"], [32, "sub rax, 28020h"], [33, "movzx eax, byte ptr [rax]"], [34, "cmp al, 2Eh "], [35, "jz loc_405D06"], [36, "lea rcx, [rbp+var_28020]"], [37, "mov eax, [rbp+var_4]"], [38, "movsxd rdx, eax"], [39, "mov rax, rdx"], [40, "shl rax, 2"], [41, "add rax, rdx"], [42, "shl rax, 5"], [43, "add rax, rcx"], [44, "mov esi, 2Eh "], [45, "mov rdi, rax"], [46, "call _strchr"], [47, "test rax, rax"], [48, "jz loc_405D09"], [49, "mov eax, [rbp+var_4]"], [50, "movsxd rdx, eax"], [51, "mov rax, rdx"], [52, "shl rax, 2"], [53, "add rax, rdx"], [54, "shl rax, 5"], [55, "add rax, rbp"], [56, "sub rax, 27FA0h"], [57, "mov eax, [rax]"], [58, "and eax, 4"], [59, "test eax, eax"], [60, "jz loc_405D0C"], [61, "mov eax, [rbp+var_4]"], [62, "movsxd rdx, eax"], [63, "mov rax, rdx"], [64, "shl rax, 2"], [65, "add rax, rdx"], [66, "shl rax, 5"], [67, "add rax, rbp"], [68, "sub rax, 27FA0h"], [69, "mov eax, [rax]"], [70, "and eax, 0F000h"], [71, "cmp eax, 4000h"], [72, "jnz loc_405D0F"], [73, "lea rcx, [rbp+var_28020]"], [74, "mov eax, [rbp+var_4]"], [75, "movsxd rdx, eax"], [76, "mov rax, rdx"], [77, "shl rax, 2"], [78, "add rax, rdx"], [79, "shl rax, 5"], [80, "lea rdx, [rcx+rax]"], [81, "lea rax, [rbp+s]"], [82, "mov rcx, rdx"], [83, "mov edx, offset aGopherS"], [84, "mov esi, 400h"], [85, "mov rdi, rax"], [86, "mov eax, 0"], [87, "call _snprintf"], [88, "mov rax, [rbp+var_28448]"], [89, "movzx eax, byte ptr [rax+13D83h]"], [90, "test al, al"], [91, "jz loc_405C8F"], [92, "lea rcx, [rbp+var_28020]"], [93, "mov eax, [rbp+var_4]"], [94, "movsxd rdx, eax"], [95, "mov rax, rdx"], [96, "shl rax, 2"], [97, "add rax, rdx"], [98, "shl rax, 5"], [99, "add rax, 90h"], [100, "add rax, rcx"], [101, "add rax, 8"], [102, "mov rdi, rax"], [103, "call _localtime"], [104, "mov [rbp+tp], rax"], [105, "mov rdx, [rbp+tp]"], [106, "lea rax, [rbp+var_28040]"], [107, "mov rcx, rdx"], [108, "mov edx, offset aYBDHM"], [109, "mov esi, 14h"], [110, "mov rdi, rax"], [111, "call _strftime"], [112, "mov rax, [rbp+var_28448]"], [113, "mov esi, [rax+1318h]"], [114, "lea rcx, [rbp+var_28020]"], [115, "mov eax, [rbp+var_4]"], [116, "movsxd rdx, eax"], [117, "mov rax, rdx"], [118, "shl rax, 2"], [119, "add rax, rdx"], [120, "shl rax, 5"], [121, "lea rdi, [rcx+rax]"], [122, "lea rcx, [rbp+var_28020]"], [123, "mov eax, [rbp+var_4]"], [124, "movsxd rdx, eax"], [125, "mov rax, rdx"], [126, "shl rax, 2"], [127, "add rax, rdx"], [128, "shl rax, 5"], [129, "lea r9, [rcx+rax]"], [130, "lea r8, [rbp+var_28040]"], [131, "lea rcx, [rbp+s]"], [132, "mov edx, [rbp+var_C]"], [133, "mov eax, [rbp+var_C]"], [134, "push rsi"], [135, "push rdi"], [136, "mov esi, eax"], [137, "mov edi, offset a1SSSSI_0"], [138, "mov eax, 0"], [139, "call _printf"], [140, "add rsp, 10h"], [141, "jmp loc_405D10"], [142, "mov rax, [rbp+var_28448]"], [143, "mov esi, [rax+1318h]"], [144, "lea rcx, [rbp+var_28020]"], [145, "mov eax, [rbp+var_4]"], [146, "movsxd rdx, eax"], [147, "mov rax, rdx"], [148, "shl rax, 2"], [149, "add rax, rdx"], [150, "shl rax, 5"], [151, "lea rdi, [rcx+rax]"], [152, "lea rcx, [rbp+var_28020]"], [153, "mov eax, [rbp+var_4]"], [154, "movsxd rdx, eax"], [155, "mov rax, rdx"], [156, "shl rax, 2"], [157, "add rax, rdx"], [158, "shl rax, 5"], [159, "add rcx, rax"], [160, "mov rax, [rbp+var_28448]"], [161, "mov eax, [rax+1090h]"], [162, "lea rdx, [rbp+s]"], [163, "mov r9d, esi"], [164, "mov r8, rdi"], [165, "mov esi, eax"], [166, "mov edi, offset a1SSSI_0"], [167, "mov eax, 0"], [168, "call _printf"], [169, "jmp short loc_405D10"], [170, "nop"], [171, "jmp short loc_405D10"], [172, "nop"], [173, "jmp short loc_405D10"], [174, "nop"], [175, "jmp short loc_405D10"], [176, "nop"], [177, "add [rbp+var_4], 1"], [178, "mov eax, [rbp+var_4]"], [179, "cmp eax, [rbp+var_8]"], [180, "jl loc_405AB5"], [181, "nop"], [182, "nop"], [183, "leave"], [184, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 4], [8, 6], [9, 5], [11, 10], [12, 11], [13, 12], [14, 3], [17, 14], [19, 3], [20, 19], [21, 20], [22, 21], [25, 23], [25, 177], [26, 25], [27, 26], [28, 27], [29, 26], [29, 28], [30, 29], [31, 1], [31, 30], [32, 31], [33, 32], [34, 33], [35, 34], [36, 36], [36, 159], [36, 131], [36, 5], [37, 177], [37, 23], [38, 37], [39, 38], [40, 39], [41, 40], [41, 38], [42, 41], [43, 36], [43, 42], [45, 43], [47, 46], [48, 47], [49, 23], [49, 177], [50, 49], [51, 50], [52, 51], [53, 50], [53, 52], [54, 53], [55, 54], [55, 1], [56, 55], [57, 56], [58, 57], [59, 58], [60, 59], [61, 177], [61, 23], [62, 61], [63, 62], [64, 63], [65, 62], [65, 64], [66, 65], [67, 1], [67, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 71], [73, 36], [74, 177], [74, 23], [75, 74], [76, 75], [77, 76], [78, 77], [78, 75], [79, 78], [80, 75], [80, 79], [81, 79], [82, 80], [85, 81], [88, 3], [89, 88], [90, 89], [91, 90], [92, 82], [93, 177], [93, 23], [94, 93], [95, 94], [96, 95], [97, 94], [97, 96], [98, 97], [99, 98], [100, 92], [100, 99], [101, 100], [102, 101], [104, 103], [105, 104], [106, 103], [107, 105], [110, 106], [112, 3], [113, 112], [114, 107], [115, 23], [115, 177], [116, 115], [117, 116], [118, 117], [119, 116], [119, 118], [120, 119], [121, 120], [121, 110], [122, 114], [123, 177], [123, 23], [124, 123], [125, 124], [126, 125], [127, 124], [127, 126], [128, 127], [129, 128], [129, 129], [129, 163], [130, 130], [130, 164], [131, 122], [132, 22], [133, 22], [134, 113], [135, 121], [136, 133], [140, 2], [140, 140], [142, 3], [143, 142], [144, 82], [145, 23], [145, 177], [146, 145], [147, 146], [148, 147], [149, 146], [149, 148], [150, 149], [151, 150], [151, 85], [152, 144], [153, 177], [153, 23], [154, 153], [155, 154], [156, 155], [157, 154], [157, 156], [158, 157], [159, 152], [159, 158], [160, 3], [161, 160], [162, 154], [163, 143], [164, 151], [165, 161], [177, 23], [177, 177], [178, 177], [178, 23], [179, 178], [179, 11], [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/afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4_afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.jsonl.gz", "strip_func_name": "sub_405A3D", "query": "\n\n\n__int64 __fastcall sub_405A3D(__int64 a1)\n{\n__int64 result; // rax\nchar s[1024]; // [rsp+10h] [rbp-28440h] BYREF\nchar v3[32]; // [rsp+410h] [rbp-28040h] BYREF\n_OWORD v4[10240]; // [rsp+430h] [rbp-28020h] BYREF\nstruct tm *tp; // [rsp+28438h] [rbp-18h]\nint v6; // [rsp+28444h] [rbp-Ch]\nint v7; // [rsp+28448h] [rbp-8h]\nunsigned int i; // [rsp+2844Ch] [rbp-4h]\n\nv7 = sub_405600((const char *)(a1 + 4504), v4, 1024);\nif ( v7 < 0 )\nsub_402796(a1, \"File or directory not found!\", \"WTF?\");\nv6 = *(_DWORD *)(a1 + 4240) - 32;\nfor ( i = 0; ; ++i )\n{\nresult = i;\nif ( (int)i >= v7 )\nbreak;\nif ( LOBYTE(v4[10 * (int)i]) != 46\n&& strchr((const char *)&v4[10 * (int)i], 46)\n&& (v4[10 * (int)i + 8] & 4) != 0\n&& (v4[10 * (int)i + 8] & 0xF000) == 0x4000 )\n{\nsnprintf(s, 0x400uLL, \"gopher://%s/\", (const char *)&v4[10 * (int)i]);\nif ( *(_BYTE *)(a1 + 81283) )\n{\ntp = localtime((const time_t *)&v4[10 * (int)i + 9] + 1);\nstrftime(v3, 0x14uLL, \"%Y-%b-%d %H:%M\", tp);\nprintf(\n\"1%-*.*s %s - \\t/;%s\\t%s\\t%i\\r\\n\",\nv6,\nv6,\ns,\nv3,\n(const char *)&v4[10 * (int)i],\n(const char *)&v4[10 * (int)i],\n*(unsigned int *)(a1 + 4888));\n}\nelse\n{\nprintf(\n\"1%.*s\\t/;%s\\t%s\\t%i\\r\\n\",\n*(_DWORD *)(a1 + 4240),\ns,\n(const char *)&v4[10 * (int)i],\n(const char *)&v4[10 * (int)i],\n*(unsigned int *)(a1 + 4888));\n}\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,s,v3,v4,tp,v6,v7,sub_405A3D,sub_405600,sub_402796,]", "hints": "[]", "response": "{'a1': 'st', 's': 'buf', 'v3': 'timestr', 'v4': 'dir', 'tp': 'ltime', 'v6': 'width', 'v7': 'num', 'sub_405A3D': 'vhostlist', 'sub_405600': 'sortdir', 'sub_402796': 'die'}"} | [
[
0.7415803670883179,
0.7241048812866211,
0.7016981244087219,
0.6999362707138062,
0.6812292337417603,
0.6662474274635315,
0.6657264828681946,
0.6615639925003052,
0.6592744588851929,
0.6576414108276367,
0.6562296748161316,
0.6550575494766235,
0.6519370675086975,
0.649449348449707,
0.6491985321044922,
0.6478067636489868,
0.6477133631706238,
0.6458260416984558,
0.6439203023910522,
0.643446683883667
],
[
119814,
36549,
122152,
137093,
244788,
225246,
215580,
101116,
264170,
1916,
264709,
198546,
163887,
60736,
239935,
91257,
151554,
158136,
164552,
210155
]
] |
|
acpi_ut_strtoul64 | a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c | mandiant | rvmi-kvm | NA | acpi_status acpi_ut_strtoul64(char *string, u32 flags, u64 *return_value)
{
acpi_status status = AE_OK;
u32 base;
ACPI_FUNCTION_TRACE_STR(ut_strtoul64, string);
/* Parameter validation */
if (!string || !return_value) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
*return_value = 0;
/* Check for zero-length string, returns 0 */
if (*string == 0) {
return_ACPI_STATUS(AE_OK);
}
/* Skip over any white space at start of string */
while (isspace((int)*string)) {
string++;
}
/* End of string? return 0 */
if (*string == 0) {
return_ACPI_STATUS(AE_OK);
}
/*
* 1) The "0x" prefix indicates base 16. Per the ACPI specification,
* the "0x" prefix is only allowed for implicit (non-strict) conversions.
* However, we always allow it for compatibility with older ACPICA.
*/
if ((*string == ACPI_ASCII_ZERO) &&
(tolower((int)*(string + 1)) == 'x')) {
string += 2; /* Go past the 0x */
if (*string == 0) {
return_ACPI_STATUS(AE_OK); /* Return value 0 */
}
base = 16;
}
/* 2) Force to base 16 (implicit conversion case) */
else if (flags & ACPI_STRTOUL_BASE16) {
base = 16;
}
/* 3) Default fallback is to Base 10 */
else {
base = 10;
}
/* Skip all leading zeros */
while (*string == ACPI_ASCII_ZERO) {
string++;
if (*string == 0) {
return_ACPI_STATUS(AE_OK); /* Return value 0 */
}
}
/* Perform the base 16 or 10 conversion */
if (base == 16) {
*return_value = acpi_ut_strtoul_base16(string, flags);
} else {
*return_value = acpi_ut_strtoul_base10(string, flags);
}
return_ACPI_STATUS(status);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405515", "function_addr": 4216085, "binary_name": "a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov [rbp+var_28], rdx"], [6, "mov [rbp+var_8], 0"], [7, "cmp [rbp+var_18], 0"], [8, "jz short loc_40553D"], [9, "cmp [rbp+var_28], 0"], [10, "jnz short loc_405547"], [11, "mov eax, 1001h"], [12, "jmp locret_40566A"], [13, "mov rax, [rbp+var_28]"], [14, "mov qword ptr [rax], 0"], [15, "mov rax, [rbp+var_18]"], [16, "movzx eax, byte ptr [rax]"], [17, "test al, al"], [18, "jnz short loc_40556C"], [19, "mov eax, 0"], [20, "jmp locret_40566A"], [21, "add [rbp+var_18], 1"], [22, "call ___ctype_b_loc"], [23, "mov rdx, [rax]"], [24, "mov rax, [rbp+var_18]"], [25, "movzx eax, byte ptr [rax]"], [26, "movsx rax, al"], [27, "add rax, rax"], [28, "add rax, rdx"], [29, "movzx eax, word ptr [rax]"], [30, "movzx eax, ax"], [31, "and eax, 2000h"], [32, "test eax, eax"], [33, "jnz short loc_405567"], [34, "mov rax, [rbp+var_18]"], [35, "movzx eax, byte ptr [rax]"], [36, "test al, al"], [37, "jnz short loc_4055A9"], [38, "mov eax, 0"], [39, "jmp locret_40566A"], [40, "mov rax, [rbp+var_18]"], [41, "movzx eax, byte ptr [rax]"], [42, "cmp al, 30h "], [43, "jnz short loc_4055F1"], [44, "mov rax, [rbp+var_18]"], [45, "add rax, 1"], [46, "movzx eax, byte ptr [rax]"], [47, "movsx eax, al"], [48, "mov edi, eax"], [49, "call _tolower"], [50, "cmp eax, 78h "], [51, "jnz short loc_4055F1"], [52, "add [rbp+var_18], 2"], [53, "mov rax, [rbp+var_18]"], [54, "movzx eax, byte ptr [rax]"], [55, "test al, al"], [56, "jnz short loc_4055E8"], [57, "mov eax, 0"], [58, "jmp locret_40566A"], [59, "mov [rbp+var_4], 10h"], [60, "jmp short loc_40560B"], [61, "mov eax, [rbp+var_1C]"], [62, "and eax, 10h"], [63, "test eax, eax"], [64, "jz short loc_405604"], [65, "mov [rbp+var_4], 10h"], [66, "jmp short loc_405624"], [67, "mov [rbp+var_4], 0Ah"], [68, "jmp short loc_405624"], [69, "add [rbp+var_18], 1"], [70, "mov rax, [rbp+var_18]"], [71, "movzx eax, byte ptr [rax]"], [72, "test al, al"], [73, "jnz short loc_405624"], [74, "mov eax, 0"], [75, "jmp short locret_40566A"], [76, "mov rax, [rbp+var_18]"], [77, "movzx eax, byte ptr [rax]"], [78, "cmp al, 30h "], [79, "jz short loc_40560D"], [80, "cmp [rbp+var_4], 10h"], [81, "jnz short loc_40564F"], [82, "mov edx, [rbp+var_1C]"], [83, "mov rax, [rbp+var_18]"], [84, "mov esi, edx"], [85, "mov rdi, rax"], [86, "call sub_40571E"], [87, "mov rdx, [rbp+var_28]"], [88, "mov [rdx], rax"], [89, "jmp short loc_405667"], [90, "mov edx, [rbp+var_1C]"], [91, "mov rax, [rbp+var_18]"], [92, "mov esi, edx"], [93, "mov rdi, rax"], [94, "call sub_40566C"], [95, "mov rdx, [rbp+var_28]"], [96, "mov [rdx], rax"], [97, "mov eax, [rbp+var_8]"], [98, "leave"], [99, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 5], [10, 9], [13, 5], [14, 13], [15, 3], [16, 15], [16, 14], [17, 16], [18, 17], [21, 3], [21, 21], [23, 22], [23, 14], [24, 3], [24, 21], [25, 24], [25, 14], [26, 25], [27, 26], [28, 23], [28, 27], [29, 28], [29, 14], [30, 29], [31, 30], [32, 31], [33, 32], [34, 3], [34, 21], [35, 14], [35, 34], [36, 35], [37, 36], [40, 3], [40, 21], [41, 40], [41, 14], [42, 41], [43, 42], [44, 3], [44, 21], [45, 44], [46, 45], [46, 14], [47, 46], [48, 47], [50, 49], [51, 50], [52, 3], [52, 21], [53, 52], [54, 14], [54, 53], [55, 54], [56, 55], [61, 4], [62, 61], [63, 62], [64, 63], [69, 3], [69, 21], [69, 69], [69, 52], [70, 69], [71, 14], [71, 70], [72, 71], [73, 72], [76, 52], [76, 3], [76, 21], [76, 69], [77, 76], [77, 14], [78, 77], [79, 78], [80, 65], [80, 67], [80, 59], [81, 80], [82, 4], [83, 3], [83, 21], [83, 69], [83, 52], [84, 82], [85, 83], [87, 5], [88, 86], [88, 87], [90, 4], [91, 52], [91, 3], [91, 21], [91, 69], [92, 90], [93, 91], [95, 5], [96, 95], [96, 94], [97, 6], [99, 38], [99, 97], [99, 74], [99, 19], [99, 57], [99, 11]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c_a2efe6de823d5f5a22d03fac402019f3dcfe6f7fdd1e90634b13efbcfbea589c.jsonl.gz", "strip_func_name": "sub_405515", "query": "\n\n\n__int64 __fastcall sub_405515(char *a1, unsigned int a2, __int64 *a3)\n{\n__int64 result; // rax\n__int64 v4; // rax\nchar *v6; // [rsp+18h] [rbp-18h]\nint v7; // [rsp+2Ch] [rbp-4h]\n\nv6 = a1;\nif ( !a1 || !a3 )\nreturn 4097LL;\n*a3 = 0LL;\nif ( !*a1 )\nreturn 0LL;\nwhile ( ((*__ctype_b_loc())[*v6] & 0x2000) != 0 )\n++v6;\nif ( !*v6 )\nreturn 0LL;\nif ( *v6 == 48 && tolower(v6[1]) == 120 )\n{\nv6 += 2;\nif ( *v6 )\n{\nv7 = 16;\ngoto LABEL_20;\n}\nresult = 0LL;\n}\nelse\n{\nif ( (a2 & 0x10) != 0 )\nv7 = 16;\nelse\nv7 = 10;\nLABEL_20:\nwhile ( *v6 == 48 )\n{\nif ( !*++v6 )\nreturn 0LL;\n}\nif ( v7 == 16 )\nv4 = sub_40571E(v6, a2);\nelse\nv4 = sub_40566C(v6, a2);\n*a3 = v4;\nresult = 0LL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v4,v6,v7,sub_405515,sub_40571E,sub_40566C,]", "hints": "[]", "response": "{'a3': 'return_value', 'a1': 'string', 'a2': 'flags', 'v4': 'result', 'v6': 'stringa', 'v7': 'base', 'sub_405515': 'acpi_ut_strtoul64', 'sub_40571E': 'acpi_ut_strtoul_base16', 'sub_40566C': 'acpi_ut_strtoul_base10'}"} | [
[
0.7442916035652161,
0.7411620616912842,
0.7384855151176453,
0.7371346950531006,
0.7366737723350525,
0.7293051481246948,
0.7277200818061829,
0.7245008945465088,
0.7236891984939575,
0.7201511859893799,
0.7123979330062866,
0.7115350961685181,
0.708970844745636,
0.707602322101593,
0.7060213685035706,
0.7056677937507629,
0.7015547752380371,
0.7012409567832947,
0.7003872394561768,
0.6996036767959595
],
[
154271,
86444,
43362,
89312,
180557,
113481,
1166,
250108,
19398,
247964,
158140,
40226,
251325,
239457,
18071,
227272,
20488,
217175,
115807,
131704
]
] |
|
color_log | 78f8ecac70fd73cc1cd31a504e914fd44148d3d0b2dbbea81d706b662ba42aa8 | emptyhua | baidu_pcs_cli | NA | void color_log(int type, const char *format, ...) {
//{{{
va_list args;
char buf[1024] = {'\0'};
int support_color = 0;
FILE *fp = NULL;
if (type == COLOR_LOG_ERROR) {
fp = stderr;
support_color = isatty(fileno(fp));
if (support_color) {
strcat(buf, "\x1b[37;41m");
}
strcat(buf, "ERROR");
if (support_color) {
strcat(buf, "\x1b[0m");
}
strcat(buf, ": ");
} else if (type == COLOR_LOG_OK) {
fp = stdout;
support_color = isatty(fileno(fp));
if (support_color) {
strcat(buf, "\x1b[32m");
}
strcat(buf, "OK");
if (support_color) {
strcat(buf, "\x1b[0m");
}
strcat(buf, ": ");
} else if (type == COLOR_LOG_IGNORE) {
fp = stdout;
support_color = isatty(fileno(fp));
if (support_color) {
strcat(buf, "\x1b[33m");
}
strcat(buf, "IGNORE");
if (support_color) {
strcat(buf, "\x1b[0m");
}
strcat(buf, ": ");
}
snprintf(buf + strlen(buf), 1024 - strlen(buf), "%s", format);
va_start(args, format);
vfprintf(fp, buf, args);
va_end(args);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402674", "function_addr": 4204148, "binary_name": "78f8ecac70fd73cc1cd31a504e914fd44148d3d0b2dbbea81d706b662ba42aa8.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 4F8h"], [4, "mov [rbp+var_4F4], edi"], [5, "mov [rbp+var_500], rsi"], [6, "mov [rbp+var_B0], rdx"], [7, "mov [rbp+var_A8], rcx"], [8, "mov [rbp+var_A0], r8"], [9, "mov [rbp+var_98], r9"], [10, "test al, al"], [11, "jz short loc_4026D0"], [12, "movaps [rbp+var_90], xmm0"], [13, "movaps [rbp+var_80], xmm1"], [14, "movaps [rbp+var_70], xmm2"], [15, "movaps [rbp+var_60], xmm3"], [16, "movaps [rbp+var_50], xmm4"], [17, "movaps [rbp+var_40], xmm5"], [18, "movaps [rbp+var_30], xmm6"], [19, "movaps [rbp+var_20], xmm7"], [20, "mov qword ptr [rbp+s], 0"], [21, "mov [rbp+var_4E8], 0"], [22, "lea rdx, [rbp+var_4E0]"], [23, "mov eax, 0"], [24, "mov ecx, 7Eh "], [25, "mov rdi, rdx"], [26, "rep stosq"], [27, "mov [rbp+var_CC], 0"], [28, "mov [rbp+stream], 0"], [29, "cmp [rbp+var_4F4], 2"], [30, "jnz loc_402800"], [31, "mov rax, cs:stderr"], [32, "mov [rbp+stream], rax"], [33, "mov rax, [rbp+stream]"], [34, "mov rdi, rax"], [35, "call _fileno"], [36, "mov edi, eax"], [37, "call _isatty"], [38, "mov [rbp+var_CC], eax"], [39, "cmp [rbp+var_CC], 0"], [40, "jz short loc_40277F"], [41, "lea rax, [rbp+s]"], [42, "mov rdi, rax"], [43, "call _strlen"], [44, "mov rdx, rax"], [45, "lea rax, [rbp+s]"], [46, "add rax, rdx"], [47, "mov rsi, 6D31343B37335B1Bh"], [48, "mov [rax], rsi"], [49, "mov byte ptr [rax+8], 0"], [50, "lea rax, [rbp+s]"], [51, "mov rdi, rax"], [52, "call _strlen"], [53, "mov rdx, rax"], [54, "lea rax, [rbp+s]"], [55, "add rax, rdx"], [56, "mov dword ptr [rax], 4F525245h"], [57, "mov word ptr [rax+4], 52h "], [58, "cmp [rbp+var_CC], 0"], [59, "jz short loc_4027D6"], [60, "lea rax, [rbp+s]"], [61, "mov rdi, rax"], [62, "call _strlen"], [63, "mov rdx, rax"], [64, "lea rax, [rbp+s]"], [65, "add rax, rdx"], [66, "mov dword ptr [rax], 6D305B1Bh"], [67, "mov byte ptr [rax+4], 0"], [68, "lea rax, [rbp+s]"], [69, "mov rdi, rax"], [70, "call _strlen"], [71, "mov rdx, rax"], [72, "lea rax, [rbp+s]"], [73, "add rax, rdx"], [74, "mov word ptr [rax], 203Ah"], [75, "mov byte ptr [rax+2], 0"], [76, "jmp loc_4029CE"], [77, "cmp [rbp+var_4F4], 1"], [78, "jnz loc_4028E6"], [79, "mov rax, cs:__bss_start"], [80, "mov [rbp+stream], rax"], [81, "mov rax, [rbp+stream]"], [82, "mov rdi, rax"], [83, "call _fileno"], [84, "mov edi, eax"], [85, "call _isatty"], [86, "mov [rbp+var_CC], eax"], [87, "cmp [rbp+var_CC], 0"], [88, "jz short loc_402868"], [89, "lea rax, [rbp+s]"], [90, "mov rdi, rax"], [91, "call _strlen"], [92, "mov rdx, rax"], [93, "lea rax, [rbp+s]"], [94, "add rax, rdx"], [95, "mov dword ptr [rax], 32335B1Bh"], [96, "mov word ptr [rax+4], 6Dh "], [97, "lea rax, [rbp+s]"], [98, "mov rdi, rax"], [99, "call _strlen"], [100, "mov rdx, rax"], [101, "lea rax, [rbp+s]"], [102, "add rax, rdx"], [103, "mov word ptr [rax], 4B4Fh"], [104, "mov byte ptr [rax+2], 0"], [105, "cmp [rbp+var_CC], 0"], [106, "jz short loc_4028BC"], [107, "lea rax, [rbp+s]"], [108, "mov rdi, rax"], [109, "call _strlen"], [110, "mov rdx, rax"], [111, "lea rax, [rbp+s]"], [112, "add rax, rdx"], [113, "mov dword ptr [rax], 6D305B1Bh"], [114, "mov byte ptr [rax+4], 0"], [115, "lea rax, [rbp+s]"], [116, "mov rdi, rax"], [117, "call _strlen"], [118, "mov rdx, rax"], [119, "lea rax, [rbp+s]"], [120, "add rax, rdx"], [121, "mov word ptr [rax], 203Ah"], [122, "mov byte ptr [rax+2], 0"], [123, "jmp loc_4029CE"], [124, "cmp [rbp+var_4F4], 3"], [125, "jnz loc_4029CE"], [126, "mov rax, cs:__bss_start"], [127, "mov [rbp+stream], rax"], [128, "mov rax, [rbp+stream]"], [129, "mov rdi, rax"], [130, "call _fileno"], [131, "mov edi, eax"], [132, "call _isatty"], [133, "mov [rbp+var_CC], eax"], [134, "cmp [rbp+var_CC], 0"], [135, "jz short loc_40294E"], [136, "lea rax, [rbp+s]"], [137, "mov rdi, rax"], [138, "call _strlen"], [139, "mov rdx, rax"], [140, "lea rax, [rbp+s]"], [141, "add rax, rdx"], [142, "mov dword ptr [rax], 33335B1Bh"], [143, "mov word ptr [rax+4], 6Dh "], [144, "lea rax, [rbp+s]"], [145, "mov rdi, rax"], [146, "call _strlen"], [147, "mov rdx, rax"], [148, "lea rax, [rbp+s]"], [149, "add rax, rdx"], [150, "mov dword ptr [rax], 4F4E4749h"], [151, "mov word ptr [rax+4], 4552h"], [152, "mov byte ptr [rax+6], 0"], [153, "cmp [rbp+var_CC], 0"], [154, "jz short loc_4029A9"], [155, "lea rax, [rbp+s]"], [156, "mov rdi, rax"], [157, "call _strlen"], [158, "mov rdx, rax"], [159, "lea rax, [rbp+s]"], [160, "add rax, rdx"], [161, "mov dword ptr [rax], 6D305B1Bh"], [162, "mov byte ptr [rax+4], 0"], [163, "lea rax, [rbp+s]"], [164, "mov rdi, rax"], [165, "call _strlen"], [166, "mov rdx, rax"], [167, "lea rax, [rbp+s]"], [168, "add rax, rdx"], [169, "mov word ptr [rax], 203Ah"], [170, "mov byte ptr [rax+2], 0"], [171, "lea rax, [rbp+s]"], [172, "mov rdi, rax"], [173, "call _strlen"], [174, "mov edx, 400h"], [175, "mov rbx, rdx"], [176, "sub rbx, rax"], [177, "lea rax, [rbp+s]"], [178, "mov rdi, rax"], [179, "call _strlen"], [180, "lea rdx, [rbp+s]"], [181, "lea rdi, [rdx+rax]"], [182, "mov rax, [rbp+var_500]"], [183, "mov rcx, rax"], [184, "mov edx, offset format"], [185, "mov rsi, rbx"], [186, "mov eax, 0"], [187, "call _snprintf"], [188, "mov [rbp+arg], 10h"], [189, "mov [rbp+var_E4], 30h "], [190, "lea rax, [rbp+arg_0]"], [191, "mov [rbp+var_E0], rax"], [192, "lea rax, [rbp+var_C0]"], [193, "mov [rbp+var_D8], rax"], [194, "lea rdx, [rbp+arg]"], [195, "lea rcx, [rbp+s]"], [196, "mov rax, [rbp+stream]"], [197, "mov rsi, rcx"], [198, "mov rdi, rax"], [199, "call _vfprintf"], [200, "nop"], [201, "mov rbx, [rbp+var_8]"], [202, "leave"], [203, "retn"]], "data_dep": [[11, 10], [25, 22], [29, 4], [30, 29], [32, 31], [33, 32], [34, 33], [36, 35], [38, 37], [39, 38], [40, 39], [41, 37], [41, 20], [42, 41], [44, 43], [45, 43], [45, 20], [46, 45], [46, 44], [48, 47], [48, 46], [49, 46], [50, 20], [50, 37], [50, 46], [51, 50], [53, 52], [54, 52], [54, 20], [55, 54], [55, 53], [56, 55], [57, 55], [58, 38], [59, 58], [60, 55], [60, 20], [61, 60], [63, 62], [64, 62], [64, 20], [65, 63], [65, 64], [66, 65], [67, 65], [68, 20], [68, 65], [68, 55], [69, 68], [71, 70], [72, 20], [72, 70], [73, 71], [73, 72], [74, 73], [75, 73], [77, 4], [78, 77], [80, 79], [81, 80], [82, 81], [84, 83], [86, 85], [87, 86], [88, 87], [89, 85], [89, 20], [90, 89], [92, 91], [93, 91], [93, 20], [94, 93], [94, 92], [95, 94], [96, 94], [97, 85], [97, 94], [97, 20], [98, 97], [100, 99], [101, 99], [101, 20], [102, 100], [102, 101], [103, 102], [104, 102], [105, 86], [106, 105], [107, 20], [107, 102], [108, 107], [110, 109], [111, 20], [111, 109], [112, 111], [112, 110], [113, 112], [114, 112], [115, 112], [115, 20], [115, 102], [116, 115], [118, 117], [119, 20], [119, 117], [120, 119], [120, 118], [121, 120], [122, 120], [124, 4], [125, 124], [127, 126], [128, 127], [129, 128], [131, 130], [133, 132], [134, 133], [135, 134], [136, 20], [136, 132], [137, 136], [139, 138], [140, 20], [140, 138], [141, 140], [141, 139], [142, 141], [143, 141], [144, 132], [144, 141], [144, 20], [145, 144], [147, 146], [148, 146], [148, 20], [149, 148], [149, 147], [150, 149], [151, 149], [152, 149], [153, 133], [154, 153], [155, 149], [155, 20], [156, 155], [158, 157], [159, 20], [159, 157], [160, 158], [160, 159], [161, 160], [162, 160], [163, 20], [163, 149], [163, 160], [164, 163], [166, 165], [167, 20], [167, 165], [168, 166], [168, 167], [169, 168], [170, 168], [171, 120], [171, 168], [171, 23], [171, 73], [171, 20], [172, 171], [175, 174], [176, 173], [176, 175], [177, 173], [177, 20], [178, 177], [180, 20], [180, 174], [181, 103], [181, 48], [181, 57], [181, 121], [181, 66], [181, 151], [181, 96], [181, 169], [181, 178], [181, 114], [181, 162], [181, 75], [181, 150], [181, 95], [181, 104], [181, 143], [181, 152], [181, 161], [181, 56], [181, 74], [181, 49], [181, 113], [181, 122], [181, 67], [181, 170], [181, 179], [181, 142], [182, 5], [183, 182], [185, 176], [190, 187], [191, 190], [192, 190], [193, 192], [194, 184], [194, 188], [195, 20], [195, 183], [196, 28], [196, 32], [196, 80], [196, 127], [197, 195], [198, 196], [203, 199]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/78f8ecac70fd73cc1cd31a504e914fd44148d3d0b2dbbea81d706b662ba42aa8_78f8ecac70fd73cc1cd31a504e914fd44148d3d0b2dbbea81d706b662ba42aa8.jsonl.gz", "strip_func_name": "sub_402674", "query": "\n\n\nint sub_402674(int a1, const char *a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, ...)\n{\nint v6; // eax\nint v7; // eax\nint v8; // eax\nsize_t v9; // rbx\nsize_t v10; // rax\nchar s[8]; // [rsp+10h] [rbp-4F0h] BYREF\n__int64 v13; // [rsp+18h] [rbp-4E8h]\nchar v14[1008]; // [rsp+20h] [rbp-4E0h] BYREF\ngcc_va_list arg; // [rsp+418h] [rbp-E8h] BYREF\nint v16; // [rsp+434h] [rbp-CCh]\nFILE *stream; // [rsp+438h] [rbp-C8h]\n__int64 v18; // [rsp+450h] [rbp-B0h]\n__int64 v19; // [rsp+458h] [rbp-A8h]\n__int64 v20; // [rsp+460h] [rbp-A0h]\n__int64 v21; // [rsp+468h] [rbp-98h]\n\nv18 = a3;\nv19 = a4;\nv20 = a5;\nv21 = a6;\n*(_QWORD *)s = 0LL;\nv13 = 0LL;\nmemset(v14, 0, sizeof(v14));\nv16 = 0;\nstream = 0LL;\nswitch ( a1 )\n{\ncase 2:\nstream = stderr;\nv6 = fileno(stderr);\nv16 = isatty(v6);\nif ( v16 )\nstrcpy(&s[strlen(s)], \"\\x1B[37;41m\");\nstrcpy(&s[strlen(s)], \"ERROR\");\nif ( v16 )\nstrcpy(&s[strlen(s)], \"\\x1B[0m\");\nLABEL_18:\nstrcpy(&s[strlen(s)], \": \");\nbreak;\ncase 1:\nstream = (FILE *)_bss_start;\nv7 = fileno((FILE *)_bss_start);\nv16 = isatty(v7);\nif ( v16 )\nstrcpy(&s[strlen(s)], \"\\x1B[32m\");\nstrcpy(&s[strlen(s)], \"OK\");\nif ( v16 )\nstrcpy(&s[strlen(s)], \"\\x1B[0m\");\ngoto LABEL_18;\ncase 3:\nstream = (FILE *)_bss_start;\nv8 = fileno((FILE *)_bss_start);\nv16 = isatty(v8);\nif ( v16 )\nstrcpy(&s[strlen(s)], \"\\x1B[33m\");\nstrcpy(&s[strlen(s)], \"IGNORE\");\nif ( v16 )\nstrcpy(&s[strlen(s)], \"\\x1B[0m\");\ngoto LABEL_18;\n}\nv9 = 1024 - strlen(s);\nv10 = strlen(s);\nsnprintf(&s[v10], v9, \"%s\", a2);\narg[0].gp_offset = 16;\nva_start(arg, a6);\nreturn vfprintf(stream, s, arg);\n}\n\n\n\nQ:[a1,a2,s,arg,v16,stream,sub_402674,]", "hints": "[]", "response": "{'a1': 'type', 'a2': 'format', 's': 'buf', 'arg': 'args', 'v16': 'support_color', 'stream': 'fp', 'sub_402674': 'color_log'}"} | [
[
0.6584998965263367,
0.6542304754257202,
0.6471883058547974,
0.646824300289154,
0.6455064415931702,
0.6429046392440796,
0.640918493270874,
0.6357128620147705,
0.6355742812156677,
0.6349486708641052,
0.6344229578971863,
0.6344229578971863,
0.6344229578971863,
0.6333820819854736,
0.6317332983016968,
0.6315804123878479,
0.6315804123878479,
0.6313247680664062,
0.6311985850334167,
0.6311985850334167
],
[
137653,
82902,
221256,
104007,
145904,
232966,
195488,
27761,
28912,
7350,
130289,
150638,
51350,
112517,
167300,
174246,
185126,
228236,
43768,
220822
]
] |
|
save_file_from_stdin | a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c | coreboot | vboot | NA | int save_file_from_stdin(const char *output)
{
FILE *in = stdin, *out = fopen(output, "wb");
char buffer[4096];
size_t sz;
assert(in);
if (!out)
return -1;
while (!feof(in)) {
sz = fread(buffer, 1, sizeof(buffer), in);
if (fwrite(buffer, 1, sz, out) != sz) {
fclose(out);
return -1;
}
}
fclose(out);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41D444", "function_addr": 4314180, "binary_name": "a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 1030h"], [3, "mov [rbp+filename], rdi"], [4, "mov rax, cs:stdin_ptr"], [5, "mov rax, [rax]"], [6, "mov [rbp+stream], rax"], [7, "mov rax, [rbp+filename]"], [8, "lea rsi, aWb_7"], [9, "mov rdi, rax"], [10, "call _fopen64"], [11, "mov [rbp+s], rax"], [12, "cmp [rbp+s], 0"], [13, "jnz short loc_41D4E5"], [14, "mov eax, 0FFFFFFFFh"], [15, "jmp short locret_41D506"], [16, "mov rdx, [rbp+stream]"], [17, "lea rax, [rbp+ptr]"], [18, "mov rcx, rdx"], [19, "mov edx, 1000h"], [20, "mov esi, 1"], [21, "mov rdi, rax"], [22, "call _fread"], [23, "mov [rbp+n], rax"], [24, "mov rcx, [rbp+s]"], [25, "mov rdx, [rbp+n]"], [26, "lea rax, [rbp+ptr]"], [27, "mov esi, 1"], [28, "mov rdi, rax"], [29, "call _fwrite"], [30, "cmp [rbp+n], rax"], [31, "jz short loc_41D4E5"], [32, "mov rax, [rbp+s]"], [33, "mov rdi, rax"], [34, "call _fclose"], [35, "mov eax, 0FFFFFFFFh"], [36, "jmp short locret_41D506"], [37, "mov rax, [rbp+stream]"], [38, "mov rdi, rax"], [39, "call _feof"], [40, "test eax, eax"], [41, "jz short loc_41D48C"], [42, "mov rax, [rbp+s]"], [43, "mov rdi, rax"], [44, "call _fclose"], [45, "mov eax, 0"], [46, "leave"], [47, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 3], [9, 7], [11, 10], [12, 11], [13, 12], [16, 6], [17, 40], [18, 16], [21, 17], [23, 22], [24, 11], [25, 23], [26, 22], [28, 26], [30, 23], [30, 29], [31, 30], [32, 11], [33, 32], [37, 6], [38, 37], [40, 39], [41, 40], [42, 11], [43, 42], [47, 45], [47, 14], [47, 35]]}
| {"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_41D444", "query": "\n\n\n__int64 __fastcall sub_41D444(const char *a1)\n{\nsize_t v2; // rax\nchar ptr[4104]; // [rsp+10h] [rbp-1020h] BYREF\nsize_t n; // [rsp+1018h] [rbp-18h]\nFILE *s; // [rsp+1020h] [rbp-10h]\nFILE *stream; // [rsp+1028h] [rbp-8h]\n\nstream = stdin;\ns = fopen64(a1, \"wb\");\nif ( !s )\nreturn 0xFFFFFFFFLL;\nwhile ( !feof(stream) )\n{\nn = fread(ptr, 1uLL, 0x1000uLL, stream);\nv2 = fwrite(ptr, 1uLL, n, s);\nif ( n != v2 )\n{\nfclose(s);\nreturn 0xFFFFFFFFLL;\n}\n}\nfclose(s);\nreturn 0LL;\n}\n\n\n\nQ:[a1,ptr,n,s,stream,sub_41D444,]", "hints": "[]", "response": "{'a1': 'output', 'ptr': 'buffer', 'n': 'sz', 's': 'out', 'stream': 'in', 'sub_41D444': 'save_file_from_stdin'}"} | [
[
0.867486834526062,
0.7994953393936157,
0.7947220802307129,
0.7870748043060303,
0.7781485319137573,
0.7764370441436768,
0.7754241824150085,
0.772771418094635,
0.763109564781189,
0.7559857368469238,
0.7534574866294861,
0.7513530254364014,
0.7503763437271118,
0.7499500513076782,
0.746154248714447,
0.7454610466957092,
0.7447003126144409,
0.743859589099884,
0.7408727407455444,
0.740618109703064
],
[
176345,
237585,
79151,
101448,
19872,
117113,
70841,
221739,
264822,
175663,
142102,
30880,
251385,
10959,
154614,
103814,
233428,
39879,
238791,
18630
]
] |
|
free_ntvclos | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static void free_ntvclos(bvm *vm, bgcobject *obj)
{
bntvclos *f = cast_ntvclos(obj);
gc_try (f != NULL) {
int count = f->nupvals;
bupval **uv = &be_ntvclos_upval(f, 0);
while (count--) {
be_free(vm, *uv++, sizeof(bupval));
}
be_free(vm, f, sizeof(bntvclos) + sizeof(bupval*) * f->nupvals);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42C752", "function_addr": 4376402, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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_30], rsi"], [5, "cmp [rbp+var_30], 0"], [6, "jz short loc_42C77B"], [7, "mov rax, [rbp+var_30]"], [8, "movzx eax, byte ptr [rax+8]"], [9, "cmp al, 46h "], [10, "jnz short loc_42C77B"], [11, "mov rax, [rbp+var_30]"], [12, "jmp short loc_42C780"], [13, "mov eax, 0"], [14, "mov [rbp+var_18], rax"], [15, "cmp [rbp+var_18], 0"], [16, "jz short loc_42C805"], [17, "mov rax, [rbp+var_18]"], [18, "movzx eax, byte ptr [rax+0Ah]"], [19, "movzx eax, al"], [20, "mov [rbp+var_4], eax"], [21, "mov rax, [rbp+var_18]"], [22, "add rax, 20h "], [23, "mov [rbp+var_10], rax"], [24, "jmp short loc_42C7CC"], [25, "mov rax, [rbp+var_10]"], [26, "lea rdx, [rax+8]"], [27, "mov [rbp+var_10], rdx"], [28, "mov rsi, [rax]"], [29, "mov rax, [rbp+var_28]"], [30, "mov ecx, 0"], [31, "mov edx, 20h "], [32, "mov rdi, rax"], [33, "call be_realloc"], [34, "mov eax, [rbp+var_4]"], [35, "lea edx, [rax-1]"], [36, "mov [rbp+var_4], edx"], [37, "test eax, eax"], [38, "jnz short loc_42C7A7"], [39, "mov rax, [rbp+var_18]"], [40, "movzx eax, byte ptr [rax+0Ah]"], [41, "movzx eax, al"], [42, "add rax, 4"], [43, "lea rdx, ds:0[rax*8]"], [44, "mov rsi, [rbp+var_18]"], [45, "mov rax, [rbp+var_28]"], [46, "mov ecx, 0"], [47, "mov rdi, rax"], [48, "call be_realloc"], [49, "nop"], [50, "leave"], [51, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 4], [8, 7], [9, 8], [10, 9], [11, 4], [14, 13], [14, 11], [15, 14], [16, 15], [17, 14], [18, 17], [19, 18], [20, 19], [21, 14], [22, 21], [23, 22], [25, 23], [25, 27], [26, 35], [26, 25], [27, 26], [28, 25], [29, 3], [32, 29], [34, 36], [34, 20], [35, 31], [35, 34], [36, 35], [37, 34], [38, 37], [39, 14], [40, 39], [41, 40], [42, 41], [43, 35], [44, 14], [45, 3], [47, 45], [51, 13], [51, 48], [51, 11]]}
| {"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_42C752", "query": "\n\n\nunsigned __int8 *__fastcall sub_42C752(__int64 a1, unsigned __int8 *a2)\n{\nunsigned __int8 *result; // rax\nvoid **v3; // rax\nunsigned __int8 *v5; // [rsp+18h] [rbp-18h]\nvoid **i; // [rsp+20h] [rbp-10h]\nint v7; // [rsp+2Ch] [rbp-4h]\n\nif ( a2 && a2[8] == 70 )\nresult = a2;\nelse\nresult = 0LL;\nv5 = result;\nif ( result )\n{\nv7 = result[10];\nfor ( i = (void **)(result + 32); v7--; ++i )\n{\nv3 = i;\nbe_realloc(a1, *v3, 0x20uLL, 0LL);\n}\nresult = (unsigned __int8 *)be_realloc(a1, v5, 8 * (v5[10] + 4LL), 0LL);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v5,i,v7,sub_42C752,]", "hints": "[]", "response": "{'a1': 'vm', 'a2': 'obj', 'v5': 'f', 'i': 'uv', 'v7': 'count', 'sub_42C752': 'free_ntvclos'}"} | [
[
0.7313273549079895,
0.7251749038696289,
0.6880074739456177,
0.6735708713531494,
0.6724416017532349,
0.671281099319458,
0.6700435876846313,
0.6656270027160645,
0.6634323596954346,
0.6633590459823608,
0.6629945039749146,
0.6619428396224976,
0.6604427695274353,
0.6602115631103516,
0.6587595343589783,
0.6575857400894165,
0.6568800806999207,
0.656146764755249,
0.6560026407241821,
0.649273157119751
],
[
143328,
217311,
240358,
100719,
72035,
257813,
98728,
98318,
54417,
170040,
134805,
13638,
127530,
161449,
164924,
64927,
146222,
4840,
20444,
131465
]
] |
|
dna_r_ncasecmp | 6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172 | noporpoise | seq-align | NA | int dna_r_ncasecmp(const char *seq, size_t len)
{
size_t i, j;
for(i = 0, j = len-1; i < len; i++, j--) {
int cmp = (int)tolower(seq[i]) - tolower(seq[j]);
if(cmp) return cmp;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4067E6", "function_addr": 4220902, "binary_name": "6723febbee00738b4ceaa2fc075923fe65a4ad6c76227ee5f04841ff1f0a7172.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 38h"], [4, "mov [rbp+var_38], rdi"], [5, "mov [rbp+var_40], rsi"], [6, "mov [rbp+var_18], 0"], [7, "mov rax, [rbp+var_40]"], [8, "sub rax, 1"], [9, "mov [rbp+var_20], rax"], [10, "jmp short loc_40685D"], [11, "mov rdx, [rbp+var_38]"], [12, "mov rax, [rbp+var_18]"], [13, "add rax, rdx"], [14, "movzx eax, byte ptr [rax]"], [15, "movsx eax, al"], [16, "mov edi, eax"], [17, "call _tolower"], [18, "mov ebx, eax"], [19, "mov rdx, [rbp+var_38]"], [20, "mov rax, [rbp+var_20]"], [21, "add rax, rdx"], [22, "movzx eax, byte ptr [rax]"], [23, "movsx eax, al"], [24, "mov edi, eax"], [25, "call _tolower"], [26, "mov edx, eax"], [27, "mov eax, ebx"], [28, "sub eax, edx"], [29, "mov [rbp+var_24], eax"], [30, "cmp [rbp+var_24], 0"], [31, "jz short loc_406853"], [32, "mov eax, [rbp+var_24]"], [33, "jmp short loc_40686C"], [34, "add [rbp+var_18], 1"], [35, "sub [rbp+var_20], 1"], [36, "mov rax, [rbp+var_18]"], [37, "cmp rax, [rbp+var_40]"], [38, "jb short loc_40680D"], [39, "mov eax, 0"], [40, "mov rbx, [rbp+var_8]"], [41, "leave"], [42, "retn"]], "data_dep": [[7, 5], [8, 7], [9, 8], [11, 4], [12, 34], [12, 6], [13, 11], [13, 12], [14, 13], [15, 14], [16, 15], [18, 17], [19, 4], [20, 35], [20, 9], [21, 19], [21, 20], [22, 21], [23, 22], [24, 23], [26, 25], [27, 18], [28, 27], [28, 26], [29, 28], [30, 29], [31, 30], [32, 29], [34, 34], [34, 6], [35, 35], [35, 9], [36, 34], [36, 6], [37, 36], [37, 5], [38, 37], [42, 39], [42, 32]]}
| {"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_4067E6", "query": "\n\n\n__int64 __fastcall sub_4067E6(__int64 a1, unsigned __int64 a2)\n{\nint v2; // ebx\nunsigned int v4; // [rsp+1Ch] [rbp-24h]\nunsigned __int64 v5; // [rsp+20h] [rbp-20h]\nunsigned __int64 v6; // [rsp+28h] [rbp-18h]\n\nv6 = 0LL;\nv5 = a2 - 1;\nwhile ( v6 < a2 )\n{\nv2 = tolower(*(char *)(a1 + v6));\nv4 = v2 - tolower(*(char *)(a1 + v5));\nif ( v4 )\nreturn v4;\n++v6;\n--v5;\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,v4,sub_4067E6,]", "hints": "[]", "response": "{'a1': 'seq', 'a2': 'len', 'v4': 'cmp', 'sub_4067E6': 'dna_r_ncasecmp'}"} | [
[
0.7733942270278931,
0.757392168045044,
0.7413426637649536,
0.7216384410858154,
0.7108413577079773,
0.7019537091255188,
0.6968676447868347,
0.69607013463974,
0.686681866645813,
0.6835043430328369,
0.6807112693786621,
0.6783150434494019,
0.6746546030044556,
0.6654393672943115,
0.6651029586791992,
0.6642789244651794,
0.662183403968811,
0.659757137298584,
0.6536005735397339,
0.6527265310287476
],
[
97139,
71378,
42150,
155434,
37030,
104451,
208495,
32104,
120572,
86934,
217697,
219483,
86435,
28449,
262216,
45810,
225455,
167784,
9663,
29494
]
] |
|
print_cluster_items | 90f820d92c2dd478226a03e997c10fd7a6311184865821cacf4685dc144080d3 | gyaikhom | agglomerative-hierarchical-clustering | NA | void print_cluster_items(cluster_t *cluster, int index)
{
cluster_node_t *node = &(cluster->nodes[index]);
fprintf(stdout, "Items: ");
if (node->num_items > 0) {
fprintf(stdout, "%s", cluster->nodes[node->items[0]].label);
for (int i = 1; i < node->num_items; ++i)
fprintf(stdout, ", %s",
cluster->nodes[node->items[i]].label);
}
fprintf(stdout, "\n");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401ECE", "function_addr": 4202190, "binary_name": "90f820d92c2dd478226a03e997c10fd7a6311184865821cacf4685dc144080d3.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 rax, [rbp+var_18]"], [6, "mov rdx, [rax+10h]"], [7, "mov eax, [rbp+var_1C]"], [8, "cdqe"], [9, "shl rax, 6"], [10, "add rax, rdx"], [11, "mov [rbp+var_10], rax"], [12, "mov rax, cs:stdout"], [13, "mov rcx, rax"], [14, "mov edx, 7"], [15, "mov esi, 1"], [16, "mov edi, offset aItems"], [17, "call _fwrite"], [18, "mov rax, [rbp+var_10]"], [19, "mov eax, [rax+28h]"], [20, "test eax, eax"], [21, "jle loc_401FB0"], [22, "mov rax, [rbp+var_18]"], [23, "mov rdx, [rax+10h]"], [24, "mov rax, [rbp+var_10]"], [25, "mov rax, [rax+30h]"], [26, "mov eax, [rax]"], [27, "cdqe"], [28, "shl rax, 6"], [29, "add rax, rdx"], [30, "mov rax, [rax+18h]"], [31, "mov rdx, cs:stdout"], [32, "mov rsi, rdx"], [33, "mov rdi, rax"], [34, "call _fputs"], [35, "mov [rbp+var_4], 1"], [36, "jmp short loc_401FA4"], [37, "mov rax, [rbp+var_18]"], [38, "mov rdx, [rax+10h]"], [39, "mov rax, [rbp+var_10]"], [40, "mov rcx, [rax+30h]"], [41, "mov eax, [rbp+var_4]"], [42, "cdqe"], [43, "shl rax, 2"], [44, "add rax, rcx"], [45, "mov eax, [rax]"], [46, "cdqe"], [47, "shl rax, 6"], [48, "add rax, rdx"], [49, "mov rdx, [rax+18h]"], [50, "mov rax, cs:stdout"], [51, "mov esi, offset aS"], [52, "mov rdi, rax"], [53, "mov eax, 0"], [54, "call _fprintf"], [55, "add [rbp+var_4], 1"], [56, "mov rax, [rbp+var_10]"], [57, "mov eax, [rax+28h]"], [58, "cmp [rbp+var_4], eax"], [59, "jl short loc_401F5C"], [60, "mov rax, cs:stdout"], [61, "mov rsi, rax"], [62, "mov edi, 0Ah"], [63, "call _fputc"], [64, "nop"], [65, "leave"], [66, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 4], [9, 7], [10, 6], [10, 9], [11, 10], [13, 12], [18, 11], [19, 18], [20, 19], [21, 20], [22, 3], [23, 22], [24, 11], [25, 24], [26, 25], [28, 26], [29, 23], [29, 28], [30, 29], [32, 31], [33, 30], [37, 3], [38, 37], [39, 11], [40, 39], [41, 55], [41, 35], [43, 41], [44, 40], [44, 43], [45, 44], [47, 45], [48, 38], [48, 47], [49, 48], [52, 50], [55, 35], [55, 55], [56, 11], [57, 56], [58, 55], [58, 57], [58, 35], [59, 58], [61, 60], [66, 63]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/90f820d92c2dd478226a03e997c10fd7a6311184865821cacf4685dc144080d3_90f820d92c2dd478226a03e997c10fd7a6311184865821cacf4685dc144080d3.jsonl.gz", "strip_func_name": "sub_401ECE", "query": "\n\n\nint __fastcall sub_401ECE(__int64 a1, int a2)\n{\n__int64 v3; // [rsp+10h] [rbp-10h]\nint i; // [rsp+1Ch] [rbp-4h]\n\nv3 = *(_QWORD *)(a1 + 16) + ((__int64)a2 << 6);\nfwrite(\"Items: \", 1uLL, 7uLL, stdout);\nif ( *(int *)(v3 + 40) > 0 )\n{\nfputs(*(const char **)(*(_QWORD *)(a1 + 16) + ((__int64)**(int **)(v3 + 48) << 6) + 24), stdout);\nfor ( i = 1; i < *(_DWORD *)(v3 + 40); ++i )\nfprintf(\nstdout,\n\", %s\",\n*(const char **)(*(_QWORD *)(a1 + 16) + ((__int64)*(int *)(*(_QWORD *)(v3 + 48) + 4LL * i) << 6) + 24));\n}\nreturn fputc(10, stdout);\n}\n\n\n\nQ:[a1,a2,v3,sub_401ECE,]", "hints": "[]", "response": "{'a1': 'cluster', 'a2': 'index', 'v3': 'node', 'sub_401ECE': 'print_cluster_items'}"} | [
[
0.7774655222892761,
0.7483803033828735,
0.715710461139679,
0.7138850688934326,
0.7135305404663086,
0.7098798155784607,
0.7066025137901306,
0.7031828761100769,
0.6991569995880127,
0.6972789168357849,
0.693138837814331,
0.6911033987998962,
0.6886398196220398,
0.6850073933601379,
0.6845685839653015,
0.684305727481842,
0.6816093325614929,
0.6778314113616943,
0.6724530458450317,
0.6718695163726807
],
[
90200,
134292,
202639,
188767,
9819,
116111,
137258,
119209,
187417,
142228,
94185,
194993,
183423,
203613,
3913,
178046,
117985,
80204,
867,
214048
]
] |
|
read_csv | 9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb | mikeryan | btcrack | NA | static void read_csv(char *filename, char **InRand, char **MasterCombKey, char **SlaveCombKey, char **MasterAuRand, char **SlaveAuRand, char **MasterSres, char **SlaveSres, char *buf) {
FILE *fh;
char *tmp;
char *temp[6] = { 0, };
int start = 0;
int count = 0;
int who = 0; /* 0 = unknown, 1 = master, 2 = slave */
int what = 0; /* 0 = unknown, 1 = comb_key, 2 = au_rand, 3 = sres, 4 = in_rand */
int i;
fh = fopen(filename, "r");
if (!fh) {
printf("Cant open file: %s\n", filename);
free(buf);
exit(-1);
}
while (fgets(buf, 1024, fh)) {
switch (start) {
case 0:
if (!strncmp(buf, "L,0,PPP,Type,Identifier,Length,Protocol", 39)) {
start = 2;
} else if (!strncmp(buf, "Index,Slave/Master,Type,Description", 35)) {
start = 1;
}
break;
case 1: /* old csv format */
tmp = strchr(buf, ',');
if (!tmp)
continue;
if (!*(++tmp))
continue;
if (!strncmp(tmp, "Master,", 7)) {
tmp += 7;
tmp = strchr(tmp, ',');
if (!tmp++)
continue;
if (!strncmp(tmp, "LMP_comb_key,", 13)) {
tmp += 16;
*MasterCombKey = strdup(tmp);
} else if (!strncmp(tmp, "LMP_au_rand,", 12)) {
tmp += 15;
*MasterAuRand = strdup(tmp);
} else if (!strncmp(tmp, "LMP_sres,", 9)) {
tmp += 12;
*MasterSres = strdup(tmp);
} else if (!strncmp(tmp, "LMP_in_rand,", 12)) {
tmp += 15;
*InRand = strdup(tmp);
}
} else if (!strncmp(tmp, "Slave,", 6)) {
tmp += 6;
tmp = strchr(tmp, ',');
if (!tmp++)
continue;
if (!strncmp(tmp, "LMP_comb_key,", 13)) {
tmp += 16;
*SlaveCombKey = strdup(tmp);
} else if (!strncmp(tmp, "LMP_au_rand,", 12)) {
tmp += 15;
*SlaveAuRand = strdup(tmp);
} else if (!strncmp(tmp, "LMP_sres,", 9)) {
tmp += 12;
*SlaveSres = strdup(tmp);
}
}
break;
case 2: /* new csv format */
tmp = buf;
for (i=0; i < 6; i++){
temp[i] = tmp;
tmp = strchr(tmp, ',');
if (!tmp)
break;
*tmp = '\0';
tmp++;
}
if (atoi(temp[1]) != count) {
count = atoi(temp[1]);
/* clear tmp vars */
who = 0;
what = 0;
}
/* who send this packet ? */
if ((*temp[0] == 'S') && (!strncmp(temp[2], "Frame", 5))) {
if (!strncmp(temp[3], "Master", 6))
who = 1;
else if (!strncmp(temp[3], "Slave", 5))
who = 2;
} else if ((*temp[0] == 'D') && (*temp[2] == '1') && (!strncmp(temp[3], "Opcode", 6))) {
if (!strncmp(temp[4], "LMP_comb_key", 13))
what = 1;
else if (!strncmp(temp[4], "LMP_au_rand", 12))
what = 2;
else if (!strncmp(temp[4], "LMP_sres", 9))
what = 3;
else if (!strncmp(temp[4], "LMP_in_rand", 12))
what = 4;
} else if ((*temp[0] == 'D') && (*temp[2] == '1') && (!strncmp(temp[3], "Random Number", 13)) &&
(strlen(temp[4]) > 5)) {
if (who == 1) {
switch(what) {
case 1: *MasterCombKey = strdup(temp[4]+3); break;
case 2: *MasterAuRand = strdup(temp[4]+3); break;
case 3: *MasterSres = strdup(temp[4]+3); printf("%s\n", *MasterSres); break;
case 4: *InRand = strdup(temp[4]+3); break;
}
} else if (who == 2) {
switch(what) {
case 1: *SlaveCombKey = strdup(temp[4]+3); break;
case 2: *SlaveAuRand = strdup(temp[4]+3); break;
case 3: *SlaveSres = strdup(temp[4]+3); break;
case 4: *InRand = strdup(temp[4]+3); break;
}
}
} else if ((*temp[0] == 'D') && (*temp[2] == '1') && (!strncmp(temp[3], "Authentication Response", 23)) &&
(strlen(temp[4]) > 5)) {
if (who == 1)
*MasterSres = strdup(temp[4]+2);
else if (who == 2)
*SlaveSres = strdup(temp[4]+2);
}
break;
}
}
fclose(fh);
return;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403550", "function_addr": 4207952, "binary_name": "9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+filename], rdi"], [4, "mov [rbp+var_70], rsi"], [5, "mov [rbp+var_78], rdx"], [6, "mov [rbp+var_80], rcx"], [7, "mov [rbp+var_88], r8"], [8, "mov [rbp+var_90], r9"], [9, "mov [rbp+var_60], 0"], [10, "mov [rbp+nptr], 0"], [11, "mov [rbp+var_50], 0"], [12, "mov [rbp+var_48], 0"], [13, "mov [rbp+s], 0"], [14, "mov [rbp+var_38], 0"], [15, "mov [rbp+var_C], 0"], [16, "mov [rbp+var_10], 0"], [17, "mov [rbp+var_14], 0"], [18, "mov [rbp+var_18], 0"], [19, "mov rax, [rbp+filename]"], [20, "mov esi, offset modes"], [21, "mov rdi, rax"], [22, "call _fopen"], [23, "mov [rbp+stream], rax"], [24, "cmp [rbp+stream], 0"], [25, "jnz loc_403D6C"], [26, "mov rax, [rbp+filename]"], [27, "mov rsi, rax"], [28, "mov edi, offset aCantOpenFileS"], [29, "mov eax, 0"], [30, "call _printf"], [31, "mov rax, [rbp+ptr]"], [32, "mov rdi, rax"], [33, "call _free"], [34, "mov edi, 0FFFFFFFFh"], [35, "call _exit"], [36, "cmp [rbp+var_C], 2"], [37, "jz loc_4038FC"], [38, "cmp [rbp+var_C], 2"], [39, "jg loc_403D6C"], [40, "cmp [rbp+var_C], 0"], [41, "jz short loc_403636"], [42, "cmp [rbp+var_C], 1"], [43, "jz short loc_403686"], [44, "jmp loc_403D6C"], [45, "mov rax, [rbp+ptr]"], [46, "mov edx, 27h "], [47, "mov esi, offset s2"], [48, "mov rdi, rax"], [49, "call _strncmp"], [50, "test eax, eax"], [51, "jnz short loc_40365C"], [52, "mov [rbp+var_C], 2"], [53, "jmp loc_403D6C"], [54, "mov rax, [rbp+ptr]"], [55, "mov edx, 23h "], [56, "mov esi, offset aIndexSlaveMast"], [57, "mov rdi, rax"], [58, "call _strncmp"], [59, "test eax, eax"], [60, "jnz loc_403D6C"], [61, "mov [rbp+var_C], 1"], [62, "jmp loc_403D6C"], [63, "mov rax, [rbp+ptr]"], [64, "mov esi, 2Ch "], [65, "mov rdi, rax"], [66, "call _strchr"], [67, "mov [rbp+s1], rax"], [68, "cmp [rbp+s1], 0"], [69, "jnz short loc_4036A7"], [70, "jmp loc_403D6C"], [71, "add [rbp+s1], 1"], [72, "mov rax, [rbp+s1]"], [73, "movzx eax, byte ptr [rax]"], [74, "test al, al"], [75, "jnz short loc_4036BC"], [76, "jmp loc_403D6C"], [77, "mov rax, [rbp+s1]"], [78, "mov edx, 7"], [79, "mov esi, offset aMaster"], [80, "mov rdi, rax"], [81, "call _strncmp"], [82, "test eax, eax"], [83, "jnz loc_4037F9"], [84, "add [rbp+s1], 7"], [85, "mov rax, [rbp+s1]"], [86, "mov esi, 2Ch "], [87, "mov rdi, rax"], [88, "call _strchr"], [89, "mov [rbp+s1], rax"], [90, "mov rax, [rbp+s1]"], [91, "lea rdx, [rax+1]"], [92, "mov [rbp+s1], rdx"], [93, "test rax, rax"], [94, "jnz short loc_40370A"], [95, "jmp loc_403D6C"], [96, "mov rax, [rbp+s1]"], [97, "mov edx, 0Dh"], [98, "mov esi, offset aLmpCombKey"], [99, "mov rdi, rax"], [100, "call _strncmp"], [101, "test eax, eax"], [102, "jnz short loc_403744"], [103, "add [rbp+s1], 10h"], [104, "mov rax, [rbp+s1]"], [105, "mov rdi, rax"], [106, "call _strdup"], [107, "mov rdx, rax"], [108, "mov rax, [rbp+var_78]"], [109, "mov [rax], rdx"], [110, "jmp loc_403D6C"], [111, "mov rax, [rbp+s1]"], [112, "mov edx, 0Ch"], [113, "mov esi, offset aLmpAuRand"], [114, "mov rdi, rax"], [115, "call _strncmp"], [116, "test eax, eax"], [117, "jnz short loc_403781"], [118, "add [rbp+s1], 0Fh"], [119, "mov rax, [rbp+s1]"], [120, "mov rdi, rax"], [121, "call _strdup"], [122, "mov rdx, rax"], [123, "mov rax, [rbp+var_88]"], [124, "mov [rax], rdx"], [125, "jmp loc_403D6C"], [126, "mov rax, [rbp+s1]"], [127, "mov edx, 9"], [128, "mov esi, offset aLmpSres"], [129, "mov rdi, rax"], [130, "call _strncmp"], [131, "test eax, eax"], [132, "jnz short loc_4037BB"], [133, "add [rbp+s1], 0Ch"], [134, "mov rax, [rbp+s1]"], [135, "mov rdi, rax"], [136, "call _strdup"], [137, "mov rdx, rax"], [138, "mov rax, [rbp+arg_0]"], [139, "mov [rax], rdx"], [140, "jmp loc_403D6C"], [141, "mov rax, [rbp+s1]"], [142, "mov edx, 0Ch"], [143, "mov esi, offset aLmpInRand"], [144, "mov rdi, rax"], [145, "call _strncmp"], [146, "test eax, eax"], [147, "jnz loc_403D6C"], [148, "add [rbp+s1], 0Fh"], [149, "mov rax, [rbp+s1]"], [150, "mov rdi, rax"], [151, "call _strdup"], [152, "mov rdx, rax"], [153, "mov rax, [rbp+var_70]"], [154, "mov [rax], rdx"], [155, "jmp loc_403D6C"], [156, "mov rax, [rbp+s1]"], [157, "mov edx, 6"], [158, "mov esi, offset aSlave"], [159, "mov rdi, rax"], [160, "call _strncmp"], [161, "test eax, eax"], [162, "jnz loc_403D6C"], [163, "add [rbp+s1], 6"], [164, "mov rax, [rbp+s1]"], [165, "mov esi, 2Ch "], [166, "mov rdi, rax"], [167, "call _strchr"], [168, "mov [rbp+s1], rax"], [169, "mov rax, [rbp+s1]"], [170, "lea rdx, [rax+1]"], [171, "mov [rbp+s1], rdx"], [172, "test rax, rax"], [173, "jnz short loc_403847"], [174, "jmp loc_403D6C"], [175, "mov rax, [rbp+s1]"], [176, "mov edx, 0Dh"], [177, "mov esi, offset aLmpCombKey"], [178, "mov rdi, rax"], [179, "call _strncmp"], [180, "test eax, eax"], [181, "jnz short loc_403881"], [182, "add [rbp+s1], 10h"], [183, "mov rax, [rbp+s1]"], [184, "mov rdi, rax"], [185, "call _strdup"], [186, "mov rdx, rax"], [187, "mov rax, [rbp+var_80]"], [188, "mov [rax], rdx"], [189, "jmp loc_403D6C"], [190, "mov rax, [rbp+s1]"], [191, "mov edx, 0Ch"], [192, "mov esi, offset aLmpAuRand"], [193, "mov rdi, rax"], [194, "call _strncmp"], [195, "test eax, eax"], [196, "jnz short loc_4038BE"], [197, "add [rbp+s1], 0Fh"], [198, "mov rax, [rbp+s1]"], [199, "mov rdi, rax"], [200, "call _strdup"], [201, "mov rdx, rax"], [202, "mov rax, [rbp+var_90]"], [203, "mov [rax], rdx"], [204, "jmp loc_403D6C"], [205, "mov rax, [rbp+s1]"], [206, "mov edx, 9"], [207, "mov esi, offset aLmpSres"], [208, "mov rdi, rax"], [209, "call _strncmp"], [210, "test eax, eax"], [211, "jnz loc_403D6C"], [212, "add [rbp+s1], 0Ch"], [213, "mov rax, [rbp+s1]"], [214, "mov rdi, rax"], [215, "call _strdup"], [216, "mov rdx, rax"], [217, "mov rax, [rbp+arg_8]"], [218, "mov [rax], rdx"], [219, "jmp loc_403D6C"], [220, "mov rax, [rbp+ptr]"], [221, "mov [rbp+s1], rax"], [222, "mov [rbp+var_1C], 0"], [223, "jmp short loc_403947"], [224, "mov eax, [rbp+var_1C]"], [225, "cdqe"], [226, "mov rdx, [rbp+s1]"], [227, "mov [rbp+rax*8+var_60], rdx"], [228, "mov rax, [rbp+s1]"], [229, "mov esi, 2Ch "], [230, "mov rdi, rax"], [231, "call _strchr"], [232, "mov [rbp+s1], rax"], [233, "cmp [rbp+s1], 0"], [234, "jz short loc_40394F"], [235, "mov rax, [rbp+s1]"], [236, "mov byte ptr [rax], 0"], [237, "add [rbp+s1], 1"], [238, "add [rbp+var_1C], 1"], [239, "cmp [rbp+var_1C], 5"], [240, "jle short loc_40390D"], [241, "jmp short loc_403950"], [242, "nop"], [243, "mov rax, [rbp+nptr]"], [244, "mov rdi, rax"], [245, "call _atoi"], [246, "cmp [rbp+var_10], eax"], [247, "jz short loc_40397E"], [248, "mov rax, [rbp+nptr]"], [249, "mov rdi, rax"], [250, "call _atoi"], [251, "mov [rbp+var_10], eax"], [252, "mov [rbp+var_14], 0"], [253, "mov [rbp+var_18], 0"], [254, "mov rax, [rbp+var_60]"], [255, "movzx eax, byte ptr [rax]"], [256, "cmp al, 53h "], [257, "jnz short loc_4039F3"], [258, "mov rax, [rbp+var_50]"], [259, "mov edx, 5"], [260, "mov esi, offset aFrame"], [261, "mov rdi, rax"], [262, "call _strncmp"], [263, "test eax, eax"], [264, "jnz short loc_4039F3"], [265, "mov rax, [rbp+var_48]"], [266, "mov edx, 6"], [267, "mov esi, offset aMaster_0"], [268, "mov rdi, rax"], [269, "call _strncmp"], [270, "test eax, eax"], [271, "jnz short loc_4039C9"], [272, "mov [rbp+var_14], 1"], [273, "jmp loc_403D64"], [274, "mov rax, [rbp+var_48]"], [275, "mov edx, 5"], [276, "mov esi, offset aSlave_0"], [277, "mov rdi, rax"], [278, "call _strncmp"], [279, "test eax, eax"], [280, "jnz loc_403D64"], [281, "mov [rbp+var_14], 2"], [282, "jmp loc_403D64"], [283, "mov rax, [rbp+var_60]"], [284, "movzx eax, byte ptr [rax]"], [285, "cmp al, 44h "], [286, "jnz loc_403B03"], [287, "mov rax, [rbp+var_50]"], [288, "movzx eax, byte ptr [rax]"], [289, "cmp al, 31h "], [290, "jnz loc_403B03"], [291, "mov rax, [rbp+var_48]"], [292, "mov edx, 6"], [293, "mov esi, offset aOpcode"], [294, "mov rdi, rax"], [295, "call _strncmp"], [296, "test eax, eax"], [297, "jnz loc_403B03"], [298, "mov rax, [rbp+s]"], [299, "mov rdx, rax"], [300, "mov eax, offset aLmpCombKey_0"], [301, "mov ecx, 0Dh"], [302, "mov rsi, rdx"], [303, "mov rdi, rax"], [304, "repe cmpsb"], [305, "setnbe al"], [306, "setb dl"], [307, "sub eax, edx"], [308, "movsx eax, al"], [309, "test eax, eax"], [310, "jnz short loc_403A63"], [311, "mov [rbp+var_18], 1"], [312, "jmp loc_403D67"], [313, "mov rax, [rbp+s]"], [314, "mov rdx, rax"], [315, "mov eax, offset aLmpAuRand_0"], [316, "mov ecx, 0Ch"], [317, "mov rsi, rdx"], [318, "mov rdi, rax"], [319, "repe cmpsb"], [320, "setnbe al"], [321, "setb dl"], [322, "sub eax, edx"], [323, "movsx eax, al"], [324, "test eax, eax"], [325, "jnz short loc_403A97"], [326, "mov [rbp+var_18], 2"], [327, "jmp loc_403D67"], [328, "mov rax, [rbp+s]"], [329, "mov rdx, rax"], [330, "mov eax, offset aLmpSres_0"], [331, "mov ecx, 9"], [332, "mov rsi, rdx"], [333, "mov rdi, rax"], [334, "repe cmpsb"], [335, "setnbe al"], [336, "setb dl"], [337, "sub eax, edx"], [338, "movsx eax, al"], [339, "test eax, eax"], [340, "jnz short loc_403ACB"], [341, "mov [rbp+var_18], 3"], [342, "jmp loc_403D67"], [343, "mov rax, [rbp+s]"], [344, "mov rdx, rax"], [345, "mov eax, offset aLmpInRand_0"], [346, "mov ecx, 0Ch"], [347, "mov rsi, rdx"], [348, "mov rdi, rax"], [349, "repe cmpsb"], [350, "setnbe al"], [351, "setb dl"], [352, "sub eax, edx"], [353, "movsx eax, al"], [354, "test eax, eax"], [355, "jnz loc_403D67"], [356, "mov [rbp+var_18], 4"], [357, "jmp loc_403D67"], [358, "mov rax, [rbp+var_60]"], [359, "movzx eax, byte ptr [rax]"], [360, "cmp al, 44h "], [361, "jnz loc_403CDA"], [362, "mov rax, [rbp+var_50]"], [363, "movzx eax, byte ptr [rax]"], [364, "cmp al, 31h "], [365, "jnz loc_403CDA"], [366, "mov rax, [rbp+var_48]"], [367, "mov edx, 0Dh"], [368, "mov esi, offset aRandomNumber"], [369, "mov rdi, rax"], [370, "call _strncmp"], [371, "test eax, eax"], [372, "jnz loc_403CDA"], [373, "mov rax, [rbp+s]"], [374, "mov rdi, rax"], [375, "call _strlen"], [376, "cmp rax, 5"], [377, "jbe loc_403CDA"], [378, "cmp [rbp+var_14], 1"], [379, "jnz loc_403C22"], [380, "cmp [rbp+var_18], 4"], [381, "jz loc_403C03"], [382, "cmp [rbp+var_18], 4"], [383, "jg loc_403D6A"], [384, "cmp [rbp+var_18], 3"], [385, "jz short loc_403BD5"], [386, "cmp [rbp+var_18], 3"], [387, "jg loc_403D6A"], [388, "cmp [rbp+var_18], 1"], [389, "jz short loc_403B94"], [390, "cmp [rbp+var_18], 2"], [391, "jz short loc_403BB3"], [392, "jmp loc_403D6A"], [393, "mov rax, [rbp+s]"], [394, "add rax, 3"], [395, "mov rdi, rax"], [396, "call _strdup"], [397, "mov rdx, rax"], [398, "mov rax, [rbp+var_78]"], [399, "mov [rax], rdx"], [400, "jmp loc_403CD5"], [401, "mov rax, [rbp+s]"], [402, "add rax, 3"], [403, "mov rdi, rax"], [404, "call _strdup"], [405, "mov rdx, rax"], [406, "mov rax, [rbp+var_88]"], [407, "mov [rax], rdx"], [408, "jmp loc_403CD5"], [409, "mov rax, [rbp+s]"], [410, "add rax, 3"], [411, "mov rdi, rax"], [412, "call _strdup"], [413, "mov rdx, rax"], [414, "mov rax, [rbp+arg_0]"], [415, "mov [rax], rdx"], [416, "mov rax, [rbp+arg_0]"], [417, "mov rax, [rax]"], [418, "mov rdi, rax"], [419, "call _puts"], [420, "jmp loc_403CD5"], [421, "mov rax, [rbp+s]"], [422, "add rax, 3"], [423, "mov rdi, rax"], [424, "call _strdup"], [425, "mov rdx, rax"], [426, "mov rax, [rbp+var_70]"], [427, "mov [rax], rdx"], [428, "jmp loc_403CD5"], [429, "cmp [rbp+var_14], 2"], [430, "jnz loc_403CD4"], [431, "cmp [rbp+var_18], 4"], [432, "jz loc_403CB8"], [433, "cmp [rbp+var_18], 4"], [434, "jg loc_403D6A"], [435, "cmp [rbp+var_18], 3"], [436, "jz short loc_403C9C"], [437, "cmp [rbp+var_18], 3"], [438, "jg loc_403D6A"], [439, "cmp [rbp+var_18], 1"], [440, "jz short loc_403C61"], [441, "cmp [rbp+var_18], 2"], [442, "jz short loc_403C7D"], [443, "jmp loc_403D6A"], [444, "mov rax, [rbp+s]"], [445, "add rax, 3"], [446, "mov rdi, rax"], [447, "call _strdup"], [448, "mov rdx, rax"], [449, "mov rax, [rbp+var_80]"], [450, "mov [rax], rdx"], [451, "jmp short loc_403CD5"], [452, "mov rax, [rbp+s]"], [453, "add rax, 3"], [454, "mov rdi, rax"], [455, "call _strdup"], [456, "mov rdx, rax"], [457, "mov rax, [rbp+var_90]"], [458, "mov [rax], rdx"], [459, "jmp short loc_403CD5"], [460, "mov rax, [rbp+s]"], [461, "add rax, 3"], [462, "mov rdi, rax"], [463, "call _strdup"], [464, "mov rdx, rax"], [465, "mov rax, [rbp+arg_8]"], [466, "mov [rax], rdx"], [467, "jmp short loc_403CD5"], [468, "mov rax, [rbp+s]"], [469, "add rax, 3"], [470, "mov rdi, rax"], [471, "call _strdup"], [472, "mov rdx, rax"], [473, "mov rax, [rbp+var_70]"], [474, "mov [rax], rdx"], [475, "jmp short loc_403CD5"], [476, "nop"], [477, "jmp loc_403D6A"], [478, "mov rax, [rbp+var_60]"], [479, "movzx eax, byte ptr [rax]"], [480, "cmp al, 44h "], [481, "jnz loc_403D6B"], [482, "mov rax, [rbp+var_50]"], [483, "movzx eax, byte ptr [rax]"], [484, "cmp al, 31h "], [485, "jnz short loc_403D6B"], [486, "mov rax, [rbp+var_48]"], [487, "mov edx, 17h"], [488, "mov esi, offset aAuthentication"], [489, "mov rdi, rax"], [490, "call _strncmp"], [491, "test eax, eax"], [492, "jnz short loc_403D6B"], [493, "mov rax, [rbp+s]"], [494, "mov rdi, rax"], [495, "call _strlen"], [496, "cmp rax, 5"], [497, "jbe short loc_403D6B"], [498, "cmp [rbp+var_14], 1"], [499, "jnz short loc_403D42"], [500, "mov rax, [rbp+s]"], [501, "add rax, 2"], [502, "mov rdi, rax"], [503, "call _strdup"], [504, "mov rdx, rax"], [505, "mov rax, [rbp+arg_0]"], [506, "mov [rax], rdx"], [507, "jmp short loc_403D6B"], [508, "cmp [rbp+var_14], 2"], [509, "jnz short loc_403D6B"], [510, "mov rax, [rbp+s]"], [511, "add rax, 2"], [512, "mov rdi, rax"], [513, "call _strdup"], [514, "mov rdx, rax"], [515, "mov rax, [rbp+arg_8]"], [516, "mov [rax], rdx"], [517, "jmp short loc_403D6B"], [518, "nop"], [519, "jmp short loc_403D6B"], [520, "nop"], [521, "jmp short loc_403D6B"], [522, "nop"], [523, "nop"], [524, "mov rdx, [rbp+stream]"], [525, "mov rax, [rbp+ptr]"], [526, "mov esi, 400h"], [527, "mov rdi, rax"], [528, "call _fgets"], [529, "test rax, rax"], [530, "jnz loc_403611"], [531, "mov rax, [rbp+stream]"], [532, "mov rdi, rax"], [533, "call _fclose"], [534, "nop"], [535, "leave"], [536, "retn"]], "data_dep": [[19, 3], [21, 19], [23, 22], [24, 23], [25, 24], [26, 3], [27, 26], [32, 31], [36, 52], [36, 61], [36, 15], [37, 36], [38, 52], [38, 61], [38, 15], [39, 38], [40, 52], [40, 61], [40, 15], [41, 40], [42, 52], [42, 61], [42, 15], [43, 42], [48, 45], [50, 49], [51, 50], [57, 54], [59, 58], [60, 59], [65, 63], [67, 66], [68, 67], [69, 68], [71, 67], [72, 71], [73, 218], [73, 236], [73, 474], [73, 203], [73, 450], [73, 427], [73, 72], [73, 458], [73, 188], [73, 124], [73, 407], [73, 109], [73, 466], [73, 415], [73, 154], [73, 139], [73, 516], [73, 399], [73, 506], [74, 73], [75, 74], [77, 71], [80, 77], [82, 81], [83, 82], [84, 71], [85, 84], [87, 85], [89, 88], [90, 89], [91, 109], [91, 90], [91, 466], [91, 415], [91, 154], [91, 427], [91, 139], [91, 516], [91, 399], [91, 506], [91, 124], [91, 218], [91, 236], [91, 474], [91, 78], [91, 203], [91, 450], [91, 458], [91, 188], [91, 407], [92, 91], [93, 90], [94, 93], [96, 92], [99, 96], [101, 100], [102, 101], [103, 92], [104, 103], [105, 104], [107, 106], [108, 5], [109, 107], [109, 108], [111, 92], [114, 111], [116, 115], [117, 116], [118, 92], [119, 118], [120, 119], [122, 121], [123, 7], [124, 123], [124, 122], [126, 92], [129, 126], [131, 130], [132, 131], [133, 92], [134, 133], [135, 134], [137, 136], [139, 138], [139, 137], [141, 92], [144, 141], [146, 145], [147, 146], [148, 92], [149, 148], [150, 149], [152, 151], [153, 4], [154, 153], [154, 152], [156, 71], [159, 156], [161, 160], [162, 161], [163, 71], [164, 163], [166, 164], [168, 167], [169, 168], [170, 169], [170, 407], [170, 415], [170, 109], [170, 466], [170, 474], [170, 154], [170, 427], [170, 139], [170, 157], [170, 516], [170, 399], [170, 506], [170, 124], [170, 218], [170, 236], [170, 203], [170, 450], [170, 458], [170, 188], [171, 170], [172, 169], [173, 172], [175, 171], [178, 175], [180, 179], [181, 180], [182, 171], [183, 182], [184, 183], [186, 185], [187, 6], [188, 187], [188, 186], [190, 171], [193, 190], [195, 194], [196, 195], [197, 171], [198, 197], [199, 198], [201, 200], [202, 8], [203, 202], [203, 201], [205, 171], [208, 205], [210, 209], [211, 210], [212, 171], [213, 212], [214, 213], [216, 215], [218, 217], [218, 216], [221, 220], [224, 238], [224, 222], [226, 221], [226, 237], [227, 224], [227, 226], [228, 221], [228, 237], [230, 228], [232, 231], [233, 232], [234, 233], [235, 232], [236, 235], [237, 232], [238, 238], [238, 222], [239, 238], [239, 222], [240, 239], [243, 10], [244, 243], [246, 251], [246, 245], [246, 16], [247, 246], [248, 10], [249, 248], [251, 250], [254, 9], [255, 109], [255, 203], [255, 458], [255, 188], [255, 407], [255, 415], [255, 154], [255, 466], [255, 218], [255, 474], [255, 450], [255, 427], [255, 139], [255, 516], [255, 399], [255, 506], [255, 124], [255, 236], [255, 254], [256, 255], [257, 256], [258, 11], [261, 258], [263, 262], [264, 263], [265, 12], [268, 265], [270, 269], [271, 270], [274, 12], [277, 274], [279, 278], [280, 279], [283, 9], [284, 415], [284, 154], [284, 516], [284, 218], [284, 474], [284, 450], [284, 427], [284, 283], [284, 139], [284, 399], [284, 506], [284, 124], [284, 407], [284, 236], [284, 109], [284, 203], [284, 458], [284, 188], [284, 466], [285, 284], [286, 285], [287, 11], [288, 399], [288, 506], [288, 124], [288, 407], [288, 236], [288, 109], [288, 203], [288, 458], [288, 188], [288, 415], [288, 154], [288, 516], [288, 466], [288, 218], [288, 474], [288, 450], [288, 427], [288, 139], [288, 287], [289, 288], [290, 289], [291, 12], [294, 291], [296, 295], [297, 296], [298, 13], [299, 298], [302, 299], [303, 300], [304, 304], [304, 349], [304, 334], [304, 319], [305, 296], [305, 300], [306, 299], [306, 296], [307, 306], [307, 305], [308, 307], [309, 308], [310, 309], [313, 13], [314, 313], [317, 314], [318, 315], [319, 304], [320, 315], [320, 309], [321, 314], [321, 309], [322, 321], [322, 320], [323, 322], [324, 323], [325, 324], [328, 13], [329, 328], [332, 329], [333, 330], [334, 319], [335, 324], [335, 330], [336, 329], [336, 324], [337, 336], [337, 335], [338, 337], [339, 338], [340, 339], [343, 13], [344, 343], [347, 344], [348, 345], [349, 334], [350, 345], [350, 339], [351, 339], [351, 344], [352, 351], [352, 350], [353, 352], [354, 353], [355, 354], [358, 9], [359, 203], [359, 450], [359, 427], [359, 399], [359, 124], [359, 407], [359, 109], [359, 458], [359, 188], [359, 466], [359, 415], [359, 154], [359, 139], [359, 516], [359, 358], [359, 506], [359, 218], [359, 236], [359, 474], [360, 359], [361, 360], [362, 11], [363, 466], [363, 415], [363, 154], [363, 139], [363, 516], [363, 399], [363, 506], [363, 124], [363, 362], [363, 218], [363, 236], [363, 474], [363, 203], [363, 450], [363, 427], [363, 458], [363, 188], [363, 407], [363, 109], [364, 363], [365, 364], [366, 12], [369, 366], [371, 370], [372, 371], [373, 13], [374, 373], [376, 375], [377, 376], [378, 17], [378, 272], [378, 281], [378, 252], [379, 378], [380, 253], [380, 341], [380, 326], [380, 311], [380, 18], [380, 356], [381, 380], [382, 326], [382, 311], [382, 18], [382, 356], [382, 253], [382, 341], [383, 382], [384, 311], [384, 253], [384, 356], [384, 341], [384, 326], [384, 18], [385, 384], [386, 253], [386, 341], [386, 326], [386, 311], [386, 18], [386, 356], [387, 386], [388, 341], [388, 326], [388, 18], [388, 311], [388, 253], [388, 356], [389, 388], [390, 311], [390, 18], [390, 356], [390, 253], [390, 341], [390, 326], [391, 390], [393, 13], [394, 393], [395, 394], [397, 396], [398, 5], [399, 397], [399, 398], [401, 13], [402, 401], [403, 402], [405, 404], [406, 7], [407, 405], [407, 406], [409, 13], [410, 409], [411, 410], [413, 412], [415, 414], [415, 413], [417, 416], [417, 415], [418, 417], [421, 13], [422, 421], [423, 422], [425, 424], [426, 4], [427, 426], [427, 425], [429, 252], [429, 17], [429, 272], [429, 281], [430, 429], [431, 326], [431, 311], [431, 18], [431, 356], [431, 253], [431, 341], [432, 431], [433, 356], [433, 253], [433, 341], [433, 326], [433, 311], [433, 18], [434, 433], [435, 253], [435, 341], [435, 326], [435, 311], [435, 18], [435, 356], [436, 435], [437, 253], [437, 326], [437, 311], [437, 18], [437, 356], [437, 341], [438, 437], [439, 326], [439, 311], [439, 18], [439, 356], [439, 253], [439, 341], [440, 439], [441, 356], [441, 253], [441, 341], [441, 326], [441, 311], [441, 18], [442, 441], [444, 13], [445, 444], [446, 445], [448, 447], [449, 6], [450, 449], [450, 448], [452, 13], [453, 452], [454, 453], [456, 455], [457, 8], [458, 456], [458, 457], [460, 13], [461, 460], [462, 461], [464, 463], [466, 464], [466, 465], [468, 13], [469, 468], [470, 469], [472, 471], [473, 4], [474, 473], [474, 472], [478, 9], [479, 506], [479, 124], [479, 236], [479, 478], [479, 109], [479, 203], [479, 458], [479, 188], [479, 407], [479, 415], [479, 154], [479, 466], [479, 218], [479, 474], [479, 450], [479, 427], [479, 139], [479, 516], [479, 399], [480, 479], [481, 480], [482, 11], [483, 466], [483, 218], [483, 474], [483, 450], [483, 427], [483, 139], [483, 516], [483, 399], [483, 506], [483, 124], [483, 236], [483, 482], [483, 109], [483, 203], [483, 458], [483, 188], [483, 407], [483, 415], [483, 154], [484, 483], [485, 484], [486, 12], [489, 486], [491, 490], [492, 491], [493, 13], [494, 493], [496, 495], [497, 496], [498, 272], [498, 281], [498, 252], [498, 17], [499, 498], [500, 13], [501, 500], [502, 501], [504, 503], [506, 504], [506, 505], [508, 281], [508, 252], [508, 17], [508, 272], [509, 508], [510, 13], [511, 510], [512, 511], [514, 513], [516, 515], [516, 514], [524, 23], [527, 525], [529, 528], [530, 529], [531, 23], [532, 531], [536, 533]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb_9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb.jsonl.gz", "strip_func_name": "sub_403550", "query": "\n\n\nint __fastcall sub_403550(const char *a1, char **a2, char **a3, char **a4, char **a5, char **a6, __int64 a7, __int64 a8, void *ptr)\n{\nchar *v9; // rax\nchar *v10; // rax\nint v11; // eax\n_BYTE *v17; // [rsp+30h] [rbp-60h]\nchar *nptr; // [rsp+38h] [rbp-58h]\nchar *v19; // [rsp+40h] [rbp-50h]\nchar *v20; // [rsp+48h] [rbp-48h]\nchar *s; // [rsp+50h] [rbp-40h]\n__int64 v22; // [rsp+58h] [rbp-38h]\nFILE *stream; // [rsp+68h] [rbp-28h]\nint i; // [rsp+74h] [rbp-1Ch]\nint v25; // [rsp+78h] [rbp-18h]\nint v26; // [rsp+7Ch] [rbp-14h]\nint v27; // [rsp+80h] [rbp-10h]\nint v28; // [rsp+84h] [rbp-Ch]\nchar *s1; // [rsp+88h] [rbp-8h]\n\nv17 = 0LL;\nnptr = 0LL;\nv19 = 0LL;\nv20 = 0LL;\ns = 0LL;\nv22 = 0LL;\nv28 = 0;\nv27 = 0;\nv26 = 0;\nv25 = 0;\nstream = fopen(a1, \"r\");\nif ( !stream )\n{\nprintf(\"Cant open file: %s\\n\", a1);\nfree(ptr);\nexit(-1);\n}\nwhile ( fgets((char *)ptr, 1024, stream) )\n{\nif ( v28 == 2 )\n{\ns1 = (char *)ptr;\nfor ( i = 0; i <= 5; ++i )\n{\n(&v17)[i] = s1;\ns1 = strchr(s1, 44);\nif ( !s1 )\nbreak;\n*s1++ = 0;\n}\nv11 = atoi(nptr);\nif ( v27 != v11 )\n{\nv27 = atoi(nptr);\nv26 = 0;\nv25 = 0;\n}\nif ( *v17 == 83 && !strncmp(v19, \"Frame\", 5uLL) )\n{\nif ( !strncmp(v20, \"Master\", 6uLL) )\n{\nv26 = 1;\n}\nelse if ( !strncmp(v20, \"Slave\", 5uLL) )\n{\nv26 = 2;\n}\n}\nelse if ( *v17 == 68 && *v19 == 49 && !strncmp(v20, \"Opcode\", 6uLL) )\n{\nif ( !strcmp(s, \"LMP_comb_key\") )\n{\nv25 = 1;\n}\nelse if ( !strcmp(s, \"LMP_au_rand\") )\n{\nv25 = 2;\n}\nelse if ( !strcmp(s, \"LMP_sres\") )\n{\nv25 = 3;\n}\nelse if ( !strcmp(s, \"LMP_in_rand\") )\n{\nv25 = 4;\n}\n}\nelse if ( *v17 == 68 && *v19 == 49 && !strncmp(v20, \"Random Number\", 0xDuLL) && strlen(s) > 5 )\n{\nif ( v26 == 1 )\n{\nif ( v25 == 4 )\ngoto LABEL_69;\nif ( v25 <= 4 )\n{\nswitch ( v25 )\n{\ncase 3:\n*(_QWORD *)a7 = strdup(s + 3);\nputs(*(const char **)a7);\nbreak;\ncase 1:\n*a3 = strdup(s + 3);\nbreak;\ncase 2:\n*a5 = strdup(s + 3);\nbreak;\n}\n}\n}\nelse if ( v26 == 2 )\n{\nif ( v25 == 4 )\n{\nLABEL_69:\n*a2 = strdup(s + 3);\n}\nelse if ( v25 <= 4 )\n{\nswitch ( v25 )\n{\ncase 3:\n*(_QWORD *)a8 = strdup(s + 3);\nbreak;\ncase 1:\n*a4 = strdup(s + 3);\nbreak;\ncase 2:\n*a6 = strdup(s + 3);\nbreak;\n}\n}\n}\n}\nelse if ( *v17 == 68 && *v19 == 49 && !strncmp(v20, \"Authentication Response\", 0x17uLL) && strlen(s) > 5 )\n{\nif ( v26 == 1 )\n{\n*(_QWORD *)a7 = strdup(s + 2);\n}\nelse if ( v26 == 2 )\n{\n*(_QWORD *)a8 = strdup(s + 2);\n}\n}\n}\nelse if ( v28 <= 2 )\n{\nif ( v28 )\n{\nif ( v28 == 1 )\n{\ns1 = strchr((const char *)ptr, 44);\nif ( s1 )\n{\nif ( *++s1 )\n{\nif ( !strncmp(s1, \"Master,\", 7uLL) )\n{\ns1 += 7;\nv9 = strchr(s1, 44);\ns1 = v9 + 1;\nif ( v9 )\n{\nif ( !strncmp(s1, \"LMP_comb_key,\", 0xDuLL) )\n{\ns1 += 16;\n*a3 = strdup(s1);\n}\nelse if ( !strncmp(s1, \"LMP_au_rand,\", 0xCuLL) )\n{\ns1 += 15;\n*a5 = strdup(s1);\n}\nelse if ( !strncmp(s1, \"LMP_sres,\", 9uLL) )\n{\ns1 += 12;\n*(_QWORD *)a7 = strdup(s1);\n}\nelse if ( !strncmp(s1, \"LMP_in_rand,\", 0xCuLL) )\n{\ns1 += 15;\n*a2 = strdup(s1);\n}\n}\n}\nelse if ( !strncmp(s1, \"Slave,\", 6uLL) )\n{\ns1 += 6;\nv10 = strchr(s1, 44);\ns1 = v10 + 1;\nif ( v10 )\n{\nif ( !strncmp(s1, \"LMP_comb_key,\", 0xDuLL) )\n{\ns1 += 16;\n*a4 = strdup(s1);\n}\nelse if ( !strncmp(s1, \"LMP_au_rand,\", 0xCuLL) )\n{\ns1 += 15;\n*a6 = strdup(s1);\n}\nelse if ( !strncmp(s1, \"LMP_sres,\", 9uLL) )\n{\ns1 += 12;\n*(_QWORD *)a8 = strdup(s1);\n}\n}\n}\n}\n}\n}\n}\nelse if ( !strncmp((const char *)ptr, \"L,0,PPP,Type,Identifier,Length,Protocol\", 0x27uLL) )\n{\nv28 = 2;\n}\nelse if ( !strncmp((const char *)ptr, \"Index,Slave/Master,Type,Description\", 0x23uLL) )\n{\nv28 = 1;\n}\n}\n}\nreturn fclose(stream);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,ptr,v17,stream,v25,v26,v27,v28,s1,sub_403550,]", "hints": "[]", "response": "{'a3': 'MasterCombKey', 'a4': 'SlaveCombKey', 'a1': 'filename', 'a2': 'InRand', 'a5': 'MasterAuRand', 'a6': 'SlaveAuRand', 'a7': 'MasterSres', 'a8': 'SlaveSres', 'ptr': 'buf', 'v17': 'temp', 'stream': 'fh', 'v25': 'what', 'v26': 'who', 'v27': 'count', 'v28': 'start', 's1': 'tmp', 'sub_403550': 'read_csv'}"} | [
[
0.8231857419013977,
0.8188410997390747,
0.7846115827560425,
0.7815179228782654,
0.7795867919921875,
0.7745707631111145,
0.7710626721382141,
0.7673214673995972,
0.7624775171279907,
0.7619668245315552,
0.7615767121315002,
0.7602229714393616,
0.75477135181427,
0.7540073394775391,
0.7529528141021729,
0.7526223063468933,
0.751510739326477,
0.7505407333374023,
0.749966025352478,
0.7494544386863708
],
[
184256,
5669,
262107,
56499,
122519,
113938,
171079,
100181,
161365,
246905,
240153,
255204,
24032,
185227,
155076,
114725,
35244,
134735,
64741,
243013
]
] |
|
glui_sdl_init | d411eb4f352d33aa66f1a1ea4e7056d0df8c32c249a9b6811e8d3f2519ae156e | kgsws | gameboy_lcd | NA | static uint32_t glui_sdl_init(uint16_t width, uint16_t height, const char *title)
{
if(SDL_Init(SDL_INIT_VIDEO) != 0)
return 1;
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetSwapInterval(1);
sdl_win = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_OPENGL);
sdl_glContext = SDL_GL_CreateContext(sdl_win);
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(0.0f);
// points
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
// lines
glEnable(GL_LINE_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
// hints
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
// blend
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40135E", "function_addr": 4199262, "binary_name": "d411eb4f352d33aa66f1a1ea4e7056d0df8c32c249a9b6811e8d3f2519ae156e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov ecx, edi"], [4, "mov eax, esi"], [5, "mov [rbp+var_10], rdx"], [6, "mov edx, ecx"], [7, "mov [rbp+var_4], dx"], [8, "mov [rbp+var_8], ax"], [9, "mov edi, 20h "], [10, "call _SDL_Init"], [11, "test eax, eax"], [12, "jz short loc_401390"], [13, "mov eax, 1"], [14, "jmp locret_401485"], [15, "mov esi, 1"], [16, "mov edi, 5"], [17, "call _SDL_GL_SetAttribute"], [18, "mov edi, 1"], [19, "call _SDL_GL_SetSwapInterval"], [20, "movzx ecx, [rbp+var_8]"], [21, "movzx edx, [rbp+var_4]"], [22, "mov rax, [rbp+var_10]"], [23, "mov r9d, 2"], [24, "mov r8d, ecx"], [25, "mov ecx, edx"], [26, "mov edx, 2FFF0000h"], [27, "mov esi, 2FFF0000h"], [28, "mov rdi, rax"], [29, "call _SDL_CreateWindow"], [30, "mov cs:qword_404180, rax"], [31, "mov rax, cs:qword_404180"], [32, "mov rdi, rax"], [33, "call _SDL_GL_CreateContext"], [34, "mov cs:qword_404188, rax"], [35, "mov edi, 1D01h"], [36, "call _glShadeModel"], [37, "pxor xmm3, xmm3"], [38, "pxor xmm2, xmm2"], [39, "pxor xmm1, xmm1"], [40, "pxor xmm0, xmm0"], [41, "call _glClearColor"], [42, "pxor xmm0, xmm0"], [43, "call _glClearDepth"], [44, "mov edi, 0B10h"], [45, "call _glEnable"], [46, "mov esi, 1102h"], [47, "mov edi, 0C51h"], [48, "call _glHint"], [49, "mov edi, 0B20h"], [50, "call _glEnable"], [51, "mov esi, 1102h"], [52, "mov edi, 0C52h"], [53, "call _glHint"], [54, "mov esi, 1102h"], [55, "mov edi, 0C53h"], [56, "call _glHint"], [57, "mov esi, 1102h"], [58, "mov edi, 0C50h"], [59, "call _glHint"], [60, "mov edi, 0BE2h"], [61, "call _glEnable"], [62, "mov esi, 303h"], [63, "mov edi, 302h"], [64, "call _glBlendFunc"], [65, "mov eax, 0"], [66, "leave"], [67, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 4], [11, 10], [12, 11], [20, 8], [21, 7], [22, 5], [24, 20], [25, 21], [28, 22], [30, 29], [31, 30], [32, 31], [34, 33], [67, 65], [67, 13]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d411eb4f352d33aa66f1a1ea4e7056d0df8c32c249a9b6811e8d3f2519ae156e_d411eb4f352d33aa66f1a1ea4e7056d0df8c32c249a9b6811e8d3f2519ae156e.jsonl.gz", "strip_func_name": "sub_40135E", "query": "\n\n\n__int64 sub_40135E()\n{\nif ( (unsigned int)SDL_Init() )\nreturn 1LL;\nSDL_GL_SetAttribute();\nSDL_GL_SetSwapInterval();\nqword_404180 = SDL_CreateWindow();\nqword_404188 = SDL_GL_CreateContext();\nglShadeModel();\nglClearColor();\nglClearDepth();\nglEnable();\nglHint();\nglEnable();\nglHint();\nglHint();\nglHint();\nglEnable();\nglBlendFunc();\nreturn 0LL;\n}\n\n\n\nQ:[sub_40135E,]", "hints": "[]", "response": "{'sub_40135E': 'glui_sdl_init'}"} | [
[
0.7765280604362488,
0.766880989074707,
0.7541165947914124,
0.7513835430145264,
0.7402005791664124,
0.7400389909744263,
0.7306996583938599,
0.7185832262039185,
0.7166833281517029,
0.7147959470748901,
0.7127028107643127,
0.7100019454956055,
0.7085815668106079,
0.7080225348472595,
0.707304835319519,
0.7069894671440125,
0.7069107890129089,
0.7066497206687927,
0.7064400315284729,
0.7006694674491882
],
[
231676,
215946,
97400,
235443,
202616,
145264,
51231,
246035,
14398,
133932,
140476,
134475,
100970,
92309,
205392,
144021,
197261,
135730,
80205,
256381
]
] |
|
get_sector_size | b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817 | chenall | grubutils | NA | uchar4
get_sector_size (char *s)
{
char *p;
uchar4 size;
size = strtoul (s, &p, 0);
if ((*p == 'k') || (*p == 'K'))
size <<= 1;
else if ((*p == 'm') || (*p == 'M'))
size <<= 11;
else if ((*p == 'g') || (*p == 'G'))
size <<= 21;
else if (*p)
quit ("invalid subfix %s", p);
return size;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4027E5", "function_addr": 4204517, "binary_name": "b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+nptr], rdi"], [4, "lea rcx, [rbp+endptr]"], [5, "mov rax, [rbp+nptr]"], [6, "mov edx, 0"], [7, "mov rsi, rcx"], [8, "mov rdi, rax"], [9, "call _strtoul"], [10, "mov [rbp+var_8], rax"], [11, "mov rax, [rbp+endptr]"], [12, "movzx eax, byte ptr [rax]"], [13, "cmp al, 6Bh "], [14, "jz short loc_402823"], [15, "mov rax, [rbp+endptr]"], [16, "movzx eax, byte ptr [rax]"], [17, "cmp al, 4Bh "], [18, "jnz short loc_402829"], [19, "shl [rbp+var_8], 1"], [20, "jmp short loc_402884"], [21, "mov rax, [rbp+endptr]"], [22, "movzx eax, byte ptr [rax]"], [23, "cmp al, 6Dh "], [24, "jz short loc_40283F"], [25, "mov rax, [rbp+endptr]"], [26, "movzx eax, byte ptr [rax]"], [27, "cmp al, 4Dh "], [28, "jnz short loc_402846"], [29, "shl [rbp+var_8], 0Bh"], [30, "jmp short loc_402884"], [31, "mov rax, [rbp+endptr]"], [32, "movzx eax, byte ptr [rax]"], [33, "cmp al, 67h "], [34, "jz short loc_40285C"], [35, "mov rax, [rbp+endptr]"], [36, "movzx eax, byte ptr [rax]"], [37, "cmp al, 47h "], [38, "jnz short loc_402863"], [39, "shl [rbp+var_8], 15h"], [40, "jmp short loc_402884"], [41, "mov rax, [rbp+endptr]"], [42, "movzx eax, byte ptr [rax]"], [43, "test al, al"], [44, "jz short loc_402884"], [45, "mov rax, [rbp+endptr]"], [46, "mov rsi, rax"], [47, "mov edi, offset aInvalidSubfixS"], [48, "mov eax, 0"], [49, "call sub_40149C"], [50, "mov rax, [rbp+var_8]"], [51, "leave"], [52, "retn"]], "data_dep": [[5, 3], [7, 4], [8, 5], [10, 9], [12, 11], [13, 12], [14, 13], [16, 15], [17, 16], [18, 17], [19, 10], [22, 21], [23, 22], [24, 23], [26, 25], [27, 26], [28, 27], [29, 10], [32, 31], [33, 32], [34, 33], [36, 35], [37, 36], [38, 37], [39, 10], [42, 41], [43, 42], [44, 43], [46, 45], [50, 39], [50, 29], [50, 10], [50, 19], [52, 50]]}
| {"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_4027E5", "query": "\n\n\nunsigned __int64 __fastcall sub_4027E5(const char *a1)\n{\n__int64 v1; // rdx\n__int64 v2; // rcx\n__int64 v3; // r8\n__int64 v4; // r9\nchar *endptr; // [rsp+10h] [rbp-10h] BYREF\nunsigned __int64 v7; // [rsp+18h] [rbp-8h]\n\nv7 = strtoul(a1, &endptr, 0);\nswitch ( *endptr )\n{\ncase 'k':\ncase 'K':\nv7 *= 2LL;\nbreak;\ncase 'm':\ncase 'M':\nv7 <<= 11;\nbreak;\ncase 'g':\ncase 'G':\nv7 <<= 21;\nbreak;\ndefault:\nif ( *endptr )\nsub_40149C(\"invalid subfix %s\", (__int64)endptr, v1, v2, v3, v4);\nbreak;\n}\nreturn v7;\n}\n\n\n\nQ:[a1,endptr,v7,sub_4027E5,sub_40149C,]", "hints": "[]", "response": "{'a1': 's', 'endptr': 'p', 'v7': 'size', 'sub_4027E5': 'get_sector_size', 'sub_40149C': 'quit'}"} | [
[
0.7539756298065186,
0.6907532811164856,
0.6855499744415283,
0.6827437877655029,
0.6792066693305969,
0.678466796875,
0.6758500337600708,
0.6751884818077087,
0.6696574687957764,
0.665779709815979,
0.6652692556381226,
0.6649860143661499,
0.6643004417419434,
0.663016140460968,
0.660201907157898,
0.6575413942337036,
0.6570020318031311,
0.6553478240966797,
0.6546911001205444,
0.6545359492301941
],
[
67619,
28204,
199975,
83750,
110796,
178573,
59912,
99598,
113266,
227214,
178229,
240835,
168662,
179639,
192542,
93450,
186073,
255911,
172552,
159855
]
] |
|
jfif_free | 219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea | rockcarry | ffjpeg | NA | void jfif_free(void *ctxt)
{
JFIF *jfif = (JFIF*)ctxt;
int i;
if (!jfif) return;
for (i=0; i<16; i++) {
if (jfif->pqtab[i]) free(jfif->pqtab[i]);
if (jfif->phcac[i]) free(jfif->phcac[i]);
if (jfif->phcdc[i]) free(jfif->phcdc[i]);
}
if (jfif->databuf) free(jfif->databuf);
free(jfif);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40291D", "function_addr": 4204829, "binary_name": "219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.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 [rbp+ptr], rax"], [6, "cmp [rbp+ptr], 0"], [7, "jz loc_402A18"], [8, "mov [rbp+var_4], 0"], [9, "jmp loc_4029DD"], [10, "mov rax, [rbp+ptr]"], [11, "mov edx, [rbp+var_4]"], [12, "movsxd rdx, edx"], [13, "mov rax, [rax+rdx*8+8]"], [14, "test rax, rax"], [15, "jz short loc_402973"], [16, "mov rax, [rbp+ptr]"], [17, "mov edx, [rbp+var_4]"], [18, "movsxd rdx, edx"], [19, "mov rax, [rax+rdx*8+8]"], [20, "mov rdi, rax"], [21, "call _free"], [22, "mov rax, [rbp+ptr]"], [23, "mov edx, [rbp+var_4]"], [24, "movsxd rdx, edx"], [25, "add rdx, 10h"], [26, "mov rax, [rax+rdx*8+8]"], [27, "test rax, rax"], [28, "jz short loc_4029A6"], [29, "mov rax, [rbp+ptr]"], [30, "mov edx, [rbp+var_4]"], [31, "movsxd rdx, edx"], [32, "add rdx, 10h"], [33, "mov rax, [rax+rdx*8+8]"], [34, "mov rdi, rax"], [35, "call _free"], [36, "mov rax, [rbp+ptr]"], [37, "mov edx, [rbp+var_4]"], [38, "movsxd rdx, edx"], [39, "add rdx, 20h "], [40, "mov rax, [rax+rdx*8+8]"], [41, "test rax, rax"], [42, "jz short loc_4029D9"], [43, "mov rax, [rbp+ptr]"], [44, "mov edx, [rbp+var_4]"], [45, "movsxd rdx, edx"], [46, "add rdx, 20h "], [47, "mov rax, [rax+rdx*8+8]"], [48, "mov rdi, rax"], [49, "call _free"], [50, "add [rbp+var_4], 1"], [51, "cmp [rbp+var_4], 0Fh"], [52, "jle loc_402948"], [53, "mov rax, [rbp+ptr]"], [54, "mov rax, [rax+1F0h]"], [55, "test rax, rax"], [56, "jz short loc_402A0A"], [57, "mov rax, [rbp+ptr]"], [58, "mov rax, [rax+1F0h]"], [59, "mov rdi, rax"], [60, "call _free"], [61, "mov rax, [rbp+ptr]"], [62, "mov rdi, rax"], [63, "call _free"], [64, "jmp short locret_402A19"], [65, "nop"], [66, "leave"], [67, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [10, 5], [11, 8], [11, 50], [12, 11], [13, 10], [14, 13], [15, 14], [16, 5], [17, 8], [17, 50], [18, 17], [19, 16], [20, 19], [22, 5], [23, 8], [23, 50], [24, 23], [25, 24], [26, 22], [27, 26], [28, 27], [29, 5], [30, 8], [30, 50], [31, 30], [32, 31], [33, 29], [34, 33], [36, 5], [37, 8], [37, 50], [38, 37], [39, 38], [40, 36], [41, 40], [42, 41], [43, 5], [44, 8], [44, 50], [45, 44], [46, 45], [47, 43], [48, 47], [50, 8], [50, 50], [51, 50], [51, 8], [52, 51], [53, 5], [54, 53], [55, 54], [56, 55], [57, 5], [58, 57], [59, 58], [61, 5], [62, 61], [67, 4], [67, 63]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea_219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.jsonl.gz", "strip_func_name": "sub_40291D", "query": "\n\n\nvoid __fastcall sub_40291D(void **a1)\n{\nint i; // [rsp+1Ch] [rbp-4h]\n\nif ( a1 )\n{\nfor ( i = 0; i <= 15; ++i )\n{\nif ( a1[i + 1] )\nfree(a1[i + 1]);\nif ( a1[i + 17] )\nfree(a1[i + 17]);\nif ( a1[i + 33] )\nfree(a1[i + 33]);\n}\nif ( a1[62] )\nfree(a1[62]);\nfree(a1);\n}\n}\n\n\n\nQ:[a1,sub_40291D,]", "hints": "[]", "response": "{'a1': 'ctxt', 'sub_40291D': 'jfif_free'}"} | [
[
0.8254023194313049,
0.7908666729927063,
0.7522197961807251,
0.7498496770858765,
0.7484074831008911,
0.715072512626648,
0.7091889381408691,
0.708184003829956,
0.7077096104621887,
0.7068959474563599,
0.7067945599555969,
0.7057209610939026,
0.703209400177002,
0.6999690532684326,
0.6994035243988037,
0.6916338205337524,
0.690816342830658,
0.690598726272583,
0.689792275428772,
0.6810669302940369
],
[
90905,
3144,
9622,
252401,
258632,
191231,
131269,
105072,
37531,
33240,
156703,
140211,
225328,
132516,
48643,
163223,
188421,
32668,
225186,
187698
]
] |
|
json_strlen | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int json_strlen(const char *json)
{
int ch;
const char *s = json + 1; /* skip '"' */
/* get string length "(\\.|[^"])*" */
while ((ch = *s) != '\0' && ch != '"') {
++s;
if (ch == '\\') {
ch = *s++;
if (ch == '\0') {
return -1;
}
}
}
return ch ? cast_int(s - json - 1) : -1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B123", "function_addr": 4239651, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov rax, [rbp+var_18]"], [4, "add rax, 1"], [5, "mov [rbp+var_8], rax"], [6, "jmp short loc_40B166"], [7, "add [rbp+var_8], 1"], [8, "cmp [rbp+var_C], 5Ch "], [9, "jnz short loc_40B166"], [10, "mov rax, [rbp+var_8]"], [11, "lea rdx, [rax+1]"], [12, "mov [rbp+var_8], rdx"], [13, "movzx eax, byte ptr [rax]"], [14, "movsx eax, al"], [15, "mov [rbp+var_C], eax"], [16, "cmp [rbp+var_C], 0"], [17, "jnz short loc_40B166"], [18, "mov eax, 0FFFFFFFFh"], [19, "jmp short loc_40B197"], [20, "mov rax, [rbp+var_8]"], [21, "movzx eax, byte ptr [rax]"], [22, "movsx eax, al"], [23, "mov [rbp+var_C], eax"], [24, "cmp [rbp+var_C], 0"], [25, "jz short loc_40B17F"], [26, "cmp [rbp+var_C], 22h "], [27, "jnz short loc_40B139"], [28, "cmp [rbp+var_C], 0"], [29, "jz short loc_40B192"], [30, "mov rax, [rbp+var_8]"], [31, "sub rax, [rbp+var_18]"], [32, "sub eax, 1"], [33, "jmp short loc_40B197"], [34, "mov eax, 0FFFFFFFFh"], [35, "pop rbp"], [36, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [7, 7], [7, 12], [7, 5], [8, 23], [9, 8], [10, 7], [11, 11], [11, 10], [12, 11], [13, 10], [14, 13], [15, 14], [16, 15], [17, 16], [20, 5], [20, 7], [20, 12], [21, 20], [22, 21], [23, 22], [24, 23], [25, 24], [26, 23], [27, 26], [28, 23], [29, 28], [30, 12], [30, 5], [30, 7], [31, 30], [31, 2], [32, 31], [35, 0], [36, 34], [36, 18], [36, 32]]}
| {"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_40B123", "query": "\n\n\n__int64 __fastcall sub_40B123(__int64 a1)\n{\n_BYTE *v1; // rax\n__int64 result; // rax\nint v3; // [rsp+Ch] [rbp-Ch]\n_BYTE *v4; // [rsp+10h] [rbp-8h]\n\nv4 = (_BYTE *)(a1 + 1);\nwhile ( 1 )\n{\nv3 = (char)*v4;\nif ( !*v4 || v3 == 34 )\nbreak;\n++v4;\nif ( v3 == 92 )\n{\nv1 = v4++;\nif ( !*v1 )\nreturn 0xFFFFFFFFLL;\n}\n}\nif ( *v4 )\nresult = (unsigned int)((_DWORD)v4 - a1 - 1);\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\n\n\n\nQ:[a1,v3,v4,sub_40B123,]", "hints": "[]", "response": "{'a1': 'json', 'v3': 'ch_0', 'v4': 's', 'sub_40B123': 'json_strlen'}"} | [
[
0.8186895251274109,
0.7991641759872437,
0.7846559286117554,
0.7757887840270996,
0.7626859545707703,
0.7600927948951721,
0.7588355541229248,
0.7586696743965149,
0.7575070858001709,
0.7568762302398682,
0.7440837621688843,
0.7334240078926086,
0.7313235402107239,
0.731128454208374,
0.7298855781555176,
0.7295197248458862,
0.729167103767395,
0.727162778377533,
0.7249964475631714,
0.7206613421440125
],
[
216144,
232844,
121526,
12498,
119591,
179119,
50659,
43098,
16335,
111439,
220455,
215586,
173294,
132691,
199058,
214312,
78059,
224925,
78372,
13954
]
] |
|
add_hex_rule | af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4 | rgerganov | nfqsed | NA | void add_hex_rule(const char *rule_str)
{
char delim = rule_str[0];
char *pos = NULL;
int length = 0;
struct rule_t *rule;
if (strlen(rule_str) < 6) {
fprintf(stderr, "hex rule too short: %s\n", rule_str);
exit(1);
}
pos = strchr(rule_str+1, delim);
if (!pos) {
fprintf(stderr, "incorrect hex rule: %s\n", rule_str);
exit(1);
}
length = strlen(pos+1);
if (length % 2 == 1) {
fprintf(stderr, "hex rule values must have even length\n");
exit(1);
}
if (pos - rule_str - 1 != length) {
fprintf(stderr, "hex1 and hex2 must have the same length: %s\n", rule_str);
exit(1);
}
length /= 2;
rule = malloc(sizeof(struct rule_t));
rule->val1 = malloc(length);
str_to_hex(rule_str+1, rule->val1, length);
rule->val2 = malloc(length);
str_to_hex(pos+1, rule->val2, length);
rule->length = length;
rule->next = NULL;
if (rules) {
rule->next = rules;
rules = rule;
} else {
rules = rule;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401654", "function_addr": 4200020, "binary_name": "af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4.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, "movzx eax, byte ptr [rax]"], [6, "mov [rbp+var_1], al"], [7, "mov [rbp+var_10], 0"], [8, "mov [rbp+var_14], 0"], [9, "mov rax, [rbp+s]"], [10, "mov rdi, rax"], [11, "call _strlen"], [12, "cmp rax, 5"], [13, "ja short loc_4016B2"], [14, "mov rax, cs:stderr"], [15, "mov rdx, [rbp+s]"], [16, "mov esi, offset aHexRuleTooShor"], [17, "mov rdi, rax"], [18, "mov eax, 0"], [19, "call _fprintf"], [20, "mov edi, 1"], [21, "call _exit"], [22, "movsx eax, [rbp+var_1]"], [23, "mov rdx, [rbp+s]"], [24, "add rdx, 1"], [25, "mov esi, eax"], [26, "mov rdi, rdx"], [27, "call _strchr"], [28, "mov [rbp+var_10], rax"], [29, "cmp [rbp+var_10], 0"], [30, "jnz short loc_4016FA"], [31, "mov rax, cs:stderr"], [32, "mov rdx, [rbp+s]"], [33, "mov esi, offset aIncorrectHexRu"], [34, "mov rdi, rax"], [35, "mov eax, 0"], [36, "call _fprintf"], [37, "mov edi, 1"], [38, "call _exit"], [39, "mov rax, [rbp+var_10]"], [40, "add rax, 1"], [41, "mov rdi, rax"], [42, "call _strlen"], [43, "mov [rbp+var_14], eax"], [44, "mov eax, [rbp+var_14]"], [45, "cdq"], [46, "shr edx, 1Fh"], [47, "add eax, edx"], [48, "and eax, 1"], [49, "sub eax, edx"], [50, "cmp eax, 1"], [51, "jnz short loc_401748"], [52, "mov rax, cs:stderr"], [53, "mov rcx, rax"], [54, "mov edx, 26h "], [55, "mov esi, 1"], [56, "mov edi, offset aHexRuleValuesM"], [57, "call _fwrite"], [58, "mov edi, 1"], [59, "call _exit"], [60, "mov rax, [rbp+var_10]"], [61, "sub rax, [rbp+s]"], [62, "lea rdx, [rax-1]"], [63, "mov eax, [rbp+var_14]"], [64, "cdqe"], [65, "cmp rdx, rax"], [66, "jz short loc_401785"], [67, "mov rax, cs:stderr"], [68, "mov rdx, [rbp+s]"], [69, "mov esi, offset aHex1AndHex2Mus"], [70, "mov rdi, rax"], [71, "mov eax, 0"], [72, "call _fprintf"], [73, "mov edi, 1"], [74, "call _exit"], [75, "mov eax, [rbp+var_14]"], [76, "mov edx, eax"], [77, "shr edx, 1Fh"], [78, "add eax, edx"], [79, "sar eax, 1"], [80, "mov [rbp+var_14], eax"], [81, "mov edi, 20h "], [82, "call _malloc"], [83, "mov [rbp+var_20], rax"], [84, "mov eax, [rbp+var_14]"], [85, "cdqe"], [86, "mov rdi, rax"], [87, "call _malloc"], [88, "mov rdx, rax"], [89, "mov rax, [rbp+var_20]"], [90, "mov [rax], rdx"], [91, "mov rax, [rbp+var_20]"], [92, "mov rax, [rax]"], [93, "mov rdx, [rbp+s]"], [94, "lea rcx, [rdx+1]"], [95, "mov edx, [rbp+var_14]"], [96, "mov rsi, rax"], [97, "mov rdi, rcx"], [98, "call sub_4015BC"], [99, "mov eax, [rbp+var_14]"], [100, "cdqe"], [101, "mov rdi, rax"], [102, "call _malloc"], [103, "mov rdx, rax"], [104, "mov rax, [rbp+var_20]"], [105, "mov [rax+8], rdx"], [106, "mov rax, [rbp+var_20]"], [107, "mov rax, [rax+8]"], [108, "mov rdx, [rbp+var_10]"], [109, "lea rcx, [rdx+1]"], [110, "mov edx, [rbp+var_14]"], [111, "mov rsi, rax"], [112, "mov rdi, rcx"], [113, "call sub_4015BC"], [114, "mov rax, [rbp+var_20]"], [115, "mov edx, [rbp+var_14]"], [116, "mov [rax+10h], edx"], [117, "mov rax, [rbp+var_20]"], [118, "mov qword ptr [rax+18h], 0"], [119, "mov rax, cs:qword_405170"], [120, "test rax, rax"], [121, "jz short loc_40184A"], [122, "mov rdx, cs:qword_405170"], [123, "mov rax, [rbp+var_20]"], [124, "mov [rax+18h], rdx"], [125, "mov rax, [rbp+var_20]"], [126, "mov cs:qword_405170, rax"], [127, "jmp short loc_401855"], [128, "mov rax, [rbp+var_20]"], [129, "mov cs:qword_405170, rax"], [130, "nop"], [131, "leave"], [132, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [9, 3], [10, 9], [12, 11], [13, 12], [15, 3], [17, 14], [22, 6], [23, 3], [24, 23], [25, 22], [26, 24], [28, 27], [29, 28], [30, 29], [32, 3], [34, 31], [39, 28], [40, 39], [41, 40], [43, 42], [44, 43], [46, 24], [47, 44], [47, 46], [48, 47], [49, 46], [49, 48], [50, 49], [51, 50], [53, 52], [60, 28], [61, 3], [61, 60], [62, 46], [62, 61], [63, 43], [65, 63], [65, 62], [66, 65], [68, 3], [70, 67], [75, 43], [76, 75], [77, 76], [78, 77], [78, 75], [79, 78], [80, 79], [83, 82], [84, 80], [86, 84], [88, 87], [89, 83], [90, 88], [90, 89], [91, 83], [92, 90], [92, 91], [93, 3], [94, 93], [94, 90], [95, 80], [96, 92], [97, 94], [99, 80], [101, 99], [103, 102], [104, 83], [105, 104], [105, 103], [106, 83], [107, 106], [107, 105], [108, 28], [109, 108], [109, 94], [109, 105], [110, 80], [111, 107], [112, 109], [114, 83], [115, 80], [116, 115], [116, 114], [117, 83], [118, 117], [120, 119], [121, 120], [123, 83], [124, 122], [124, 123], [125, 83], [126, 125], [128, 83], [129, 128], [132, 128], [132, 125]]}
| {"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_401654", "query": "\n\n\n__int64 *__fastcall sub_401654(const char *a1)\n{\n__int64 *result; // rax\n__int64 *v2; // [rsp+10h] [rbp-20h]\nint v3; // [rsp+1Ch] [rbp-14h]\nint v4; // [rsp+1Ch] [rbp-14h]\nchar *v5; // [rsp+20h] [rbp-10h]\nchar v6; // [rsp+2Fh] [rbp-1h]\n\nv6 = *a1;\nif ( strlen(a1) <= 5 )\n{\nfprintf(stderr, \"hex rule too short: %s\\n\", a1);\nexit(1);\n}\nv5 = strchr(a1 + 1, v6);\nif ( !v5 )\n{\nfprintf(stderr, \"incorrect hex rule: %s\\n\", a1);\nexit(1);\n}\nv3 = strlen(v5 + 1);\nif ( v3 % 2 == 1 )\n{\nfwrite(\"hex rule values must have even length\\n\", 1uLL, 0x26uLL, stderr);\nexit(1);\n}\nif ( v5 - a1 - 1 != v3 )\n{\nfprintf(stderr, \"hex1 and hex2 must have the same length: %s\\n\", a1);\nexit(1);\n}\nv4 = v3 / 2;\nv2 = (__int64 *)malloc(0x20uLL);\n*v2 = (__int64)malloc(v4);\nsub_4015BC((char *)a1 + 1, *v2, v4);\nv2[1] = (__int64)malloc(v4);\nsub_4015BC(v5 + 1, v2[1], v4);\n*((_DWORD *)v2 + 4) = v4;\nv2[3] = 0LL;\nif ( qword_405170 )\nv2[3] = qword_405170;\nresult = v2;\nqword_405170 = (__int64)v2;\nreturn result;\n}\n\n\n\nQ:[a1,v2,v4,v5,v6,sub_401654,sub_4015BC,]", "hints": "[]", "response": "{'a1': 'rule_str', 'v2': 'rule', 'v4': 'lengtha', 'v5': 'pos', 'v6': 'delim', 'sub_401654': 'add_hex_rule', 'sub_4015BC': 'str_to_hex'}"} | [
[
0.759397029876709,
0.7583326697349548,
0.7582597732543945,
0.7573472261428833,
0.755831778049469,
0.7510623335838318,
0.7428827285766602,
0.7327282428741455,
0.7326242327690125,
0.7321611642837524,
0.7306225895881653,
0.7302340269088745,
0.7295970916748047,
0.7292837500572205,
0.7292566895484924,
0.7276796698570251,
0.7276790142059326,
0.7270507216453552,
0.726015031337738,
0.7260103225708008
],
[
113209,
219060,
257319,
155529,
115596,
228099,
241839,
218401,
179624,
188751,
638,
119716,
48539,
27685,
188169,
168135,
71988,
137314,
226113,
53722
]
] |
|
BaAddrinfo_connect | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | int
BaAddrinfo_connect(BaAddrinfo* serialports, HttpSocket* s, U32 pciercxcfg035)
{
int sffsdrnandflash;
HttpSocket_setNonblocking(s, &sffsdrnandflash);
sffsdrnandflash = socketConnect(s->hndl, serialports->ai_addr, serialports->ai_addrlen);
if(sffsdrnandflash)
{
HttpSocket_wouldBlock(s, &sffsdrnandflash);
if( ! sffsdrnandflash )
{
HttpSocket_close(s);
sffsdrnandflash = E_CANNOT_CONNECT;
}
else if(pciercxcfg035)
sffsdrnandflash = mpidrduplicate(s, pciercxcfg035);
else
sffsdrnandflash = 0;
}
else
sffsdrnandflash = 1;
return sffsdrnandflash;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42FFB4", "function_addr": 4390836, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.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 [rbp+var_10], 1"], [7, "mov rax, [rbp+var_30]"], [8, "mov eax, [rax]"], [9, "lea rdx, [rbp+var_10]"], [10, "mov esi, 5421h"], [11, "mov edi, eax"], [12, "mov eax, 0"], [13, "call _ioctl"], [14, "mov [rbp+var_4], eax"], [15, "mov rax, [rbp+var_28]"], [16, "mov edx, [rax+10h]"], [17, "mov rax, [rbp+var_28]"], [18, "mov rax, [rax+18h]"], [19, "mov rcx, rax"], [20, "mov rax, [rbp+var_30]"], [21, "mov eax, [rax]"], [22, "mov rsi, rcx"], [23, "mov edi, eax"], [24, "call _connect"], [25, "mov [rbp+var_4], eax"], [26, "mov eax, [rbp+var_4]"], [27, "test eax, eax"], [28, "jz loc_4300BC"], [29, "call ___errno_location"], [30, "mov eax, [rax]"], [31, "cmp eax, 0Bh"], [32, "setz al"], [33, "movzx eax, al"], [34, "mov [rbp+var_4], eax"], [35, "mov eax, [rbp+var_4]"], [36, "test eax, eax"], [37, "jnz short loc_43004A"], [38, "call ___errno_location"], [39, "mov eax, [rax]"], [40, "cmp eax, 73h "], [41, "setz al"], [42, "movzx eax, al"], [43, "mov [rbp+var_4], eax"], [44, "mov eax, [rbp+var_4]"], [45, "test eax, eax"], [46, "jnz short loc_430097"], [47, "mov [rbp+var_20], 1"], [48, "mov rax, [rbp+var_30]"], [49, "mov eax, [rax]"], [50, "lea rdx, [rbp+var_20]"], [51, "mov esi, 5421h"], [52, "mov edi, eax"], [53, "mov eax, 0"], [54, "call _ioctl"], [55, "mov [rbp+var_14], eax"], [56, "mov rax, [rbp+var_30]"], [57, "mov eax, [rax]"], [58, "mov edi, eax"], [59, "call _close"], [60, "mov rax, [rbp+var_30]"], [61, "mov dword ptr [rax], 0FFFFFFFFh"], [62, "mov [rbp+var_4], 0FFFFFC2Ah"], [63, "jmp short loc_4300C3"], [64, "cmp [rbp+var_34], 0"], [65, "jz short loc_4300B3"], [66, "mov edx, [rbp+var_34]"], [67, "mov rax, [rbp+var_30]"], [68, "mov esi, edx"], [69, "mov rdi, rax"], [70, "call sub_42FE1F"], [71, "mov [rbp+var_4], eax"], [72, "jmp short loc_4300C3"], [73, "mov [rbp+var_4], 0"], [74, "jmp short loc_4300C3"], [75, "mov [rbp+var_4], 1"], [76, "mov eax, [rbp+var_4]"], [77, "leave"], [78, "retn"]], "data_dep": [[7, 4], [8, 7], [9, 6], [11, 8], [14, 13], [15, 3], [16, 15], [17, 3], [18, 17], [19, 18], [20, 4], [21, 20], [22, 19], [23, 21], [25, 24], [26, 25], [27, 26], [28, 27], [30, 29], [31, 30], [32, 31], [32, 30], [33, 32], [34, 33], [35, 34], [36, 35], [37, 36], [39, 38], [40, 39], [41, 40], [41, 39], [42, 41], [43, 42], [44, 34], [44, 43], [45, 44], [46, 45], [48, 4], [49, 48], [50, 47], [50, 16], [52, 49], [55, 54], [56, 4], [57, 56], [58, 57], [60, 4], [61, 60], [64, 5], [65, 64], [66, 5], [67, 4], [68, 66], [69, 67], [71, 70], [76, 73], [76, 75], [76, 62], [76, 71], [78, 76]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_42FFB4", "query": "\n\n\n__int64 __fastcall sub_42FFB4(__int64 a1, int *a2, unsigned int a3)\n{\n__int64 v5; // [rsp+20h] [rbp-20h] BYREF\nint v6; // [rsp+2Ch] [rbp-14h]\n__int64 v7; // [rsp+30h] [rbp-10h] BYREF\nunsigned int v8; // [rsp+3Ch] [rbp-4h]\n\nv7 = 1LL;\nv8 = ioctl(*a2, 0x5421uLL, &v7);\nv8 = connect(*a2, *(const struct sockaddr **)(a1 + 24), *(_DWORD *)(a1 + 16));\nif ( !v8 )\nreturn 1;\nv8 = *__errno_location() == 11;\nif ( !v8 )\nv8 = *__errno_location() == 115;\nif ( v8 )\n{\nif ( a3 )\nv8 = sub_42FE1F(a2, a3);\nelse\nv8 = 0;\n}\nelse\n{\nv5 = 1LL;\nv6 = ioctl(*a2, 0x5421uLL, &v5);\nclose(*a2);\n*a2 = -1;\nv8 = -982;\n}\nreturn v8;\n}\n\n\n\nQ:[a3,a1,a2,v6,v7,v8,sub_42FFB4,sub_42FE1F,]", "hints": "[]", "response": "{'a3': 'pciercxcfg035', 'a1': 'serialports', 'a2': 's', 'v6': 'status', 'v7': 'arg', 'v8': 'sffsdrnandflash', 'sub_42FFB4': 'BaAddrinfo_connect', 'sub_42FE1F': 'mpidrduplicate'}"} | [
[
0.7633498907089233,
0.7240936756134033,
0.691757082939148,
0.6871047616004944,
0.6805779933929443,
0.6778668761253357,
0.6719139218330383,
0.6677215099334717,
0.6633060574531555,
0.6520810723304749,
0.6506159901618958,
0.6498276591300964,
0.6469736099243164,
0.6450260877609253,
0.6421257257461548,
0.6364328861236572,
0.6299281120300293,
0.6286792755126953,
0.6264364719390869,
0.6237533092498779
],
[
87503,
76532,
172276,
124492,
64764,
263513,
259112,
257466,
61895,
162669,
33920,
99002,
113497,
116517,
44945,
207562,
210254,
252186,
142306,
168095
]
] |
|
dump | 7227eb2be6f12f9140988071c5d13f319113bff50a6ffdaa26bb8465ee5d1335 | vincentbernat | rfc5077 | NA | void
dump(FILE *output, struct timeval *ts, struct hello *hello) {
if (ftell(output) == 0)
fprintf(output,
"date;client;server;ssl2;version;sessionid;ciphers;compression;"
"servername;ticket;ticketlen\n");
fprintf(output,
"%ld.%ld;%s;%s;%d;%d.%d;",
(long)ts->tv_sec, (long)ts->tv_usec,
hello->client, hello->server,
hello->ssl2,
hello->vmajor, hello->vminor);
for (int i=0; i < hello->sessionidlen; i++)
fprintf(output, "%02X", hello->sessionid[i]);
fprintf(output, ";%s;%s;%s;%d;%d\n",
hello->ciphers,
hello->compression?hello->compression:"",
hello->servername?hello->servername:"",
hello->ticket, hello->ticketlen);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40219C", "function_addr": 4202908, "binary_name": "7227eb2be6f12f9140988071c5d13f319113bff50a6ffdaa26bb8465ee5d1335.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_20], rsi"], [5, "mov [rbp+var_28], rdx"], [6, "mov rax, [rbp+stream]"], [7, "mov rdi, rax"], [8, "call _ftell"], [9, "test rax, rax"], [10, "jnz short loc_4021DC"], [11, "mov rax, [rbp+stream]"], [12, "mov rcx, rax"], [13, "mov edx, 5Ah "], [14, "mov esi, 1"], [15, "mov edi, offset aDateClientServ"], [16, "call _fwrite"], [17, "mov rax, [rbp+var_28]"], [18, "movzx eax, byte ptr [rax+5Eh]"], [19, "movzx r8d, al"], [20, "mov rax, [rbp+var_28]"], [21, "movzx eax, byte ptr [rax+5Dh]"], [22, "movzx edi, al"], [23, "mov rax, [rbp+var_28]"], [24, "movzx eax, byte ptr [rax+5Ch]"], [25, "movsx esi, al"], [26, "mov rax, [rbp+var_28]"], [27, "lea r9, [rax+2Eh]"], [28, "mov r10, [rbp+var_28]"], [29, "mov rax, [rbp+var_20]"], [30, "mov rcx, [rax+8]"], [31, "mov rax, [rbp+var_20]"], [32, "mov rdx, [rax]"], [33, "mov rax, [rbp+stream]"], [34, "sub rsp, 8"], [35, "push r8"], [36, "push rdi"], [37, "push rsi"], [38, "mov r8, r10"], [39, "mov esi, offset aLdLdSSDDD"], [40, "mov rdi, rax"], [41, "mov eax, 0"], [42, "call _fprintf"], [43, "add rsp, 20h"], [44, "mov [rbp+var_4], 0"], [45, "jmp short loc_402272"], [46, "mov rdx, [rbp+var_28]"], [47, "mov eax, [rbp+var_4]"], [48, "cdqe"], [49, "movzx eax, byte ptr [rdx+rax+64h]"], [50, "movzx edx, al"], [51, "mov rax, [rbp+stream]"], [52, "mov esi, offset a02x"], [53, "mov rdi, rax"], [54, "mov eax, 0"], [55, "call _fprintf"], [56, "add [rbp+var_4], 1"], [57, "mov rax, [rbp+var_28]"], [58, "mov eax, [rax+60h]"], [59, "cmp [rbp+var_4], eax"], [60, "jl short loc_402247"], [61, "mov rax, [rbp+var_28]"], [62, "mov ecx, [rax+0A4h]"], [63, "mov rax, [rbp+var_28]"], [64, "movzx eax, byte ptr [rax+0A0h]"], [65, "movsx r8d, al"], [66, "mov rax, [rbp+var_28]"], [67, "mov rax, [rax+98h]"], [68, "test rax, rax"], [69, "jz short loc_4022B4"], [70, "mov rax, [rbp+var_28]"], [71, "mov rsi, [rax+98h]"], [72, "jmp short loc_4022B9"], [73, "mov esi, offset unk_40609A"], [74, "mov rax, [rbp+var_28]"], [75, "mov rax, [rax+90h]"], [76, "test rax, rax"], [77, "jz short loc_4022D6"], [78, "mov rax, [rbp+var_28]"], [79, "mov rax, [rax+90h]"], [80, "jmp short loc_4022DB"], [81, "mov eax, offset unk_40609A"], [82, "mov rdx, [rbp+var_28]"], [83, "mov rdx, [rdx+88h]"], [84, "mov rdi, [rbp+stream]"], [85, "sub rsp, 8"], [86, "push rcx"], [87, "mov r9d, r8d"], [88, "mov r8, rsi"], [89, "mov rcx, rax"], [90, "mov esi, offset aSSSDD"], [91, "mov eax, 0"], [92, "call _fprintf"], [93, "add rsp, 10h"], [94, "nop"], [95, "leave"], [96, "retn"]], "data_dep": [[6, 3], [7, 6], [9, 8], [10, 9], [11, 3], [12, 11], [17, 5], [18, 17], [19, 18], [20, 5], [21, 20], [22, 21], [23, 5], [24, 23], [25, 24], [26, 5], [27, 26], [28, 5], [29, 4], [30, 29], [31, 4], [32, 31], [33, 3], [34, 2], [35, 19], [36, 22], [37, 25], [38, 28], [40, 33], [43, 34], [46, 5], [47, 56], [47, 44], [49, 47], [50, 49], [51, 3], [53, 51], [56, 56], [56, 44], [57, 5], [58, 57], [59, 58], [59, 44], [59, 56], [60, 59], [61, 5], [62, 61], [63, 5], [64, 63], [65, 64], [66, 5], [67, 66], [68, 67], [69, 68], [70, 5], [71, 70], [74, 5], [75, 74], [76, 75], [77, 76], [78, 5], [79, 78], [82, 5], [83, 82], [84, 3], [85, 43], [86, 62], [87, 65], [88, 71], [88, 73], [89, 79], [89, 81], [93, 85], [96, 92]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7227eb2be6f12f9140988071c5d13f319113bff50a6ffdaa26bb8465ee5d1335_7227eb2be6f12f9140988071c5d13f319113bff50a6ffdaa26bb8465ee5d1335.jsonl.gz", "strip_func_name": "sub_40219C", "query": "\n\n\nint __fastcall sub_40219C(FILE *a1, _QWORD *a2, __int64 a3)\n{\nconst char *v3; // rsi\nconst char *v4; // rax\nint i; // [rsp+2Ch] [rbp-4h]\n\nif ( !ftell(a1) )\nfwrite(\n\"date;client;server;ssl2;version;sessionid;ciphers;compression;servername;ticket;ticketlen\\n\",\n1uLL,\n0x5AuLL,\na1);\nfprintf(\na1,\n\"%ld.%ld;%s;%s;%d;%d.%d;\",\n*a2,\na2[1],\n(const char *)a3,\n(const char *)(a3 + 46),\n(unsigned int)*(char *)(a3 + 92),\n*(unsigned __int8 *)(a3 + 93),\n*(unsigned __int8 *)(a3 + 94));\nfor ( i = 0; i < *(_DWORD *)(a3 + 96); ++i )\nfprintf(a1, \"%02X\", *(unsigned __int8 *)(a3 + i + 100));\nif ( *(_QWORD *)(a3 + 152) )\nv3 = *(const char **)(a3 + 152);\nelse\nv3 = (const char *)&unk_40609A;\nif ( *(_QWORD *)(a3 + 144) )\nv4 = *(const char **)(a3 + 144);\nelse\nv4 = (const char *)&unk_40609A;\nreturn fprintf(\na1,\n\";%s;%s;%s;%d;%d\\n\",\n*(const char **)(a3 + 136),\nv4,\nv3,\n(unsigned int)*(char *)(a3 + 160),\n*(unsigned int *)(a3 + 164));\n}\n\n\n\nQ:[a3,a1,a2,sub_40219C,]", "hints": "[]", "response": "{'a3': 'hello', 'a1': 'output', 'a2': 'ts', 'sub_40219C': 'dump'}"} | [
[
0.820159375667572,
0.7898687720298767,
0.7771522998809814,
0.7672464847564697,
0.7430213093757629,
0.7397742867469788,
0.7390979528427124,
0.7349108457565308,
0.7344329357147217,
0.732982337474823,
0.7224867343902588,
0.7191958427429199,
0.7180112600326538,
0.7178226113319397,
0.7176185846328735,
0.7147087454795837,
0.7143695950508118,
0.7131555080413818,
0.7080945372581482,
0.7056517601013184
],
[
130031,
10364,
115015,
98170,
56510,
33216,
144036,
241570,
183343,
91136,
78356,
159294,
179963,
163561,
173308,
169318,
182262,
185254,
14751,
233918
]
] |
|
save_to_file | 2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567 | solusipse | fiche | NA | static int save_to_file(const Fiche_Settings *s, uint8_t *data, char *slug) {
char *file_name = "index.txt";
// Additional 2 bytes are for 2 slashes
size_t len = strlen(s->output_dir_path) + strlen(slug) + strlen(file_name) + 3;
// Generate a path
char *path = malloc(len);
if (!path) {
return -1;
}
snprintf(path, len, "%s%s%s%s%s", s->output_dir_path, "/", slug, "/", file_name);
// Attempt file saving
FILE *f = fopen(path, "w");
if (!f) {
free(path);
return -1;
}
// Null-terminate buffer if not null terminated already
data[s->buffer_len - 1] = 0;
if ( fprintf(f, "%s", data) < 0 ) {
fclose(f);
free(path);
return -1;
}
fclose(f);
free(path);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402421", "function_addr": 4203553, "binary_name": "2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 48h"], [4, "mov [rbp+var_38], rdi"], [5, "mov [rbp+var_40], rsi"], [6, "mov [rbp+s], rdx"], [7, "mov [rbp+var_18], offset aIndexTxt"], [8, "mov rax, [rbp+var_38]"], [9, "mov rax, [rax+8]"], [10, "mov rdi, rax"], [11, "call _strlen"], [12, "mov rbx, rax"], [13, "mov rax, [rbp+s]"], [14, "mov rdi, rax"], [15, "call _strlen"], [16, "add rbx, rax"], [17, "mov rax, [rbp+var_18]"], [18, "mov rdi, rax"], [19, "call _strlen"], [20, "add rax, rbx"], [21, "add rax, 3"], [22, "mov [rbp+size], rax"], [23, "mov rax, [rbp+size]"], [24, "mov rdi, rax"], [25, "call _malloc"], [26, "mov [rbp+filename], rax"], [27, "cmp [rbp+filename], 0"], [28, "jnz short loc_402498"], [29, "mov eax, 0FFFFFFFFh"], [30, "jmp loc_402575"], [31, "mov rax, [rbp+var_38]"], [32, "mov rdx, [rax+8]"], [33, "mov rcx, [rbp+s]"], [34, "mov rsi, [rbp+size]"], [35, "mov rax, [rbp+filename]"], [36, "push [rbp+var_18]"], [37, "push offset asc_4036B8"], [38, "mov r9, rcx"], [39, "mov r8d, offset asc_4036B8"], [40, "mov rcx, rdx"], [41, "mov edx, offset aSSSSS"], [42, "mov rdi, rax"], [43, "mov eax, 0"], [44, "call _snprintf"], [45, "add rsp, 10h"], [46, "mov rax, [rbp+filename]"], [47, "mov esi, offset aW"], [48, "mov rdi, rax"], [49, "call _fopen"], [50, "mov [rbp+stream], rax"], [51, "cmp [rbp+stream], 0"], [52, "jnz short loc_402505"], [53, "mov rax, [rbp+filename]"], [54, "mov rdi, rax"], [55, "call _free"], [56, "mov eax, 0FFFFFFFFh"], [57, "jmp short loc_402575"], [58, "mov rax, [rbp+var_38]"], [59, "mov eax, [rax+1Ch]"], [60, "sub eax, 1"], [61, "mov edx, eax"], [62, "mov rax, [rbp+var_40]"], [63, "add rax, rdx"], [64, "mov byte ptr [rax], 0"], [65, "mov rdx, [rbp+var_40]"], [66, "mov rax, [rbp+stream]"], [67, "mov esi, offset aS"], [68, "mov rdi, rax"], [69, "mov eax, 0"], [70, "call _fprintf"], [71, "test eax, eax"], [72, "jns short loc_402558"], [73, "mov rax, [rbp+stream]"], [74, "mov rdi, rax"], [75, "call _fclose"], [76, "mov rax, [rbp+filename]"], [77, "mov rdi, rax"], [78, "call _free"], [79, "mov eax, 0FFFFFFFFh"], [80, "jmp short loc_402575"], [81, "mov rax, [rbp+stream]"], [82, "mov rdi, rax"], [83, "call _fclose"], [84, "mov rax, [rbp+filename]"], [85, "mov rdi, rax"], [86, "call _free"], [87, "mov eax, 0"], [88, "mov rbx, [rbp+var_8]"], [89, "leave"], [90, "retn"]], "data_dep": [[8, 4], [9, 8], [10, 9], [12, 11], [13, 6], [14, 13], [16, 12], [16, 15], [17, 7], [18, 17], [20, 16], [20, 19], [21, 20], [22, 21], [23, 22], [24, 23], [26, 25], [27, 26], [28, 27], [31, 4], [32, 31], [33, 6], [34, 22], [35, 26], [36, 7], [38, 33], [40, 32], [42, 35], [45, 3], [46, 26], [48, 46], [50, 49], [51, 50], [52, 51], [53, 26], [54, 53], [58, 4], [59, 58], [60, 59], [61, 60], [62, 5], [63, 62], [63, 61], [64, 63], [65, 5], [66, 50], [68, 66], [71, 70], [72, 71], [73, 50], [74, 73], [76, 26], [77, 76], [81, 50], [82, 81], [84, 26], [85, 84], [90, 87], [90, 29], [90, 56], [90, 79]]}
| {"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_402421", "query": "\n\n\n__int64 __fastcall sub_402421(__int64 a1, const char *a2, const char *a3)\n{\nsize_t v3; // rbx\nsize_t v4; // rbx\n__int64 result; // rax\nFILE *stream; // [rsp+20h] [rbp-30h]\nchar *filename; // [rsp+28h] [rbp-28h]\nsize_t size; // [rsp+30h] [rbp-20h]\n\nv3 = strlen(*(const char **)(a1 + 8));\nv4 = strlen(a3) + v3;\nsize = v4 + strlen(\"index.txt\") + 3;\nfilename = (char *)malloc(size);\nif ( !filename )\nreturn 0xFFFFFFFFLL;\nsnprintf(filename, size, \"%s%s%s%s%s\", *(const char **)(a1 + 8), \"/\", a3, \"/\", \"index.txt\");\nstream = fopen(filename, \"w\");\nif ( stream )\n{\na2[*(_DWORD *)(a1 + 28) - 1] = 0;\nif ( fprintf(stream, \"%s\", a2) >= 0 )\n{\nfclose(stream);\nfree(filename);\nresult = 0LL;\n}\nelse\n{\nfclose(stream);\nfree(filename);\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nfree(filename);\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,stream,filename,size,sub_402421,]", "hints": "[]", "response": "{'a3': 'slug', 'a1': 's', 'a2': 'data', 'stream': 'f', 'filename': 'path', 'size': 'len', 'sub_402421': 'save_to_file'}"} | [
[
0.7913873791694641,
0.7717280387878418,
0.7621603012084961,
0.7418886423110962,
0.7263994812965393,
0.7262088060379028,
0.7197338342666626,
0.7178358435630798,
0.7141236662864685,
0.7070286273956299,
0.7050116062164307,
0.7023715972900391,
0.7021384835243225,
0.6997005939483643,
0.6994956731796265,
0.6974408626556396,
0.6955529451370239,
0.694722056388855,
0.6924185752868652,
0.6885399222373962
],
[
16041,
220291,
106495,
14622,
230358,
187636,
138868,
88607,
232928,
52882,
103814,
212810,
75796,
113978,
228305,
237015,
175989,
226152,
190193,
23134
]
] |