2009-12-23 06:50:29 +08:00
|
|
|
//===- Disassembler.cpp - Disassembler for hex strings --------------------===//
|
2009-12-17 09:49:59 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This class implements the disassembler of strings of bytes written in
|
|
|
|
// hexadecimal, from standard input or from a file.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-12-23 06:50:29 +08:00
|
|
|
#include "Disassembler.h"
|
2010-07-21 02:25:19 +08:00
|
|
|
#include "../../lib/MC/MCDisassembler/EDDisassembler.h"
|
|
|
|
#include "../../lib/MC/MCDisassembler/EDInst.h"
|
|
|
|
#include "../../lib/MC/MCDisassembler/EDOperand.h"
|
|
|
|
#include "../../lib/MC/MCDisassembler/EDToken.h"
|
2012-12-04 18:44:52 +08:00
|
|
|
#include "llvm/ADT/OwningPtr.h"
|
|
|
|
#include "llvm/ADT/Triple.h"
|
2009-12-17 09:49:59 +08:00
|
|
|
#include "llvm/MC/MCDisassembler.h"
|
|
|
|
#include "llvm/MC/MCInst.h"
|
2012-04-16 19:32:10 +08:00
|
|
|
#include "llvm/MC/MCStreamer.h"
|
2011-09-08 01:24:38 +08:00
|
|
|
#include "llvm/MC/MCSubtargetInfo.h"
|
2009-12-17 09:49:59 +08:00
|
|
|
#include "llvm/Support/MemoryBuffer.h"
|
|
|
|
#include "llvm/Support/MemoryObject.h"
|
2009-12-22 14:45:48 +08:00
|
|
|
#include "llvm/Support/SourceMgr.h"
|
2011-08-25 02:08:43 +08:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2012-04-16 19:32:10 +08:00
|
|
|
|
2009-12-17 09:49:59 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2009-12-22 14:56:51 +08:00
|
|
|
typedef std::vector<std::pair<unsigned char, const char*> > ByteArrayTy;
|
|
|
|
|
|
|
|
namespace {
|
2009-12-17 09:49:59 +08:00
|
|
|
class VectorMemoryObject : public MemoryObject {
|
|
|
|
private:
|
2009-12-22 14:56:51 +08:00
|
|
|
const ByteArrayTy &Bytes;
|
2009-12-17 09:49:59 +08:00
|
|
|
public:
|
2009-12-22 14:56:51 +08:00
|
|
|
VectorMemoryObject(const ByteArrayTy &bytes) : Bytes(bytes) {}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-22 14:56:51 +08:00
|
|
|
uint64_t getBase() const { return 0; }
|
2012-02-29 09:09:06 +08:00
|
|
|
uint64_t getExtent() const { return Bytes.size(); }
|
2009-12-17 09:49:59 +08:00
|
|
|
|
2012-02-29 09:09:06 +08:00
|
|
|
int readByte(uint64_t Addr, uint8_t *Byte) const {
|
2011-01-07 00:48:42 +08:00
|
|
|
if (Addr >= getExtent())
|
2009-12-17 09:49:59 +08:00
|
|
|
return -1;
|
2009-12-22 14:56:51 +08:00
|
|
|
*Byte = Bytes[Addr].first;
|
2009-12-17 09:49:59 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
};
|
2009-12-22 14:56:51 +08:00
|
|
|
}
|
2009-12-17 09:49:59 +08:00
|
|
|
|
2010-03-21 06:36:35 +08:00
|
|
|
static bool PrintInsts(const MCDisassembler &DisAsm,
|
2012-04-16 19:32:10 +08:00
|
|
|
const ByteArrayTy &Bytes,
|
|
|
|
SourceMgr &SM, raw_ostream &Out,
|
|
|
|
MCStreamer &Streamer) {
|
2009-12-17 09:49:59 +08:00
|
|
|
// Wrap the vector in a MemoryObject.
|
2009-12-22 14:56:51 +08:00
|
|
|
VectorMemoryObject memoryObject(Bytes);
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-02-03 11:46:41 +08:00
|
|
|
// Disassemble it to strings.
|
2009-12-22 14:56:51 +08:00
|
|
|
uint64_t Size;
|
2010-02-03 11:46:41 +08:00
|
|
|
uint64_t Index;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-02-03 11:46:41 +08:00
|
|
|
for (Index = 0; Index < Bytes.size(); Index += Size) {
|
|
|
|
MCInst Inst;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-08-18 01:44:15 +08:00
|
|
|
MCDisassembler::DecodeStatus S;
|
|
|
|
S = DisAsm.getInstruction(Inst, Size, memoryObject, Index,
|
2011-09-16 07:38:46 +08:00
|
|
|
/*REMOVE*/ nulls(), nulls());
|
2011-08-18 01:44:15 +08:00
|
|
|
switch (S) {
|
|
|
|
case MCDisassembler::Fail:
|
2010-02-03 11:46:41 +08:00
|
|
|
SM.PrintMessage(SMLoc::getFromPointer(Bytes[Index].second),
|
2011-10-16 13:43:57 +08:00
|
|
|
SourceMgr::DK_Warning,
|
|
|
|
"invalid instruction encoding");
|
2010-02-03 11:46:41 +08:00
|
|
|
if (Size == 0)
|
|
|
|
Size = 1; // skip illegible bytes
|
2011-08-18 01:44:15 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MCDisassembler::SoftFail:
|
|
|
|
SM.PrintMessage(SMLoc::getFromPointer(Bytes[Index].second),
|
2011-10-16 13:43:57 +08:00
|
|
|
SourceMgr::DK_Warning,
|
|
|
|
"potentially undefined instruction encoding");
|
2011-08-18 01:44:15 +08:00
|
|
|
// Fall through
|
|
|
|
|
|
|
|
case MCDisassembler::Success:
|
2012-04-16 19:32:10 +08:00
|
|
|
Streamer.EmitInstruction(Inst);
|
2011-08-18 01:44:15 +08:00
|
|
|
break;
|
2010-02-03 11:46:41 +08:00
|
|
|
}
|
2009-12-17 09:49:59 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-22 14:56:51 +08:00
|
|
|
return false;
|
2009-12-17 09:49:59 +08:00
|
|
|
}
|
|
|
|
|
2011-05-10 04:05:25 +08:00
|
|
|
static bool ByteArrayFromString(ByteArrayTy &ByteArray,
|
|
|
|
StringRef &Str,
|
2010-04-13 03:43:00 +08:00
|
|
|
SourceMgr &SM) {
|
2009-12-22 14:24:00 +08:00
|
|
|
while (!Str.empty()) {
|
2009-12-22 14:37:58 +08:00
|
|
|
// Strip horizontal whitespace.
|
|
|
|
if (size_t Pos = Str.find_first_not_of(" \t\r")) {
|
|
|
|
Str = Str.substr(Pos);
|
|
|
|
continue;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-02-03 11:46:41 +08:00
|
|
|
// If this is the end of a line or start of a comment, remove the rest of
|
|
|
|
// the line.
|
2009-12-22 14:37:58 +08:00
|
|
|
if (Str[0] == '\n' || Str[0] == '#') {
|
|
|
|
// Strip to the end of line if we already processed any bytes on this
|
|
|
|
// line. This strips the comment and/or the \n.
|
2010-04-13 03:43:00 +08:00
|
|
|
if (Str[0] == '\n') {
|
2009-12-22 14:37:58 +08:00
|
|
|
Str = Str.substr(1);
|
2010-04-13 03:43:00 +08:00
|
|
|
} else {
|
2009-12-22 14:37:58 +08:00
|
|
|
Str = Str.substr(Str.find_first_of('\n'));
|
|
|
|
if (!Str.empty())
|
|
|
|
Str = Str.substr(1);
|
|
|
|
}
|
|
|
|
continue;
|
2009-12-17 09:49:59 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-17 09:49:59 +08:00
|
|
|
// Get the current token.
|
2009-12-22 14:37:58 +08:00
|
|
|
size_t Next = Str.find_first_of(" \t\n\r#");
|
|
|
|
StringRef Value = Str.substr(0, Next);
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-17 09:49:59 +08:00
|
|
|
// Convert to a byte and add to the byte vector.
|
2009-12-22 14:24:00 +08:00
|
|
|
unsigned ByteVal;
|
|
|
|
if (Value.getAsInteger(0, ByteVal) || ByteVal > 255) {
|
2009-12-22 14:45:48 +08:00
|
|
|
// If we have an error, print it and skip to the end of line.
|
2011-10-16 13:43:57 +08:00
|
|
|
SM.PrintMessage(SMLoc::getFromPointer(Value.data()), SourceMgr::DK_Error,
|
|
|
|
"invalid input token");
|
2009-12-22 14:45:48 +08:00
|
|
|
Str = Str.substr(Str.find('\n'));
|
|
|
|
ByteArray.clear();
|
|
|
|
continue;
|
2009-12-17 09:49:59 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-22 14:56:51 +08:00
|
|
|
ByteArray.push_back(std::make_pair((unsigned char)ByteVal, Value.data()));
|
2009-12-22 14:24:00 +08:00
|
|
|
Str = Str.substr(Next);
|
2009-12-17 09:49:59 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-07-07 03:45:42 +08:00
|
|
|
int Disassembler::disassemble(const Target &T,
|
2011-03-21 12:13:46 +08:00
|
|
|
const std::string &Triple,
|
2012-04-16 19:32:10 +08:00
|
|
|
MCSubtargetInfo &STI,
|
|
|
|
MCStreamer &Streamer,
|
2010-08-20 09:07:01 +08:00
|
|
|
MemoryBuffer &Buffer,
|
2012-04-16 19:32:10 +08:00
|
|
|
SourceMgr &SM,
|
2010-08-20 09:07:01 +08:00
|
|
|
raw_ostream &Out) {
|
2012-04-16 19:32:10 +08:00
|
|
|
OwningPtr<const MCDisassembler> DisAsm(T.createMCDisassembler(STI));
|
2010-04-13 03:43:00 +08:00
|
|
|
if (!DisAsm) {
|
|
|
|
errs() << "error: no disassembler for target " << Triple << "\n";
|
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2012-04-16 19:32:10 +08:00
|
|
|
// Set up initial section manually here
|
|
|
|
Streamer.InitSections();
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
bool ErrorOccurred = false;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
// Convert the input to a vector for disassembly.
|
|
|
|
ByteArrayTy ByteArray;
|
|
|
|
StringRef Str = Buffer.getBuffer();
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
ErrorOccurred |= ByteArrayFromString(ByteArray, Str, SM);
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-22 14:24:00 +08:00
|
|
|
if (!ByteArray.empty())
|
2012-04-16 19:32:10 +08:00
|
|
|
ErrorOccurred |= PrintInsts(*DisAsm, ByteArray, SM, Out, Streamer);
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2009-12-22 14:56:51 +08:00
|
|
|
return ErrorOccurred;
|
2009-12-17 09:49:59 +08:00
|
|
|
}
|
2010-04-13 03:43:00 +08:00
|
|
|
|
|
|
|
static int byteArrayReader(uint8_t *B, uint64_t A, void *Arg) {
|
|
|
|
ByteArrayTy &ByteArray = *((ByteArrayTy*)Arg);
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
if (A >= ByteArray.size())
|
|
|
|
return -1;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
*B = ByteArray[A].first;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int verboseEvaluator(uint64_t *V, unsigned R, void *Arg) {
|
2010-08-20 09:07:01 +08:00
|
|
|
EDDisassembler &disassembler = *(EDDisassembler *)((void **)Arg)[0];
|
|
|
|
raw_ostream &Out = *(raw_ostream *)((void **)Arg)[1];
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-07-21 02:25:19 +08:00
|
|
|
if (const char *regName = disassembler.nameWithRegisterID(R))
|
2010-08-20 09:07:01 +08:00
|
|
|
Out << "[" << regName << "/" << R << "]";
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-07-21 02:25:19 +08:00
|
|
|
if (disassembler.registerIsStackPointer(R))
|
2010-08-20 09:07:01 +08:00
|
|
|
Out << "(sp)";
|
2010-07-21 02:25:19 +08:00
|
|
|
if (disassembler.registerIsProgramCounter(R))
|
2010-08-20 09:07:01 +08:00
|
|
|
Out << "(pc)";
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
*V = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-05-10 04:05:25 +08:00
|
|
|
int Disassembler::disassembleEnhanced(const std::string &TS,
|
2010-08-20 09:07:01 +08:00
|
|
|
MemoryBuffer &Buffer,
|
2012-04-16 19:32:10 +08:00
|
|
|
SourceMgr &SM,
|
2010-08-20 09:07:01 +08:00
|
|
|
raw_ostream &Out) {
|
2010-04-13 03:43:00 +08:00
|
|
|
ByteArrayTy ByteArray;
|
|
|
|
StringRef Str = Buffer.getBuffer();
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
if (ByteArrayFromString(ByteArray, Str, SM)) {
|
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
Triple T(TS);
|
2010-07-21 02:25:19 +08:00
|
|
|
EDDisassembler::AssemblySyntax AS;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
switch (T.getArch()) {
|
|
|
|
default:
|
|
|
|
errs() << "error: no default assembly syntax for " << TS.c_str() << "\n";
|
|
|
|
return -1;
|
|
|
|
case Triple::arm:
|
|
|
|
case Triple::thumb:
|
2010-07-21 02:25:19 +08:00
|
|
|
AS = EDDisassembler::kEDAssemblySyntaxARMUAL;
|
2010-04-13 03:43:00 +08:00
|
|
|
break;
|
|
|
|
case Triple::x86:
|
|
|
|
case Triple::x86_64:
|
2010-07-21 02:25:19 +08:00
|
|
|
AS = EDDisassembler::kEDAssemblySyntaxX86ATT;
|
2010-04-13 03:43:00 +08:00
|
|
|
break;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-24 19:03:19 +08:00
|
|
|
OwningPtr<EDDisassembler>
|
|
|
|
disassembler(EDDisassembler::getDisassembler(TS.c_str(), AS));
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-07-21 02:25:19 +08:00
|
|
|
if (disassembler == 0) {
|
|
|
|
errs() << "error: couldn't get disassembler for " << TS << '\n';
|
2010-04-13 03:43:00 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
while (ByteArray.size()) {
|
2011-02-24 19:03:19 +08:00
|
|
|
OwningPtr<EDInst>
|
|
|
|
inst(disassembler->createInst(byteArrayReader, 0, &ByteArray));
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
if (inst == 0) {
|
|
|
|
errs() << "error: Didn't get an instruction\n";
|
2010-04-13 03:43:00 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2011-04-09 08:21:04 +08:00
|
|
|
|
|
|
|
ByteArray.erase (ByteArray.begin(), ByteArray.begin() + inst->byteSize());
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
unsigned numTokens = inst->numTokens();
|
|
|
|
if ((int)numTokens < 0) {
|
|
|
|
errs() << "error: couldn't count the instruction's tokens\n";
|
2010-04-13 03:43:00 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
for (unsigned tokenIndex = 0; tokenIndex != numTokens; ++tokenIndex) {
|
|
|
|
EDToken *token;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
if (inst->getToken(token, tokenIndex)) {
|
|
|
|
errs() << "error: Couldn't get token\n";
|
2010-04-13 03:43:00 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
const char *buf;
|
|
|
|
if (token->getString(buf)) {
|
|
|
|
errs() << "error: Couldn't get string for token\n";
|
2010-04-13 03:43:00 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
Out << '[';
|
|
|
|
int operandIndex = token->operandID();
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
if (operandIndex >= 0)
|
|
|
|
Out << operandIndex << "-";
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
switch (token->type()) {
|
|
|
|
case EDToken::kTokenWhitespace: Out << "w"; break;
|
|
|
|
case EDToken::kTokenPunctuation: Out << "p"; break;
|
|
|
|
case EDToken::kTokenOpcode: Out << "o"; break;
|
|
|
|
case EDToken::kTokenLiteral: Out << "l"; break;
|
|
|
|
case EDToken::kTokenRegister: Out << "r"; break;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
Out << ":" << buf;
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
if (token->type() == EDToken::kTokenLiteral) {
|
|
|
|
Out << "=";
|
|
|
|
if (token->literalSign())
|
|
|
|
Out << "-";
|
|
|
|
uint64_t absoluteValue;
|
|
|
|
if (token->literalAbsoluteValue(absoluteValue)) {
|
|
|
|
errs() << "error: Couldn't get the value of a literal token\n";
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
Out << absoluteValue;
|
|
|
|
} else if (token->type() == EDToken::kTokenRegister) {
|
|
|
|
Out << "=";
|
|
|
|
unsigned regID;
|
|
|
|
if (token->registerID(regID)) {
|
|
|
|
errs() << "error: Couldn't get the ID of a register token\n";
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
Out << "r" << regID;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
Out << "]";
|
2010-04-13 03:43:00 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
Out << " ";
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
if (inst->isBranch())
|
|
|
|
Out << "<br> ";
|
|
|
|
if (inst->isMove())
|
|
|
|
Out << "<mov> ";
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
unsigned numOperands = inst->numOperands();
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
if ((int)numOperands < 0) {
|
|
|
|
errs() << "error: Couldn't count operands\n";
|
2010-04-13 03:43:00 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
|
|
|
for (unsigned operandIndex = 0; operandIndex != numOperands;
|
|
|
|
++operandIndex) {
|
2011-02-23 11:29:41 +08:00
|
|
|
Out << operandIndex << ":";
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
EDOperand *operand;
|
|
|
|
if (inst->getOperand(operand, operandIndex)) {
|
|
|
|
errs() << "error: couldn't get operand\n";
|
|
|
|
return -1;
|
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
uint64_t evaluatedResult;
|
2011-02-24 19:03:19 +08:00
|
|
|
void *Arg[] = { disassembler.get(), &Out };
|
2011-02-23 11:29:41 +08:00
|
|
|
if (operand->evaluate(evaluatedResult, verboseEvaluator, Arg)) {
|
|
|
|
errs() << "error: Couldn't evaluate an operand\n";
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
Out << "=" << evaluatedResult << " ";
|
2011-02-22 10:09:15 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2011-02-23 11:29:41 +08:00
|
|
|
Out << '\n';
|
2010-04-13 03:43:00 +08:00
|
|
|
}
|
2011-05-10 04:05:25 +08:00
|
|
|
|
2010-04-13 03:43:00 +08:00
|
|
|
return 0;
|
|
|
|
}
|