ProRec
Collection
Data and Models for "Source Code Foundation Models are Transferable Binary Analysis Knowledge Bases"
•
15 items
•
Updated
src
stringlengths 11
425k
| codeart
stringlengths 257
560k
|
---|---|
int main_lorenz(int argc, char *argv[])
{
bam_plp_t plp;
BGZF *fp;
bam_hdr_t *h;
const bam_pileup1_t *p;
int i, c, n_plp, tid, pos, step = 1000;
uint64_t *cnt, bed_len = 0, sum_partial = 0, cov = 0, tot = 0, tot_partial = 0;
void *bed = 0;
while ((c = getopt(argc, argv, "b:s:")) >= 0) {
if (c == 'b') {
bed = bed_read(optarg);
bed_len = bed_totlen(bed);
fprintf(stderr, "[M::%s] total length in BED: %ld\n", __func__, (long)bed_len);
} else if (c == 's') step = atoi(optarg);
}
if (optind == argc) {
fprintf(stderr, "Usage: lianti lorenz [-b bed] [-s step=%d] <aln.bam>\n", step);
return 1;
}
cnt = (uint64_t*)calloc(MAX_DEPTH + 1, sizeof(uint64_t));
fp = bgzf_open(argv[optind], "r");
h = bam_hdr_read(fp);
plp = bam_plp_init((bam_plp_auto_f)bam_read1, fp);
while ((p = bam_plp_auto(plp, &tid, &pos, &n_plp)) != 0) {
if (bed_overlap(bed, h->target_name[tid], pos, pos + 1))
++cnt[n_plp < MAX_DEPTH? n_plp : MAX_DEPTH];
}
for (i = 1; i <= MAX_DEPTH; ++i) cov += cnt[i];
cnt[0] = bed_len - cov;
for (i = 0; i <= MAX_DEPTH; ++i) tot += cnt[i] * i;
bam_plp_destroy(plp);
printf("%.4f\t%.4f\n", 0., 0.);
for (i = 0, sum_partial = tot_partial = 0; i <= MAX_DEPTH; ++i) {
if (cnt[i] <= step) {
sum_partial += cnt[i], tot_partial += i * cnt[i];
printf("%.4f\t%.4f\n", (double)sum_partial / bed_len, (double)tot_partial / tot);
} else {
uint64_t rest = cnt[i];
while (rest) {
int x = rest < step? rest : step;
sum_partial += x, tot_partial += i * x;
printf("%.4f\t%.4f\n", (double)sum_partial / bed_len, (double)tot_partial / tot);
rest -= x;
}
}
}
bam_hdr_destroy(h);
bgzf_close(fp);
free(cnt);
if (bed) bed_destroy(bed);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_430613", "function_addr": 4392467, "binary_name": "18ba826ac31830a73aba61dc9990ca60507abe36300168b1d3124d77e38500a7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+argc], edi"], [4, "mov [rbp+argv], rsi"], [5, "mov [rbp+var_8], 3E8h"], [6, "mov [rbp+var_10], 0"], [7, "mov [rbp+var_18], 0"], [8, "mov [rbp+var_20], 0"], [9, "mov [rbp+var_28], 0"], [10, "mov [rbp+var_30], 0"], [11, "mov [rbp+var_38], 0"], [12, "jmp short loc_4306CC"], [13, "cmp [rbp+var_44], 62h "], [14, "jnz short loc_4306B4"], [15, "mov rax, cs:optarg"], [16, "mov rdi, rax"], [17, "call sub_40F80C"], [18, "mov [rbp+var_38], rax"], [19, "mov rax, [rbp+var_38]"], [20, "mov rdi, rax"], [21, "call sub_40F29E"], [22, "mov [rbp+var_10], rax"], [23, "mov rdx, [rbp+var_10]"], [24, "mov rax, cs:stderr"], [25, "mov rcx, rdx"], [26, "mov edx, offset aMainLorenz"], [27, "mov esi, offset aMSTotalLengthI"], [28, "mov rdi, rax"], [29, "mov eax, 0"], [30, "call _fprintf"], [31, "jmp short loc_4306CC"], [32, "cmp [rbp+var_44], 73h "], [33, "jnz short loc_4306CC"], [34, "mov rax, cs:optarg"], [35, "mov rdi, rax"], [36, "call _atoi"], [37, "mov [rbp+var_8], eax"], [38, "mov rcx, [rbp+argv]"], [39, "mov eax, [rbp+argc]"], [40, "mov edx, offset aBS"], [41, "mov rsi, rcx"], [42, "mov edi, eax"], [43, "call _getopt"], [44, "mov [rbp+var_44], eax"], [45, "cmp [rbp+var_44], 0"], [46, "jns loc_430664"], [47, "mov eax, cs:optind"], [48, "cmp [rbp+argc], eax"], [49, "jnz short loc_430729"], [50, "mov rax, cs:stderr"], [51, "mov edx, [rbp+var_8]"], [52, "mov esi, offset aUsageLiantiLor"], [53, "mov rdi, rax"], [54, "mov eax, 0"], [55, "call _fprintf"], [56, "mov eax, 1"], [57, "jmp locret_430B9F"], [58, "mov esi, 8"], [59, "mov edi, 2711h"], [60, "call _calloc"], [61, "mov [rbp+ptr], rax"], [62, "mov eax, cs:optind"], [63, "cdqe"], [64, "lea rdx, ds:0[rax*8]"], [65, "mov rax, [rbp+argv]"], [66, "add rax, rdx"], [67, "mov rax, [rax]"], [68, "mov esi, offset aR_9"], [69, "mov rdi, rax"], [70, "call sub_4030B8"], [71, "mov [rbp+var_58], rax"], [72, "mov rax, [rbp+var_58]"], [73, "mov rdi, rax"], [74, "call sub_411F78"], [75, "mov [rbp+var_60], rax"], [76, "mov rax, [rbp+var_58]"], [77, "mov rsi, rax"], [78, "mov edi, offset sub_412A69"], [79, "call sub_4170B4"], [80, "mov [rbp+var_68], rax"], [81, "jmp short loc_4307F0"], [82, "mov eax, [rbp+var_80]"], [83, "lea ecx, [rax+1]"], [84, "mov edx, [rbp+var_80]"], [85, "mov rax, [rbp+var_60]"], [86, "mov rsi, [rax+20h]"], [87, "mov eax, [rbp+var_7C]"], [88, "cdqe"], [89, "shl rax, 3"], [90, "add rax, rsi"], [91, "mov rsi, [rax]"], [92, "mov rax, [rbp+var_38]"], [93, "mov rdi, rax"], [94, "call sub_40F78B"], [95, "test eax, eax"], [96, "jz short loc_4307F0"], [97, "mov eax, [rbp+var_78]"], [98, "cmp eax, 270Fh"], [99, "jg short loc_4307DA"], [100, "mov eax, [rbp+var_78]"], [101, "cdqe"], [102, "lea rdx, ds:0[rax*8]"], [103, "jmp short loc_4307DF"], [104, "mov edx, 13880h"], [105, "mov rax, [rbp+ptr]"], [106, "add rax, rdx"], [107, "mov rdx, [rax]"], [108, "add rdx, 1"], [109, "mov [rax], rdx"], [110, "lea rcx, [rbp+var_78]"], [111, "lea rdx, [rbp+var_80]"], [112, "lea rsi, [rbp+var_7C]"], [113, "mov rax, [rbp+var_68]"], [114, "mov rdi, rax"], [115, "call sub_417875"], [116, "mov [rbp+var_70], rax"], [117, "cmp [rbp+var_70], 0"], [118, "jnz loc_430791"], [119, "mov [rbp+var_4], 1"], [120, "jmp short loc_43083F"], [121, "mov eax, [rbp+var_4]"], [122, "cdqe"], [123, "lea rdx, ds:0[rax*8]"], [124, "mov rax, [rbp+ptr]"], [125, "add rax, rdx"], [126, "mov rax, [rax]"], [127, "add [rbp+var_20], rax"], [128, "add [rbp+var_4], 1"], [129, "cmp [rbp+var_4], 2710h"], [130, "jle short loc_430820"], [131, "mov rax, [rbp+var_10]"], [132, "sub rax, [rbp+var_20]"], [133, "mov rdx, rax"], [134, "mov rax, [rbp+ptr]"], [135, "mov [rax], rdx"], [136, "mov [rbp+var_4], 0"], [137, "jmp short loc_43088B"], [138, "mov eax, [rbp+var_4]"], [139, "cdqe"], [140, "lea rdx, ds:0[rax*8]"], [141, "mov rax, [rbp+ptr]"], [142, "add rax, rdx"], [143, "mov rdx, [rax]"], [144, "mov eax, [rbp+var_4]"], [145, "cdqe"], [146, "imul rax, rdx"], [147, "add [rbp+var_28], rax"], [148, "add [rbp+var_4], 1"], [149, "cmp [rbp+var_4], 2710h"], [150, "jle short loc_430863"], [151, "mov rax, [rbp+var_68]"], [152, "mov rdi, rax"], [153, "call sub_417187"], [154, "pxor xmm1, xmm1"], [155, "pxor xmm0, xmm0"], [156, "mov edi, offset a4f4f"], [157, "mov eax, 2"], [158, "call _printf"], [159, "mov [rbp+var_4], 0"], [160, "mov [rbp+var_30], 0"], [161, "mov rax, [rbp+var_30]"], [162, "mov [rbp+var_18], rax"], [163, "jmp loc_430B56"], [164, "mov eax, [rbp+var_4]"], [165, "cdqe"], [166, "lea rdx, ds:0[rax*8]"], [167, "mov rax, [rbp+ptr]"], [168, "add rax, rdx"], [169, "mov rdx, [rax]"], [170, "mov eax, [rbp+var_8]"], [171, "cdqe"], [172, "cmp rdx, rax"], [173, "ja loc_430A1A"], [174, "mov eax, [rbp+var_4]"], [175, "cdqe"], [176, "lea rdx, ds:0[rax*8]"], [177, "mov rax, [rbp+ptr]"], [178, "add rax, rdx"], [179, "mov rax, [rax]"], [180, "add [rbp+var_18], rax"], [181, "mov eax, [rbp+var_4]"], [182, "movsxd rdx, eax"], [183, "mov eax, [rbp+var_4]"], [184, "cdqe"], [185, "lea rcx, ds:0[rax*8]"], [186, "mov rax, [rbp+ptr]"], [187, "add rax, rcx"], [188, "mov rax, [rax]"], [189, "imul rax, rdx"], [190, "add [rbp+var_30], rax"], [191, "mov rax, [rbp+var_30]"], [192, "test rax, rax"], [193, "js short loc_43094C"], [194, "pxor xmm0, xmm0"], [195, "cvtsi2sd xmm0, rax"], [196, "jmp short loc_430965"], [197, "mov rdx, rax"], [198, "shr rdx, 1"], [199, "and eax, 1"], [200, "or rdx, rax"], [201, "pxor xmm0, xmm0"], [202, "cvtsi2sd xmm0, rdx"], [203, "addsd xmm0, xmm0"], [204, "mov rax, [rbp+var_28]"], [205, "test rax, rax"], [206, "js short loc_430979"], [207, "pxor xmm1, xmm1"], [208, "cvtsi2sd xmm1, rax"], [209, "jmp short loc_430992"], [210, "mov rdx, rax"], [211, "shr rdx, 1"], [212, "and eax, 1"], [213, "or rdx, rax"], [214, "pxor xmm1, xmm1"], [215, "cvtsi2sd xmm1, rdx"], [216, "addsd xmm1, xmm1"], [217, "movapd xmm2, xmm0"], [218, "divsd xmm2, xmm1"], [219, "mov rax, [rbp+var_18]"], [220, "test rax, rax"], [221, "js short loc_4309AE"], [222, "pxor xmm0, xmm0"], [223, "cvtsi2sd xmm0, rax"], [224, "jmp short loc_4309C7"], [225, "mov rdx, rax"], [226, "shr rdx, 1"], [227, "and eax, 1"], [228, "or rdx, rax"], [229, "pxor xmm0, xmm0"], [230, "cvtsi2sd xmm0, rdx"], [231, "addsd xmm0, xmm0"], [232, "mov rax, [rbp+var_10]"], [233, "test rax, rax"], [234, "js short loc_4309DB"], [235, "pxor xmm1, xmm1"], [236, "cvtsi2sd xmm1, rax"], [237, "jmp short loc_4309F4"], [238, "mov rdx, rax"], [239, "shr rdx, 1"], [240, "and eax, 1"], [241, "or rdx, rax"], [242, "pxor xmm1, xmm1"], [243, "cvtsi2sd xmm1, rdx"], [244, "addsd xmm1, xmm1"], [245, "divsd xmm0, xmm1"], [246, "movq rax, xmm0"], [247, "movapd xmm1, xmm2"], [248, "movq xmm0, rax"], [249, "mov edi, offset a4f4f"], [250, "mov eax, 2"], [251, "call _printf"], [252, "jmp loc_430B52"], [253, "mov eax, [rbp+var_4]"], [254, "cdqe"], [255, "lea rdx, ds:0[rax*8]"], [256, "mov rax, [rbp+ptr]"], [257, "add rax, rdx"], [258, "mov rax, [rax]"], [259, "mov [rbp+var_40], rax"], [260, "jmp loc_430B47"], [261, "mov eax, [rbp+var_8]"], [262, "cdqe"], [263, "cmp [rbp+var_40], rax"], [264, "cmovbe rax, [rbp+var_40]"], [265, "mov [rbp+var_74], eax"], [266, "mov eax, [rbp+var_74]"], [267, "cdqe"], [268, "add [rbp+var_18], rax"], [269, "mov eax, [rbp+var_4]"], [270, "imul eax, [rbp+var_74]"], [271, "cdqe"], [272, "add [rbp+var_30], rax"], [273, "mov rax, [rbp+var_30]"], [274, "test rax, rax"], [275, "js short loc_430A75"], [276, "pxor xmm0, xmm0"], [277, "cvtsi2sd xmm0, rax"], [278, "jmp short loc_430A8E"], [279, "mov rdx, rax"], [280, "shr rdx, 1"], [281, "and eax, 1"], [282, "or rdx, rax"], [283, "pxor xmm0, xmm0"], [284, "cvtsi2sd xmm0, rdx"], [285, "addsd xmm0, xmm0"], [286, "mov rax, [rbp+var_28]"], [287, "test rax, rax"], [288, "js short loc_430AA2"], [289, "pxor xmm1, xmm1"], [290, "cvtsi2sd xmm1, rax"], [291, "jmp short loc_430ABB"], [292, "mov rdx, rax"], [293, "shr rdx, 1"], [294, "and eax, 1"], [295, "or rdx, rax"], [296, "pxor xmm1, xmm1"], [297, "cvtsi2sd xmm1, rdx"], [298, "addsd xmm1, xmm1"], [299, "movapd xmm2, xmm0"], [300, "divsd xmm2, xmm1"], [301, "mov rax, [rbp+var_18]"], [302, "test rax, rax"], [303, "js short loc_430AD7"], [304, "pxor xmm0, xmm0"], [305, "cvtsi2sd xmm0, rax"], [306, "jmp short loc_430AF0"], [307, "mov rdx, rax"], [308, "shr rdx, 1"], [309, "and eax, 1"], [310, "or rdx, rax"], [311, "pxor xmm0, xmm0"], [312, "cvtsi2sd xmm0, rdx"], [313, "addsd xmm0, xmm0"], [314, "mov rax, [rbp+var_10]"], [315, "test rax, rax"], [316, "js short loc_430B04"], [317, "pxor xmm1, xmm1"], [318, "cvtsi2sd xmm1, rax"], [319, "jmp short loc_430B1D"], [320, "mov rdx, rax"], [321, "shr rdx, 1"], [322, "and eax, 1"], [323, "or rdx, rax"], [324, "pxor xmm1, xmm1"], [325, "cvtsi2sd xmm1, rdx"], [326, "addsd xmm1, xmm1"], [327, "divsd xmm0, xmm1"], [328, "movq rax, xmm0"], [329, "movapd xmm1, xmm2"], [330, "movq xmm0, rax"], [331, "mov edi, offset a4f4f"], [332, "mov eax, 2"], [333, "call _printf"], [334, "mov eax, [rbp+var_74]"], [335, "cdqe"], [336, "sub [rbp+var_40], rax"], [337, "cmp [rbp+var_40], 0"], [338, "jnz loc_430A3A"], [339, "add [rbp+var_4], 1"], [340, "cmp [rbp+var_4], 2710h"], [341, "jle loc_4308D3"], [342, "mov rax, [rbp+var_60]"], [343, "mov rdi, rax"], [344, "call sub_411D2A"], [345, "mov rax, [rbp+var_58]"], [346, "mov rdi, rax"], [347, "call sub_4046AD"], [348, "mov rax, [rbp+ptr]"], [349, "mov rdi, rax"], [350, "call _free"], [351, "cmp [rbp+var_38], 0"], [352, "jz short loc_430B9A"], [353, "mov rax, [rbp+var_38]"], [354, "mov rdi, rax"], [355, "call sub_40FB87"], [356, "mov eax, 0"], [357, "leave"], [358, "retn"]], "data_dep": [[13, 44], [14, 13], [16, 15], [18, 17], [19, 18], [20, 19], [22, 21], [23, 22], [25, 23], [28, 24], [32, 44], [33, 32], [35, 34], [37, 36], [38, 4], [39, 3], [41, 38], [42, 39], [44, 43], [45, 44], [46, 45], [48, 3], [48, 47], [49, 48], [51, 37], [51, 5], [53, 50], [61, 60], [64, 40], [65, 4], [66, 65], [66, 64], [67, 66], [69, 67], [71, 70], [72, 71], [73, 72], [75, 74], [76, 71], [77, 76], [80, 79], [83, 109], [83, 110], [83, 82], [85, 75], [86, 109], [86, 85], [89, 87], [90, 86], [90, 89], [91, 109], [91, 90], [92, 11], [92, 18], [93, 92], [95, 94], [96, 95], [98, 97], [99, 98], [102, 84], [105, 61], [106, 102], [106, 105], [106, 104], [107, 106], [107, 109], [108, 107], [109, 106], [109, 108], [110, 38], [110, 83], [111, 64], [111, 108], [111, 84], [112, 91], [112, 77], [113, 80], [114, 113], [116, 115], [117, 116], [118, 117], [121, 119], [121, 128], [123, 111], [123, 123], [124, 61], [125, 124], [125, 123], [126, 125], [126, 109], [127, 127], [127, 126], [127, 8], [128, 119], [128, 128], [129, 128], [129, 119], [130, 129], [131, 22], [131, 6], [132, 127], [132, 131], [132, 8], [133, 132], [134, 61], [135, 134], [135, 133], [138, 136], [138, 148], [140, 143], [140, 133], [141, 61], [142, 140], [142, 141], [143, 135], [143, 142], [143, 109], [144, 136], [144, 148], [146, 144], [146, 143], [147, 9], [147, 147], [147, 146], [148, 136], [148, 148], [149, 136], [149, 148], [150, 149], [151, 80], [152, 151], [161, 160], [162, 161], [164, 339], [164, 159], [166, 143], [166, 255], [166, 282], [166, 241], [166, 133], [166, 213], [166, 310], [166, 323], [166, 295], [166, 228], [166, 182], [166, 200], [167, 61], [168, 167], [168, 166], [169, 109], [169, 168], [169, 135], [170, 5], [170, 37], [172, 170], [172, 169], [173, 172], [174, 159], [174, 339], [176, 169], [177, 61], [178, 177], [178, 176], [179, 178], [179, 109], [179, 135], [180, 162], [180, 268], [180, 180], [180, 179], [181, 159], [181, 339], [182, 181], [183, 339], [183, 159], [185, 110], [185, 185], [186, 61], [187, 186], [187, 185], [188, 187], [188, 109], [188, 135], [189, 182], [189, 188], [190, 189], [190, 160], [190, 272], [190, 190], [191, 190], [192, 191], [193, 192], [195, 192], [195, 194], [197, 192], [198, 197], [199, 192], [200, 199], [200, 198], [202, 200], [202, 201], [203, 202], [204, 9], [204, 147], [205, 204], [206, 205], [208, 205], [208, 207], [210, 205], [211, 210], [212, 205], [213, 212], [213, 211], [215, 214], [215, 213], [216, 215], [217, 203], [217, 195], [218, 208], [218, 217], [218, 216], [219, 180], [220, 219], [221, 220], [223, 222], [223, 220], [225, 220], [226, 225], [227, 220], [228, 226], [228, 227], [230, 229], [230, 228], [231, 230], [232, 22], [232, 6], [233, 232], [234, 233], [236, 235], [236, 233], [238, 233], [239, 238], [240, 233], [241, 240], [241, 239], [243, 242], [243, 241], [244, 243], [245, 236], [245, 231], [245, 244], [245, 223], [246, 245], [247, 218], [248, 246], [253, 159], [253, 339], [255, 169], [256, 61], [257, 256], [257, 255], [258, 109], [258, 257], [258, 135], [259, 258], [261, 37], [261, 5], [263, 336], [263, 261], [263, 259], [264, 259], [264, 263], [264, 336], [265, 264], [266, 265], [268, 266], [268, 162], [268, 180], [268, 268], [269, 159], [269, 339], [270, 265], [270, 269], [272, 272], [272, 160], [272, 270], [272, 190], [273, 272], [274, 273], [275, 274], [277, 276], [277, 274], [279, 274], [280, 279], [281, 274], [282, 280], [282, 281], [284, 283], [284, 282], [285, 284], [286, 147], [286, 9], [287, 286], [288, 287], [290, 289], [290, 287], [292, 287], [293, 292], [294, 287], [295, 294], [295, 293], [297, 296], [297, 295], [298, 297], [299, 277], [299, 285], [300, 290], [300, 299], [300, 298], [301, 268], [302, 301], [303, 302], [305, 302], [305, 304], [307, 302], [308, 307], [309, 302], [310, 309], [310, 308], [312, 311], [312, 310], [313, 312], [314, 22], [314, 6], [315, 314], [316, 315], [318, 315], [318, 317], [320, 315], [321, 320], [322, 315], [323, 322], [323, 321], [325, 324], [325, 323], [326, 325], [327, 305], [327, 318], [327, 313], [327, 326], [328, 327], [329, 300], [330, 328], [334, 265], [336, 334], [336, 259], [336, 336], [337, 259], [337, 336], [338, 337], [339, 159], [339, 339], [340, 159], [340, 339], [341, 340], [342, 75], [343, 342], [345, 71], [346, 345], [348, 61], [349, 348], [351, 11], [351, 18], [352, 351], [353, 11], [353, 18], [354, 353], [358, 56], [358, 356]]}
|
static void raw_close(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
if (s->fd >= 0) {
close(s->fd);
s->fd = -1;
if (s->aligned_buf != NULL)
qemu_vfree(s->aligned_buf);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_442330", "function_addr": 4465456, "binary_name": "cc7eb91bd0d1f267d417b082eda72b746468e69048449bb22bfbc4468f0e77da.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 rax, [rax+48h]"], [9, "mov [rbp+var_10], rax"], [10, "mov rax, [rbp+var_10]"], [11, "mov eax, [rax]"], [12, "test eax, eax"], [13, "js short loc_442395"], [14, "mov rax, [rbp+var_10]"], [15, "mov eax, [rax]"], [16, "mov edi, eax"], [17, "call _close"], [18, "mov rax, [rbp+var_10]"], [19, "mov dword ptr [rax], 0FFFFFFFFh"], [20, "mov rax, [rbp+var_10]"], [21, "mov rax, [rax+38h]"], [22, "test rax, rax"], [23, "jz short loc_442395"], [24, "mov rax, [rbp+var_10]"], [25, "mov rax, [rax+38h]"], [26, "mov rdi, rax"], [27, "call sub_4060BA"], [28, "nop"], [29, "mov rax, [rbp+var_8]"], [30, "sub rax, fs:28h"], [31, "jz short locret_4423AA"], [32, "call ___stack_chk_fail"], [33, "leave"], [34, "retn"]], "data_dep": [[5, 4], [7, 3], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 9], [15, 14], [16, 15], [18, 9], [19, 18], [20, 9], [21, 19], [21, 20], [22, 21], [23, 22], [24, 9], [25, 19], [25, 24], [26, 25], [29, 5], [30, 29], [31, 30], [34, 30]]}
|
static DTableDesc HUFv07_getDTableDesc(const HUFv07_DTable* table)
{
DTableDesc dtd;
memcpy(&dtd, table, sizeof(dtd));
return dtd;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43DC88", "function_addr": 4447368, "binary_name": "a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821.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, "mov eax, [rax]"], [5, "mov [rbp+var_4], eax"], [6, "mov eax, [rbp+var_4]"], [7, "pop rbp"], [8, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 5], [7, 0], [8, 6]]}
|
int btf_type_visit_str_offs(struct btf_type *t, str_off_visit_fn visit, void *ctx)
{
int i, n, err;
err = visit(&t->name_off, ctx);
if (err)
return err;
switch (btf_kind(t)) {
case BTF_KIND_STRUCT:
case BTF_KIND_UNION: {
struct btf_member *m = btf_members(t);
for (i = 0, n = btf_vlen(t); i < n; i++, m++) {
err = visit(&m->name_off, ctx);
if (err)
return err;
}
break;
}
case BTF_KIND_ENUM: {
struct btf_enum *m = btf_enum(t);
for (i = 0, n = btf_vlen(t); i < n; i++, m++) {
err = visit(&m->name_off, ctx);
if (err)
return err;
}
break;
}
case BTF_KIND_FUNC_PROTO: {
struct btf_param *m = btf_params(t);
for (i = 0, n = btf_vlen(t); i < n; i++, m++) {
err = visit(&m->name_off, ctx);
if (err)
return err;
}
break;
}
default:
break;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42F248", "function_addr": 4387400, "binary_name": "feda8be2137e1ca53e8082ecae6cfbea19ddaf0e7963aa620ad58be1c3aa369b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+var_48], rdx"], [6, "mov rax, [rbp+var_38]"], [7, "mov rdx, [rbp+var_48]"], [8, "mov rcx, [rbp+var_40]"], [9, "mov rsi, rdx"], [10, "mov rdi, rax"], [11, "call rcx"], [12, "mov [rbp+var_24], eax"], [13, "cmp [rbp+var_24], 0"], [14, "jz short loc_42F281"], [15, "mov eax, [rbp+var_24]"], [16, "jmp locret_42F3E7"], [17, "mov rax, [rbp+var_38]"], [18, "mov rdi, rax"], [19, "call sub_427027"], [20, "movzx eax, ax"], [21, "cmp eax, 0Dh"], [22, "jz loc_42F381"], [23, "cmp eax, 0Dh"], [24, "jg loc_42F3E1"], [25, "cmp eax, 5"], [26, "jg short loc_42F2B1"], [27, "cmp eax, 4"], [28, "jge short loc_42F2BB"], [29, "jmp loc_42F3E1"], [30, "cmp eax, 6"], [31, "jz short loc_42F321"], [32, "jmp loc_42F3E1"], [33, "mov rax, [rbp+var_38]"], [34, "mov rdi, rax"], [35, "call sub_427253"], [36, "mov [rbp+var_10], rax"], [37, "mov [rbp+var_4], 0"], [38, "mov rax, [rbp+var_38]"], [39, "mov rdi, rax"], [40, "call sub_42703E"], [41, "movzx eax, ax"], [42, "mov [rbp+var_28], eax"], [43, "jmp short loc_42F314"], [44, "mov rax, [rbp+var_10]"], [45, "mov rdx, [rbp+var_48]"], [46, "mov rcx, [rbp+var_40]"], [47, "mov rsi, rdx"], [48, "mov rdi, rax"], [49, "call rcx"], [50, "mov [rbp+var_24], eax"], [51, "cmp [rbp+var_24], 0"], [52, "jz short loc_42F30B"], [53, "mov eax, [rbp+var_24]"], [54, "jmp locret_42F3E7"], [55, "add [rbp+var_4], 1"], [56, "add [rbp+var_10], 0Ch"], [57, "mov eax, [rbp+var_4]"], [58, "cmp eax, [rbp+var_28]"], [59, "jl short loc_42F2E6"], [60, "jmp loc_42F3E2"], [61, "mov rax, [rbp+var_38]"], [62, "mov rdi, rax"], [63, "call sub_427241"], [64, "mov [rbp+var_18], rax"], [65, "mov [rbp+var_4], 0"], [66, "mov rax, [rbp+var_38]"], [67, "mov rdi, rax"], [68, "call sub_42703E"], [69, "movzx eax, ax"], [70, "mov [rbp+var_28], eax"], [71, "jmp short loc_42F377"], [72, "mov rax, [rbp+var_18]"], [73, "mov rdx, [rbp+var_48]"], [74, "mov rcx, [rbp+var_40]"], [75, "mov rsi, rdx"], [76, "mov rdi, rax"], [77, "call rcx"], [78, "mov [rbp+var_24], eax"], [79, "cmp [rbp+var_24], 0"], [80, "jz short loc_42F36E"], [81, "mov eax, [rbp+var_24]"], [82, "jmp short locret_42F3E7"], [83, "add [rbp+var_4], 1"], [84, "add [rbp+var_18], 8"], [85, "mov eax, [rbp+var_4]"], [86, "cmp eax, [rbp+var_28]"], [87, "jl short loc_42F34C"], [88, "jmp short loc_42F3E2"], [89, "mov rax, [rbp+var_38]"], [90, "mov rdi, rax"], [91, "call sub_427265"], [92, "mov [rbp+var_20], rax"], [93, "mov [rbp+var_4], 0"], [94, "mov rax, [rbp+var_38]"], [95, "mov rdi, rax"], [96, "call sub_42703E"], [97, "movzx eax, ax"], [98, "mov [rbp+var_28], eax"], [99, "jmp short loc_42F3D7"], [100, "mov rax, [rbp+var_20]"], [101, "mov rdx, [rbp+var_48]"], [102, "mov rcx, [rbp+var_40]"], [103, "mov rsi, rdx"], [104, "mov rdi, rax"], [105, "call rcx"], [106, "mov [rbp+var_24], eax"], [107, "cmp [rbp+var_24], 0"], [108, "jz short loc_42F3CE"], [109, "mov eax, [rbp+var_24]"], [110, "jmp short locret_42F3E7"], [111, "add [rbp+var_4], 1"], [112, "add [rbp+var_20], 8"], [113, "mov eax, [rbp+var_4]"], [114, "cmp eax, [rbp+var_28]"], [115, "jl short loc_42F3AC"], [116, "jmp short loc_42F3E2"], [117, "nop"], [118, "mov eax, 0"], [119, "leave"], [120, "retn"]], "data_dep": [[6, 3], [7, 5], [8, 4], [9, 7], [10, 6], [11, 8], [12, 11], [13, 12], [14, 13], [15, 12], [17, 3], [18, 17], [20, 19], [21, 20], [22, 21], [23, 20], [24, 23], [25, 20], [26, 25], [27, 20], [28, 27], [30, 20], [31, 30], [33, 3], [34, 33], [36, 35], [38, 3], [39, 38], [41, 40], [42, 41], [44, 36], [44, 56], [45, 5], [46, 4], [47, 45], [48, 44], [49, 46], [50, 49], [51, 50], [52, 51], [53, 50], [55, 37], [55, 55], [56, 36], [56, 56], [57, 37], [57, 55], [58, 42], [58, 57], [59, 58], [61, 3], [62, 61], [64, 63], [66, 3], [67, 66], [69, 68], [70, 69], [72, 84], [72, 64], [73, 5], [74, 4], [75, 73], [76, 72], [77, 74], [78, 77], [79, 78], [80, 79], [81, 78], [83, 65], [83, 83], [84, 84], [84, 64], [85, 65], [85, 83], [86, 85], [86, 70], [87, 86], [89, 3], [90, 89], [92, 91], [94, 3], [95, 94], [97, 96], [98, 97], [100, 92], [100, 112], [101, 5], [102, 4], [103, 101], [104, 100], [105, 102], [106, 105], [107, 106], [108, 107], [109, 106], [111, 93], [111, 111], [112, 92], [112, 112], [113, 93], [113, 111], [114, 113], [114, 98], [115, 114], [120, 81], [120, 53], [120, 15], [120, 109], [120, 118]]}
|
static DecodeStatus DecodeModImmInstruction(MCInst *Inst, uint32_t insn,
uint64_t Addr,
void *Decoder)
{
unsigned Rd = fieldFromInstruction(insn, 0, 5);
unsigned cmode = fieldFromInstruction(insn, 12, 4);
unsigned imm = fieldFromInstruction(insn, 16, 3) << 5;
imm |= fieldFromInstruction(insn, 5, 5);
if (MCInst_getOpcode(Inst) == AArch64_MOVID)
DecodeFPR64RegisterClass(Inst, Rd, Addr, Decoder);
else
DecodeVectorRegisterClass(Inst, Rd, Addr, Decoder);
MCOperand_CreateImm0(Inst, imm);
switch (MCInst_getOpcode(Inst)) {
default:
break;
case AArch64_MOVIv4i16:
case AArch64_MOVIv8i16:
case AArch64_MVNIv4i16:
case AArch64_MVNIv8i16:
case AArch64_MOVIv2i32:
case AArch64_MOVIv4i32:
case AArch64_MVNIv2i32:
case AArch64_MVNIv4i32:
MCOperand_CreateImm0(Inst, (cmode & 6) << 2);
break;
case AArch64_MOVIv2s_msl:
case AArch64_MOVIv4s_msl:
case AArch64_MVNIv2s_msl:
case AArch64_MVNIv4s_msl:
MCOperand_CreateImm0(Inst, cmode & 1 ? 0x110 : 0x108);
break;
}
return Success;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_469090", "function_addr": 4624528, "binary_name": "23b57fe50de11e692ac0fdc29e161ccb6cbe21a200aecc695b811f04513510b2.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_30], rcx"], [7, "mov eax, [rbp+var_1C]"], [8, "mov edx, 5"], [9, "mov esi, 0"], [10, "mov edi, eax"], [11, "call sub_4517D7"], [12, "mov [rbp+var_4], eax"], [13, "mov eax, [rbp+var_1C]"], [14, "mov edx, 4"], [15, "mov esi, 0Ch"], [16, "mov edi, eax"], [17, "call sub_4517D7"], [18, "mov [rbp+var_8], eax"], [19, "mov eax, [rbp+var_1C]"], [20, "mov edx, 3"], [21, "mov esi, 10h"], [22, "mov edi, eax"], [23, "call sub_4517D7"], [24, "shl eax, 5"], [25, "mov [rbp+var_C], eax"], [26, "mov eax, [rbp+var_1C]"], [27, "mov edx, 5"], [28, "mov esi, 5"], [29, "mov edi, eax"], [30, "call sub_4517D7"], [31, "or [rbp+var_C], eax"], [32, "mov rax, [rbp+var_18]"], [33, "mov rdi, rax"], [34, "call sub_4050C9"], [35, "cmp eax, 448h"], [36, "jnz short loc_469132"], [37, "mov rcx, [rbp+var_30]"], [38, "mov rdx, [rbp+var_28]"], [39, "mov esi, [rbp+var_4]"], [40, "mov rax, [rbp+var_18]"], [41, "mov rdi, rax"], [42, "call sub_4672B6"], [43, "jmp short loc_469149"], [44, "mov rcx, [rbp+var_30]"], [45, "mov rdx, [rbp+var_28]"], [46, "mov esi, [rbp+var_4]"], [47, "mov rax, [rbp+var_18]"], [48, "mov rdi, rax"], [49, "call sub_467570"], [50, "mov edx, [rbp+var_C]"], [51, "mov rax, [rbp+var_18]"], [52, "mov rsi, rdx"], [53, "mov rdi, rax"], [54, "call sub_405338"], [55, "mov rax, [rbp+var_18]"], [56, "mov rdi, rax"], [57, "call sub_4050C9"], [58, "sub eax, 44Bh"], [59, "cmp eax, 29h"], [60, "ja short def_469191"], [61, "mov eax, eax"], [62, "lea rdx, ds:0[rax*4]"], [63, "lea rax, jpt_469191"], [64, "mov eax, ds:(jpt_469191 - 511844h)[rdx+rax]"], [65, "cdqe"], [66, "lea rdx, jpt_469191"], [67, "add rax, rdx"], [68, "jmp rax"], [69, "mov eax, [rbp+var_8]"], [70, "shl eax, 2"], [71, "mov eax, eax"], [72, "and eax, 18h"], [73, "mov rdx, rax"], [74, "mov rax, [rbp+var_18]"], [75, "mov rsi, rdx"], [76, "mov rdi, rax"], [77, "call sub_405338"], [78, "jmp short loc_4691DA"], [79, "mov eax, [rbp+var_8]"], [80, "and eax, 1"], [81, "test eax, eax"], [82, "jz short loc_4691C3"], [83, "mov edx, 110h"], [84, "jmp short loc_4691C8"], [85, "mov edx, 108h"], [86, "mov rax, [rbp+var_18]"], [87, "mov rsi, rdx"], [88, "mov rdi, rax"], [89, "call sub_405338"], [90, "jmp short loc_4691DA"], [91, "nop"], [92, "mov eax, 3"], [93, "leave"], [94, "retn"]], "data_dep": [[7, 4], [10, 7], [12, 11], [13, 4], [16, 13], [18, 17], [19, 4], [22, 19], [24, 23], [25, 24], [26, 4], [29, 26], [31, 25], [31, 30], [32, 3], [33, 32], [35, 34], [36, 35], [37, 6], [38, 5], [39, 12], [40, 3], [41, 40], [44, 6], [45, 5], [46, 12], [47, 3], [48, 47], [50, 31], [51, 3], [52, 50], [53, 51], [55, 3], [56, 55], [58, 57], [59, 58], [60, 59], [61, 58], [62, 50], [63, 61], [66, 62], [67, 64], [67, 66], [68, 67], [69, 18], [70, 69], [71, 70], [72, 71], [73, 72], [74, 3], [75, 73], [76, 74], [79, 18], [80, 79], [81, 80], [82, 81], [86, 3], [87, 83], [87, 85], [88, 86], [94, 92]]}
|
static void ZSTDv05_copy4(void* dst, const void* src) { memcpy(dst, src, 4); } | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_431843", "function_addr": 4397123, "binary_name": "a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821.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 rax, [rbp+var_10]"], [5, "mov edx, [rax]"], [6, "mov rax, [rbp+var_8]"], [7, "mov [rax], edx"], [8, "nop"], [9, "pop rbp"], [10, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 2], [7, 6], [7, 5], [9, 0], [10, 6]]}
|
int Stack_pop(Stack *stack, void *elem) {
if (stack->nelems == 0)
return 1;
stack->nelems--;
memcpy(elem, &((uint8_t *)(stack->data))[stack->nelems * stack->elem_size], stack->elem_size);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401287", "function_addr": 4199047, "binary_name": "67d5b516845f1a5189b619fa08251f200ed0c551fc567a5346241564c352debb.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+dest], rsi"], [5, "mov rax, [rbp+var_8]"], [6, "mov rax, [rax+8]"], [7, "test rax, rax"], [8, "jnz short loc_4012AB"], [9, "mov eax, 1"], [10, "jmp short locret_4012FA"], [11, "mov rax, [rbp+var_8]"], [12, "mov rax, [rax+8]"], [13, "lea rdx, [rax-1]"], [14, "mov rax, [rbp+var_8]"], [15, "mov [rax+8], rdx"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdx, [rax+10h]"], [18, "mov rax, [rbp+var_8]"], [19, "mov rsi, [rax]"], [20, "mov rax, [rbp+var_8]"], [21, "mov rcx, [rax+8]"], [22, "mov rax, [rbp+var_8]"], [23, "mov rax, [rax+10h]"], [24, "imul rax, rcx"], [25, "lea rcx, [rsi+rax]"], [26, "mov rax, [rbp+dest]"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _memcpy"], [30, "mov eax, 0"], [31, "leave"], [32, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 7], [11, 3], [12, 11], [13, 12], [14, 3], [15, 14], [15, 13], [16, 3], [17, 15], [17, 16], [18, 3], [19, 18], [19, 15], [20, 3], [21, 15], [21, 20], [22, 3], [23, 22], [23, 15], [24, 23], [24, 21], [25, 15], [25, 21], [25, 24], [26, 4], [27, 25], [28, 26], [32, 9], [32, 30]]}
|
int dm_msg_cache_deinit(void)
{
dm_msg_cache_ctx_t *ctx = _dm_msg_cache_get_ctx();
dm_msg_cache_node_t *node = NULL;
dm_msg_cache_node_t *next = NULL;
_dm_msg_cache_mutex_lock();
list_for_each_entry_safe(node, next, &ctx->dmc_list, linked_list, dm_msg_cache_node_t) {
list_del(&node->linked_list);
if (node->data) {
DM_free(node->data);
}
DM_free(node);
_dm_msg_cache_mutex_unlock();
}
_dm_msg_cache_mutex_unlock();
if (ctx->mutex) {
HAL_MutexDestroy(ctx->mutex);
}
return SUCCESS_RETURN;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "dm_msg_cache_deinit", "function_addr": 4335462, "binary_name": "9bbc9de5dd57f4f934e24f9b8a7ac1dacad3c7a25e14002cbd8d0494c83f5fb1.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "call _dm_msg_cache_get_ctx"], [4, "mov [rbp+var_18], rax"], [5, "mov [rbp+var_8], 0"], [6, "mov [rbp+var_10], 0"], [7, "call sub_4226AB"], [8, "mov rax, [rbp+var_18]"], [9, "mov rax, [rax+18h]"], [10, "sub rax, 20h "], [11, "mov [rbp+var_8], rax"], [12, "mov rax, [rbp+var_8]"], [13, "mov rax, [rax+28h]"], [14, "sub rax, 20h "], [15, "mov [rbp+var_10], rax"], [16, "jmp loc_4228B5"], [17, "mov rax, [rbp+var_8]"], [18, "add rax, 20h "], [19, "mov rdi, rax"], [20, "call sub_422645"], [21, "mov rax, [rbp+var_8]"], [22, "mov rax, [rax+10h]"], [23, "test rax, rax"], [24, "jz short loc_42283C"], [25, "mov rax, [rbp+var_8]"], [26, "mov rax, [rax+10h]"], [27, "test rax, rax"], [28, "jnz short loc_422814"], [29, "sub rsp, 8"], [30, "push offset aNodeData"], [31, "mov r9d, offset aNodeData"], [32, "mov r8d, offset aSNullLiteFreeS_7"], [33, "mov ecx, 3"], [34, "mov edx, 3Ah "], [35, "mov esi, offset aDmMsgCacheDein_0"], [36, "mov edi, offset aUtils_8"], [37, "mov eax, 0"], [38, "call LITE_syslog"], [39, "add rsp, 10h"], [40, "jmp short loc_422830"], [41, "mov rax, [rbp+var_8]"], [42, "mov rax, [rax+10h]"], [43, "mov rdi, rax"], [44, "call LITE_free_internal"], [45, "mov rax, [rbp+var_8]"], [46, "mov qword ptr [rax+10h], 0"], [47, "mov rax, [rbp+var_8]"], [48, "mov qword ptr [rax+10h], 0"], [49, "cmp [rbp+var_8], 0"], [50, "jnz short loc_42287C"], [51, "sub rsp, 8"], [52, "push offset aNode_1"], [53, "mov r9d, offset aNode_1"], [54, "mov r8d, offset aSNullLiteFreeS_7"], [55, "mov ecx, 3"], [56, "mov edx, 3Ch "], [57, "mov esi, offset aDmMsgCacheDein_0"], [58, "mov edi, offset aUtils_8"], [59, "mov eax, 0"], [60, "call LITE_syslog"], [61, "add rsp, 10h"], [62, "jmp short loc_422890"], [63, "mov rax, [rbp+var_8]"], [64, "mov rdi, rax"], [65, "call LITE_free_internal"], [66, "mov [rbp+var_8], 0"], [67, "mov [rbp+var_8], 0"], [68, "call sub_4226DA"], [69, "mov rax, [rbp+var_10]"], [70, "mov [rbp+var_8], rax"], [71, "mov rax, [rbp+var_10]"], [72, "mov rax, [rax+28h]"], [73, "sub rax, 20h "], [74, "mov [rbp+var_10], rax"], [75, "mov rax, [rbp+var_8]"], [76, "lea rdx, [rax+20h]"], [77, "mov rax, [rbp+var_18]"], [78, "add rax, 10h"], [79, "cmp rdx, rax"], [80, "jnz loc_4227B1"], [81, "call sub_4226DA"], [82, "mov rax, [rbp+var_18]"], [83, "mov rax, [rax]"], [84, "test rax, rax"], [85, "jz short loc_4228EE"], [86, "mov rax, [rbp+var_18]"], [87, "mov rax, [rax]"], [88, "mov rdi, rax"], [89, "call HAL_MutexDestroy"], [90, "mov eax, 0"], [91, "leave"], [92, "retn"]], "data_dep": [[4, 3], [8, 4], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [17, 11], [17, 70], [18, 17], [19, 18], [21, 11], [21, 70], [22, 46], [22, 21], [22, 48], [23, 22], [24, 23], [25, 11], [25, 70], [26, 25], [26, 48], [26, 46], [27, 26], [28, 27], [29, 61], [29, 39], [29, 2], [39, 29], [41, 11], [41, 70], [42, 48], [42, 41], [42, 46], [43, 42], [45, 11], [45, 70], [46, 45], [47, 11], [47, 70], [48, 47], [49, 11], [49, 70], [50, 49], [51, 2], [51, 61], [51, 39], [61, 51], [63, 70], [63, 11], [64, 63], [69, 74], [69, 15], [70, 69], [71, 15], [71, 74], [72, 46], [72, 48], [72, 71], [73, 72], [74, 73], [75, 11], [75, 70], [76, 56], [76, 46], [76, 76], [76, 48], [76, 34], [76, 75], [77, 4], [78, 77], [79, 76], [79, 78], [80, 79], [82, 4], [83, 82], [83, 48], [83, 46], [84, 83], [85, 84], [86, 4], [87, 48], [87, 86], [87, 46], [88, 87], [92, 90]]}
|
static int check64_cb(struct dl_phdr_info* info, void* data, unsigned elf_flags) {
const uint64_t v = *(const uint64_t*)data;
for (size_t i = 0; i < info->dlpi_phnum; i++) {
/* Look only in the actual binary, and not in libraries */
if (info->dlpi_name[0] != '\0') {
continue;
}
if (info->dlpi_phdr[i].p_type != PT_LOAD) {
continue;
}
if ((info->dlpi_phdr[i].p_flags & elf_flags) != elf_flags) {
continue;
}
uint64_t* start = (uint64_t*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
uint64_t* end =
(uint64_t*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr +
HF_MIN(info->dlpi_phdr[i].p_memsz, info->dlpi_phdr[i].p_filesz));
/* Assume that the 64bit value looked for is also 64bit aligned */
for (; start < end; start++) {
if (*start == v) {
return 1;
}
}
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407820", "function_addr": 4225056, "binary_name": "0dcdc633414e45d27b838a1fde0e9f4d9b83ef1ae00c4d7b391a0b48d531666e.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_30]"], [6, "mov rax, [rax]"], [7, "mov [rbp+var_18], rax"], [8, "mov [rbp+var_8], 0"], [9, "jmp loc_40798C"], [10, "mov rax, [rbp+var_28]"], [11, "mov rax, [rax+8]"], [12, "movzx eax, byte ptr [rax]"], [13, "test al, al"], [14, "jnz loc_407980"], [15, "mov rax, [rbp+var_28]"], [16, "mov rcx, [rax+10h]"], [17, "mov rdx, [rbp+var_8]"], [18, "mov rax, rdx"], [19, "shl rax, 3"], [20, "sub rax, rdx"], [21, "shl rax, 3"], [22, "add rax, rcx"], [23, "mov eax, [rax]"], [24, "cmp eax, 1"], [25, "jnz loc_407983"], [26, "mov rax, [rbp+var_28]"], [27, "mov rcx, [rax+10h]"], [28, "mov rdx, [rbp+var_8]"], [29, "mov rax, rdx"], [30, "shl rax, 3"], [31, "sub rax, rdx"], [32, "shl rax, 3"], [33, "add rax, rcx"], [34, "mov eax, [rax+4]"], [35, "and eax, [rbp+var_34]"], [36, "cmp [rbp+var_34], eax"], [37, "jnz loc_407986"], [38, "mov rax, [rbp+var_28]"], [39, "mov rcx, [rax]"], [40, "mov rax, [rbp+var_28]"], [41, "mov rsi, [rax+10h]"], [42, "mov rdx, [rbp+var_8]"], [43, "mov rax, rdx"], [44, "shl rax, 3"], [45, "sub rax, rdx"], [46, "shl rax, 3"], [47, "add rax, rsi"], [48, "mov rax, [rax+10h]"], [49, "add rax, rcx"], [50, "mov [rbp+var_10], rax"], [51, "mov rax, [rbp+var_28]"], [52, "mov rcx, [rax]"], [53, "mov rax, [rbp+var_28]"], [54, "mov rsi, [rax+10h]"], [55, "mov rdx, [rbp+var_8]"], [56, "mov rax, rdx"], [57, "shl rax, 3"], [58, "sub rax, rdx"], [59, "shl rax, 3"], [60, "add rax, rsi"], [61, "mov rax, [rax+10h]"], [62, "lea rdi, [rcx+rax]"], [63, "mov rax, [rbp+var_28]"], [64, "mov rcx, [rax+10h]"], [65, "mov rdx, [rbp+var_8]"], [66, "mov rax, rdx"], [67, "shl rax, 3"], [68, "sub rax, rdx"], [69, "shl rax, 3"], [70, "add rax, rcx"], [71, "mov rdx, [rax+20h]"], [72, "mov rax, [rbp+var_28]"], [73, "mov rsi, [rax+10h]"], [74, "mov rcx, [rbp+var_8]"], [75, "mov rax, rcx"], [76, "shl rax, 3"], [77, "sub rax, rcx"], [78, "shl rax, 3"], [79, "add rax, rsi"], [80, "mov rax, [rax+28h]"], [81, "cmp rdx, rax"], [82, "cmovbe rax, rdx"], [83, "add rax, rdi"], [84, "mov [rbp+var_20], rax"], [85, "jmp short loc_407974"], [86, "mov rax, [rbp+var_10]"], [87, "mov rax, [rax]"], [88, "cmp [rbp+var_18], rax"], [89, "jnz short loc_40796F"], [90, "mov eax, 1"], [91, "jmp short loc_4079A6"], [92, "add [rbp+var_10], 8"], [93, "mov rax, [rbp+var_10]"], [94, "cmp rax, [rbp+var_20]"], [95, "jb short loc_40795B"], [96, "jmp short loc_407987"], [97, "nop"], [98, "jmp short loc_407987"], [99, "nop"], [100, "jmp short loc_407987"], [101, "nop"], [102, "add [rbp+var_8], 1"], [103, "mov rax, [rbp+var_28]"], [104, "movzx eax, word ptr [rax+18h]"], [105, "movzx eax, ax"], [106, "cmp [rbp+var_8], rax"], [107, "jb loc_407847"], [108, "mov eax, 0"], [109, "pop rbp"], [110, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [10, 2], [11, 10], [12, 11], [13, 12], [14, 13], [15, 2], [16, 15], [17, 102], [17, 8], [18, 17], [19, 18], [20, 17], [20, 19], [21, 20], [22, 21], [22, 16], [23, 22], [24, 23], [25, 24], [26, 2], [27, 26], [28, 102], [28, 8], [29, 28], [30, 29], [31, 28], [31, 30], [32, 31], [33, 32], [33, 27], [34, 33], [35, 4], [35, 34], [36, 4], [36, 35], [37, 36], [38, 2], [39, 38], [40, 2], [41, 40], [42, 102], [42, 8], [43, 42], [44, 43], [45, 42], [45, 44], [46, 45], [47, 41], [47, 46], [48, 47], [49, 39], [49, 48], [50, 49], [51, 2], [52, 51], [53, 2], [54, 53], [55, 8], [55, 102], [56, 55], [57, 56], [58, 55], [58, 57], [59, 58], [60, 59], [60, 54], [61, 60], [62, 62], [62, 61], [63, 2], [64, 63], [65, 8], [65, 102], [66, 65], [67, 66], [68, 65], [68, 67], [69, 68], [70, 64], [70, 69], [71, 70], [72, 2], [73, 72], [74, 8], [74, 102], [75, 74], [76, 75], [77, 76], [77, 74], [78, 77], [79, 78], [79, 73], [80, 79], [81, 71], [81, 80], [82, 81], [82, 71], [83, 62], [83, 82], [84, 83], [86, 92], [86, 50], [87, 86], [88, 87], [88, 7], [89, 88], [92, 92], [92, 50], [93, 50], [93, 92], [94, 84], [94, 93], [95, 94], [102, 8], [102, 102], [103, 2], [104, 103], [105, 104], [106, 8], [106, 102], [106, 105], [107, 106], [109, 0], [110, 90], [110, 108]]}
|
static void
addConstrChildIdxDeps(DumpableObject *dobj, const IndxInfo *refidx)
{
SimplePtrListCell *cell;
Assert(dobj->objType == DO_FK_CONSTRAINT);
for (cell = refidx->partattaches.head; cell; cell = cell->next)
{
IndexAttachInfo *attach = (IndexAttachInfo *) cell->ptr;
addObjectDependency(dobj, attach->dobj.dumpId);
if (attach->partitionIdx->partattaches.head != NULL)
addConstrChildIdxDeps(dobj, attach->partitionIdx);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_414F7C", "function_addr": 4280188, "binary_name": "c554d64d8507512ec7c5460397d7e8fd60edb662d620824236cdfae536ce1f50.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_20], rsi"], [5, "mov rax, [rbp+var_20]"], [6, "mov rax, [rax+88h]"], [7, "mov [rbp+var_8], rax"], [8, "jmp short loc_414FF4"], [9, "mov rax, [rbp+var_8]"], [10, "mov rax, [rax+8]"], [11, "mov [rbp+var_10], rax"], [12, "mov rax, [rbp+var_10]"], [13, "mov edx, [rax+0Ch]"], [14, "mov rax, [rbp+var_18]"], [15, "mov esi, edx"], [16, "mov rdi, rax"], [17, "call sub_4324D6"], [18, "mov rax, [rbp+var_10]"], [19, "mov rax, [rax+48h]"], [20, "mov rax, [rax+88h]"], [21, "test rax, rax"], [22, "jz short loc_414FE9"], [23, "mov rax, [rbp+var_10]"], [24, "mov rdx, [rax+48h]"], [25, "mov rax, [rbp+var_18]"], [26, "mov rsi, rdx"], [27, "mov rdi, rax"], [28, "call sub_414F7C"], [29, "mov rax, [rbp+var_8]"], [30, "mov rax, [rax]"], [31, "mov [rbp+var_8], rax"], [32, "cmp [rbp+var_8], 0"], [33, "jnz short loc_414F9D"], [34, "nop"], [35, "nop"], [36, "leave"], [37, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [9, 7], [9, 31], [10, 9], [11, 10], [12, 11], [13, 12], [14, 3], [15, 13], [16, 14], [18, 11], [19, 18], [20, 19], [21, 20], [22, 21], [23, 11], [24, 23], [25, 3], [26, 24], [27, 25], [29, 7], [29, 31], [30, 29], [31, 30], [32, 31], [32, 7], [33, 32], [37, 6], [37, 30]]}
|
static int
zrhhdr(char *hdr)
{
register int c;
register unsigned short crc;
register int n;
if ((c = zgethex()) < 0)
return c;
Rxtype = c;
crc = updcrc(c, 0);
for (n=4; --n >= 0; ++hdr) {
if ((c = zgethex()) < 0)
return c;
crc = updcrc(c, crc);
*hdr = c;
}
if ((c = zgethex()) < 0)
return c;
crc = updcrc(c, crc);
if ((c = zgethex()) < 0)
return c;
crc = updcrc(c, crc);
if (crc & 0xFFFF) {
zperr(badcrc); return ERROR;
}
switch ( c = READLINE_PF(1)) {
case 0215:
/* **** FALL THRU TO **** */
case 015:
/* Throw away possible cr/lf */
READLINE_PF(1);
break;
}
protocol = ZM_ZMODEM;
zmodem_requested=TRUE;
return Rxtype;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B396", "function_addr": 4240278, "binary_name": "d684d0e103b0580db997ecc931a42fce8955cefc27bedc1ac56a24d435bd8eaf.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r13"], [3, "push r12"], [4, "push rbx"], [5, "sub rsp, 18h"], [6, "mov [rbp+var_28], rdi"], [7, "call sub_4099CA"], [8, "mov ebx, eax"], [9, "test ebx, ebx"], [10, "jns short loc_40B3B9"], [11, "mov eax, ebx"], [12, "jmp loc_40B55E"], [13, "mov cs:dword_415304, ebx"], [14, "movzx eax, cs:word_412340"], [15, "mov edx, eax"], [16, "mov eax, ebx"], [17, "xor eax, edx"], [18, "mov r12d, eax"], [19, "mov r13d, 4"], [20, "jmp short loc_40B41F"], [21, "call sub_4099CA"], [22, "mov ebx, eax"], [23, "test ebx, ebx"], [24, "jns short loc_40B3E9"], [25, "mov eax, ebx"], [26, "jmp loc_40B55E"], [27, "mov eax, r12d"], [28, "shr ax, 8"], [29, "movzx eax, ax"], [30, "movzx eax, al"], [31, "cdqe"], [32, "movzx eax, word_412340[rax+rax]"], [33, "mov edx, eax"], [34, "movzx eax, r12w"], [35, "shl eax, 8"], [36, "xor eax, edx"], [37, "mov edx, ebx"], [38, "xor eax, edx"], [39, "mov r12d, eax"], [40, "mov edx, ebx"], [41, "mov rax, [rbp+var_28]"], [42, "mov [rax], dl"], [43, "add [rbp+var_28], 1"], [44, "sub r13d, 1"], [45, "test r13d, r13d"], [46, "jns short loc_40B3D7"], [47, "call sub_4099CA"], [48, "mov ebx, eax"], [49, "test ebx, ebx"], [50, "jns short loc_40B43A"], [51, "mov eax, ebx"], [52, "jmp loc_40B55E"], [53, "mov eax, r12d"], [54, "shr ax, 8"], [55, "movzx eax, ax"], [56, "movzx eax, al"], [57, "cdqe"], [58, "movzx eax, word_412340[rax+rax]"], [59, "mov edx, eax"], [60, "movzx eax, r12w"], [61, "shl eax, 8"], [62, "xor eax, edx"], [63, "mov edx, ebx"], [64, "xor eax, edx"], [65, "mov r12d, eax"], [66, "call sub_4099CA"], [67, "mov ebx, eax"], [68, "test ebx, ebx"], [69, "jns short loc_40B475"], [70, "mov eax, ebx"], [71, "jmp loc_40B55E"], [72, "mov eax, r12d"], [73, "shr ax, 8"], [74, "movzx eax, ax"], [75, "movzx eax, al"], [76, "cdqe"], [77, "movzx eax, word_412340[rax+rax]"], [78, "mov edx, eax"], [79, "movzx eax, r12w"], [80, "shl eax, 8"], [81, "xor eax, edx"], [82, "mov edx, ebx"], [83, "xor eax, edx"], [84, "mov r12d, eax"], [85, "test r12w, r12w"], [86, "jz short loc_40B4BD"], [87, "mov edi, offset aBadCrc"], [88, "mov eax, 0"], [89, "call sub_40B7FC"], [90, "mov eax, 0FFFFFFFFh"], [91, "jmp loc_40B55E"], [92, "mov eax, cs:dword_415480"], [93, "sub eax, 1"], [94, "mov cs:dword_415480, eax"], [95, "mov eax, cs:dword_415480"], [96, "test eax, eax"], [97, "js short loc_40B4F3"], [98, "mov rax, cs:qword_415488"], [99, "lea rdx, [rax+1]"], [100, "mov cs:qword_415488, rdx"], [101, "movzx eax, byte ptr [rax]"], [102, "movsx eax, al"], [103, "movzx eax, al"], [104, "jmp short loc_40B4FD"], [105, "mov edi, 1"], [106, "call sub_40BAEB"], [107, "mov ebx, eax"], [108, "cmp ebx, 0Dh"], [109, "jz short loc_40B50C"], [110, "cmp ebx, 8Dh"], [111, "jnz short loc_40B544"], [112, "mov eax, cs:dword_415480"], [113, "sub eax, 1"], [114, "mov cs:dword_415480, eax"], [115, "mov eax, cs:dword_415480"], [116, "test eax, eax"], [117, "js short loc_40B539"], [118, "mov rax, cs:qword_415488"], [119, "add rax, 1"], [120, "mov cs:qword_415488, rax"], [121, "jmp short loc_40B543"], [122, "mov edi, 1"], [123, "call sub_40BAEB"], [124, "nop"], [125, "mov cs:dword_412FF4, 2"], [126, "mov cs:dword_412FFC, 1"], [127, "mov eax, cs:dword_415304"], [128, "add rsp, 18h"], [129, "pop rbx"], [130, "pop r12"], [131, "pop r13"], [132, "pop rbp"], [133, "retn"]], "data_dep": [[8, 7], [9, 8], [10, 9], [11, 9], [13, 9], [15, 14], [16, 9], [17, 16], [17, 15], [18, 17], [22, 21], [23, 22], [24, 23], [25, 23], [27, 39], [27, 18], [28, 27], [29, 28], [30, 29], [33, 32], [34, 18], [34, 39], [35, 34], [36, 33], [36, 35], [37, 23], [38, 36], [38, 37], [39, 38], [40, 23], [41, 43], [41, 6], [42, 41], [42, 40], [43, 43], [43, 6], [44, 45], [44, 19], [45, 44], [46, 45], [48, 47], [49, 48], [50, 49], [51, 49], [53, 18], [53, 39], [54, 53], [55, 54], [56, 55], [59, 58], [60, 39], [60, 18], [61, 60], [62, 59], [62, 61], [63, 49], [64, 62], [64, 63], [65, 64], [67, 66], [68, 67], [69, 68], [70, 68], [72, 65], [73, 72], [74, 73], [75, 74], [78, 77], [79, 65], [80, 79], [81, 78], [81, 80], [82, 68], [83, 82], [83, 81], [84, 83], [85, 84], [86, 85], [93, 92], [94, 93], [95, 94], [96, 95], [97, 96], [99, 42], [99, 98], [99, 82], [100, 99], [101, 42], [101, 98], [102, 101], [103, 102], [107, 106], [107, 103], [108, 107], [109, 108], [110, 107], [111, 110], [112, 94], [113, 112], [114, 113], [115, 114], [116, 115], [117, 116], [118, 100], [119, 118], [120, 119], [127, 13], [128, 5], [129, 4], [130, 3], [131, 2], [132, 0], [133, 70], [133, 127], [133, 51], [133, 90], [133, 25], [133, 11]]}
|
int pmc_send_get_action(struct pmc *pmc, int id)
{
int datalen, pdulen;
struct ptp_message *msg;
struct management_tlv *mgt;
struct tlv_extra *extra;
msg = pmc_message(pmc, GET);
if (!msg) {
return -1;
}
mgt = (struct management_tlv *) msg->management.suffix;
mgt->type = TLV_MANAGEMENT;
datalen = pmc_tlv_datalen(pmc, id);
mgt->length = 2 + datalen;
mgt->id = id;
pdulen = msg->header.messageLength + sizeof(*mgt) + datalen;
msg->header.messageLength = pdulen;
extra = tlv_extra_alloc();
if (!extra) {
pr_err("failed to allocate TLV descriptor");
msg_put(msg);
return -ENOMEM;
}
extra->tlv = (struct TLV *) msg->management.suffix;
msg_tlv_attach(msg, extra);
if (id == TLV_CLOCK_DESCRIPTION && !pmc->zero_length_gets) {
/*
* Make sure the tlv_extra pointers dereferenced in
* mgt_pre_send() do point to something.
*/
struct mgmt_clock_description *cd = &extra->cd;
uint8_t *buf = mgt->data;
cd->clockType = (UInteger16 *) buf;
buf += sizeof(*cd->clockType);
cd->physicalLayerProtocol = (struct PTPText *) buf;
buf += sizeof(struct PTPText) + cd->physicalLayerProtocol->length;
cd->physicalAddress = (struct PhysicalAddress *) buf;
buf += sizeof(struct PhysicalAddress) + 0;
cd->protocolAddress = (struct PortAddress *) buf;
}
pmc_send(pmc, msg);
msg_put(msg);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A479", "function_addr": 4236409, "binary_name": "b881a36ac1042d08a153dc6d79e8af7857537b515a74f12df247ec16fc2fe0b7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_3C], esi"], [5, "mov rax, [rbp+var_38]"], [6, "mov esi, 0"], [7, "mov rdi, rax"], [8, "call sub_40A19E"], [9, "mov [rbp+var_8], rax"], [10, "cmp [rbp+var_8], 0"], [11, "jnz short loc_40A4AE"], [12, "mov eax, 0FFFFFFFFh"], [13, "jmp locret_40A60E"], [14, "mov rax, [rbp+var_8]"], [15, "add rax, 30h "], [16, "mov [rbp+var_10], rax"], [17, "mov rax, [rbp+var_10]"], [18, "mov word ptr [rax], 1"], [19, "mov edx, [rbp+var_3C]"], [20, "mov rax, [rbp+var_38]"], [21, "mov esi, edx"], [22, "mov rdi, rax"], [23, "call sub_40A303"], [24, "mov [rbp+var_14], eax"], [25, "mov eax, [rbp+var_14]"], [26, "lea edx, [rax+2]"], [27, "mov rax, [rbp+var_10]"], [28, "mov [rax+2], dx"], [29, "mov eax, [rbp+var_3C]"], [30, "mov edx, eax"], [31, "mov rax, [rbp+var_10]"], [32, "mov [rax+4], dx"], [33, "mov rax, [rbp+var_8]"], [34, "movzx eax, word ptr [rax+2]"], [35, "movzx edx, ax"], [36, "mov eax, [rbp+var_14]"], [37, "add eax, edx"], [38, "add eax, 6"], [39, "mov [rbp+var_18], eax"], [40, "mov eax, [rbp+var_18]"], [41, "mov edx, eax"], [42, "mov rax, [rbp+var_8]"], [43, "mov [rax+2], dx"], [44, "call sub_410BC5"], [45, "mov [rbp+var_20], rax"], [46, "cmp [rbp+var_20], 0"], [47, "jnz short loc_40A54F"], [48, "mov esi, offset aFailedToAlloca_2"], [49, "mov edi, 3"], [50, "mov eax, 0"], [51, "call sub_40B47F"], [52, "mov rax, [rbp+var_8]"], [53, "mov rdi, rax"], [54, "call sub_4092A7"], [55, "mov eax, 0FFFFFFF4h"], [56, "jmp locret_40A60E"], [57, "mov rax, [rbp+var_8]"], [58, "lea rdx, [rax+30h]"], [59, "mov rax, [rbp+var_20]"], [60, "mov [rax+10h], rdx"], [61, "mov rdx, [rbp+var_20]"], [62, "mov rax, [rbp+var_8]"], [63, "mov rsi, rdx"], [64, "mov rdi, rax"], [65, "call sub_409155"], [66, "cmp [rbp+var_3C], 1"], [67, "jnz short loc_40A5EA"], [68, "mov rax, [rbp+var_38]"], [69, "mov eax, [rax+5Ch]"], [70, "test eax, eax"], [71, "jnz short loc_40A5EA"], [72, "mov rax, [rbp+var_20]"], [73, "add rax, 18h"], [74, "mov [rbp+var_28], rax"], [75, "mov rax, [rbp+var_10]"], [76, "add rax, 6"], [77, "mov [rbp+var_30], rax"], [78, "mov rax, [rbp+var_28]"], [79, "mov rdx, [rbp+var_30]"], [80, "mov [rax], rdx"], [81, "add [rbp+var_30], 2"], [82, "mov rax, [rbp+var_28]"], [83, "mov rdx, [rbp+var_30]"], [84, "mov [rax+8], rdx"], [85, "mov rax, [rbp+var_28]"], [86, "mov rax, [rax+8]"], [87, "movzx eax, byte ptr [rax]"], [88, "movzx eax, al"], [89, "add rax, 1"], [90, "add [rbp+var_30], rax"], [91, "mov rax, [rbp+var_28]"], [92, "mov rdx, [rbp+var_30]"], [93, "mov [rax+10h], rdx"], [94, "add [rbp+var_30], 2"], [95, "mov rax, [rbp+var_28]"], [96, "mov rdx, [rbp+var_30]"], [97, "mov [rax+18h], rdx"], [98, "mov rdx, [rbp+var_8]"], [99, "mov rax, [rbp+var_38]"], [100, "mov rsi, rdx"], [101, "mov rdi, rax"], [102, "call sub_40A29D"], [103, "mov rax, [rbp+var_8]"], [104, "mov rdi, rax"], [105, "call sub_4092A7"], [106, "mov eax, 0"], [107, "leave"], [108, "retn"]], "data_dep": [[5, 3], [7, 5], [9, 8], [10, 9], [11, 10], [14, 9], [15, 14], [16, 15], [17, 16], [18, 17], [19, 4], [20, 3], [21, 19], [22, 20], [24, 23], [25, 24], [26, 25], [26, 18], [26, 19], [27, 16], [28, 27], [28, 26], [29, 4], [30, 29], [31, 16], [32, 30], [32, 31], [33, 9], [34, 28], [34, 32], [34, 33], [35, 34], [36, 24], [37, 35], [37, 36], [38, 37], [39, 38], [40, 39], [41, 40], [42, 9], [43, 41], [43, 42], [45, 44], [46, 45], [47, 46], [52, 9], [53, 52], [57, 9], [58, 28], [58, 60], [58, 32], [58, 18], [58, 57], [58, 41], [58, 43], [59, 45], [60, 59], [60, 58], [61, 45], [62, 9], [63, 61], [64, 62], [66, 4], [67, 66], [68, 3], [69, 60], [69, 28], [69, 32], [69, 18], [69, 68], [69, 43], [70, 69], [71, 70], [72, 45], [73, 72], [74, 73], [75, 16], [76, 75], [77, 76], [78, 74], [79, 77], [80, 78], [80, 79], [81, 77], [82, 74], [83, 81], [84, 83], [84, 82], [85, 74], [86, 85], [86, 84], [87, 80], [87, 84], [87, 86], [88, 87], [89, 88], [90, 81], [90, 89], [91, 74], [92, 90], [93, 92], [93, 91], [94, 90], [95, 74], [96, 94], [97, 95], [97, 96], [98, 9], [99, 3], [100, 98], [101, 99], [103, 9], [104, 103], [108, 106], [108, 12], [108, 55]]}
|
static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn,
struct basic_block *bb, unsigned long generation, struct pseudo_list **dominators,
int local)
{
struct basic_block *parent;
FOR_EACH_PTR(bb->parents, parent) {
struct instruction *one;
struct instruction *br;
pseudo_t phi;
FOR_EACH_PTR_REVERSE(parent->insns, one) {
int dominance;
if (!one->bb)
continue;
if (one == insn)
goto no_dominance;
dominance = dominates(pseudo, insn, one, local);
if (dominance < 0) {
if (one->opcode == OP_LOAD)
continue;
return 0;
}
if (!dominance)
continue;
goto found_dominator;
} END_FOR_EACH_PTR_REVERSE(one);
no_dominance:
if (parent->generation == generation)
continue;
parent->generation = generation;
if (!find_dominating_parents(pseudo, insn, parent, generation, dominators, local))
return 0;
continue;
found_dominator:
br = delete_last_instruction(&parent->insns);
phi = alloc_phi(parent, one->target, one->type);
phi->ident = phi->ident ? : one->target->ident;
add_instruction(&parent->insns, br);
use_pseudo(insn, phi, add_pseudo(dominators, phi));
} END_FOR_EACH_PTR(parent);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4449C3", "function_addr": 4475331, "binary_name": "3ab645463ad13ea30c238ceac9bf56691ea8cada0b7c92413fecc09c2d081d33.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+var_68], 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_8C], r9d"], [9, "mov rax, [rbp+var_78]"], [10, "mov rax, [rax+20h]"], [11, "mov [rbp+var_28], rax"], [12, "mov rax, [rbp+var_28]"], [13, "mov [rbp+var_8], rax"], [14, "cmp [rbp+var_28], 0"], [15, "jz loc_444C67"], [16, "mov [rbp+var_C], 0"], [17, "jmp loc_444C38"], [18, "mov rax, [rbp+var_8]"], [19, "mov edx, [rbp+var_C]"], [20, "movsxd rdx, edx"], [21, "add rdx, 2"], [22, "mov rax, [rax+rdx*8+8]"], [23, "mov [rbp+var_30], rax"], [24, "mov rax, [rbp+var_8]"], [25, "movzx eax, byte ptr [rax+1]"], [26, "test al, al"], [27, "jz short loc_444A45"], [28, "cmp [rbp+var_30], 0"], [29, "jz loc_444C2D"], [30, "mov rax, [rbp+var_30]"], [31, "mov rax, [rax+30h]"], [32, "mov [rbp+var_38], rax"], [33, "mov rax, [rbp+var_38]"], [34, "mov [rbp+var_18], rax"], [35, "mov rax, [rbp+var_30]"], [36, "mov rax, [rax+30h]"], [37, "test rax, rax"], [38, "jz loc_444B2F"], [39, "mov rax, [rbp+var_18]"], [40, "mov rax, [rax+8]"], [41, "mov [rbp+var_18], rax"], [42, "mov rax, [rbp+var_18]"], [43, "movzx eax, byte ptr [rax]"], [44, "movsx eax, al"], [45, "mov [rbp+var_1C], eax"], [46, "jmp loc_444B11"], [47, "mov rax, [rbp+var_18]"], [48, "mov edx, [rbp+var_1C]"], [49, "movsxd rdx, edx"], [50, "add rdx, 2"], [51, "mov rax, [rax+rdx*8+8]"], [52, "mov [rbp+var_40], rax"], [53, "mov rax, [rbp+var_18]"], [54, "movzx eax, byte ptr [rax+1]"], [55, "test al, al"], [56, "jz short loc_444AB4"], [57, "cmp [rbp+var_40], 0"], [58, "jnz short loc_444AB4"], [59, "jmp short loc_444B11"], [60, "mov rax, [rbp+var_40]"], [61, "mov rax, [rax+8]"], [62, "test rax, rax"], [63, "jnz short loc_444AC3"], [64, "jmp short loc_444B11"], [65, "mov rax, [rbp+var_40]"], [66, "cmp rax, [rbp+var_70]"], [67, "jz short loc_444B32"], [68, "mov ecx, [rbp+var_8C]"], [69, "mov rdx, [rbp+var_40]"], [70, "mov rsi, [rbp+var_70]"], [71, "mov rax, [rbp+var_68]"], [72, "mov rdi, rax"], [73, "call sub_43E435"], [74, "mov [rbp+var_44], eax"], [75, "cmp [rbp+var_44], 0"], [76, "jns short loc_444B0A"], [77, "mov rax, [rbp+var_40]"], [78, "movzx eax, byte ptr [rax]"], [79, "and eax, 7Fh"], [80, "cmp al, 43h "], [81, "jnz short loc_444B00"], [82, "jmp short loc_444B11"], [83, "mov eax, 0"], [84, "jmp locret_444C6D"], [85, "cmp [rbp+var_44], 0"], [86, "jnz short loc_444B8F"], [87, "nop"], [88, "sub [rbp+var_1C], 1"], [89, "cmp [rbp+var_1C], 0"], [90, "jns loc_444A88"], [91, "mov rax, [rbp+var_18]"], [92, "cmp rax, [rbp+var_38]"], [93, "jnz loc_444A6A"], [94, "jmp short loc_444B33"], [95, "nop"], [96, "jmp short loc_444B33"], [97, "nop"], [98, "mov rax, [rbp+var_30]"], [99, "mov rax, [rax+8]"], [100, "cmp [rbp+var_80], rax"], [101, "jz loc_444C30"], [102, "mov rax, [rbp+var_30]"], [103, "mov rdx, [rbp+var_80]"], [104, "mov [rax+8], rdx"], [105, "mov r8d, [rbp+var_8C]"], [106, "mov rdi, [rbp+var_88]"], [107, "mov rcx, [rbp+var_80]"], [108, "mov rdx, [rbp+var_30]"], [109, "mov rsi, [rbp+var_70]"], [110, "mov rax, [rbp+var_68]"], [111, "mov r9d, r8d"], [112, "mov r8, rdi"], [113, "mov rdi, rax"], [114, "call sub_4449C3"], [115, "test eax, eax"], [116, "jnz loc_444C33"], [117, "mov eax, 0"], [118, "jmp locret_444C6D"], [119, "nop"], [120, "mov rax, [rbp+var_30]"], [121, "add rax, 30h "], [122, "mov rdi, rax"], [123, "call sub_44480A"], [124, "mov [rbp+var_50], rax"], [125, "mov rax, [rbp+var_40]"], [126, "mov rdx, [rax+18h]"], [127, "mov rax, [rbp+var_40]"], [128, "mov rcx, [rax+20h]"], [129, "mov rax, [rbp+var_30]"], [130, "mov rsi, rcx"], [131, "mov rdi, rax"], [132, "call sub_40BE1E"], [133, "mov [rbp+var_58], rax"], [134, "mov rax, [rbp+var_58]"], [135, "mov rax, [rax+10h]"], [136, "test rax, rax"], [137, "jnz short loc_444BE0"], [138, "mov rax, [rbp+var_40]"], [139, "mov rax, [rax+20h]"], [140, "mov rax, [rax+10h]"], [141, "mov rdx, [rbp+var_58]"], [142, "mov [rdx+10h], rax"], [143, "mov rax, [rbp+var_30]"], [144, "lea rdx, [rax+30h]"], [145, "mov rax, [rbp+var_50]"], [146, "mov rsi, rax"], [147, "mov rdi, rdx"], [148, "call sub_444824"], [149, "mov rdx, [rbp+var_58]"], [150, "mov rax, [rbp+var_88]"], [151, "mov rsi, rdx"], [152, "mov rdi, rax"], [153, "call sub_444852"], [154, "mov rdx, rax"], [155, "mov rcx, [rbp+var_58]"], [156, "mov rax, [rbp+var_70]"], [157, "mov rsi, rcx"], [158, "mov rdi, rax"], [159, "call sub_444928"], [160, "jmp short loc_444C34"], [161, "nop"], [162, "jmp short loc_444C34"], [163, "nop"], [164, "jmp short loc_444C34"], [165, "nop"], [166, "add [rbp+var_C], 1"], [167, "mov rax, [rbp+var_8]"], [168, "movzx eax, byte ptr [rax]"], [169, "movsx eax, al"], [170, "cmp [rbp+var_C], eax"], [171, "jl loc_444A17"], [172, "mov rax, [rbp+var_8]"], [173, "mov rax, [rax+10h]"], [174, "mov [rbp+var_8], rax"], [175, "mov rax, [rbp+var_8]"], [176, "cmp rax, [rbp+var_28]"], [177, "jnz loc_444A0B"], [178, "jmp short loc_444C68"], [179, "nop"], [180, "mov eax, 1"], [181, "leave"], [182, "retn"]], "data_dep": [[9, 5], [10, 9], [11, 10], [12, 11], [13, 12], [14, 11], [15, 14], [18, 174], [18, 13], [19, 166], [19, 16], [20, 19], [21, 20], [22, 142], [22, 18], [22, 104], [23, 22], [24, 174], [24, 13], [25, 104], [25, 24], [25, 142], [26, 25], [27, 26], [28, 23], [29, 28], [30, 23], [31, 104], [31, 30], [31, 142], [32, 31], [33, 32], [34, 33], [35, 23], [36, 104], [36, 35], [36, 142], [37, 36], [38, 37], [39, 41], [39, 34], [40, 104], [40, 142], [40, 39], [41, 40], [42, 41], [43, 142], [43, 104], [43, 42], [44, 43], [45, 44], [47, 41], [48, 88], [49, 48], [50, 49], [51, 47], [51, 104], [51, 142], [52, 51], [53, 41], [54, 104], [54, 142], [54, 53], [55, 54], [56, 55], [57, 52], [58, 57], [60, 52], [61, 104], [61, 60], [61, 142], [62, 61], [63, 62], [65, 52], [66, 4], [66, 65], [67, 66], [68, 8], [69, 52], [70, 4], [71, 3], [72, 71], [74, 73], [75, 74], [76, 75], [77, 52], [78, 77], [78, 104], [78, 142], [79, 78], [80, 79], [81, 80], [85, 74], [86, 85], [88, 45], [88, 88], [89, 88], [90, 89], [91, 41], [92, 32], [92, 91], [93, 92], [98, 23], [99, 104], [99, 142], [99, 98], [100, 6], [100, 99], [101, 100], [102, 23], [103, 6], [104, 102], [104, 103], [105, 8], [106, 7], [107, 6], [108, 23], [109, 4], [110, 3], [111, 105], [112, 106], [113, 110], [115, 114], [116, 115], [120, 23], [121, 120], [122, 121], [124, 123], [125, 52], [126, 142], [126, 125], [126, 104], [127, 52], [128, 142], [128, 127], [128, 104], [129, 23], [130, 128], [131, 129], [133, 132], [134, 133], [135, 104], [135, 142], [135, 134], [136, 135], [137, 136], [138, 52], [139, 142], [139, 138], [139, 104], [140, 139], [140, 104], [140, 142], [141, 133], [142, 141], [142, 136], [142, 140], [143, 23], [144, 141], [144, 143], [144, 142], [145, 124], [146, 145], [147, 144], [149, 133], [150, 7], [151, 149], [152, 150], [154, 153], [155, 133], [156, 4], [157, 155], [158, 156], [166, 16], [166, 166], [167, 13], [167, 174], [168, 104], [168, 142], [168, 167], [169, 168], [170, 169], [170, 16], [170, 166], [171, 170], [172, 13], [172, 174], [173, 104], [173, 142], [173, 172], [174, 173], [175, 174], [176, 11], [176, 175], [177, 176], [182, 83], [182, 117], [182, 180]]}
|
void
display_icon (
ICON_ENTRY * icon
)
{
int bit;
int display_width;
const char * indent = " ";
int index;
int max_index;
int x;
int y;
/*
0x20, 0x60, 0xC0, 0xFF, 0xFF, 0xC0, 0x60, 0x20, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00
**
**
**
**
**
** ** **
******
****
**
*/
printf ("/*\r\n");
printf (" %s [%d, %d]\r\n", icon->name, icon->width, icon->height);
printf ("\r\n");
if (DRAW_OUTLINE) {
if (icon->width > 9) {
printf ("%s ", indent);
for (x = 1; x <= icon->width; x++)
printf ("%c", (x % 10) ? ' ' : ('0' + (x / 10)));
printf ("\r\n");
}
printf ("%s ", indent);
for (x = 1; x <= icon->width; x++)
printf ("%d", x % 10);
printf ("\r\n");
printf ("%s .", indent);
for (x = 0; x < icon->width; x++)
printf ("-");
printf (".\r\n");
}
for (y = 0; y < icon->height; y++) {
printf ("%s", indent);
if (DRAW_OUTLINE)
printf ("0x%02x|", 1 << (y & 7));
for (x = 0; x < icon->width; x++) {
bit = icon->data[((y >> 3) * icon->bytes_wide) + x];
bit >>= y & 7;
printf ("%c", (bit & 1) ? '*' : ' ');
}
if (DRAW_OUTLINE)
printf ("|");
printf ("\r\n");
}
if (DRAW_OUTLINE) {
printf ("%s '", indent);
for (x = 0; x < icon->width; x++)
printf ("-");
printf ("'\r\n");
}
printf ("*/\r\n");
printf ("\r\n");
// Display the symbols if requested
if (DISPLAY_VARIABLES) {
if (icon->height_name)
printf ("const int %s = %d;\r\n", icon->height_name, icon->height);
if (icon->width_name)
printf ("const int %s = %d;\r\n", icon->width_name, icon->width);
printf ("const uint8_t %s [] = {", icon->name);
display_width = icon->bytes_wide;
if (WRAP_AT_16 || (display_width > 20))
display_width = 16;
max_index = icon->bytes_high * icon->bytes_wide;
for (index = 0; index < max_index; index++) {
if ((index % display_width) == 0)
printf ("\r\n ");
if (USE_UPPERCASE_A)
printf (" 0x%02X", icon->data[index]);
else
printf (" 0x%02x", icon->data[index]);
if (index != (max_index - 1))
printf (",");
}
if (ADD_TRAILING_COMMA)
printf (",");
printf ("\r\n");
printf ("};\r\n");
printf ("\r\n");
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40195B", "function_addr": 4200795, "binary_name": "d4df84ecafb323f6f0a346a3a103c7075467f09b9b7969f8c20d2b007e407a6c.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_18], offset asc_402044"], [5, "mov edi, offset s"], [6, "call _puts"], [7, "mov rax, [rbp+var_28]"], [8, "mov ecx, [rax+10h]"], [9, "mov rax, [rbp+var_28]"], [10, "mov edx, [rax+20h]"], [11, "mov rax, [rbp+var_28]"], [12, "mov rax, [rax+8]"], [13, "mov rsi, rax"], [14, "mov edi, offset format"], [15, "mov eax, 0"], [16, "call _printf"], [17, "mov edi, offset asc_402063"], [18, "call _puts"], [19, "mov rax, [rbp+var_28]"], [20, "mov eax, [rax+20h]"], [21, "cmp eax, 9"], [22, "jle loc_401A50"], [23, "mov rax, [rbp+var_18]"], [24, "mov rsi, rax"], [25, "mov edi, offset aS"], [26, "mov eax, 0"], [27, "call _printf"], [28, "mov [rbp+var_C], 1"], [29, "jmp short loc_401A3A"], [30, "mov ecx, [rbp+var_C]"], [31, "movsxd rax, ecx"], [32, "imul rax, 66666667h"], [33, "shr rax, 20h"], [34, "sar eax, 2"], [35, "mov esi, ecx"], [36, "sar esi, 1Fh"], [37, "sub eax, esi"], [38, "mov edx, eax"], [39, "mov eax, edx"], [40, "shl eax, 2"], [41, "add eax, edx"], [42, "add eax, eax"], [43, "sub ecx, eax"], [44, "mov edx, ecx"], [45, "test edx, edx"], [46, "jnz short loc_401A2A"], [47, "mov eax, [rbp+var_C]"], [48, "movsxd rdx, eax"], [49, "imul rdx, 66666667h"], [50, "shr rdx, 20h"], [51, "sar edx, 2"], [52, "sar eax, 1Fh"], [53, "mov ecx, eax"], [54, "mov eax, edx"], [55, "sub eax, ecx"], [56, "add eax, 30h "], [57, "jmp short loc_401A2F"], [58, "mov eax, 20h "], [59, "mov edi, eax"], [60, "call _putchar"], [61, "add [rbp+var_C], 1"], [62, "mov rax, [rbp+var_28]"], [63, "mov eax, [rax+20h]"], [64, "cmp [rbp+var_C], eax"], [65, "jle short loc_4019DA"], [66, "mov edi, offset asc_402063"], [67, "call _puts"], [68, "mov rax, [rbp+var_18]"], [69, "mov rsi, rax"], [70, "mov edi, offset aS"], [71, "mov eax, 0"], [72, "call _printf"], [73, "mov [rbp+var_C], 1"], [74, "jmp short loc_401AAE"], [75, "mov ecx, [rbp+var_C]"], [76, "movsxd rax, ecx"], [77, "imul rax, 66666667h"], [78, "shr rax, 20h"], [79, "sar eax, 2"], [80, "mov esi, ecx"], [81, "sar esi, 1Fh"], [82, "sub eax, esi"], [83, "mov edx, eax"], [84, "mov eax, edx"], [85, "shl eax, 2"], [86, "add eax, edx"], [87, "add eax, eax"], [88, "sub ecx, eax"], [89, "mov edx, ecx"], [90, "mov esi, edx"], [91, "mov edi, offset aD"], [92, "mov eax, 0"], [93, "call _printf"], [94, "add [rbp+var_C], 1"], [95, "mov rax, [rbp+var_28]"], [96, "mov eax, [rax+20h]"], [97, "cmp [rbp+var_C], eax"], [98, "jle short loc_401A6F"], [99, "mov edi, offset asc_402063"], [100, "call _puts"], [101, "mov rax, [rbp+var_18]"], [102, "mov rsi, rax"], [103, "mov edi, offset aS_0"], [104, "mov eax, 0"], [105, "call _printf"], [106, "mov [rbp+var_C], 0"], [107, "jmp short loc_401AF1"], [108, "mov edi, 2Dh "], [109, "call _putchar"], [110, "add [rbp+var_C], 1"], [111, "mov rax, [rbp+var_28]"], [112, "mov eax, [rax+20h]"], [113, "cmp [rbp+var_C], eax"], [114, "jl short loc_401AE3"], [115, "mov edi, offset asc_402075"], [116, "call _puts"], [117, "mov [rbp+var_10], 0"], [118, "jmp loc_401BCC"], [119, "mov rax, [rbp+var_18]"], [120, "mov rsi, rax"], [121, "mov edi, offset aS_1"], [122, "mov eax, 0"], [123, "call _printf"], [124, "mov eax, [rbp+var_10]"], [125, "and eax, 7"], [126, "mov edx, 1"], [127, "mov ecx, eax"], [128, "shl edx, cl"], [129, "mov eax, edx"], [130, "mov esi, eax"], [131, "mov edi, offset a0x02x"], [132, "mov eax, 0"], [133, "call _printf"], [134, "mov [rbp+var_C], 0"], [135, "jmp short loc_401BA8"], [136, "mov eax, [rbp+var_10]"], [137, "sar eax, 3"], [138, "mov edx, eax"], [139, "mov rax, [rbp+var_28]"], [140, "mov eax, [rax+34h]"], [141, "imul edx, eax"], [142, "mov eax, [rbp+var_C]"], [143, "add eax, edx"], [144, "mov rdx, [rbp+var_28]"], [145, "cdqe"], [146, "movzx eax, byte ptr [rdx+rax+38h]"], [147, "movzx eax, al"], [148, "mov [rbp+var_20], eax"], [149, "mov eax, [rbp+var_10]"], [150, "and eax, 7"], [151, "mov ecx, eax"], [152, "sar [rbp+var_20], cl"], [153, "mov eax, [rbp+var_20]"], [154, "and eax, 1"], [155, "test eax, eax"], [156, "jz short loc_401B98"], [157, "mov eax, 2Ah "], [158, "jmp short loc_401B9D"], [159, "mov eax, 20h "], [160, "mov edi, eax"], [161, "call _putchar"], [162, "add [rbp+var_C], 1"], [163, "mov rax, [rbp+var_28]"], [164, "mov eax, [rax+20h]"], [165, "cmp [rbp+var_C], eax"], [166, "jl short loc_401B54"], [167, "mov edi, 7Ch "], [168, "call _putchar"], [169, "mov edi, offset asc_402063"], [170, "call _puts"], [171, "add [rbp+var_10], 1"], [172, "mov rax, [rbp+var_28]"], [173, "mov eax, [rax+10h]"], [174, "cmp [rbp+var_10], eax"], [175, "jl loc_401B13"], [176, "mov rax, [rbp+var_18]"], [177, "mov rsi, rax"], [178, "mov edi, offset aS_2"], [179, "mov eax, 0"], [180, "call _printf"], [181, "mov [rbp+var_C], 0"], [182, "jmp short loc_401C09"], [183, "mov edi, 2Dh "], [184, "call _putchar"], [185, "add [rbp+var_C], 1"], [186, "mov rax, [rbp+var_28]"], [187, "mov eax, [rax+20h]"], [188, "cmp [rbp+var_C], eax"], [189, "jl short loc_401BFB"], [190, "mov edi, offset asc_40208B"], [191, "call _puts"], [192, "mov edi, offset asc_40208E"], [193, "call _puts"], [194, "mov edi, offset asc_402063"], [195, "call _puts"], [196, "mov rax, [rbp+var_28]"], [197, "mov rax, [rax+18h]"], [198, "test rax, rax"], [199, "jz short loc_401C61"], [200, "mov rax, [rbp+var_28]"], [201, "mov edx, [rax+10h]"], [202, "mov rax, [rbp+var_28]"], [203, "mov rax, [rax+18h]"], [204, "mov rsi, rax"], [205, "mov edi, offset aConstIntSD"], [206, "mov eax, 0"], [207, "call _printf"], [208, "mov rax, [rbp+var_28]"], [209, "mov rax, [rax+28h]"], [210, "test rax, rax"], [211, "jz short loc_401C8F"], [212, "mov rax, [rbp+var_28]"], [213, "mov edx, [rax+20h]"], [214, "mov rax, [rbp+var_28]"], [215, "mov rax, [rax+28h]"], [216, "mov rsi, rax"], [217, "mov edi, offset aConstIntSD"], [218, "mov eax, 0"], [219, "call _printf"], [220, "mov rax, [rbp+var_28]"], [221, "mov rax, [rax+8]"], [222, "mov rsi, rax"], [223, "mov edi, offset aConstUint8TS"], [224, "mov eax, 0"], [225, "call _printf"], [226, "mov rax, [rbp+var_28]"], [227, "mov eax, [rax+34h]"], [228, "mov [rbp+var_4], eax"], [229, "cmp [rbp+var_4], 14h"], [230, "jle short loc_401CC0"], [231, "mov [rbp+var_4], 10h"], [232, "mov rax, [rbp+var_28]"], [233, "mov edx, [rax+30h]"], [234, "mov rax, [rbp+var_28]"], [235, "mov eax, [rax+34h]"], [236, "imul eax, edx"], [237, "mov [rbp+var_1C], eax"], [238, "mov [rbp+var_8], 0"], [239, "jmp short loc_401D34"], [240, "mov eax, [rbp+var_8]"], [241, "cdq"], [242, "idiv [rbp+var_4]"], [243, "mov eax, edx"], [244, "test eax, eax"], [245, "jnz short loc_401CF9"], [246, "mov edi, offset asc_4020BF"], [247, "mov eax, 0"], [248, "call _printf"], [249, "mov rdx, [rbp+var_28]"], [250, "mov eax, [rbp+var_8]"], [251, "cdqe"], [252, "movzx eax, byte ptr [rdx+rax+38h]"], [253, "movzx eax, al"], [254, "mov esi, eax"], [255, "mov edi, offset a0x02x_0"], [256, "mov eax, 0"], [257, "call _printf"], [258, "mov eax, [rbp+var_1C]"], [259, "sub eax, 1"], [260, "cmp [rbp+var_8], eax"], [261, "jz short loc_401D30"], [262, "mov edi, 2Ch "], [263, "call _putchar"], [264, "add [rbp+var_8], 1"], [265, "mov eax, [rbp+var_8]"], [266, "cmp eax, [rbp+var_1C]"], [267, "jl short loc_401CDD"], [268, "mov edi, offset asc_402063"], [269, "call _puts"], [270, "mov edi, offset asc_4020CB"], [271, "call _puts"], [272, "mov edi, offset asc_402063"], [273, "call _puts"], [274, "nop"], [275, "leave"], [276, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 3], [10, 9], [11, 3], [12, 11], [13, 12], [19, 3], [20, 19], [21, 20], [22, 21], [23, 4], [24, 23], [30, 61], [30, 28], [31, 30], [32, 31], [33, 32], [34, 33], [35, 30], [36, 35], [37, 34], [37, 36], [38, 37], [39, 38], [40, 39], [41, 40], [41, 38], [42, 41], [43, 30], [43, 42], [44, 43], [45, 44], [46, 45], [47, 61], [47, 28], [48, 47], [49, 48], [50, 49], [51, 50], [52, 47], [53, 52], [54, 51], [55, 54], [55, 53], [56, 55], [59, 56], [59, 58], [61, 61], [61, 28], [62, 3], [63, 62], [64, 61], [64, 63], [64, 28], [65, 64], [68, 4], [69, 68], [75, 94], [75, 73], [76, 75], [77, 76], [78, 77], [79, 78], [80, 75], [81, 80], [82, 79], [82, 81], [83, 82], [84, 83], [85, 84], [86, 83], [86, 85], [87, 86], [88, 87], [88, 75], [89, 88], [90, 89], [94, 94], [94, 73], [95, 3], [96, 95], [97, 94], [97, 96], [97, 73], [98, 97], [101, 4], [102, 101], [110, 106], [110, 110], [111, 3], [112, 111], [113, 110], [113, 112], [113, 106], [114, 113], [119, 4], [120, 119], [124, 117], [124, 171], [125, 124], [127, 125], [128, 126], [128, 127], [129, 128], [130, 129], [136, 171], [136, 117], [137, 136], [138, 137], [139, 3], [140, 139], [141, 138], [141, 140], [142, 162], [142, 134], [143, 142], [143, 141], [144, 3], [146, 143], [147, 146], [148, 147], [149, 171], [149, 117], [150, 149], [151, 150], [152, 151], [152, 148], [153, 152], [154, 153], [155, 154], [156, 155], [160, 157], [160, 159], [162, 162], [162, 134], [163, 3], [164, 163], [165, 162], [165, 164], [165, 134], [166, 165], [171, 117], [171, 171], [172, 3], [173, 172], [174, 171], [174, 173], [174, 117], [175, 174], [176, 4], [177, 176], [185, 181], [185, 185], [186, 3], [187, 186], [188, 187], [188, 181], [188, 185], [189, 188], [196, 3], [197, 196], [198, 197], [199, 198], [200, 3], [201, 200], [202, 3], [203, 202], [204, 203], [208, 3], [209, 208], [210, 209], [211, 210], [212, 3], [213, 212], [214, 3], [215, 214], [216, 215], [220, 3], [221, 220], [222, 221], [226, 3], [227, 226], [228, 227], [229, 228], [230, 229], [232, 3], [233, 232], [234, 3], [235, 234], [236, 233], [236, 235], [237, 236], [240, 264], [240, 238], [242, 231], [242, 242], [242, 228], [243, 249], [243, 233], [244, 243], [245, 244], [249, 3], [250, 264], [250, 238], [252, 250], [253, 252], [254, 253], [258, 237], [259, 258], [260, 238], [260, 264], [260, 259], [261, 260], [264, 264], [264, 238], [265, 264], [265, 238], [266, 265], [266, 237], [267, 266], [276, 273]]}
|
void filtering_candidates_buffered_kmer_filter_retrieve_region(
filtering_candidates_buffered_t* const filtering_candidates_buffered,
filtering_candidates_t* const filtering_candidates,
filtering_region_t* const filtering_region,
pattern_t* const pattern,
gpu_buffer_kmer_filter_t* const gpu_buffer_kmer_filter,
uint64_t* const gpu_buffer_offset) {
// Parameters
alignment_t* const alignment = &filtering_region->alignment;
pattern_tiled_t* const pattern_tiled = &pattern->pattern_tiled;
const uint64_t max_error = pattern->max_effective_filtering_error;
// Detect trimmed matches
if (!pattern_tiled->kmer_filter_nway.enabled){
alignment->distance_min_bound = ALIGN_DISTANCE_UNKNOWN;
vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*);
PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED);
return;
}
if (filtering_region->key_trimmed || pattern->key_length < FILTERING_CANDIDATES_KMER_FILTER_MIN_KEY_LENGTH) {
alignment->distance_min_bound = ALIGN_DISTANCE_UNKNOWN;
vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*);
PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED);
return;
}
// Detect exact-matches
if (filtering_region->alignment.distance_min_bound == 0) {
vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*);
PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED);
return;
}
// Retrieve min-bound
uint64_t min_distance_bound;
if (gpu_buffer_kmer_filter->kmer_filter_enabled) {
min_distance_bound = gpu_buffer_kmer_filter_get_min_edit_bound(
gpu_buffer_kmer_filter,*gpu_buffer_offset,
pattern_tiled->kmer_filter_nway.num_tiles);
*gpu_buffer_offset += pattern_tiled->kmer_filter_nway.num_tiles;
// DEBUG
#ifdef GPU_CHECK_KMER_FILTER
const uint64_t min_distance_bound_check =
filtering_candidates_buffered_kmer_filter_compute_alignment(
filtering_candidates,filtering_region,pattern);
if (min_distance_bound_check != min_distance_bound) {
fprintf(stderr,"GPU.Kmer-Filter. Difference detected (CPU=%lu;GPU=%lu)\n",
min_distance_bound_check,min_distance_bound);
}
#endif
} else {
min_distance_bound = 0; // Unknown
// filtering_candidates_buffered_kmer_filter_compute_alignment(
// filtering_candidates,filtering_region,pattern);
}
if (min_distance_bound <= max_error) {
alignment->distance_min_bound = ALIGN_DISTANCE_UNKNOWN;
vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*);
PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED);
} else {
// Discarded candidate
filtering_region->status = filtering_region_verified_discarded;
alignment->distance_min_bound = ALIGN_DISTANCE_INF;
// Add to discarded candidates (buffered)
const uint64_t num_discarded_regions = filtering_candidates_buffered->num_discarded_regions;
filtering_candidates_buffered->discarded_regions[num_discarded_regions] = filtering_region;
++(filtering_candidates_buffered->num_discarded_regions);
PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_DISCARDED);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42695B", "function_addr": 4352347, "binary_name": "2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+var_48], rdx"], [6, "mov [rbp+var_50], rcx"], [7, "mov [rbp+var_58], r8"], [8, "mov [rbp+var_60], r9"], [9, "mov rax, [rbp+var_48]"], [10, "add rax, 0B0h"], [11, "mov [rbp+var_10], rax"], [12, "mov rax, [rbp+var_50]"], [13, "add rax, 68h "], [14, "mov [rbp+var_18], rax"], [15, "mov rax, [rbp+var_50]"], [16, "mov rax, [rax+50h]"], [17, "mov [rbp+var_20], rax"], [18, "mov rax, [rbp+var_18]"], [19, "movzx eax, byte ptr [rax+70h]"], [20, "xor eax, 1"], [21, "test al, al"], [22, "jz short loc_426A23"], [23, "mov rax, [rbp+var_10]"], [24, "mov esi, 0FFFFFFFEh"], [25, "mov [rax+8], rsi"], [26, "mov rax, [rbp+var_40]"], [27, "mov rax, [rax+18h]"], [28, "mov rax, [rax+8]"], [29, "lea rcx, [rax+1]"], [30, "mov rax, [rbp+var_40]"], [31, "mov rax, [rax+18h]"], [32, "mov edx, 0"], [33, "mov rsi, rcx"], [34, "mov rdi, rax"], [35, "call sub_47D500"], [36, "mov rax, [rbp+var_40]"], [37, "mov rax, [rax+18h]"], [38, "mov rdx, [rax]"], [39, "mov rax, [rbp+var_40]"], [40, "mov rax, [rax+18h]"], [41, "mov rax, [rax+8]"], [42, "shl rax, 3"], [43, "add rdx, rax"], [44, "mov rax, [rbp+var_48]"], [45, "mov [rdx], rax"], [46, "mov rax, [rbp+var_40]"], [47, "mov rax, [rax+18h]"], [48, "mov rdx, [rax+8]"], [49, "add rdx, 1"], [50, "mov [rax+8], rdx"], [51, "jmp locret_426C4F"], [52, "mov rax, [rbp+var_48]"], [53, "movzx eax, byte ptr [rax+0A8h]"], [54, "test al, al"], [55, "jnz short loc_426A42"], [56, "mov rax, [rbp+var_50]"], [57, "mov rax, [rax+10h]"], [58, "cmp rax, 3D08Fh"], [59, "ja short loc_426AB5"], [60, "mov rax, [rbp+var_10]"], [61, "mov edi, 0FFFFFFFEh"], [62, "mov [rax+8], rdi"], [63, "mov rax, [rbp+var_40]"], [64, "mov rax, [rax+18h]"], [65, "mov rax, [rax+8]"], [66, "lea rcx, [rax+1]"], [67, "mov rax, [rbp+var_40]"], [68, "mov rax, [rax+18h]"], [69, "mov edx, 0"], [70, "mov rsi, rcx"], [71, "mov rdi, rax"], [72, "call sub_47D500"], [73, "mov rax, [rbp+var_40]"], [74, "mov rax, [rax+18h]"], [75, "mov rdx, [rax]"], [76, "mov rax, [rbp+var_40]"], [77, "mov rax, [rax+18h]"], [78, "mov rax, [rax+8]"], [79, "shl rax, 3"], [80, "add rdx, rax"], [81, "mov rax, [rbp+var_48]"], [82, "mov [rdx], rax"], [83, "mov rax, [rbp+var_40]"], [84, "mov rax, [rax+18h]"], [85, "mov rdx, [rax+8]"], [86, "add rdx, 1"], [87, "mov [rax+8], rdx"], [88, "jmp locret_426C4F"], [89, "mov rax, [rbp+var_48]"], [90, "mov rax, [rax+0B8h]"], [91, "test rax, rax"], [92, "jnz short loc_426B2B"], [93, "mov rax, [rbp+var_40]"], [94, "mov rax, [rax+18h]"], [95, "mov rax, [rax+8]"], [96, "lea rcx, [rax+1]"], [97, "mov rax, [rbp+var_40]"], [98, "mov rax, [rax+18h]"], [99, "mov edx, 0"], [100, "mov rsi, rcx"], [101, "mov rdi, rax"], [102, "call sub_47D500"], [103, "mov rax, [rbp+var_40]"], [104, "mov rax, [rax+18h]"], [105, "mov rdx, [rax]"], [106, "mov rax, [rbp+var_40]"], [107, "mov rax, [rax+18h]"], [108, "mov rax, [rax+8]"], [109, "shl rax, 3"], [110, "add rdx, rax"], [111, "mov rax, [rbp+var_48]"], [112, "mov [rdx], rax"], [113, "mov rax, [rbp+var_40]"], [114, "mov rax, [rax+18h]"], [115, "mov rdx, [rax+8]"], [116, "add rdx, 1"], [117, "mov [rax+8], rdx"], [118, "jmp locret_426C4F"], [119, "mov rax, [rbp+var_58]"], [120, "movzx eax, byte ptr [rax+8]"], [121, "test al, al"], [122, "jz short loc_426B7C"], [123, "mov rax, [rbp+var_18]"], [124, "mov rdx, [rax+0A8h]"], [125, "mov rax, [rbp+var_60]"], [126, "mov rcx, [rax]"], [127, "mov rax, [rbp+var_58]"], [128, "mov rsi, rcx"], [129, "mov rdi, rax"], [130, "call sub_4320A2"], [131, "mov [rbp+var_8], rax"], [132, "mov rax, [rbp+var_60]"], [133, "mov rdx, [rax]"], [134, "mov rax, [rbp+var_18]"], [135, "mov rax, [rax+0A8h]"], [136, "add rdx, rax"], [137, "mov rax, [rbp+var_60]"], [138, "mov [rax], rdx"], [139, "jmp short loc_426B84"], [140, "mov [rbp+var_8], 0"], [141, "mov rax, [rbp+var_8]"], [142, "cmp rax, [rbp+var_20]"], [143, "ja short loc_426BFE"], [144, "mov rax, [rbp+var_10]"], [145, "mov esi, 0FFFFFFFEh"], [146, "mov [rax+8], rsi"], [147, "mov rax, [rbp+var_40]"], [148, "mov rax, [rax+18h]"], [149, "mov rax, [rax+8]"], [150, "lea rcx, [rax+1]"], [151, "mov rax, [rbp+var_40]"], [152, "mov rax, [rax+18h]"], [153, "mov edx, 0"], [154, "mov rsi, rcx"], [155, "mov rdi, rax"], [156, "call sub_47D500"], [157, "mov rax, [rbp+var_40]"], [158, "mov rax, [rax+18h]"], [159, "mov rdx, [rax]"], [160, "mov rax, [rbp+var_40]"], [161, "mov rax, [rax+18h]"], [162, "mov rax, [rax+8]"], [163, "shl rax, 3"], [164, "add rdx, rax"], [165, "mov rax, [rbp+var_48]"], [166, "mov [rdx], rax"], [167, "mov rax, [rbp+var_40]"], [168, "mov rax, [rax+18h]"], [169, "mov rdx, [rax+8]"], [170, "add rdx, 1"], [171, "mov [rax+8], rdx"], [172, "jmp short locret_426C4F"], [173, "mov rax, [rbp+var_48]"], [174, "mov dword ptr [rax], 2"], [175, "mov rax, [rbp+var_10]"], [176, "mov edi, 0FFFFFFFFh"], [177, "mov [rax+8], rdi"], [178, "mov rax, [rbp+var_38]"], [179, "mov rax, [rax+30h]"], [180, "mov [rbp+var_28], rax"], [181, "mov rax, [rbp+var_38]"], [182, "mov rdx, [rax+28h]"], [183, "mov rax, [rbp+var_28]"], [184, "shl rax, 3"], [185, "add rdx, rax"], [186, "mov rax, [rbp+var_48]"], [187, "mov [rdx], rax"], [188, "mov rax, [rbp+var_38]"], [189, "mov rax, [rax+30h]"], [190, "lea rdx, [rax+1]"], [191, "mov rax, [rbp+var_38]"], [192, "mov [rax+30h], rdx"], [193, "leave"], [194, "retn"]], "data_dep": [[9, 5], [10, 9], [11, 10], [12, 6], [13, 12], [14, 13], [15, 6], [16, 15], [17, 16], [18, 14], [19, 18], [20, 19], [21, 20], [22, 21], [23, 11], [25, 23], [25, 24], [26, 4], [27, 26], [27, 25], [28, 25], [28, 27], [29, 28], [29, 25], [30, 4], [31, 30], [31, 25], [33, 29], [34, 31], [36, 4], [37, 25], [37, 36], [38, 25], [38, 37], [39, 4], [40, 25], [40, 39], [41, 40], [41, 25], [42, 41], [43, 38], [43, 42], [44, 5], [45, 43], [45, 44], [46, 4], [47, 45], [47, 46], [48, 45], [48, 47], [48, 25], [49, 48], [50, 47], [50, 49], [52, 5], [53, 52], [54, 53], [55, 54], [56, 6], [57, 56], [58, 57], [59, 58], [60, 11], [62, 60], [62, 61], [63, 4], [64, 62], [64, 63], [65, 62], [65, 64], [66, 62], [66, 65], [67, 4], [68, 67], [68, 62], [70, 66], [71, 68], [73, 4], [74, 73], [74, 62], [75, 74], [75, 62], [76, 4], [77, 62], [77, 76], [78, 77], [78, 62], [79, 78], [80, 75], [80, 79], [81, 5], [82, 81], [82, 80], [83, 4], [84, 83], [84, 82], [85, 82], [85, 84], [85, 62], [86, 85], [87, 84], [87, 86], [89, 5], [90, 89], [91, 90], [92, 91], [93, 4], [94, 93], [95, 94], [96, 95], [97, 4], [98, 97], [100, 96], [101, 98], [103, 4], [104, 103], [105, 104], [106, 4], [107, 106], [108, 107], [109, 108], [110, 109], [110, 105], [111, 5], [112, 111], [112, 110], [113, 4], [114, 113], [114, 112], [115, 112], [115, 114], [116, 115], [117, 114], [117, 116], [119, 7], [120, 119], [121, 120], [122, 121], [123, 14], [124, 123], [125, 8], [126, 125], [127, 7], [128, 126], [129, 127], [133, 132], [135, 134], [136, 135], [136, 133], [138, 137], [138, 136], [141, 131], [141, 140], [142, 141], [142, 17], [143, 142], [144, 11], [146, 145], [146, 144], [147, 4], [148, 147], [148, 146], [149, 146], [149, 148], [150, 149], [150, 146], [151, 4], [152, 151], [152, 146], [154, 150], [155, 152], [157, 4], [158, 146], [158, 157], [159, 146], [159, 138], [159, 158], [160, 4], [161, 160], [161, 146], [162, 161], [162, 146], [163, 162], [164, 159], [164, 163], [165, 5], [166, 165], [166, 164], [167, 4], [168, 166], [168, 167], [169, 146], [169, 166], [169, 168], [170, 169], [171, 168], [171, 170], [173, 5], [174, 173], [175, 11], [177, 176], [177, 175], [178, 3], [179, 178], [179, 177], [180, 179], [181, 3], [182, 177], [182, 181], [183, 180], [184, 183], [185, 182], [185, 184], [186, 5], [187, 185], [187, 186], [188, 3], [189, 188], [189, 187], [190, 185], [190, 187], [190, 189], [191, 3], [192, 190], [192, 191], [194, 114], [194, 84], [194, 168], [194, 191], [194, 47]]}
|
long snum(int size)
{
register int i;
register long x;
pc += size;
x = getc(dvifp);
if (x & 0x80)
x -= 0x100;
for (i = size - 1; i > 0; i--)
x = (x << 8) + (unsigned) getc(dvifp);
return x;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402248", "function_addr": 4203080, "binary_name": "f8643e6b5b09093b12ae8fad3c4cdbf0b6ef786af63fd564d389e89ab3be0270.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_14], edi"], [6, "mov eax, [rbp+var_14]"], [7, "movsxd rdx, eax"], [8, "mov rax, cs:qword_406108"], [9, "add rax, rdx"], [10, "mov cs:qword_406108, rax"], [11, "mov rax, cs:stream"], [12, "mov rdi, rax"], [13, "call _getc"], [14, "movsxd rbx, eax"], [15, "mov rax, rbx"], [16, "and eax, 80h"], [17, "test rax, rax"], [18, "jz short loc_402293"], [19, "sub rbx, 100h"], [20, "mov eax, [rbp+var_14]"], [21, "lea r12d, [rax-1]"], [22, "jmp short loc_4022B8"], [23, "shl rbx, 8"], [24, "mov rax, cs:stream"], [25, "mov rdi, rax"], [26, "call _getc"], [27, "mov eax, eax"], [28, "add rbx, rax"], [29, "sub r12d, 1"], [30, "test r12d, r12d"], [31, "jg short loc_40229C"], [32, "mov rax, rbx"], [33, "add rsp, 10h"], [34, "pop rbx"], [35, "pop r12"], [36, "pop rbp"], [37, "retn"]], "data_dep": [[6, 5], [7, 6], [9, 8], [9, 7], [10, 9], [12, 11], [14, 13], [15, 14], [16, 15], [17, 16], [18, 17], [19, 14], [20, 5], [21, 20], [23, 19], [23, 28], [23, 14], [25, 24], [27, 26], [28, 27], [28, 23], [29, 30], [30, 21], [30, 29], [31, 30], [32, 14], [32, 19], [32, 28], [33, 4], [34, 3], [35, 2], [36, 0], [37, 32]]}
|
static uint16_t handle_read_request2(att_connection_t * att_connection, uint8_t * response_buffer, uint16_t response_buffer_size, uint16_t handle){
log_info("ATT_READ_REQUEST: handle %04x", handle);
uint8_t request_type = ATT_READ_REQUEST;
att_iterator_t it;
int ok = att_find_handle(&it, handle);
if (!ok){
return setup_error_invalid_handle(response_buffer, request_type, handle);
}
// check if handle can be read
if ((it.flags & ATT_PROPERTY_READ) == 0) {
return setup_error_read_not_permitted(response_buffer, request_type, handle);
}
// check security requirements
uint8_t error_code = att_validate_security(att_connection, ATT_READ, &it);
if (error_code) {
return setup_error(response_buffer, request_type, handle, error_code);
}
att_update_value_len(&it, att_connection->con_handle);
#ifdef ENABLE_ATT_DELAYED_RESPONSE
if (it.value_len == ATT_READ_RESPONSE_PENDING) return ATT_READ_RESPONSE_PENDING;
#endif
// store
uint16_t offset = 1;
uint16_t bytes_copied = att_copy_value(&it, 0, response_buffer + offset, response_buffer_size - offset, att_connection->con_handle);
offset += bytes_copied;
response_buffer[0] = ATT_READ_RESPONSE;
return offset;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_437374", "function_addr": 4420468, "binary_name": "32e5bef9a534f6a023b94f0e20e0c28fed442ec28edeb1e289ac97b9496f472a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_48], rdi"], [4, "mov [rbp+var_50], rsi"], [5, "mov eax, ecx"], [6, "mov [rbp+var_54], dx"], [7, "mov [rbp+var_58], ax"], [8, "movzx eax, [rbp+var_58]"], [9, "mov r8d, eax"], [10, "mov ecx, 293h"], [11, "mov edx, offset aAttDbC"], [12, "mov esi, offset aSUAttReadReque"], [13, "mov edi, 1"], [14, "mov eax, 0"], [15, "call sub_41A13D"], [16, "mov [rbp+var_1], 0Ah"], [17, "movzx edx, [rbp+var_58]"], [18, "lea rax, [rbp+var_40]"], [19, "mov esi, edx"], [20, "mov rdi, rax"], [21, "call sub_43627A"], [22, "mov [rbp+var_8], eax"], [23, "cmp [rbp+var_8], 0"], [24, "jnz short loc_4373ED"], [25, "movzx edx, [rbp+var_58]"], [26, "movzx ecx, [rbp+var_1]"], [27, "mov rax, [rbp+var_50]"], [28, "mov esi, ecx"], [29, "mov rdi, rax"], [30, "call sub_43679D"], [31, "jmp locret_4374CD"], [32, "movzx eax, [rbp+var_36]"], [33, "movzx eax, ax"], [34, "and eax, 2"], [35, "test eax, eax"], [36, "jnz short loc_437416"], [37, "movzx edx, [rbp+var_58]"], [38, "movzx ecx, [rbp+var_1]"], [39, "mov rax, [rbp+var_50]"], [40, "mov esi, ecx"], [41, "mov rdi, rax"], [42, "call sub_4366FE"], [43, "jmp locret_4374CD"], [44, "lea rdx, [rbp+var_40]"], [45, "mov rax, [rbp+var_48]"], [46, "mov esi, 0"], [47, "mov rdi, rax"], [48, "call sub_436835"], [49, "mov [rbp+var_9], al"], [50, "cmp [rbp+var_9], 0"], [51, "jz short loc_43744E"], [52, "movzx ecx, [rbp+var_9]"], [53, "movzx edx, [rbp+var_58]"], [54, "movzx esi, [rbp+var_1]"], [55, "mov rax, [rbp+var_50]"], [56, "mov rdi, rax"], [57, "call sub_4366A0"], [58, "jmp short locret_4374CD"], [59, "mov rax, [rbp+var_48]"], [60, "movzx eax, word ptr [rax]"], [61, "movzx edx, ax"], [62, "lea rax, [rbp+var_40]"], [63, "mov esi, edx"], [64, "mov rdi, rax"], [65, "call sub_43633C"], [66, "movzx eax, [rbp+var_28]"], [67, "cmp ax, 0FFFFh"], [68, "jnz short loc_437477"], [69, "mov eax, 0FFFFFFFFh"], [70, "jmp short locret_4374CD"], [71, "mov [rbp+var_C], 1"], [72, "mov rax, [rbp+var_48]"], [73, "movzx eax, word ptr [rax]"], [74, "movzx ecx, ax"], [75, "movzx eax, [rbp+var_54]"], [76, "sub ax, [rbp+var_C]"], [77, "movzx edx, ax"], [78, "movzx esi, [rbp+var_C]"], [79, "mov rax, [rbp+var_50]"], [80, "add rsi, rax"], [81, "lea rax, [rbp+var_40]"], [82, "mov r8d, ecx"], [83, "mov ecx, edx"], [84, "mov rdx, rsi"], [85, "mov esi, 0"], [86, "mov rdi, rax"], [87, "call sub_43639A"], [88, "mov [rbp+var_E], ax"], [89, "movzx eax, [rbp+var_E]"], [90, "add [rbp+var_C], ax"], [91, "mov rax, [rbp+var_50]"], [92, "mov byte ptr [rax], 0Bh"], [93, "movzx eax, [rbp+var_C]"], [94, "leave"], [95, "retn"]], "data_dep": [[7, 5], [8, 7], [9, 8], [17, 7], [18, 15], [19, 17], [20, 18], [22, 21], [23, 22], [24, 23], [25, 7], [26, 16], [27, 4], [28, 26], [29, 27], [33, 32], [34, 33], [35, 34], [36, 35], [37, 7], [38, 16], [39, 4], [40, 38], [41, 39], [44, 17], [45, 3], [47, 45], [49, 48], [50, 49], [51, 50], [52, 49], [53, 7], [54, 16], [55, 4], [56, 55], [59, 3], [60, 59], [61, 60], [62, 60], [63, 61], [64, 62], [67, 66], [68, 67], [72, 3], [73, 72], [74, 73], [75, 6], [76, 75], [76, 71], [77, 76], [78, 71], [79, 4], [80, 79], [80, 78], [81, 79], [82, 74], [83, 77], [84, 80], [86, 81], [88, 87], [89, 88], [90, 71], [90, 89], [91, 4], [92, 91], [93, 90], [95, 69], [95, 57], [95, 93], [95, 30], [95, 42]]}
|
static void btstack_tlv_posix_append_tag(btstack_tlv_posix_t * self, uint32_t tag, const uint8_t * data, uint32_t data_size){
if (!self->file) return;
log_info("append tag %04x, len %u", tag, data_size);
uint8_t header[8];
big_endian_store_32(header, 0, tag);
big_endian_store_32(header, 4, data_size);
size_t written_header = fwrite(header, 1, sizeof(header), self->file);
if (written_header != sizeof(header)) return;
if (data_size > 0) {
size_t written_value = fwrite(data, 1, data_size, self->file);
if (written_value != data_size) return;
}
fflush(self->file);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403068", "function_addr": 4206696, "binary_name": "c0fe0b1d115c9a9d40b2c9859f7dfd1ea6098b73116e2548a49a45e30fbdd252.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov dword ptr [rbp+n+4], esi"], [5, "mov [rbp+var_38], rdx"], [6, "mov dword ptr [rbp+n], ecx"], [7, "mov rax, [rbp+var_28]"], [8, "mov rax, [rax+10h]"], [9, "test rax, rax"], [10, "jnz short loc_403095"], [11, "mov eax, 1"], [12, "jmp locret_403165"], [13, "mov edx, dword ptr [rbp+n]"], [14, "mov eax, dword ptr [rbp+n+4]"], [15, "mov r9d, edx"], [16, "mov r8d, eax"], [17, "mov ecx, 4Ah "], [18, "mov edx, offset aBtstackTlvPosi"], [19, "mov esi, offset aSUAppendTag04x"], [20, "mov edi, 1"], [21, "mov eax, 0"], [22, "call sub_4122DA"], [23, "mov edx, dword ptr [rbp+n+4]"], [24, "lea rax, [rbp+ptr]"], [25, "mov esi, 0"], [26, "mov rdi, rax"], [27, "call sub_40845A"], [28, "mov edx, dword ptr [rbp+n]"], [29, "lea rax, [rbp+ptr]"], [30, "mov esi, 4"], [31, "mov rdi, rax"], [32, "call sub_40845A"], [33, "mov rax, [rbp+var_28]"], [34, "mov rdx, [rax+10h]"], [35, "lea rax, [rbp+ptr]"], [36, "mov rcx, rdx"], [37, "mov edx, 8"], [38, "mov esi, 1"], [39, "mov rdi, rax"], [40, "call _fwrite"], [41, "mov [rbp+var_8], rax"], [42, "cmp [rbp+var_8], 8"], [43, "jz short loc_40311A"], [44, "mov eax, 1"], [45, "jmp short locret_403165"], [46, "cmp dword ptr [rbp+n], 0"], [47, "jz short loc_403150"], [48, "mov rax, [rbp+var_28]"], [49, "mov rcx, [rax+10h]"], [50, "mov edx, dword ptr [rbp+n]"], [51, "mov rax, [rbp+var_38]"], [52, "mov esi, 1"], [53, "mov rdi, rax"], [54, "call _fwrite"], [55, "mov [rbp+var_10], rax"], [56, "mov eax, dword ptr [rbp+n]"], [57, "cmp [rbp+var_10], rax"], [58, "jz short loc_403150"], [59, "mov eax, 1"], [60, "jmp short locret_403165"], [61, "mov rax, [rbp+var_28]"], [62, "mov rax, [rax+10h]"], [63, "mov rdi, rax"], [64, "call _fflush"], [65, "mov eax, 1"], [66, "leave"], [67, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 8], [10, 9], [13, 6], [14, 4], [15, 13], [16, 14], [23, 4], [24, 22], [26, 24], [28, 6], [29, 27], [31, 29], [33, 3], [34, 33], [35, 33], [36, 34], [39, 35], [41, 40], [42, 41], [43, 42], [46, 6], [47, 46], [48, 3], [49, 48], [50, 6], [51, 5], [53, 51], [55, 54], [56, 6], [57, 56], [57, 55], [58, 57], [61, 3], [62, 61], [63, 62], [67, 65], [67, 59], [67, 11], [67, 44]]}
|
uint8_t gba_check_sram_flash (void) {
uint16_t currAddr = 0x0000;
uint16_t zeroTotal = 0;
hasFlashSave = NOT_CHECKED;
// Special check for certain games
if (strncmp(gameTitle, "CHUCHU ROCKE", 12) == 0 || strncmp(gameTitle, "CHUCHUROCKET", 12) == 0) { // Chu-Chu Rocket!
return SRAM_FLASH_512KBIT;
}
// Pre-read SRAM/Flash (if the cart has an EEPROM, sometimes D0-D7 come back with random data in the first 64 bytes read)
set_number(currAddr, SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
com_read_bytes(READ_BUFFER, 64);
com_read_stop();
// Test if SRAM is present, read 32 sections of RAM (64 bytes each)
for (uint8_t x = 0; x < 32; x++) {
set_number(currAddr, SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
com_read_bytes(READ_BUFFER, 64);
com_read_stop();
// Check for 0x00 byte
for (uint8_t c = 0; c < 64; c++) {
if (readBuffer[c] == 0) {
zeroTotal++;
}
}
currAddr += 0x400;
// Progress
if (x % 10 == 0) {
printf(".");
}
}
if (zeroTotal >= 2000) { // Looks like no SRAM or Flash present, lets do a more thorough check
// Set start and end address
currAddr = 0x0000;
endAddr = 32768;
set_number(currAddr, SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
zeroTotal = 0;
// Read data
while (currAddr < endAddr) {
com_read_bytes(READ_BUFFER, 64);
currAddr += 64;
// Check for 0x00 byte
for (uint8_t c = 0; c < 64; c++) {
if (readBuffer[c] == 0) {
zeroTotal++;
}
}
// Request 64 bytes more
if (currAddr < endAddr) {
com_read_cont();
}
}
com_read_stop();
if (zeroTotal == 32768) {
return 0;
}
}
// Calculate size by checking different addresses (Test 256Kbit or 512Kbit)
uint16_t duplicateCount = 0;
char firstBuffer[65];
char secondBuffer[65];
for (uint8_t x = 0; x < 32; x++) {
set_number((uint32_t) (x * 0x400), SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
com_read_bytes(READ_BUFFER, 64);
memcpy(&firstBuffer, readBuffer, 64);
com_read_stop();
set_number((uint32_t) (x * 0x400) + 0x8000, SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
com_read_bytes(READ_BUFFER, 64);
memcpy(&secondBuffer, readBuffer, 64);
com_read_stop();
// Compare
for (uint8_t x = 0; x < 64; x++) {
if (firstBuffer[x] == secondBuffer[x]) {
duplicateCount++;
}
}
// Progress
if (x % 10 == 0) {
printf(".");
}
}
if (duplicateCount >= 2000) {
return SRAM_FLASH_256KBIT;
}
// Check if it's SRAM or Flash at this stage, maximum for SRAM is 512Kbit
printf("\n");
hasFlashSave = gba_test_sram_flash_write();
if (hasFlashSave == NO_FLASH) {
return SRAM_FLASH_512KBIT;
}
// Test 512Kbit or 1Mbit Flash, read first 64 bytes on bank 0 then bank 1 and compare
else {
duplicateCount = 0;
printf("Testing for 512Kbit or 1Mbit Flash... ");
for (uint8_t x = 0; x < 32; x++) {
// Read bank 0
set_number((uint32_t) (x * 0x400), SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
com_read_bytes(READ_BUFFER, 64);
memcpy(&firstBuffer, readBuffer, 64);
com_read_stop();
// Read bank 1
set_number(1, GBA_FLASH_SET_BANK); // Set bank 1
set_number((uint32_t) (x * 0x400), SET_START_ADDRESS);
set_mode(GBA_READ_SRAM);
com_read_bytes(READ_BUFFER, 64);
memcpy(&secondBuffer, readBuffer, 64);
com_read_stop();
set_number(0, GBA_FLASH_SET_BANK); // Set back to bank 0
// Compare
for (uint8_t x = 0; x < 64; x++) {
if (firstBuffer[x] == secondBuffer[x]) {
duplicateCount++;
}
}
}
// If bank 0 and 1 are duplicated, then it's 512Kbit Flash
if (duplicateCount >= 2000) {
printf("512Kbit\n");
return SRAM_FLASH_512KBIT;
}
else {
printf("1Mbit\n");
return SRAM_FLASH_1MBIT;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402E02", "function_addr": 4206082, "binary_name": "19d5318b349f2d5485888470c0f50eb4432edaf30b2bf3df0a433de4edc90d52.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+var_2], 0"], [4, "mov [rbp+var_4], 0"], [5, "mov cs:dword_408688, 0"], [6, "mov edx, 0Ch"], [7, "mov esi, offset s2"], [8, "mov edi, offset s1"], [9, "call _strncmp"], [10, "test eax, eax"], [11, "jz short loc_402E53"], [12, "mov edx, 0Ch"], [13, "mov esi, offset aChuchurocket"], [14, "mov edi, offset s1"], [15, "call _strncmp"], [16, "test eax, eax"], [17, "jnz short loc_402E5D"], [18, "mov eax, 2"], [19, "jmp locret_4032C7"], [20, "movzx eax, [rbp+var_2]"], [21, "mov esi, 41h "], [22, "mov edi, eax"], [23, "call sub_401EF9"], [24, "mov edi, 6Dh "], [25, "call sub_401EAE"], [26, "mov esi, 40h "], [27, "mov edi, 0"], [28, "call sub_401D36"], [29, "call sub_401C1D"], [30, "mov [rbp+var_5], 0"], [31, "jmp loc_402F44"], [32, "movzx eax, [rbp+var_2]"], [33, "mov esi, 41h "], [34, "mov edi, eax"], [35, "call sub_401EF9"], [36, "mov edi, 6Dh "], [37, "call sub_401EAE"], [38, "mov esi, 40h "], [39, "mov edi, 0"], [40, "call sub_401D36"], [41, "call sub_401C1D"], [42, "mov [rbp+var_6], 0"], [43, "jmp short loc_402EEE"], [44, "movzx eax, [rbp+var_6]"], [45, "cdqe"], [46, "movzx eax, byte ptr ds:qword_408420[rax]"], [47, "test al, al"], [48, "jnz short loc_402EE4"], [49, "movzx eax, [rbp+var_4]"], [50, "add eax, 1"], [51, "mov [rbp+var_4], ax"], [52, "movzx eax, [rbp+var_6]"], [53, "add eax, 1"], [54, "mov [rbp+var_6], al"], [55, "cmp [rbp+var_6], 3Fh "], [56, "jbe short loc_402EC8"], [57, "add [rbp+var_2], 400h"], [58, "movzx ecx, [rbp+var_5]"], [59, "movzx edx, cl"], [60, "mov eax, edx"], [61, "shl eax, 2"], [62, "add eax, edx"], [63, "shl eax, 3"], [64, "add eax, edx"], [65, "lea edx, ds:0[rax*4]"], [66, "add eax, edx"], [67, "shr ax, 8"], [68, "mov edx, eax"], [69, "shr dl, 3"], [70, "mov eax, edx"], [71, "shl eax, 2"], [72, "add eax, edx"], [73, "add eax, eax"], [74, "sub ecx, eax"], [75, "mov edx, ecx"], [76, "test dl, dl"], [77, "jnz short loc_402F3A"], [78, "mov edi, 2Eh "], [79, "call _putchar"], [80, "movzx eax, [rbp+var_5]"], [81, "add eax, 1"], [82, "mov [rbp+var_5], al"], [83, "cmp [rbp+var_5], 1Fh"], [84, "jbe loc_402E94"], [85, "cmp [rbp+var_4], 7CFh"], [86, "jbe loc_40300A"], [87, "mov [rbp+var_2], 0"], [88, "mov cs:dword_408168, 8000h"], [89, "movzx eax, [rbp+var_2]"], [90, "mov esi, 41h "], [91, "mov edi, eax"], [92, "call sub_401EF9"], [93, "mov edi, 6Dh "], [94, "call sub_401EAE"], [95, "mov [rbp+var_4], 0"], [96, "jmp short loc_402FE5"], [97, "mov esi, 40h "], [98, "mov edi, 0"], [99, "call sub_401D36"], [100, "add [rbp+var_2], 40h "], [101, "mov [rbp+var_7], 0"], [102, "jmp short loc_402FCC"], [103, "movzx eax, [rbp+var_7]"], [104, "cdqe"], [105, "movzx eax, byte ptr ds:qword_408420[rax]"], [106, "test al, al"], [107, "jnz short loc_402FC2"], [108, "movzx eax, [rbp+var_4]"], [109, "add eax, 1"], [110, "mov [rbp+var_4], ax"], [111, "movzx eax, [rbp+var_7]"], [112, "add eax, 1"], [113, "mov [rbp+var_7], al"], [114, "cmp [rbp+var_7], 3Fh "], [115, "jbe short loc_402FA6"], [116, "movzx edx, [rbp+var_2]"], [117, "mov eax, cs:dword_408168"], [118, "cmp edx, eax"], [119, "jnb short loc_402FE5"], [120, "call sub_401C43"], [121, "movzx edx, [rbp+var_2]"], [122, "mov eax, cs:dword_408168"], [123, "cmp edx, eax"], [124, "jb short loc_402F8C"], [125, "call sub_401C1D"], [126, "cmp [rbp+var_4], 8000h"], [127, "jnz short loc_40300A"], [128, "mov eax, 0"], [129, "jmp locret_4032C7"], [130, "mov [rbp+var_A], 0"], [131, "mov [rbp+var_B], 0"], [132, "jmp loc_403137"], [133, "movzx eax, [rbp+var_B]"], [134, "shl eax, 0Ah"], [135, "mov esi, 41h "], [136, "mov edi, eax"], [137, "call sub_401EF9"], [138, "mov edi, 6Dh "], [139, "call sub_401EAE"], [140, "mov esi, 40h "], [141, "mov edi, 0"], [142, "call sub_401D36"], [143, "lea rax, [rbp+dest]"], [144, "mov edx, 40h "], [145, "mov esi, offset qword_408420"], [146, "mov rdi, rax"], [147, "call _memcpy"], [148, "call sub_401C1D"], [149, "movzx eax, [rbp+var_B]"], [150, "shl eax, 0Ah"], [151, "add eax, 8000h"], [152, "mov esi, 41h "], [153, "mov edi, eax"], [154, "call sub_401EF9"], [155, "mov edi, 6Dh "], [156, "call sub_401EAE"], [157, "mov esi, 40h "], [158, "mov edi, 0"], [159, "call sub_401D36"], [160, "lea rax, [rbp+var_A0]"], [161, "mov edx, 40h "], [162, "mov esi, offset qword_408420"], [163, "mov rdi, rax"], [164, "call _memcpy"], [165, "call sub_401C1D"], [166, "mov [rbp+var_C], 0"], [167, "jmp short loc_4030E7"], [168, "movzx eax, [rbp+var_C]"], [169, "cdqe"], [170, "movzx edx, [rbp+rax+dest]"], [171, "movzx eax, [rbp+var_C]"], [172, "cdqe"], [173, "movzx eax, [rbp+rax+var_A0]"], [174, "cmp dl, al"], [175, "jnz short loc_4030DD"], [176, "movzx eax, [rbp+var_A]"], [177, "add eax, 1"], [178, "mov [rbp+var_A], ax"], [179, "movzx eax, [rbp+var_C]"], [180, "add eax, 1"], [181, "mov [rbp+var_C], al"], [182, "cmp [rbp+var_C], 3Fh "], [183, "jbe short loc_4030B5"], [184, "movzx ecx, [rbp+var_B]"], [185, "movzx edx, cl"], [186, "mov eax, edx"], [187, "shl eax, 2"], [188, "add eax, edx"], [189, "shl eax, 3"], [190, "add eax, edx"], [191, "lea edx, ds:0[rax*4]"], [192, "add eax, edx"], [193, "shr ax, 8"], [194, "mov edx, eax"], [195, "shr dl, 3"], [196, "mov eax, edx"], [197, "shl eax, 2"], [198, "add eax, edx"], [199, "add eax, eax"], [200, "sub ecx, eax"], [201, "mov edx, ecx"], [202, "test dl, dl"], [203, "jnz short loc_40312D"], [204, "mov edi, 2Eh "], [205, "call _putchar"], [206, "movzx eax, [rbp+var_B]"], [207, "add eax, 1"], [208, "mov [rbp+var_B], al"], [209, "cmp [rbp+var_B], 1Fh"], [210, "jbe loc_403019"], [211, "cmp [rbp+var_A], 7CFh"], [212, "jbe short loc_403153"], [213, "mov eax, 1"], [214, "jmp locret_4032C7"], [215, "mov edi, 0Ah"], [216, "call _putchar"], [217, "call sub_402942"], [218, "movzx eax, al"], [219, "mov cs:dword_408688, eax"], [220, "mov eax, cs:dword_408688"], [221, "cmp eax, 1"], [222, "jnz short loc_403180"], [223, "mov eax, 2"], [224, "jmp locret_4032C7"], [225, "mov [rbp+var_A], 0"], [226, "mov edi, offset aTestingFor512k"], [227, "mov eax, 0"], [228, "call _printf"], [229, "mov [rbp+var_D], 0"], [230, "jmp loc_403295"], [231, "movzx eax, [rbp+var_D]"], [232, "shl eax, 0Ah"], [233, "mov esi, 41h "], [234, "mov edi, eax"], [235, "call sub_401EF9"], [236, "mov edi, 6Dh "], [237, "call sub_401EAE"], [238, "mov esi, 40h "], [239, "mov edi, 0"], [240, "call sub_401D36"], [241, "lea rax, [rbp+dest]"], [242, "mov edx, 40h "], [243, "mov esi, offset qword_408420"], [244, "mov rdi, rax"], [245, "call _memcpy"], [246, "call sub_401C1D"], [247, "mov esi, 6Bh "], [248, "mov edi, 1"], [249, "call sub_401EF9"], [250, "movzx eax, [rbp+var_D]"], [251, "shl eax, 0Ah"], [252, "mov esi, 41h "], [253, "mov edi, eax"], [254, "call sub_401EF9"], [255, "mov edi, 6Dh "], [256, "call sub_401EAE"], [257, "mov esi, 40h "], [258, "mov edi, 0"], [259, "call sub_401D36"], [260, "lea rax, [rbp+var_A0]"], [261, "mov edx, 40h "], [262, "mov esi, offset qword_408420"], [263, "mov rdi, rax"], [264, "call _memcpy"], [265, "call sub_401C1D"], [266, "mov esi, 6Bh "], [267, "mov edi, 0"], [268, "call sub_401EF9"], [269, "mov [rbp+var_E], 0"], [270, "jmp short loc_403285"], [271, "movzx eax, [rbp+var_E]"], [272, "cdqe"], [273, "movzx edx, [rbp+rax+dest]"], [274, "movzx eax, [rbp+var_E]"], [275, "cdqe"], [276, "movzx eax, [rbp+rax+var_A0]"], [277, "cmp dl, al"], [278, "jnz short loc_40327B"], [279, "movzx eax, [rbp+var_A]"], [280, "add eax, 1"], [281, "mov [rbp+var_A], ax"], [282, "movzx eax, [rbp+var_E]"], [283, "add eax, 1"], [284, "mov [rbp+var_E], al"], [285, "cmp [rbp+var_E], 3Fh "], [286, "jbe short loc_403253"], [287, "movzx eax, [rbp+var_D]"], [288, "add eax, 1"], [289, "mov [rbp+var_D], al"], [290, "cmp [rbp+var_D], 1Fh"], [291, "jbe loc_40319E"], [292, "cmp [rbp+var_A], 7CFh"], [293, "jbe short loc_4032B8"], [294, "mov edi, offset a512kbit"], [295, "call _puts"], [296, "mov eax, 2"], [297, "jmp short locret_4032C7"], [298, "mov edi, offset a1mbit"], [299, "call _puts"], [300, "mov eax, 3"], [301, "leave"], [302, "retn"]], "data_dep": [[10, 9], [11, 10], [16, 15], [17, 16], [20, 3], [22, 20], [32, 3], [32, 57], [34, 32], [44, 54], [44, 42], [47, 46], [48, 47], [49, 4], [49, 51], [50, 49], [51, 50], [52, 42], [52, 54], [53, 52], [54, 53], [55, 54], [55, 42], [56, 55], [57, 57], [57, 3], [58, 30], [58, 82], [59, 58], [60, 59], [61, 60], [62, 59], [62, 61], [63, 62], [64, 59], [64, 63], [65, 59], [66, 64], [66, 65], [67, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 69], [72, 71], [73, 72], [74, 73], [74, 58], [75, 74], [76, 75], [77, 76], [80, 30], [80, 82], [81, 80], [82, 81], [83, 30], [83, 82], [84, 83], [85, 4], [85, 51], [86, 85], [89, 87], [91, 89], [100, 87], [100, 100], [103, 113], [103, 101], [106, 105], [107, 106], [108, 95], [108, 110], [109, 108], [110, 109], [111, 101], [111, 113], [112, 111], [113, 112], [114, 113], [114, 101], [115, 114], [116, 100], [117, 88], [118, 117], [118, 116], [119, 118], [121, 87], [121, 100], [122, 88], [123, 121], [123, 122], [124, 123], [126, 110], [126, 95], [127, 126], [133, 131], [133, 208], [134, 133], [136, 134], [143, 142], [146, 143], [149, 208], [149, 131], [150, 149], [151, 150], [153, 151], [160, 159], [163, 160], [168, 166], [168, 181], [170, 168], [171, 181], [171, 166], [173, 171], [174, 173], [174, 170], [175, 174], [176, 178], [176, 130], [177, 176], [178, 177], [179, 181], [179, 166], [180, 179], [181, 180], [182, 181], [182, 166], [183, 182], [184, 131], [184, 208], [185, 184], [186, 185], [187, 186], [188, 187], [188, 185], [189, 188], [190, 185], [190, 189], [191, 185], [192, 190], [192, 191], [193, 192], [194, 193], [195, 194], [196, 195], [197, 196], [198, 195], [198, 197], [199, 198], [200, 199], [200, 184], [201, 200], [202, 201], [203, 202], [206, 131], [206, 208], [207, 206], [208, 207], [209, 131], [209, 208], [210, 209], [211, 130], [211, 178], [212, 211], [218, 217], [219, 218], [220, 219], [221, 220], [222, 221], [231, 289], [231, 229], [232, 231], [234, 232], [241, 240], [244, 241], [250, 289], [250, 229], [251, 250], [253, 251], [260, 259], [263, 260], [271, 269], [271, 284], [273, 271], [274, 269], [274, 284], [276, 274], [277, 276], [277, 273], [278, 277], [279, 281], [279, 225], [280, 279], [281, 280], [282, 269], [282, 284], [283, 282], [284, 283], [285, 269], [285, 284], [286, 285], [287, 289], [287, 229], [288, 287], [289, 288], [290, 289], [290, 229], [291, 290], [292, 225], [292, 281], [293, 292], [302, 128], [302, 18], [302, 223], [302, 296], [302, 300], [302, 213]]}
|
static int sm_passkey_entry(stk_generation_method_t method){
switch (method){
case PK_RESP_INPUT:
case PK_INIT_INPUT:
case PK_BOTH_INPUT:
return 1;
default:
return 0;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4259DB", "function_addr": 4348379, "binary_name": "1f4b836241663a98d995a650a671acd1dabc7b5a96a4160d7267c822f4bbfdca.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "mov eax, [rbp+var_4]"], [4, "sub eax, 1"], [5, "cmp eax, 2"], [6, "ja short loc_4259F4"], [7, "mov eax, 1"], [8, "jmp short loc_4259F9"], [9, "mov eax, 0"], [10, "pop rbp"], [11, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 5], [10, 0], [11, 7], [11, 9]]}
|
static void increase_tima(GB_gameboy_t *gb)
{
gb->io_registers[GB_IO_TIMA]++;
if (gb->io_registers[GB_IO_TIMA] == 0) {
gb->io_registers[GB_IO_TIMA] = gb->io_registers[GB_IO_TMA];
gb->tima_reload_state = GB_TIMA_RELOADING;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43F156", "function_addr": 4452694, "binary_name": "276536b89cc3e58f9e6dd34cde9d9d4ba21328c5a859320d5e06460e1ec2c7de.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov rax, [rbp+var_8]"], [4, "movzx eax, byte ptr [rax+19Ch]"], [5, "lea edx, [rax+1]"], [6, "mov rax, [rbp+var_8]"], [7, "mov [rax+19Ch], dl"], [8, "mov rax, [rbp+var_8]"], [9, "movzx eax, byte ptr [rax+19Ch]"], [10, "test al, al"], [11, "jnz short loc_43F1A5"], [12, "mov rax, [rbp+var_8]"], [13, "movzx edx, byte ptr [rax+19Dh]"], [14, "mov rax, [rbp+var_8]"], [15, "mov [rax+19Ch], dl"], [16, "mov rax, [rbp+var_8]"], [17, "mov byte ptr [rax+22Ah], 1"], [18, "nop"], [19, "pop rbp"], [20, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 2], [7, 6], [7, 5], [8, 2], [9, 8], [9, 7], [10, 9], [11, 10], [12, 2], [13, 17], [13, 7], [13, 15], [13, 12], [14, 2], [15, 14], [15, 13], [16, 2], [17, 16], [19, 0], [20, 10], [20, 16]]}
|
void archive_search_se_new(
search_parameters_t* const search_parameters,
const bool buffered_search,
archive_search_t** const archive_search) {
// Prepare Search
*archive_search = mm_alloc(archive_search_t); // Allocate handler
archive_search_configure(*archive_search,search_parameters,buffered_search);
archive_select_configure_se(*archive_search);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_414651", "function_addr": 4277841, "binary_name": "2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_18], rdx"], [6, "mov [rbp+var_C], al"], [7, "mov ecx, 0"], [8, "mov edx, 0"], [9, "mov esi, 538h"], [10, "mov edi, 1"], [11, "call sub_44D294"], [12, "mov rdx, [rbp+var_18]"], [13, "mov [rdx], rax"], [14, "movzx edx, [rbp+var_C]"], [15, "mov rax, [rbp+var_18]"], [16, "mov rax, [rax]"], [17, "mov rcx, [rbp+var_8]"], [18, "mov rsi, rcx"], [19, "mov rdi, rax"], [20, "call sub_414600"], [21, "mov rax, [rbp+var_18]"], [22, "mov rax, [rax]"], [23, "mov rdi, rax"], [24, "call sub_417505"], [25, "nop"], [26, "leave"], [27, "retn"]], "data_dep": [[6, 4], [12, 5], [13, 12], [13, 11], [14, 6], [15, 5], [16, 13], [16, 15], [17, 3], [18, 17], [19, 16], [21, 5], [22, 21], [22, 13], [23, 22], [27, 24]]}
|
bool AL_HEVC_IsRASL(AL_ENut eNUT)
{
return eNUT == AL_HEVC_NUT_RASL_N || eNUT == AL_HEVC_NUT_RASL_R;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43876A", "function_addr": 4425578, "binary_name": "5e2a239e524ee6c8d1db011c62e19bf6e5a376e8054688e7b0fce1f13117e67f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "cmp [rbp+var_4], 8"], [4, "jz short loc_43877D"], [5, "cmp [rbp+var_4], 9"], [6, "jnz short loc_438784"], [7, "mov eax, 1"], [8, "jmp short loc_438789"], [9, "mov eax, 0"], [10, "and eax, 1"], [11, "pop rbp"], [12, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 2], [6, 5], [10, 7], [10, 9], [11, 0], [12, 10]]}
|
int bf_pow(bf_t *r, const bf_t *x, const bf_t *y, limb_t prec, bf_flags_t flags)
{
bf_context_t *s = r->ctx;
bf_t T_s, *T = &T_s;
bf_t ytmp_s;
BOOL y_is_int, y_is_odd;
int r_sign, ret, rnd_mode;
slimb_t y_emin;
if (x->len == 0 || y->len == 0) {
if (y->expn == BF_EXP_ZERO) {
/* pow(x, 0) = 1 */
bf_set_ui(r, 1);
} else if (x->expn == BF_EXP_NAN) {
bf_set_nan(r);
} else {
int cmp_x_abs_1;
bf_set_ui(r, 1);
cmp_x_abs_1 = bf_cmpu(x, r);
if (cmp_x_abs_1 == 0 && (flags & BF_POW_JS_QUICKS) &&
(y->expn >= BF_EXP_INF)) {
bf_set_nan(r);
} else if (cmp_x_abs_1 == 0 &&
(!x->sign || y->expn != BF_EXP_NAN)) {
/* pow(1, y) = 1 even if y = NaN */
/* pow(-1, +/-inf) = 1 */
} else if (y->expn == BF_EXP_NAN) {
bf_set_nan(r);
} else if (y->expn == BF_EXP_INF) {
if (y->sign == (cmp_x_abs_1 > 0)) {
bf_set_zero(r, 0);
} else {
bf_set_inf(r, 0);
}
} else {
y_emin = bf_get_exp_min(y);
y_is_odd = (y_emin == 0);
if (y->sign == (x->expn == BF_EXP_ZERO)) {
bf_set_inf(r, y_is_odd & x->sign);
if (y->sign) {
/* pow(0, y) with y < 0 */
return BF_ST_DIVIDE_ZERO;
}
} else {
bf_set_zero(r, y_is_odd & x->sign);
}
}
}
return 0;
}
bf_init(s, T);
bf_set(T, x);
y_emin = bf_get_exp_min(y);
y_is_int = (y_emin >= 0);
rnd_mode = flags & BF_RND_MASK;
if (x->sign) {
if (!y_is_int) {
bf_set_nan(r);
bf_delete(T);
return BF_ST_INVALID_OP;
}
y_is_odd = (y_emin == 0);
r_sign = y_is_odd;
/* change the directed rounding mode if the sign of the result
is changed */
if (r_sign && (rnd_mode == BF_RNDD || rnd_mode == BF_RNDU))
flags ^= 1;
bf_neg(T);
} else {
r_sign = 0;
}
bf_set_ui(r, 1);
if (bf_cmp_eq(T, r)) {
/* abs(x) = 1: nothing more to do */
ret = 0;
} else if (y_is_int) {
slimb_t T_bits, e;
int_pow:
T_bits = T->expn - bf_get_exp_min(T);
if (T_bits == 1) {
/* pow(2^b, y) = 2^(b*y) */
bf_mul_si(T, y, T->expn - 1, LIMB_BITS, BF_RNDZ);
bf_get_limb(&e, T, 0);
bf_set_ui(r, 1);
ret = bf_mul_2exp(r, e, prec, flags);
} else if (prec == BF_PREC_INF) {
slimb_t y1;
/* specific case for infinite precision (integer case) */
bf_get_limb(&y1, y, 0);
assert(!y->sign);
/* x must be an integer, so abs(x) >= 2 */
if (y1 >= ((slimb_t)1 << BF_EXP_BITS_MAX)) {
bf_delete(T);
return bf_set_overflow(r, 0, BF_PREC_INF, flags);
}
ret = bf_pow_ui(r, T, y1, BF_PREC_INF, BF_RNDZ);
} else {
if (y->expn <= 31) {
/* small enough power: use exponentiation in all cases */
} else if (y->sign) {
/* cannot be exact */
goto general_case;
} else {
if (rnd_mode == BF_RNDF)
goto general_case; /* no need to track exact results */
/* see if the result has a chance to be exact:
if x=a*2^b (a odd), x^y=a^y*2^(b*y)
x^y needs a precision of at least floor_log2(a)*y bits
*/
bf_mul_si(r, y, T_bits - 1, LIMB_BITS, BF_RNDZ);
bf_get_limb(&e, r, 0);
if (prec < e)
goto general_case;
}
ret = bf_ziv_rounding(r, T, prec, flags, bf_pow_int, (void *)y);
}
} else {
if (rnd_mode != BF_RNDF) {
bf_t *y1;
if (y_emin < 0 && check_exact_power2n(r, T, -y_emin)) {
/* the problem is reduced to a power to an integer */
#if 0
printf("\nn=%ld\n", -y_emin);
bf_print_str("T", T);
bf_print_str("r", r);
#endif
bf_set(T, r);
y1 = &ytmp_s;
y1->tab = y->tab;
y1->len = y->len;
y1->sign = y->sign;
y1->expn = y->expn - y_emin;
y = y1;
goto int_pow;
}
}
general_case:
ret = bf_ziv_rounding(r, T, prec, flags, bf_pow_generic, (void *)y);
}
bf_delete(T);
r->sign = r_sign;
return ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4ACED0", "function_addr": 4902608, "binary_name": "14b4410c8e8a2353de548309387c938c5992a16f6551c711ac38d6178ebe7243.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 0E8h"], [4, "mov [rbp+var_C8], rdi"], [5, "mov [rbp+var_D0], rsi"], [6, "mov [rbp+var_D8], rdx"], [7, "mov [rbp+var_E0], rcx"], [8, "mov [rbp+var_E4], r8d"], [9, "mov rax, [rbp+var_C8]"], [10, "mov rax, [rax]"], [11, "mov [rbp+var_20], rax"], [12, "lea rax, [rbp+var_80]"], [13, "mov [rbp+var_28], rax"], [14, "mov rax, [rbp+var_D0]"], [15, "mov rax, [rax+18h]"], [16, "test rax, rax"], [17, "jz short loc_4ACF39"], [18, "mov rax, [rbp+var_D8]"], [19, "mov rax, [rax+18h]"], [20, "test rax, rax"], [21, "jnz loc_4AD187"], [22, "mov rax, [rbp+var_D8]"], [23, "mov rax, [rax+10h]"], [24, "mov rdx, 8000000000000000h"], [25, "cmp rax, rdx"], [26, "jnz short loc_4ACF6C"], [27, "mov rax, [rbp+var_C8]"], [28, "mov esi, 1"], [29, "mov rdi, rax"], [30, "call sub_4A2788"], [31, "jmp loc_4AD17D"], [32, "mov rax, [rbp+var_D0]"], [33, "mov rax, [rax+10h]"], [34, "mov rdx, 7FFFFFFFFFFFFFFFh"], [35, "cmp rax, rdx"], [36, "jnz short loc_4ACF9A"], [37, "mov rax, [rbp+var_C8]"], [38, "mov rdi, rax"], [39, "call sub_4A2872"], [40, "jmp loc_4AD17D"], [41, "mov rax, [rbp+var_C8]"], [42, "mov esi, 1"], [43, "mov rdi, rax"], [44, "call sub_4A2788"], [45, "mov rdx, [rbp+var_C8]"], [46, "mov rax, [rbp+var_D0]"], [47, "mov rsi, rdx"], [48, "mov rdi, rax"], [49, "call sub_4A381D"], [50, "mov [rbp+var_54], eax"], [51, "cmp [rbp+var_54], 0"], [52, "jnz short loc_4AD00D"], [53, "mov eax, [rbp+var_E4]"], [54, "and eax, 10000h"], [55, "test eax, eax"], [56, "jz short loc_4AD00D"], [57, "mov rax, [rbp+var_D8]"], [58, "mov rax, [rax+10h]"], [59, "mov rdx, 7FFFFFFFFFFFFFFDh"], [60, "cmp rax, rdx"], [61, "jle short loc_4AD00D"], [62, "mov rax, [rbp+var_C8]"], [63, "mov rdi, rax"], [64, "call sub_4A2872"], [65, "jmp loc_4AD17D"], [66, "cmp [rbp+var_54], 0"], [67, "jnz short loc_4AD043"], [68, "mov rax, [rbp+var_D0]"], [69, "mov eax, [rax+8]"], [70, "test eax, eax"], [71, "jz loc_4AD17C"], [72, "mov rax, [rbp+var_D8]"], [73, "mov rax, [rax+10h]"], [74, "mov rdx, 7FFFFFFFFFFFFFFFh"], [75, "cmp rax, rdx"], [76, "jnz loc_4AD17C"], [77, "mov rax, [rbp+var_D8]"], [78, "mov rax, [rax+10h]"], [79, "mov rdx, 7FFFFFFFFFFFFFFFh"], [80, "cmp rax, rdx"], [81, "jnz short loc_4AD071"], [82, "mov rax, [rbp+var_C8]"], [83, "mov rdi, rax"], [84, "call sub_4A2872"], [85, "jmp loc_4AD17D"], [86, "mov rax, [rbp+var_D8]"], [87, "mov rax, [rax+10h]"], [88, "mov rdx, 7FFFFFFFFFFFFFFEh"], [89, "cmp rax, rdx"], [90, "jnz short loc_4AD0D5"], [91, "mov rax, [rbp+var_D8]"], [92, "mov edx, [rax+8]"], [93, "cmp [rbp+var_54], 0"], [94, "setnle al"], [95, "movzx eax, al"], [96, "cmp edx, eax"], [97, "jnz short loc_4AD0BC"], [98, "mov rax, [rbp+var_C8]"], [99, "mov esi, 0"], [100, "mov rdi, rax"], [101, "call sub_4A28AF"], [102, "jmp loc_4AD17D"], [103, "mov rax, [rbp+var_C8]"], [104, "mov esi, 0"], [105, "mov rdi, rax"], [106, "call sub_4A28EE"], [107, "jmp loc_4AD17D"], [108, "mov rax, [rbp+var_D8]"], [109, "mov rdi, rax"], [110, "call sub_4A595B"], [111, "mov [rbp+var_30], rax"], [112, "cmp [rbp+var_30], 0"], [113, "setz al"], [114, "movzx eax, al"], [115, "mov [rbp+var_3C], eax"], [116, "mov rax, [rbp+var_D8]"], [117, "mov edx, [rax+8]"], [118, "mov rax, [rbp+var_D0]"], [119, "mov rax, [rax+10h]"], [120, "mov rcx, 8000000000000000h"], [121, "cmp rax, rcx"], [122, "setz al"], [123, "movzx eax, al"], [124, "cmp edx, eax"], [125, "jnz short loc_4AD15A"], [126, "mov rax, [rbp+var_D0]"], [127, "mov eax, [rax+8]"], [128, "and eax, [rbp+var_3C]"], [129, "mov edx, eax"], [130, "mov rax, [rbp+var_C8]"], [131, "mov esi, edx"], [132, "mov rdi, rax"], [133, "call sub_4A28EE"], [134, "mov rax, [rbp+var_D8]"], [135, "mov eax, [rax+8]"], [136, "test eax, eax"], [137, "jz short loc_4AD17D"], [138, "mov eax, 2"], [139, "jmp loc_4AD606"], [140, "mov rax, [rbp+var_D0]"], [141, "mov eax, [rax+8]"], [142, "and eax, [rbp+var_3C]"], [143, "mov edx, eax"], [144, "mov rax, [rbp+var_C8]"], [145, "mov esi, edx"], [146, "mov rdi, rax"], [147, "call sub_4A28AF"], [148, "jmp short loc_4AD17D"], [149, "nop"], [150, "mov eax, 0"], [151, "jmp loc_4AD606"], [152, "mov rdx, [rbp+var_28]"], [153, "mov rax, [rbp+var_20]"], [154, "mov rsi, rdx"], [155, "mov rdi, rax"], [156, "call sub_4A26DE"], [157, "mov rdx, [rbp+var_D0]"], [158, "mov rax, [rbp+var_28]"], [159, "mov rsi, rdx"], [160, "mov rdi, rax"], [161, "call sub_4A292D"], [162, "mov rax, [rbp+var_D8]"], [163, "mov rdi, rax"], [164, "call sub_4A595B"], [165, "mov [rbp+var_30], rax"], [166, "mov rax, [rbp+var_30]"], [167, "not rax"], [168, "shr rax, 3Fh"], [169, "movzx eax, al"], [170, "mov [rbp+var_34], eax"], [171, "mov eax, [rbp+var_E4]"], [172, "and eax, 7"], [173, "mov [rbp+var_38], eax"], [174, "mov rax, [rbp+var_D0]"], [175, "mov eax, [rax+8]"], [176, "test eax, eax"], [177, "jz short loc_4AD254"], [178, "cmp [rbp+var_34], 0"], [179, "jnz short loc_4AD219"], [180, "mov rax, [rbp+var_C8]"], [181, "mov rdi, rax"], [182, "call sub_4A2872"], [183, "mov rax, [rbp+var_28]"], [184, "mov rdi, rax"], [185, "call sub_4A2528"], [186, "mov eax, 1"], [187, "jmp loc_4AD606"], [188, "cmp [rbp+var_30], 0"], [189, "setz al"], [190, "movzx eax, al"], [191, "mov [rbp+var_3C], eax"], [192, "mov eax, [rbp+var_3C]"], [193, "mov [rbp+var_14], eax"], [194, "cmp [rbp+var_14], 0"], [195, "jz short loc_4AD246"], [196, "cmp [rbp+var_38], 2"], [197, "jz short loc_4AD23F"], [198, "cmp [rbp+var_38], 3"], [199, "jnz short loc_4AD246"], [200, "xor [rbp+var_E4], 1"], [201, "mov rax, [rbp+var_28]"], [202, "mov rdi, rax"], [203, "call sub_4A2565"], [204, "jmp short loc_4AD25B"], [205, "mov [rbp+var_14], 0"], [206, "mov rax, [rbp+var_C8]"], [207, "mov esi, 1"], [208, "mov rdi, rax"], [209, "call sub_4A2788"], [210, "mov rdx, [rbp+var_C8]"], [211, "mov rax, [rbp+var_28]"], [212, "mov rsi, rdx"], [213, "mov rdi, rax"], [214, "call sub_4A3B03"], [215, "test eax, eax"], [216, "jz short loc_4AD295"], [217, "mov [rbp+var_18], 0"], [218, "jmp loc_4AD5EA"], [219, "cmp [rbp+var_34], 0"], [220, "jz loc_4AD4EE"], [221, "nop"], [222, "mov rax, [rbp+var_28]"], [223, "mov rbx, [rax+10h]"], [224, "mov rax, [rbp+var_28]"], [225, "mov rdi, rax"], [226, "call sub_4A595B"], [227, "mov rdx, rax"], [228, "mov rax, rbx"], [229, "sub rax, rdx"], [230, "mov [rbp+var_50], rax"], [231, "cmp [rbp+var_50], 1"], [232, "jnz loc_4AD350"], [233, "mov rax, [rbp+var_28]"], [234, "mov rax, [rax+10h]"], [235, "lea rdx, [rax-1]"], [236, "mov rsi, [rbp+var_D8]"], [237, "mov rax, [rbp+var_28]"], [238, "mov r8d, 1"], [239, "mov ecx, 40h "], [240, "mov rdi, rax"], [241, "call sub_4A744F"], [242, "mov rcx, [rbp+var_28]"], [243, "lea rax, [rbp+var_B8]"], [244, "mov edx, 0"], [245, "mov rsi, rcx"], [246, "mov rdi, rax"], [247, "call sub_4A672D"], [248, "mov rax, [rbp+var_C8]"], [249, "mov esi, 1"], [250, "mov rdi, rax"], [251, "call sub_4A2788"], [252, "mov rsi, [rbp+var_B8]"], [253, "mov ecx, [rbp+var_E4]"], [254, "mov rdx, [rbp+var_E0]"], [255, "mov rax, [rbp+var_C8]"], [256, "mov rdi, rax"], [257, "call sub_4A5517"], [258, "mov [rbp+var_18], eax"], [259, "jmp loc_4AD5EA"], [260, "mov rax, 3FFFFFFFFFFFFFFFh"], [261, "cmp [rbp+var_E0], rax"], [262, "jnz loc_4AD42E"], [263, "mov rcx, [rbp+var_D8]"], [264, "lea rax, [rbp+var_C0]"], [265, "mov edx, 0"], [266, "mov rsi, rcx"], [267, "mov rdi, rax"], [268, "call sub_4A672D"], [269, "mov rax, [rbp+var_D8]"], [270, "mov eax, [rax+8]"], [271, "test eax, eax"], [272, "jz short loc_4AD3AC"], [273, "mov ecx, offset aBfPow"], [274, "mov edx, 1025h"], [275, "mov esi, offset aLibbfC"], [276, "mov edi, offset aYSign"], [277, "call ___assert_fail"], [278, "mov rax, [rbp+var_C0]"], [279, "mov rdx, 3FFFFFFFFFFFFFFFh"], [280, "cmp rax, rdx"], [281, "jle short loc_4AD3F9"], [282, "mov rax, [rbp+var_28]"], [283, "mov rdi, rax"], [284, "call sub_4A2528"], [285, "mov edx, [rbp+var_E4]"], [286, "mov rax, [rbp+var_C8]"], [287, "mov ecx, edx"], [288, "mov rdx, 3FFFFFFFFFFFFFFFh"], [289, "mov esi, 0"], [290, "mov rdi, rax"], [291, "call sub_4A2E02"], [292, "jmp loc_4AD606"], [293, "mov rax, [rbp+var_C0]"], [294, "mov rdx, rax"], [295, "mov rsi, [rbp+var_28]"], [296, "mov rax, [rbp+var_C8]"], [297, "mov r8d, 1"], [298, "mov rcx, 3FFFFFFFFFFFFFFFh"], [299, "mov rdi, rax"], [300, "call sub_4A753D"], [301, "mov [rbp+var_18], eax"], [302, "jmp loc_4AD5EA"], [303, "mov rax, [rbp+var_D8]"], [304, "mov rax, [rax+10h]"], [305, "cmp rax, 1Fh"], [306, "jle short loc_4AD4B6"], [307, "mov rax, [rbp+var_D8]"], [308, "mov eax, [rax+8]"], [309, "test eax, eax"], [310, "jnz loc_4AD5AD"], [311, "cmp [rbp+var_38], 6"], [312, "jz loc_4AD5B0"], [313, "mov rax, [rbp+var_50]"], [314, "lea rdx, [rax-1]"], [315, "mov rsi, [rbp+var_D8]"], [316, "mov rax, [rbp+var_C8]"], [317, "mov r8d, 1"], [318, "mov ecx, 40h "], [319, "mov rdi, rax"], [320, "call sub_4A744F"], [321, "mov rcx, [rbp+var_C8]"], [322, "lea rax, [rbp+var_B8]"], [323, "mov edx, 0"], [324, "mov rsi, rcx"], [325, "mov rdi, rax"], [326, "call sub_4A672D"], [327, "mov rax, [rbp+var_B8]"], [328, "cmp [rbp+var_E0], rax"], [329, "jb loc_4AD5B3"], [330, "mov rdi, [rbp+var_D8]"], [331, "mov ecx, [rbp+var_E4]"], [332, "mov rdx, [rbp+var_E0]"], [333, "mov rsi, [rbp+var_28]"], [334, "mov rax, [rbp+var_C8]"], [335, "mov r9, rdi"], [336, "mov r8d, offset sub_4ACC1B"], [337, "mov rdi, rax"], [338, "call sub_4ABD7C"], [339, "mov [rbp+var_18], eax"], [340, "jmp loc_4AD5EA"], [341, "cmp [rbp+var_38], 6"], [342, "jz loc_4AD5B6"], [343, "cmp [rbp+var_30], 0"], [344, "jns loc_4AD5B6"], [345, "mov rax, [rbp+var_30]"], [346, "neg rax"], [347, "mov rdx, rax"], [348, "mov rcx, [rbp+var_28]"], [349, "mov rax, [rbp+var_C8]"], [350, "mov rsi, rcx"], [351, "mov rdi, rax"], [352, "call sub_4ACD2D"], [353, "test eax, eax"], [354, "jz loc_4AD5B6"], [355, "mov rdx, [rbp+var_C8]"], [356, "mov rax, [rbp+var_28]"], [357, "mov rsi, rdx"], [358, "mov rdi, rax"], [359, "call sub_4A292D"], [360, "lea rax, [rbp+var_B0]"], [361, "mov [rbp+var_48], rax"], [362, "mov rax, [rbp+var_D8]"], [363, "mov rdx, [rax+20h]"], [364, "mov rax, [rbp+var_48]"], [365, "mov [rax+20h], rdx"], [366, "mov rax, [rbp+var_D8]"], [367, "mov rdx, [rax+18h]"], [368, "mov rax, [rbp+var_48]"], [369, "mov [rax+18h], rdx"], [370, "mov rax, [rbp+var_D8]"], [371, "mov edx, [rax+8]"], [372, "mov rax, [rbp+var_48]"], [373, "mov [rax+8], edx"], [374, "mov rax, [rbp+var_D8]"], [375, "mov rax, [rax+10h]"], [376, "sub rax, [rbp+var_30]"], [377, "mov rdx, rax"], [378, "mov rax, [rbp+var_48]"], [379, "mov [rax+10h], rdx"], [380, "mov rax, [rbp+var_48]"], [381, "mov [rbp+var_D8], rax"], [382, "jmp loc_4AD2A0"], [383, "nop"], [384, "jmp short loc_4AD5B7"], [385, "nop"], [386, "jmp short loc_4AD5B7"], [387, "nop"], [388, "jmp short loc_4AD5B7"], [389, "nop"], [390, "mov rdi, [rbp+var_D8]"], [391, "mov ecx, [rbp+var_E4]"], [392, "mov rdx, [rbp+var_E0]"], [393, "mov rsi, [rbp+var_28]"], [394, "mov rax, [rbp+var_C8]"], [395, "mov r9, rdi"], [396, "mov r8d, offset sub_4ACB66"], [397, "mov rdi, rax"], [398, "call sub_4ABD7C"], [399, "mov [rbp+var_18], eax"], [400, "mov rax, [rbp+var_28]"], [401, "mov rdi, rax"], [402, "call sub_4A2528"], [403, "mov rax, [rbp+var_C8]"], [404, "mov edx, [rbp+var_14]"], [405, "mov [rax+8], edx"], [406, "mov eax, [rbp+var_18]"], [407, "mov rbx, [rbp+var_8]"], [408, "leave"], [409, "retn"]], "data_dep": [[9, 4], [10, 9], [11, 10], [12, 10], [13, 12], [14, 5], [15, 14], [16, 15], [17, 16], [18, 6], [19, 18], [20, 19], [21, 20], [22, 6], [23, 22], [25, 24], [25, 23], [26, 25], [27, 4], [29, 27], [32, 5], [33, 32], [35, 34], [35, 33], [36, 35], [37, 4], [38, 37], [41, 4], [43, 41], [45, 4], [46, 5], [47, 45], [48, 46], [50, 49], [51, 50], [52, 51], [53, 8], [54, 53], [55, 54], [56, 55], [57, 6], [58, 57], [60, 59], [60, 58], [61, 60], [62, 4], [63, 62], [66, 50], [67, 66], [68, 5], [69, 68], [70, 69], [71, 70], [72, 6], [73, 72], [75, 74], [75, 73], [76, 75], [77, 6], [78, 77], [80, 79], [80, 78], [81, 80], [82, 4], [83, 82], [86, 6], [87, 86], [89, 88], [89, 87], [90, 89], [91, 6], [92, 91], [93, 50], [94, 91], [95, 94], [96, 95], [96, 92], [97, 96], [98, 4], [100, 98], [103, 4], [105, 103], [108, 6], [109, 108], [111, 110], [112, 111], [113, 112], [113, 110], [114, 113], [115, 114], [116, 6], [117, 116], [118, 5], [119, 118], [121, 119], [121, 120], [122, 119], [122, 121], [123, 122], [124, 123], [124, 117], [125, 124], [126, 5], [127, 126], [128, 115], [128, 127], [129, 128], [130, 4], [131, 129], [132, 130], [134, 6], [135, 134], [136, 135], [137, 136], [140, 5], [141, 140], [142, 115], [142, 141], [143, 142], [144, 4], [145, 143], [146, 144], [152, 13], [153, 11], [154, 152], [155, 153], [157, 5], [158, 13], [159, 157], [160, 158], [162, 6], [163, 162], [165, 164], [166, 165], [167, 166], [168, 167], [169, 168], [170, 169], [171, 8], [172, 171], [173, 172], [174, 5], [175, 174], [176, 175], [177, 176], [178, 170], [179, 178], [180, 4], [181, 180], [183, 13], [184, 183], [188, 165], [189, 176], [189, 188], [190, 189], [191, 190], [192, 191], [193, 192], [194, 193], [195, 194], [196, 173], [197, 196], [198, 173], [199, 198], [200, 8], [201, 13], [202, 201], [206, 4], [208, 206], [210, 4], [211, 13], [212, 210], [213, 211], [215, 214], [216, 215], [219, 170], [220, 219], [222, 13], [223, 222], [223, 379], [223, 365], [223, 369], [223, 373], [224, 13], [225, 224], [227, 226], [228, 223], [229, 228], [229, 227], [230, 229], [231, 230], [232, 231], [233, 13], [234, 379], [234, 365], [234, 369], [234, 373], [234, 233], [235, 373], [235, 227], [235, 379], [235, 365], [235, 369], [235, 234], [236, 6], [236, 381], [237, 13], [240, 237], [242, 13], [243, 241], [245, 242], [246, 243], [248, 4], [250, 248], [253, 8], [253, 200], [254, 7], [255, 4], [256, 255], [258, 257], [261, 7], [261, 260], [262, 261], [263, 6], [263, 381], [264, 260], [266, 263], [267, 264], [269, 6], [269, 381], [270, 269], [270, 379], [270, 365], [270, 369], [270, 373], [271, 270], [272, 271], [280, 278], [280, 279], [281, 280], [282, 13], [283, 282], [285, 200], [285, 8], [286, 4], [287, 285], [290, 286], [294, 293], [295, 13], [296, 4], [299, 296], [301, 300], [303, 6], [303, 381], [304, 379], [304, 365], [304, 369], [304, 303], [304, 373], [305, 304], [306, 305], [307, 6], [307, 381], [308, 379], [308, 365], [308, 369], [308, 307], [308, 373], [309, 308], [310, 309], [311, 173], [312, 311], [313, 230], [314, 373], [314, 227], [314, 379], [314, 365], [314, 369], [314, 313], [315, 6], [315, 381], [316, 4], [319, 316], [321, 4], [322, 320], [324, 321], [325, 322], [328, 327], [328, 7], [329, 328], [330, 381], [330, 6], [331, 200], [331, 8], [332, 7], [333, 13], [334, 4], [335, 330], [337, 334], [339, 338], [341, 173], [342, 341], [343, 165], [344, 343], [345, 165], [346, 345], [347, 346], [348, 13], [349, 4], [350, 348], [351, 349], [353, 352], [354, 353], [355, 4], [356, 13], [357, 355], [358, 356], [360, 359], [361, 360], [362, 6], [363, 362], [364, 361], [365, 364], [365, 363], [366, 6], [367, 365], [367, 366], [368, 361], [369, 368], [369, 367], [370, 6], [371, 370], [371, 369], [372, 361], [373, 371], [373, 372], [374, 6], [375, 374], [375, 373], [376, 165], [376, 375], [377, 376], [378, 361], [379, 377], [379, 378], [380, 361], [381, 380], [390, 381], [390, 6], [391, 200], [391, 8], [392, 7], [393, 13], [394, 4], [395, 390], [397, 394], [399, 398], [400, 13], [401, 400], [403, 4], [404, 205], [404, 193], [405, 403], [405, 404], [406, 301], [406, 399], [406, 217], [406, 258], [406, 339], [409, 186], [409, 291], [409, 138], [409, 150], [409, 406]]}
|
void config_set_uint64(config_file_t *conf, const char *key, uint64_t val)
{
char buf[32];
snprintf(buf, sizeof(buf), "%" PRIu64, val);
config_set_string(conf, key, buf);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407796", "function_addr": 4224918, "binary_name": "2beab05072d063ded206a99a8794f868cc82b7f065265d1bfa006686c89bca5b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "mov rdx, [rbp+var_38]"], [7, "lea rax, [rbp+s]"], [8, "mov rcx, rdx"], [9, "mov edx, offset aLu"], [10, "mov esi, 20h "], [11, "mov rdi, rax"], [12, "mov eax, 0"], [13, "call _snprintf"], [14, "lea rdx, [rbp+s]"], [15, "mov rcx, [rbp+var_30]"], [16, "mov rax, [rbp+var_28]"], [17, "mov rsi, rcx"], [18, "mov rdi, rax"], [19, "call sub_4071FB"], [20, "nop"], [21, "leave"], [22, "retn"]], "data_dep": [[6, 5], [8, 6], [11, 7], [14, 9], [15, 4], [16, 3], [17, 15], [18, 16], [22, 19]]}
|
void LDL_Stream_init(struct ldl_stream *self, void *buf, uint8_t size)
{
LDL_PEDANTIC(self != NULL)
LDL_PEDANTIC((buf != NULL) || (size == 0U))
self->write = buf;
self->read = buf;
self->size = size;
self->pos = 0U;
self->error = false;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41699D", "function_addr": 4286877, "binary_name": "f2b2915e9e2d6729375d876f6c15174498b7f2f04b5b9bcc85cb7c605be4924f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_10], rsi"], [5, "mov eax, edx"], [6, "mov [rbp+var_14], al"], [7, "mov rax, cs:qword_437F80"], [8, "add rax, 1"], [9, "mov cs:qword_437F80, rax"], [10, "cmp [rbp+var_8], 0"], [11, "jnz short loc_4169F6"], [12, "mov rax, cs:qword_437F88"], [13, "add rax, 1"], [14, "mov cs:qword_437F88, rax"], [15, "mov ecx, offset aLdlStreamInit"], [16, "mov edx, 1Eh"], [17, "mov esi, offset aSrcLdlStreamC"], [18, "mov edi, offset aSelfVoid0_1"], [19, "call ___assert_fail"], [20, "cmp [rbp+var_10], 0"], [21, "jnz short loc_416A40"], [22, "mov rax, cs:qword_437F90"], [23, "add rax, 1"], [24, "mov cs:qword_437F90, rax"], [25, "cmp [rbp+var_14], 0"], [26, "jz short loc_416A40"], [27, "mov rax, cs:qword_437F98"], [28, "add rax, 1"], [29, "mov cs:qword_437F98, rax"], [30, "mov ecx, offset aLdlStreamInit"], [31, "mov edx, 1Fh"], [32, "mov esi, offset aSrcLdlStreamC"], [33, "mov edi, offset aBufVoid0Size0u"], [34, "call ___assert_fail"], [35, "mov rax, [rbp+var_8]"], [36, "mov rdx, [rbp+var_10]"], [37, "mov [rax], rdx"], [38, "mov rax, [rbp+var_8]"], [39, "mov rdx, [rbp+var_10]"], [40, "mov [rax+8], rdx"], [41, "mov rax, [rbp+var_8]"], [42, "movzx edx, [rbp+var_14]"], [43, "mov [rax+10h], dl"], [44, "mov rax, [rbp+var_8]"], [45, "mov byte ptr [rax+11h], 0"], [46, "mov rax, [rbp+var_8]"], [47, "mov byte ptr [rax+12h], 0"], [48, "nop"], [49, "leave"], [50, "retn"]], "data_dep": [[6, 5], [8, 7], [9, 8], [10, 3], [11, 10], [13, 12], [14, 13], [20, 4], [21, 20], [23, 22], [24, 23], [25, 6], [26, 25], [28, 27], [29, 28], [35, 3], [36, 4], [37, 36], [37, 35], [38, 3], [39, 4], [40, 38], [40, 39], [41, 3], [42, 6], [43, 42], [43, 41], [44, 3], [45, 44], [46, 3], [47, 46], [50, 46]]}
|
static void numtostr(js_State *J, const char *fmt, int w, double n)
{
/* buf needs to fit printf("%.20f", 1e20) */
char buf[50], *e;
sprintf(buf, fmt, w, n);
e = strchr(buf, 'e');
if (e) {
int exp = atoi(e+1);
sprintf(e, "e%+d", exp);
}
js_pushstring(J, buf);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_418515", "function_addr": 4293909, "binary_name": "e3c8c5c70ba394a96abdb474fdaf272392a22f0c576d50cae847e2e708e15611.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_48], rdi"], [4, "mov [rbp+format], rsi"], [5, "mov [rbp+var_54], edx"], [6, "movsd [rbp+var_60], xmm0"], [7, "mov rsi, [rbp+var_60]"], [8, "mov edx, [rbp+var_54]"], [9, "mov rcx, [rbp+format]"], [10, "lea rax, [rbp+s]"], [11, "movq xmm0, rsi"], [12, "mov rsi, rcx"], [13, "mov rdi, rax"], [14, "mov eax, 1"], [15, "call _sprintf"], [16, "lea rax, [rbp+s]"], [17, "mov esi, 65h "], [18, "mov rdi, rax"], [19, "call _strchr"], [20, "mov [rbp+var_8], rax"], [21, "cmp [rbp+var_8], 0"], [22, "jz short loc_418599"], [23, "mov rax, [rbp+var_8]"], [24, "add rax, 1"], [25, "mov rdi, rax"], [26, "call _atoi"], [27, "mov [rbp+var_C], eax"], [28, "mov edx, [rbp+var_C]"], [29, "mov rax, [rbp+var_8]"], [30, "mov esi, offset aED"], [31, "mov rdi, rax"], [32, "mov eax, 0"], [33, "call _sprintf"], [34, "lea rdx, [rbp+s]"], [35, "mov rax, [rbp+var_48]"], [36, "mov rsi, rdx"], [37, "mov rdi, rax"], [38, "call sub_424BAA"], [39, "nop"], [40, "leave"], [41, "retn"]], "data_dep": [[7, 6], [8, 5], [9, 4], [11, 7], [12, 9], [13, 10], [16, 15], [18, 16], [20, 19], [21, 20], [22, 21], [23, 20], [24, 23], [25, 24], [27, 26], [28, 27], [29, 20], [31, 29], [34, 28], [34, 8], [35, 3], [36, 34], [37, 35], [41, 38]]}
|
static int write_iops_log(struct thread_data *td, int try, bool unit_log)
{
int ret;
if (per_unit_log(td->iops_log) != unit_log)
return 0;
ret = __write_log(td, td->iops_log, try);
if (!ret)
td->iops_log = NULL;
return ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_47CFAB", "function_addr": 4706219, "binary_name": "da112328d43ad283d891ef745b1d04f93c0e61c8af6f1658d5fe5192a776b52b.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 eax, edx"], [6, "mov [rbp+var_20], al"], [7, "mov rax, [rbp+var_18]"], [8, "mov rax, [rax+2DB70h]"], [9, "mov rdi, rax"], [10, "call sub_478C66"], [11, "cmp [rbp+var_20], al"], [12, "jz short loc_47CFDE"], [13, "mov eax, 0"], [14, "jmp short locret_47D016"], [15, "mov rax, [rbp+var_18]"], [16, "mov rcx, [rax+2DB70h]"], [17, "mov edx, [rbp+var_1C]"], [18, "mov rax, [rbp+var_18]"], [19, "mov rsi, rcx"], [20, "mov rdi, rax"], [21, "call sub_47CF72"], [22, "mov [rbp+var_4], eax"], [23, "cmp [rbp+var_4], 0"], [24, "jnz short loc_47D013"], [25, "mov rax, [rbp+var_18]"], [26, "mov qword ptr [rax+2DB70h], 0"], [27, "mov eax, [rbp+var_4]"], [28, "leave"], [29, "retn"]], "data_dep": [[6, 5], [7, 3], [8, 7], [9, 8], [11, 10], [11, 6], [12, 11], [15, 3], [16, 15], [17, 4], [18, 3], [19, 16], [20, 18], [22, 21], [23, 22], [24, 23], [25, 3], [26, 25], [27, 22], [29, 13], [29, 27]]}
|
int bpf_program__set_prep(struct bpf_program *prog, int nr_instances,
bpf_program_prep_t prep)
{
int *instances_fds;
if (nr_instances <= 0 || !prep)
return -EINVAL;
if (prog->instances.nr > 0 || prog->instances.fds) {
pr_warn("Can't set pre-processor after loading\n");
return -EINVAL;
}
instances_fds = malloc(sizeof(int) * nr_instances);
if (!instances_fds) {
pr_warn("alloc memory failed for fds\n");
return -ENOMEM;
}
/* fill all fd with -1 */
memset(instances_fds, -1, sizeof(int) * nr_instances);
prog->instances.nr = nr_instances;
prog->instances.fds = instances_fds;
prog->preprocessor = prep;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "bpf_program__set_prep", "function_addr": 4299987, "binary_name": "c3029f1e790b5e1a59516e394f267d59ba9f8391e8c8f3441f155452ceddb393.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, "cmp [rbp+var_1C], 0"], [7, "jle short loc_419CF3"], [8, "cmp [rbp+var_28], 0"], [9, "jnz short loc_419CFD"], [10, "mov eax, 0FFFFFFEAh"], [11, "jmp locret_419DB0"], [12, "mov rax, [rbp+var_18]"], [13, "mov eax, [rax+60h]"], [14, "test eax, eax"], [15, "jg short loc_419D15"], [16, "mov rax, [rbp+var_18]"], [17, "mov rax, [rax+68h]"], [18, "test rax, rax"], [19, "jz short loc_419D32"], [20, "lea rsi, aLibbpfCanTSetP"], [21, "mov edi, 0"], [22, "mov eax, 0"], [23, "call sub_40A1AC"], [24, "mov eax, 0FFFFFFEAh"], [25, "jmp short locret_419DB0"], [26, "mov eax, [rbp+var_1C]"], [27, "cdqe"], [28, "shl rax, 2"], [29, "mov rdi, rax"], [30, "call _malloc"], [31, "mov [rbp+s], rax"], [32, "cmp [rbp+s], 0"], [33, "jnz short loc_419D6B"], [34, "lea rsi, aLibbpfAllocMem_0"], [35, "mov edi, 0"], [36, "mov eax, 0"], [37, "call sub_40A1AC"], [38, "mov eax, 0FFFFFFF4h"], [39, "jmp short locret_419DB0"], [40, "mov eax, [rbp+var_1C]"], [41, "cdqe"], [42, "lea rdx, ds:0[rax*4]"], [43, "mov rax, [rbp+s]"], [44, "mov esi, 0FFFFFFFFh"], [45, "mov rdi, rax"], [46, "call _memset"], [47, "mov rax, [rbp+var_18]"], [48, "mov edx, [rbp+var_1C]"], [49, "mov [rax+60h], edx"], [50, "mov rax, [rbp+var_18]"], [51, "mov rdx, [rbp+s]"], [52, "mov [rax+68h], rdx"], [53, "mov rax, [rbp+var_18]"], [54, "mov rdx, [rbp+var_28]"], [55, "mov [rax+70h], rdx"], [56, "mov eax, 0"], [57, "leave"], [58, "retn"]], "data_dep": [[6, 4], [7, 6], [8, 5], [9, 8], [12, 3], [13, 12], [14, 13], [15, 14], [16, 3], [17, 16], [18, 17], [19, 18], [26, 4], [28, 26], [29, 28], [31, 30], [32, 31], [33, 32], [40, 4], [43, 31], [45, 43], [47, 3], [48, 4], [49, 47], [49, 48], [50, 3], [51, 31], [52, 51], [52, 50], [53, 3], [54, 5], [55, 53], [55, 54], [58, 56], [58, 10], [58, 24], [58, 38]]}
|
static uint32_t find_free_channel(void)
{
/* FIXME: this needs to actually find a free channel, not just fail to be unlucky */
return snis_randn(100000); /* simplest possible thing that might work. */
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_484168", "function_addr": 4735336, "binary_name": "d20d5d136ed82a5a36fdeedd4c3a30a62ee46f8e0365a7e4e8f0c462411d4a2f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov edi, 186A0h"], [3, "call snis_randn"], [4, "pop rbp"], [5, "retn"]], "data_dep": [[4, 0], [5, 3]]}
|
unsigned OptJumpTarget3 (CodeSeg* S)
/* Jumps to load instructions of a register, that do already have the matching
** register contents may skip the load instruction, since it's job is already
** done.
*/
{
unsigned Changes = 0;
unsigned I;
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
CodeEntry* N;
/* Get next entry */
CodeEntry* E = CS_GetEntry (S, I);
/* Check if this is a load insn with a label and the next insn is not
** a conditional branch that needs the flags from the load.
*/
if ((E->Info & OF_LOAD) != 0 &&
CE_IsConstImm (E) &&
CE_HasLabel (E) &&
(N = CS_GetNextEntry (S, I)) != 0 &&
!CE_UseLoadFlags (N)) {
unsigned J;
int K;
/* New jump label */
CodeLabel* LN = 0;
/* Walk over all insn that jump here */
for (J = 0; J < CE_GetLabelCount (E); ++J) {
/* Get the label */
CodeLabel* L = CE_GetLabel (E, J);
/* Loop over all insn that reference this label. Since we may
** eventually remove a reference in the loop, we must loop
** from end down to start.
*/
for (K = CL_GetRefCount (L) - 1; K >= 0; --K) {
/* Get the entry that jumps here */
CodeEntry* Jump = CL_GetRef (L, K);
/* Get the register info from this insn */
short Val = RegVal (E->Chg, &Jump->RI->Out2);
/* Check if the outgoing value is the one thats's loaded */
if (Val == (unsigned char) E->Num) {
/* OK, skip the insn. First, generate a label for the
** next insn after E.
*/
if (LN == 0) {
LN = CS_GenLabel (S, N);
}
/* Change the jump target to point to this new label */
CS_MoveLabelRef (S, Jump, LN);
/* Remember that we had changes */
++Changes;
}
}
}
}
/* Next entry */
++I;
}
/* Return the number of changes made */
return Changes;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4455A7", "function_addr": 4478375, "binary_name": "1c9782cb95ac345a77465ba88b70eb8da93f650d1c8877cf5bb119d4d1bf0021.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_48], rdi"], [4, "mov [rbp+var_4], 0"], [5, "mov [rbp+var_8], 0"], [6, "jmp loc_44573E"], [7, "mov edx, [rbp+var_8]"], [8, "mov rax, [rbp+var_48]"], [9, "mov esi, edx"], [10, "mov rdi, rax"], [11, "call sub_44476C"], [12, "mov [rbp+var_20], rax"], [13, "mov rax, [rbp+var_20]"], [14, "movzx eax, word ptr [rax+18h]"], [15, "movzx eax, ax"], [16, "and eax, 40h"], [17, "test eax, eax"], [18, "jz loc_44573A"], [19, "mov rax, [rbp+var_20]"], [20, "mov rdi, rax"], [21, "call sub_407515"], [22, "test eax, eax"], [23, "jz loc_44573A"], [24, "mov rax, [rbp+var_20]"], [25, "mov rdi, rax"], [26, "call sub_4446E4"], [27, "test eax, eax"], [28, "jz loc_44573A"], [29, "mov edx, [rbp+var_8]"], [30, "mov rax, [rbp+var_48]"], [31, "mov esi, edx"], [32, "mov rdi, rax"], [33, "call sub_42FA40"], [34, "mov [rbp+var_28], rax"], [35, "cmp [rbp+var_28], 0"], [36, "jz loc_44573A"], [37, "mov rax, [rbp+var_28]"], [38, "mov rdi, rax"], [39, "call sub_407593"], [40, "test eax, eax"], [41, "jnz loc_44573A"], [42, "mov [rbp+var_18], 0"], [43, "mov [rbp+var_C], 0"], [44, "jmp loc_445725"], [45, "mov edx, [rbp+var_C]"], [46, "mov rax, [rbp+var_20]"], [47, "mov esi, edx"], [48, "mov rdi, rax"], [49, "call sub_444728"], [50, "mov [rbp+var_30], rax"], [51, "mov rax, [rbp+var_30]"], [52, "mov rdi, rax"], [53, "call sub_444687"], [54, "sub eax, 1"], [55, "mov [rbp+var_10], eax"], [56, "jmp loc_445717"], [57, "mov edx, [rbp+var_10]"], [58, "mov rax, [rbp+var_30]"], [59, "mov esi, edx"], [60, "mov rdi, rax"], [61, "call sub_4446A5"], [62, "mov [rbp+var_38], rax"], [63, "mov rax, [rbp+var_38]"], [64, "mov rax, [rax+40h]"], [65, "lea rdx, [rax+20h]"], [66, "mov rax, [rbp+var_20]"], [67, "movzx eax, word ptr [rax+1Ch]"], [68, "movzx eax, ax"], [69, "mov rsi, rdx"], [70, "mov edi, eax"], [71, "call sub_444AB1"], [72, "mov [rbp+var_3A], ax"], [73, "movsx edx, [rbp+var_3A]"], [74, "mov rax, [rbp+var_20]"], [75, "mov rax, [rax+10h]"], [76, "movzx eax, al"], [77, "cmp edx, eax"], [78, "jnz short loc_445713"], [79, "cmp [rbp+var_18], 0"], [80, "jnz short loc_4456F8"], [81, "mov rdx, [rbp+var_28]"], [82, "mov rax, [rbp+var_48]"], [83, "mov rsi, rdx"], [84, "mov rdi, rax"], [85, "call sub_42FCFF"], [86, "mov [rbp+var_18], rax"], [87, "mov rdx, [rbp+var_18]"], [88, "mov rcx, [rbp+var_38]"], [89, "mov rax, [rbp+var_48]"], [90, "mov rsi, rcx"], [91, "mov rdi, rax"], [92, "call sub_43019F"], [93, "add [rbp+var_4], 1"], [94, "sub [rbp+var_10], 1"], [95, "cmp [rbp+var_10], 0"], [96, "jns loc_44568D"], [97, "add [rbp+var_C], 1"], [98, "mov rax, [rbp+var_20]"], [99, "mov rdi, rax"], [100, "call sub_44470A"], [101, "cmp [rbp+var_C], eax"], [102, "jb loc_445661"], [103, "add [rbp+var_8], 1"], [104, "mov rax, [rbp+var_48]"], [105, "mov rdi, rax"], [106, "call sub_44474E"], [107, "cmp [rbp+var_8], eax"], [108, "jb loc_4455C6"], [109, "mov eax, [rbp+var_4]"], [110, "leave"], [111, "retn"]], "data_dep": [[7, 5], [7, 103], [8, 3], [9, 7], [10, 8], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 16], [18, 17], [19, 12], [20, 19], [22, 21], [23, 22], [24, 12], [25, 24], [27, 26], [28, 27], [29, 5], [29, 103], [30, 3], [31, 29], [32, 30], [34, 33], [35, 34], [36, 35], [37, 34], [38, 37], [40, 39], [41, 40], [45, 43], [45, 97], [46, 12], [47, 45], [48, 46], [50, 49], [51, 50], [52, 51], [54, 53], [55, 54], [57, 94], [57, 55], [58, 50], [59, 57], [60, 58], [62, 61], [63, 62], [64, 63], [65, 64], [65, 57], [66, 12], [67, 66], [68, 67], [69, 65], [70, 68], [72, 71], [73, 72], [74, 12], [75, 74], [76, 75], [77, 76], [77, 73], [78, 77], [79, 42], [79, 86], [80, 79], [81, 34], [82, 3], [83, 81], [84, 82], [86, 85], [87, 86], [87, 42], [88, 62], [89, 3], [90, 88], [91, 89], [93, 4], [93, 93], [94, 94], [94, 55], [95, 94], [95, 55], [96, 95], [97, 97], [97, 43], [98, 12], [99, 98], [101, 97], [101, 43], [101, 100], [102, 101], [103, 103], [103, 5], [104, 3], [105, 104], [107, 106], [107, 103], [107, 5], [108, 107], [109, 4], [109, 93], [111, 109]]}
|
void EA_DropItem(int client, char *it)
{
botimport.BotClientCommand(client, va("drop %s", it));
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_498CD6", "function_addr": 4820182, "binary_name": "65b0a6a66ac7f742f3b62174dd1ff457acc880965e6d65927b21910da8931604.elf_extract.pkl\n"}, "code": [[0, "push rbx"], [1, "sub rsp, 10h"], [2, "mov [rsp+18h+var_C], edi"], [3, "mov [rsp+18h+var_18], rsi"], [4, "mov rbx, cs:qword_7BFB38"], [5, "mov rax, [rsp+18h+var_18]"], [6, "mov rsi, rax"], [7, "mov edi, offset aDropS"], [8, "mov eax, 0"], [9, "call sub_44691C"], [10, "mov rdx, rax"], [11, "mov eax, [rsp+18h+var_C]"], [12, "mov rsi, rdx"], [13, "mov edi, eax"], [14, "call rbx "], [15, "nop"], [16, "add rsp, 10h"], [17, "pop rbx"], [18, "retn"]], "data_dep": [[5, 3], [6, 5], [10, 9], [11, 2], [12, 10], [13, 11], [14, 4], [16, 1], [17, 0], [18, 14]]}
|
number_ptr mul_fr_fr(number_ptr x, number_ptr y){
number_ptr z = new_fr();
mpfr_mul(z->fr.fr, x->fr.fr, y->fr.fr, MPFR_RNDN);
return z;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_412054", "function_addr": 4268116, "binary_name": "3b5d72f99f5eb3da8f19b8df0eef4a3aa16116874d08ef5e6ed040cc58832406.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_20], rsi"], [5, "mov eax, 0"], [6, "call sub_411B04"], [7, "mov [rbp+var_8], rax"], [8, "mov rax, [rbp+var_20]"], [9, "lea rdx, [rax+8]"], [10, "mov rax, [rbp+var_18]"], [11, "lea rsi, [rax+8]"], [12, "mov rax, [rbp+var_8]"], [13, "add rax, 8"], [14, "mov ecx, 0"], [15, "mov rdi, rax"], [16, "call _mpfr_mul"], [17, "mov rax, [rbp+var_8]"], [18, "leave"], [19, "retn"]], "data_dep": [[7, 6], [8, 4], [9, 8], [10, 3], [11, 10], [12, 7], [13, 12], [15, 13], [17, 7], [19, 17]]}
|
unsigned int findInTable(unsigned int *tab, unsigned wc) {
int i;
for (i = 0; i < 256; i++) {
if (tab[i] == wc) break;
}
return i;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403198", "function_addr": 4207000, "binary_name": "b075dfd15a5f87f7bd9b7e1d96fde5cc5aceb552b90c5c42e9565c1e439733f4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_1C], esi"], [4, "mov [rbp+var_4], 0"], [5, "jmp short loc_4031CB"], [6, "mov eax, [rbp+var_4]"], [7, "cdqe"], [8, "lea rdx, ds:0[rax*4]"], [9, "mov rax, [rbp+var_18]"], [10, "add rax, rdx"], [11, "mov eax, [rax]"], [12, "cmp [rbp+var_1C], eax"], [13, "jz short loc_4031D6"], [14, "add [rbp+var_4], 1"], [15, "cmp [rbp+var_4], 0FFh"], [16, "jle short loc_4031AC"], [17, "jmp short loc_4031D7"], [18, "nop"], [19, "mov eax, [rbp+var_4]"], [20, "pop rbp"], [21, "retn"]], "data_dep": [[6, 14], [6, 4], [8, 8], [9, 2], [10, 9], [10, 8], [11, 10], [12, 3], [12, 11], [13, 12], [14, 4], [14, 14], [15, 14], [15, 4], [16, 15], [19, 14], [19, 4], [20, 0], [21, 19]]}
|
size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel)
{
return ZSTD_compressBegin_usingDict(cctx, NULL, 0, compressionLevel);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_414C7B", "function_addr": 4279419, "binary_name": "0d5cc33be703a38c79bfdcda07108b6b035bbbdab3162c06b4fb671d7a57f5b7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_C], esi"], [5, "mov edx, [rbp+var_C]"], [6, "mov rax, [rbp+var_8]"], [7, "mov ecx, edx"], [8, "mov edx, 0"], [9, "mov esi, 0"], [10, "mov rdi, rax"], [11, "call sub_414BB7"], [12, "leave"], [13, "retn"]], "data_dep": [[5, 4], [6, 3], [7, 5], [10, 6], [13, 11]]}
|
ACPI_STATUS
AcpiOsDeleteSemaphore (
ACPI_HANDLE Handle)
{
return (AE_OK);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4044E1", "function_addr": 4211937, "binary_name": "53081f683e097394c8bd35863853914f3d78f9fba127cafeea789f2252f98359.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov eax, 0"], [4, "pop rbp"], [5, "retn"]], "data_dep": [[4, 0], [5, 3]]}
|
xlEXPORT void xlStkOver(void)
{
xlFmtAbort("value stack overflow");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_409478", "function_addr": 4232312, "binary_name": "616268ddd6c2eb493b2c54efa19d29a7054ba3644d87315019eb9d0213d39602.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov edi, offset aValueStackOver"], [3, "mov eax, 0"], [4, "call sub_40A8AC"]], "data_dep": []}
|
int read_from_filesystem_process(struct pipeline_element_t *e,
struct audit_log_entry_t *audit_log)
{
int res = 0;
struct read_from_filesystem_config_t *conf = e->payload;
d("Starting batch operation at the directory: %s\n", conf->directory);
res = open_directory_recursive(conf->directory,
read_from_filesystem_call_entry_cb, conf);
if (res)
{
res = -1;
e("Failed to open the directory: '%s' or one of its sub-directories\n",
conf->directory);
goto failed_opening_directory;
}
failed_opening_directory:
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4017E6", "function_addr": 4200422, "binary_name": "5818f963fbe7ec3d7e2ec9a7a9898955e36502c12a2dfcf92867927ad35fca32.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_20], rsi"], [5, "mov [rbp+var_4], 0"], [6, "mov rax, [rbp+var_18]"], [7, "mov rax, [rax+8]"], [8, "mov [rbp+var_10], rax"], [9, "mov eax, cs:dword_418184"], [10, "test eax, eax"], [11, "jz short loc_40183B"], [12, "mov rax, [rbp+var_10]"], [13, "mov rax, [rax]"], [14, "mov r8, rax"], [15, "mov ecx, offset aReadFromFilesy"], [16, "mov edx, 2Fh "], [17, "mov esi, offset aInputElementsR"], [18, "mov edi, offset aSDSStartingBat"], [19, "mov eax, 0"], [20, "call _printf"], [21, "mov rax, [rbp+var_10]"], [22, "mov rax, [rax]"], [23, "mov rdx, [rbp+var_10]"], [24, "mov esi, offset sub_4016D7"], [25, "mov rdi, rax"], [26, "call sub_402C13"], [27, "mov [rbp+var_4], eax"], [28, "cmp [rbp+var_4], 0"], [29, "jz short loc_401898"], [30, "mov [rbp+var_4], 0FFFFFFFFh"], [31, "mov rax, [rbp+var_10]"], [32, "mov rdx, [rax]"], [33, "mov rax, cs:stderr"], [34, "mov r9, rdx"], [35, "mov r8d, offset aReadFromFilesy"], [36, "mov ecx, 37h "], [37, "mov edx, offset aInputElementsR"], [38, "mov esi, offset aSDSFailedToOpe"], [39, "mov rdi, rax"], [40, "mov eax, 0"], [41, "call _fprintf"], [42, "jmp short loc_401899"], [43, "nop"], [44, "mov eax, 0"], [45, "leave"], [46, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [10, 9], [11, 10], [12, 8], [13, 12], [14, 13], [21, 8], [22, 21], [23, 8], [25, 22], [27, 26], [28, 27], [29, 28], [31, 8], [32, 31], [34, 32], [39, 33], [46, 44]]}
|
static int firehose_write(struct qdl_device *qdl, xmlDoc *doc)
{
int saved_errno;
xmlChar *s;
int len;
int ret;
xmlDocDumpMemory(doc, &s, &len);
for (;;) {
if (qdl_debug)
fprintf(stderr, "FIREHOSE WRITE: %s\n", s);
ret = qdl_write(qdl, s, len);
saved_errno = errno;
/*
* db410c sometimes sense a <response> followed by <log>
* entries and won't accept write commands until these are
* drained, so attempt to read any pending data and then retry
* the write.
*/
if (ret < 0 && errno == ETIMEDOUT) {
firehose_read(qdl, 100, firehose_generic_parser, NULL);
} else {
break;
}
}
xmlFree(s);
return ret < 0 ? -saved_errno : 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402A22", "function_addr": 4205090, "binary_name": "87d497476ce9b442dfc0f771c36a76215e7a33fb8f88d419a9455bf6dafcfb7d.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, "lea rdx, [rbp+var_14]"], [6, "lea rcx, [rbp+var_10]"], [7, "mov rax, [rbp+var_30]"], [8, "mov rsi, rcx"], [9, "mov rdi, rax"], [10, "call _xmlDocDumpMemory"], [11, "movzx eax, cs:byte_40B340"], [12, "test al, al"], [13, "jz short loc_402A71"], [14, "mov rdx, [rbp+var_10]"], [15, "mov rax, cs:stderr"], [16, "mov esi, offset aFirehoseWriteS"], [17, "mov rdi, rax"], [18, "mov eax, 0"], [19, "call _fprintf"], [20, "mov eax, [rbp+var_14]"], [21, "movsxd rdx, eax"], [22, "mov rcx, [rbp+var_10]"], [23, "mov rax, [rbp+var_28]"], [24, "mov rsi, rcx"], [25, "mov rdi, rax"], [26, "call sub_4048AE"], [27, "mov [rbp+var_4], eax"], [28, "call ___errno_location"], [29, "mov eax, [rax]"], [30, "mov [rbp+var_8], eax"], [31, "cmp [rbp+var_4], 0"], [32, "jns short loc_402AC6"], [33, "call ___errno_location"], [34, "mov eax, [rax]"], [35, "cmp eax, 6Eh "], [36, "jnz short loc_402AC6"], [37, "mov rax, [rbp+var_28]"], [38, "mov ecx, 0"], [39, "mov edx, offset sub_40272D"], [40, "mov esi, 64h "], [41, "mov rdi, rax"], [42, "call sub_4027AB"], [43, "jmp short loc_402A49"], [44, "mov rdx, cs:xmlFree"], [45, "mov rax, [rbp+var_10]"], [46, "mov rdi, rax"], [47, "call rdx "], [48, "cmp [rbp+var_4], 0"], [49, "jns short loc_402AE3"], [50, "mov eax, [rbp+var_8]"], [51, "neg eax"], [52, "jmp short locret_402AE8"], [53, "mov eax, 0"], [54, "leave"], [55, "retn"]], "data_dep": [[7, 4], [8, 6], [9, 7], [12, 11], [13, 12], [17, 15], [21, 20], [23, 3], [24, 22], [25, 23], [27, 26], [29, 28], [30, 29], [31, 27], [32, 31], [34, 33], [35, 34], [36, 35], [37, 3], [41, 37], [46, 45], [47, 44], [48, 27], [49, 48], [50, 30], [51, 50], [55, 53], [55, 51]]}
|
int vb2_safe_memcmp(const void *s1, const void *s2, size_t size)
{
const unsigned char *us1 = s1;
const unsigned char *us2 = s2;
int result = 0;
if (0 == size)
return 0;
/*
* Code snippet without data-dependent branch due to Nate Lawson
* ([email protected]) of Root Labs.
*/
while (size--)
result |= *us1++ ^ *us2++;
return result != 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40550F", "function_addr": 4216079, "binary_name": "a97a959f5a5bbcfbc13eaf601fe5a3d4d6f443efbaca9a1e6880d3b64fa82be1.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_38], rdx"], [5, "mov rax, [rbp+var_28]"], [6, "mov [rbp+var_8], rax"], [7, "mov rax, [rbp+var_30]"], [8, "mov [rbp+var_10], rax"], [9, "mov [rbp+var_14], 0"], [10, "cmp [rbp+var_38], 0"], [11, "jnz short loc_40556A"], [12, "mov eax, 0"], [13, "jmp short loc_405585"], [14, "mov rax, [rbp+var_8]"], [15, "lea rdx, [rax+1]"], [16, "mov [rbp+var_8], rdx"], [17, "movzx ecx, byte ptr [rax]"], [18, "mov rax, [rbp+var_10]"], [19, "lea rdx, [rax+1]"], [20, "mov [rbp+var_10], rdx"], [21, "movzx eax, byte ptr [rax]"], [22, "xor eax, ecx"], [23, "movzx eax, al"], [24, "or [rbp+var_14], eax"], [25, "mov rax, [rbp+var_38]"], [26, "lea rdx, [rax-1]"], [27, "mov [rbp+var_38], rdx"], [28, "test rax, rax"], [29, "jnz short loc_405544"], [30, "cmp [rbp+var_14], 0"], [31, "setnz al"], [32, "movzx eax, al"], [33, "pop rbp"], [34, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 3], [8, 7], [10, 4], [11, 10], [14, 16], [14, 6], [15, 14], [15, 26], [16, 15], [17, 14], [18, 20], [18, 8], [19, 18], [19, 15], [20, 19], [21, 18], [22, 17], [22, 21], [23, 22], [24, 23], [24, 9], [24, 24], [25, 4], [25, 27], [26, 19], [26, 25], [27, 26], [28, 25], [29, 28], [30, 9], [30, 24], [31, 28], [31, 30], [32, 31], [33, 0], [34, 12], [34, 32]]}
|
static void
flushbuffer(PrintfTarget *target)
{
size_t nc = target->bufptr - target->bufstart;
/*
* Don't write anything if we already failed; this is to ensure we
* preserve the original failure's errno.
*/
if (!target->failed && nc > 0)
{
size_t written;
written = fwrite(target->bufstart, 1, nc, target->stream);
target->nchars += written;
if (written != nc)
target->failed = true;
}
target->bufptr = target->bufstart;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_413780", "function_addr": 4274048, "binary_name": "40874554c46d15a39ce91c8819ccc126854a63e765dafd614f39346dbaf3dc95.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 rdx, [rax]"], [6, "mov rax, [rbp+var_18]"], [7, "mov rcx, [rax+8]"], [8, "mov rax, rdx"], [9, "sub rax, rcx"], [10, "mov [rbp+n], rax"], [11, "mov rax, [rbp+var_18]"], [12, "movzx eax, byte ptr [rax+24h]"], [13, "xor eax, 1"], [14, "test al, al"], [15, "jz short loc_41380A"], [16, "cmp [rbp+n], 0"], [17, "jz short loc_41380A"], [18, "mov rax, [rbp+var_18]"], [19, "mov rcx, [rax+18h]"], [20, "mov rax, [rbp+var_18]"], [21, "mov rax, [rax+8]"], [22, "mov rdx, [rbp+n]"], [23, "mov esi, 1"], [24, "mov rdi, rax"], [25, "call _fwrite"], [26, "mov [rbp+var_10], rax"], [27, "mov rax, [rbp+var_18]"], [28, "mov eax, [rax+20h]"], [29, "mov edx, eax"], [30, "mov rax, [rbp+var_10]"], [31, "add eax, edx"], [32, "mov edx, eax"], [33, "mov rax, [rbp+var_18]"], [34, "mov [rax+20h], edx"], [35, "mov rax, [rbp+var_10]"], [36, "cmp rax, [rbp+n]"], [37, "jz short loc_41380A"], [38, "mov rax, [rbp+var_18]"], [39, "mov byte ptr [rax+24h], 1"], [40, "mov rax, [rbp+var_18]"], [41, "mov rdx, [rax+8]"], [42, "mov rax, [rbp+var_18]"], [43, "mov [rax], rdx"], [44, "nop"], [45, "leave"], [46, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 3], [7, 6], [8, 5], [9, 8], [9, 7], [10, 9], [11, 3], [12, 11], [13, 12], [14, 13], [15, 14], [16, 10], [17, 16], [18, 3], [19, 18], [20, 3], [21, 20], [22, 10], [24, 21], [26, 25], [27, 3], [28, 27], [29, 28], [30, 26], [31, 29], [31, 30], [32, 31], [33, 3], [34, 33], [34, 32], [35, 26], [36, 10], [36, 35], [37, 36], [38, 3], [39, 38], [40, 3], [41, 40], [41, 43], [41, 39], [41, 34], [42, 3], [43, 42], [43, 41], [46, 42]]}
|
void
writeout(void)
{
hword i;
for(i = 0; i < itemp-1; i++){
writew(item[i], relfp);
// printf("\t\tDUMP: %06o %06o\n", left(item[i]), right(item[i]));
}
//printf("\n");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40158E", "function_addr": 4199822, "binary_name": "29ea477980c0d8b0baee130da8b95a902e69458dd77b36fa27b9e48bd094f22d.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_4], 0"], [4, "jmp short loc_4015C0"], [5, "mov rdx, cs:qword_40E870"], [6, "mov eax, [rbp+var_4]"], [7, "mov rax, ds:qword_435F80[rax*8]"], [8, "mov rsi, rdx"], [9, "mov rdi, rax"], [10, "call sub_405918"], [11, "add [rbp+var_4], 1"], [12, "mov eax, cs:dword_635F80"], [13, "sub eax, 1"], [14, "cmp [rbp+var_4], eax"], [15, "jb short loc_40159F"], [16, "nop"], [17, "nop"], [18, "leave"], [19, "retn"]], "data_dep": [[6, 11], [6, 3], [8, 5], [9, 7], [11, 3], [11, 11], [13, 12], [14, 13], [14, 3], [14, 11], [15, 14], [19, 13]]}
|
t_stat mt_detach (UNIT *uptr)
{
uptr->botf = uptr->eotf = 0;
return sim_tape_detach (uptr);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40CE09", "function_addr": 4247049, "binary_name": "13f2671241114a962235990a8a53447d965ef69e183b81e214ebbded998f318a.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 dword ptr [rax+60h], 0"], [6, "mov rax, [rbp+var_8]"], [7, "mov edx, [rax+60h]"], [8, "mov rax, [rbp+var_8]"], [9, "mov [rax+5Ch], edx"], [10, "mov rax, [rbp+var_8]"], [11, "mov rdi, rax"], [12, "call sub_46BFDD"], [13, "leave"], [14, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 3], [7, 6], [7, 5], [8, 3], [9, 8], [9, 7], [10, 3], [11, 10], [14, 12]]}
|
static void perf_evlist__collapse_resort(struct perf_evlist *evlist)
{
struct perf_evsel *evsel;
evlist__for_each(evlist, evsel) {
struct hists *hists = &evsel->hists;
hists__collapse_resort(hists, NULL);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_420563", "function_addr": 4326755, "binary_name": "decb9d72b93d941cc30c251e69b1ae930ef147e67c065af3feea2db57aca5f08.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_38], rdi"], [4, "mov rax, fs:28h"], [5, "mov [rbp+var_8], rax"], [6, "xor eax, eax"], [7, "mov rax, [rbp+var_38]"], [8, "mov rax, [rax]"], [9, "mov [rbp+var_20], rax"], [10, "mov rax, [rbp+var_20]"], [11, "mov [rbp+var_28], rax"], [12, "jmp short loc_4205C5"], [13, "mov rax, [rbp+var_28]"], [14, "add rax, 0A8h"], [15, "mov [rbp+var_18], rax"], [16, "mov rax, [rbp+var_18]"], [17, "mov esi, 0"], [18, "mov rdi, rax"], [19, "call hists__collapse_resort"], [20, "mov rax, [rbp+var_28]"], [21, "mov rax, [rax]"], [22, "mov [rbp+var_10], rax"], [23, "mov rax, [rbp+var_10]"], [24, "mov [rbp+var_28], rax"], [25, "mov rax, [rbp+var_28]"], [26, "cmp rax, [rbp+var_38]"], [27, "jnz short loc_420593"], [28, "nop"], [29, "mov rax, [rbp+var_8]"], [30, "sub rax, fs:28h"], [31, "jz short locret_4205E4"], [32, "call ___stack_chk_fail"], [33, "leave"], [34, "retn"]], "data_dep": [[5, 4], [7, 3], [8, 7], [9, 8], [10, 9], [11, 10], [13, 11], [13, 24], [14, 13], [15, 14], [16, 15], [18, 16], [20, 11], [20, 24], [21, 20], [22, 21], [23, 22], [24, 23], [25, 24], [25, 11], [26, 25], [26, 3], [27, 26], [29, 5], [30, 29], [31, 30], [34, 30]]}
|
int encode_mac( uint8_t * base,
size_t * idx,
const n2n_mac_t m )
{
return encode_buf( base, idx, m, N2N_MAC_SIZE );
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_408C3E", "function_addr": 4230206, "binary_name": "e6347362ab4087e8b7809efee81b7765bd9154d476290188e08904771149bd36.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_10], rsi"], [5, "mov [rbp+var_18], rdx"], [6, "mov rdx, [rbp+var_18]"], [7, "mov rsi, [rbp+var_10]"], [8, "mov rax, [rbp+var_8]"], [9, "mov ecx, 6"], [10, "mov rdi, rax"], [11, "call sub_408B67"], [12, "leave"], [13, "retn"]], "data_dep": [[6, 5], [7, 4], [8, 3], [10, 8], [13, 11]]}
|
bool_t
xdr_qcsapi_wifi_wowlan_get_udp_port_rpcdata (XDR *xdrs, qcsapi_wifi_wowlan_get_udp_port_rpcdata *objp)
{
register int32_t *buf;
if (!xdr_pointer (xdrs, (char **)&objp->ifname, sizeof (__rpc_string), (xdrproc_t) xdr___rpc_string))
return FALSE;
if (!xdr_pointer (xdrs, (char **)&objp->p_value, sizeof (uint16_t), (xdrproc_t) xdr_uint16_t))
return FALSE;
if (!xdr_pointer (xdrs, (char **)&objp->len, sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
return FALSE;
if (!xdr_int (xdrs, &objp->return_code))
return FALSE;
return TRUE;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4474E2", "function_addr": 4486370, "binary_name": "501cccf918b79847e8ca63bec31f6c1a738c67ece900875150908962c3feed30.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+xdrs], rdi"], [4, "mov [rbp+objpp], rsi"], [5, "mov rsi, [rbp+objpp]"], [6, "mov rax, [rbp+xdrs]"], [7, "mov rdx, offset xdr_obj"], [8, "mov rcx, rdx"], [9, "mov edx, 8"], [10, "mov rdi, rax"], [11, "call _xdr_pointer"], [12, "test eax, eax"], [13, "jnz short loc_44751F"], [14, "mov eax, 0"], [15, "jmp locret_4475A2"], [16, "mov rax, [rbp+objpp]"], [17, "lea rsi, [rax+8]"], [18, "mov rax, [rbp+xdrs]"], [19, "mov rdx, cs:xdr_uint16_t_ptr"], [20, "mov rcx, rdx"], [21, "mov edx, 2"], [22, "mov rdi, rax"], [23, "call _xdr_pointer"], [24, "test eax, eax"], [25, "jnz short loc_44754D"], [26, "mov eax, 0"], [27, "jmp short locret_4475A2"], [28, "mov rax, [rbp+objpp]"], [29, "lea rsi, [rax+10h]"], [30, "mov rax, [rbp+xdrs]"], [31, "mov rdx, cs:xdr_uint32_t_ptr"], [32, "mov rcx, rdx"], [33, "mov edx, 4"], [34, "mov rdi, rax"], [35, "call _xdr_pointer"], [36, "test eax, eax"], [37, "jnz short loc_44757B"], [38, "mov eax, 0"], [39, "jmp short locret_4475A2"], [40, "mov rax, [rbp+objpp]"], [41, "lea rdx, [rax+18h]"], [42, "mov rax, [rbp+xdrs]"], [43, "mov rsi, rdx"], [44, "mov rdi, rax"], [45, "call xdr_int"], [46, "test eax, eax"], [47, "jnz short loc_44759D"], [48, "mov eax, 0"], [49, "jmp short locret_4475A2"], [50, "mov eax, 1"], [51, "leave"], [52, "retn"]], "data_dep": [[5, 4], [6, 3], [8, 7], [10, 6], [12, 11], [13, 12], [16, 4], [17, 5], [17, 16], [18, 3], [20, 19], [22, 18], [24, 23], [25, 24], [28, 4], [29, 17], [29, 28], [30, 3], [32, 31], [34, 30], [36, 35], [37, 36], [40, 4], [41, 40], [41, 33], [42, 3], [43, 41], [44, 42], [46, 45], [47, 46], [52, 48], [52, 14], [52, 26], [52, 38], [52, 50]]}
|