Files
Pyarmor-Static-Unpack-1shot/bytecode.h

36 lines
921 B
C
Raw Normal View History

2011-10-23 17:48:10 -07:00
#include "pyc_code.h"
#include "pyc_module.h"
2009-07-26 10:07:13 +00:00
#include "data.h"
2009-07-24 08:35:21 +00:00
namespace Pyc {
2009-07-24 08:35:21 +00:00
enum Opcode {
#define OPCODE(x) x,
#define OPCODE_A_FIRST(x) PYC_HAVE_ARG, x##_A = PYC_HAVE_ARG,
#define OPCODE_A(x) x##_A,
#include "bytecode_ops.inl"
#undef OPCODE_A
#undef OPCODE_A_FIRST
#undef OPCODE
PYC_LAST_OPCODE,
PYC_INVALID_OPCODE = -1,
2009-07-24 08:35:21 +00:00
};
const char* OpcodeName(int opcode);
int ByteToOpcode(int maj, int min, int opcode);
2009-07-24 08:35:21 +00:00
2009-07-24 19:52:47 +00:00
bool IsConstArg(int opcode);
bool IsNameArg(int opcode);
bool IsVarNameArg(int opcode);
bool IsCellArg(int opcode);
bool IsJumpOffsetArg(int opcode);
bool IsJumpArg(int opcode);
bool IsCompareArg(int opcode);
2009-07-24 19:52:47 +00:00
2009-07-24 08:35:21 +00:00
}
void print_const(PycRef<PycObject> obj, PycModule* mod, const char* parent_f_string_quote = nullptr);
2009-07-26 10:07:13 +00:00
void bc_next(PycBuffer& source, PycModule* mod, int& opcode, int& operand, int& pos);
2009-07-24 08:35:21 +00:00
void bc_disasm(PycRef<PycCode> code, PycModule* mod, int indent);