MCPcopy Create free account
hub / github.com/Lil-House/Pyarmor-Static-Unpack-1shot / OpcodeName

Method OpcodeName

pycdc/bytecode.cpp:44–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42DECLARE_PYTHON(3, 14)
43
44const char* Pyc::OpcodeName(int opcode)
45{
46 static const char* opcode_names[] = {
47 #define OPCODE(x) #x,
48 #define OPCODE_A_FIRST(x) #x,
49 #define OPCODE_A(x) #x,
50 #include "bytecode_ops.inl"
51 #undef OPCODE_A
52 #undef OPCODE_A_FIRST
53 #undef OPCODE
54 };
55
56#if __cplusplus >= 201103L
57 static_assert(sizeof(opcode_names) / sizeof(opcode_names[0]) == PYC_LAST_OPCODE,
58 "Pyc::OpcodeName opcode_names not in sync with opcode enum");
59#endif
60
61 if (opcode < 0)
62 return "<INVALID>";
63
64 if (opcode < PYC_LAST_OPCODE)
65 return opcode_names[opcode];
66
67 static char badcode[16];
68 snprintf(badcode, sizeof(badcode), "<%d>", opcode);
69 return badcode;
70};
71
72int Pyc::ByteToOpcode(int maj, int min, int opcode)
73{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected