def requested_mem_size():
    possible_bp_syms = ["calloc", "malloc", "realloc"]
    sym = None
    for line in pykd.dbgCommand("kb").splitlines()[1:]:
        try:
            _, _, arg0, arg1, _, sym = line.split()
            arg0 = int(arg0, 16)
            arg1 = int(arg1, 16)
            sym = sym.split("!")[1].strip()
        except (ValueError, __HOLE__):
            continue
        if sym in possible_bp_syms:
            break
        sym = None

    if sym == "calloc":
        ret_val = arg0 * arg1
    elif sym == "malloc":
        ret_val = arg0
    elif sym == "realloc":
        ret_val = arg1
    else:
        ret_val = 0
    return ret_val
dataset/ETHPy150Open blackberry/ALF/lib/dbgmin/scripts/WinDBGMemoryLimit.py/requested_mem_size