def main(): if not lock.is_unlock(): print("\033[1;31m 用户被锁定,请稍后重试\033[0m") return if login.login(): operate.operate() else: lock.lock_user()
def explore_path(path): locks = [] unlocks = [] for e in path.effects: if isinstance(e, PathCall): if lock.is_lock(e.func): locks.append(e) if lock.is_unlock(e.func): unlocks.append(e) if len(locks) > 3 or len(unlocks) > 3: break return (locks, unlocks)
def explore_path(path, report): state = lock.LockState() for e in path.effects: if state.is_locked(): state.add(e) if isinstance(e, PathCall): # like this # extracted from results/lock-locked.log if "i_size_read" == e.func: dbg.bug_range("XXXX: %s (locked: %s)", str(e), state.is_locked()) report.add("not protected", e.func, path, e.loc) if lock.is_lock(e.func): state.lock(e) elif lock.is_unlock(e.func): state.unlock(e) return state