Disasm.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  std

Classes

class  TempOp
class  UsecodeHeader
class  GlobalName

Functions

uint32 read1 (IDataSource *ucfile)
uint32 read2 (IDataSource *ucfile)
uint32 read4 (IDataSource *ucfile)
std::string readstr (IDataSource *ucfile)
std::string readnstr (IDataSource *ucfile, uint32 n)
const char *const print_bp (const sint32 offset)
const char *const print_sp (const sint32 offset)
sint32 snprintf (char *, size_t, const char *,...)
void printoverloads (IDataSource *ucfile, uint32 endpos)
void readglobals (IDataSource *ucfile)
void printglobals ()
void just_print (TempOp &op, IDataSource *ucfile)
bool readfunction (IDataSource *ucfile, const char *name, const UsecodeHeader &uch, const uint32 func)
void printfunc (const uint32 func, const uint32 nameoffset, IDataSource *ucfile)
void readfunctionnames (void)
int main (int argc, char **argv)

Variables

uint32 curOffset
std::map< sint32, string > ScriptExpressions
map< uint32, uint32EventMap
ConvertUsecodeconvert = new ConvertUsecodeU8()
map< uint32, GlobalNameGlobalNames
map< string, string > FuncNames
string gamelanguage
string gametype
string outputdir
bool print_globals = false
bool strings_only = false
bool crusader = false
Folderfolder = new Folder()


Function Documentation

void just_print ( TempOp op,
IDataSource ucfile 
)

Definition at line 296 of file Disasm.cpp.

References convert, TempOp::i0, TempOp::i1, TempOp::i2, TempOp::i3, TempOp::i4, ConvertUsecode::intrinsics(), TempOp::nextoffset, TempOp::offset, TempOp::op(), print_bp(), print_sp(), TempOp::str, and ConvertUsecode::UsecodeFunctionAddressToString().

Referenced by readfunction().

int main ( int  argc,
char **  argv 
)

Definition at line 743 of file Disasm.cpp.

References con, convert, Args::declare(), Console::DisableWordWrap(), UsecodeHeader::externTable, UsecodeHeader::fixupTable, IDataSource::getSize(), initfolding(), UsecodeHeader::maxOffset, UsecodeHeader::offset, perr, pout, print_disasm, Console::Printf(), printfunc(), printglobals(), printoverloads(), Args::process(), IDataSource::read(), IDataSource::read4(), read4(), FileSystem::ReadFile(), readfunctionnames(), readglobals(), ConvertUsecode::readheader(), UsecodeHeader::routines, IDataSource::seek(), and Pentagram::strcasecmp().

const char* const print_bp ( const sint32  offset  ) 

Definition at line 131 of file Disasm.cpp.

References snprintf().

Referenced by UCMachine::execProcess(), just_print(), and ConvertUsecode::printDbgSymbols().

const char* const print_sp ( const sint32  offset  ) 

Definition at line 138 of file Disasm.cpp.

References snprintf().

Referenced by UCMachine::execProcess(), and just_print().

void printfunc ( const uint32  func,
const uint32  nameoffset,
IDataSource ucfile 
)

Definition at line 678 of file Disasm.cpp.

References con, convert, Folder::FinalUnit(), folder, Folder::print_asm(), Folder::print_unk(), IDataSource::read(), read4(), ConvertUsecode::readevents(), readfunction(), ConvertUsecode::readheader(), and IDataSource::seek().

Referenced by main().

void printglobals (  ) 

Definition at line 222 of file Disasm.cpp.

References con, and Console::Printf().

Referenced by main().

void printoverloads ( IDataSource ucfile,
uint32  endpos 
)

Definition at line 978 of file Disasm.cpp.

References con, convert, ConvertUsecode::event_names(), IDataSource::getPos(), Console::Printf(), IDataSource::read(), and IDataSource::read4().

Referenced by main().

uint32 read1 ( IDataSource ucfile  )  [inline]

Definition at line 88 of file Disasm.cpp.

References IDataSource::read1().

Referenced by ConvertUsecode::readDbgSymbols(), readglobals(), readnstr(), ConvertUsecode::readOpGeneric(), and readstr().

uint32 read2 ( IDataSource ucfile  )  [inline]

Definition at line 89 of file Disasm.cpp.

References IDataSource::read2().

Referenced by ConvertUsecodeCrusader::readevents(), and ConvertUsecode::readOpGeneric().

uint32 read4 ( IDataSource ucfile  )  [inline]

Definition at line 90 of file Disasm.cpp.

References IDataSource::read4().

Referenced by main(), printfunc(), and readglobals().

bool readfunction ( IDataSource ucfile,
const char *  name,
const UsecodeHeader uch,
const uint32  func 
)

Definition at line 247 of file Disasm.cpp.

References convert, ConvertUsecode::event_names(), Folder::fold(), folder, IDataSource::getPos(), IDataSource::getSize(), just_print(), UsecodeHeader::maxOffset, ConvertUsecode::readOp(), and Folder::SelectUnit().

Referenced by printfunc().

void readfunctionnames ( void   ) 

Definition at line 716 of file Disasm.cpp.

References perr.

Referenced by main().

void readglobals ( IDataSource ucfile  ) 

Definition at line 193 of file Disasm.cpp.

References read1(), read4(), and IDataSource::seek().

Referenced by main().

std::string readnstr ( IDataSource ucfile,
uint32  n 
) [inline]

Definition at line 103 of file Disasm.cpp.

References read1().

Referenced by ConvertUsecode::readOpGeneric().

std::string readstr ( IDataSource ucfile  )  [inline]

Definition at line 92 of file Disasm.cpp.

References read1().

sint32 snprintf ( char *  ,
size_t  ,
const char *  ,
  ... 
)

Referenced by GameData::getSpeechFlex(), main(), GUIApp::paint(), suc::print_bp(), print_bp(), suc::print_sp(), print_sp(), and ConvertUsecode::UsecodeFunctionAddressToString().


Variable Documentation

ConvertUsecode* convert = new ConvertUsecodeU8()

Definition at line 161 of file Disasm.cpp.

Referenced by initfolding(), just_print(), main(), printfunc(), printoverloads(), and readfunction().

bool crusader = false

Definition at line 191 of file Disasm.cpp.

uint32 curOffset

Definition at line 86 of file Disasm.cpp.

map<uint32, uint32> EventMap

Definition at line 116 of file Disasm.cpp.

Referenced by ConvertUsecodeU8::readevents(), and ConvertUsecodeCrusader::readevents().

Folder* folder = new Folder()

Definition at line 243 of file Disasm.cpp.

Referenced by printfunc(), and readfunction().

map<string, string> FuncNames

Definition at line 183 of file Disasm.cpp.

Referenced by ConvertUsecode::UsecodeFunctionAddressToString().

string gamelanguage

Definition at line 185 of file Disasm.cpp.

string gametype

Definition at line 186 of file Disasm.cpp.

Referenced by CoreApp::getGameInfo().

map<uint32, GlobalName> GlobalNames

Definition at line 181 of file Disasm.cpp.

string outputdir

Definition at line 187 of file Disasm.cpp.

bool print_globals = false

Definition at line 188 of file Disasm.cpp.

std::map<sint32, string> ScriptExpressions

Definition at line 114 of file Disasm.cpp.

Referenced by LoopScriptNode::print_asm().

bool strings_only = false

Definition at line 189 of file Disasm.cpp.


Generated on Fri Jul 27 22:28:00 2007 for pentagram by  doxygen 1.4.7