Project
Test roots, truncation and a 255-byte expanded-name limit, rejecting invalid label tags, cycles and pointers that do not point backward.
LabelFen is a Windows AI coding client for reviewing compressed DNS names in a project. Connect a compatible model endpoint, discuss packet offsets and inspect proposed parsing changes before accepting them.
def dns_name(data, offset):
if type(data) is not bytes or len(data) > 65535 or type(offset) is not int or not 0 <= offset < len(data):
raise ValueError("dns.input")
labels, seen, pos, end, size = [], set(), offset, None, 1
while True:
if pos in seen or pos >= len(data):
raise ValueError("dns.pointer")
seen.add(pos)
count = data[pos]
if count & 192 == 192:
if pos+1 >= len(data):
raise ValueError("dns.truncated")
target = ((count & 63) << 8) | data[pos+1]
if target >= pos:
raise ValueError("dns.forward")
if end is None:
end = pos+2
pos = target
continue
if count & 192 or pos+1+count > len(data):
raise ValueError("dns.label")
pos += 1
if count == 0:
return labels, pos if end is None else end
size += count+1
if size > 255:
raise ValueError("dns.length")
labels.append(data[pos:pos+count])
pos += count
Test roots, truncation and a 255-byte expanded-name limit, rejecting invalid label tags, cycles and pointers that do not point backward.
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
Base URL, credentials and a reachable server.
def dns_name(data, offset):
if type(data) is not bytes or len(data) > 65535 or type(offset) is not int or not 0 <= offset < len(data):
raise ValueError("dns.input")
labels, seen, pos, end, size = [], set(), offset, None, 1
while True:
if pos in seen or pos >= len(data):
raise ValueError("dns.pointer")
seen.add(pos)
count = data[pos]
if count & 192 == 192:
if pos+1 >= len(data):
raise ValueError("dns.truncated")
target = ((count & 63) << 8) | data[pos+1]
if target >= pos:
raise ValueError("dns.forward")
if end is None:
end = pos+2
pos = target
continue
if count & 192 or pos+1+count > len(data):
raise ValueError("dns.label")
pos += 1
if count == 0:
return labels, pos if end is None else end
size += count+1
if size > 255:
raise ValueError("dns.length")
labels.append(data[pos:pos+count])
pos += count
LabelFen brings protocol maintenance into a Windows AI coding workspace. Open the project folder and describe the packet behavior you need to change, including what the next stage expects after parsing. A conversation grounded in those files can connect a local correction to the wider reader instead of judging a helper solely by the value it returns.
Compressed DNS names provide an example task. Ask the model to inspect pointer handling, malformed input rejection and the offset returned to the caller. Include a packet with a compressed name followed by another field. That gives the proposed patch a concrete requirement: recover the name while leaving the surrounding parser in the right place.
During review, distinguish where a pointer is followed from where the caller should resume. A plausible decoded name does not prove that the next field will be read correctly. Run relevant tests with truncated and valid fixtures, inspect the final offset, and compare the surrounding parser’s result before adopting the change.
You can select an abliterated AI model offered by a supported OpenAI-compatible or Anthropic endpoint, with credentials when required. Its response restrictions, tools and context limits remain model- and server-dependent. LabelFen supports the project discussion; your review and protocol fixtures provide the evidence for the software decision.
The caller may use that offset to read the next field. A correct name with an incorrect resume position can corrupt the rest of the packet interpretation. Include a following field in the fixture and check both outcomes explicitly.
Only accept forms that your documented contract supports. Compare the implementation with that subset before broadening it. Ask the model to identify newly accepted inputs so a cleanup does not silently change protocol acceptance rules.
It should end at a meaningful boundary, such as an incomplete pointer or label, and specify the expected rejection. Review whether the parser fails before consuming unavailable bytes, then check how the surrounding reader handles the error.
Depending on endpoint and tool configuration, yes. Prefer sanitized byte fixtures and review destinations before sharing captures. Running a local model server separately does not make every connected inspection tool or external service local.
LabelFen · Updated 2026-10-25