MCPcopy Create free account
hub / github.com/bytedance/android-inline-hook / parse_flags

Function parse_flags

tools/record_parser.py:297–312  ·  view source on GitHub ↗
(flags, op)

Source from the content-addressed store, hash-verified

295
296
297def parse_flags(flags, op):
298 flags_str = ''
299 n = int(flags)
300 if op.startswith("hook_"):
301 if n & 0b0111 == 0: flags_str += 'default_mode | '
302 if n & 0b0001: flags_str += 'shared_mode | '
303 if n & 0b0010: flags_str += 'unique_mode | '
304 if n & 0b0100: flags_str += 'multi_mode | '
305 if n & 0b1000: flags_str += 'record | '
306 elif op.startswith("intercept_"):
307 if n & 0b011 == 0: flags_str += 'default | '
308 if n & 0b011 == 1: flags_str += 'read_only | '
309 if n & 0b011 == 2: flags_str += 'write_only | '
310 if n & 0b011 == 3: flags_str += 'read_write | '
311 if n & 0b100: flags_str += 'record | '
312 return flags if not flags_str else (flags + ' (' + flags_str[:-3] + ')')
313
314
315def op_is_unop(op):

Callers 1

parse_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected