コード例 #1
0
 def closeEvent(self, event):
     if self.languageButtonGroup.checkedId() != -1:
         self.parent.parent.parent_window.tab_window.main_window.race = elf.Elf(
             "High Elf", self.cantrip, self.getLanguage())
         self.parent.parent.parent_window.label.setText(
             "High Elf with {} Cantrip and {} Language".format(
                 self.cantrip, self.getLanguage()))
         #print("Character set to")
         #print(self.parent.parent.parent_window.tab_window.main_window.race)
         event.accept()
     else:
         self.label.setText("YOU MUST SELECT A LANGUAGE TO MOVE ON!")
         event.ignore()
コード例 #2
0
    def closeEvent(self, event):

        if self.highButton.isChecked():
            self.pCan = PickCantrip(self, "High Elf")
            self.pCan.show()
            event.accept()
        else:
            if self.woodButton.isChecked():
                self.parent_window.tab_window.main_window.race = elf.Elf(
                    "Wood Elf")
                self.parent_window.label.setText("Wood Elf")
                #print("Subrace chosen, character now ")
                #print(self.parent_window.tab_window.main_window.race)
                event.accept()
            elif self.darkButton.isChecked():
                self.parent_window.tab_window.main_window.race = elf.Elf(
                    "Dark Elf (Drow)")
                self.parent_window.label.setText("Dark Elf (Drow)")
                #print("Subrace chosen, character now ")
                #print(self.parent_window.tab_window.main_window.race)
                event.accept()
            else:
                self.label.setText("YOU MUST SELECT A SUBRACE TO CONTINUE!")
                event.ignore()
コード例 #3
0
    if not args:
        Fatal('no files specified')

    if attribute is not None:
        if attribute not in ['vaddr', 'paddr', 'memsz', 'filesz']:
            Fatal('unknown attribute: %s' % attribute)
        if segment is None:
            Fatal('you must specify a segment name via -s')
        if flags is None:
            Fatal('you must specify segment flags via -f')
        if divisor is None:
            Fatal('you must specify a divisor via -d')
        if remainder is None:
            Fatal('you must specify a remainder via -r')

    for filename in args:
        data = open(filename).read()
        elf_obj = elf.Elf(data)
        if attribute is None:
            DumpSegments(elf_obj)
        else:
            CheckSegments(elf_obj, attribute, segment, flags, divisor,
                          remainder)

    return 0


if __name__ == '__main__':
    sys.exit(main(sys.argv))
コード例 #4
0
ファイル: dump_tc.py プロジェクト: yanxx297/fast-pokeemu
#!/usr/bin/python

import sys, os
from os.path import dirname, basename, abspath, join as joinpath, isfile
from common import *
import cpustate_x86
import elf

ROOT = abspath(joinpath(dirname(abspath(__file__)), ".."))
KERNEL = joinpath(ROOT, "Kernel/kernel")
kernel_elf = elf.Elf(KERNEL)

tc = kernel_elf.findSection(".testcase")
tc = (tc.getLowAddr(), tc.getHighAddr())
dump = cpustate_x86.load_dump(sys.argv[1])

print dump.mem.data[tc[0]:tc[1]]
コード例 #5
0
import classhealer, classfighter, classmage, classarcher
import sword, broadsword, pike, greatsword
import human, elf, dwarf, halfling
import shortbow, longbow, throwingknife
import chainmail, platemail, scalemail
import roundshield, buckler, heavyshield

CLASSES = [
    classfighter.ClassFighter(),
    classmage.ClassMage(),
    classarcher.ClassArcher()
]
RACES = [human.Human(), dwarf.Dwarf(), halfling.Halfling(), elf.Elf()]
NAMES = open("fantasy_names.txt", "r").readlines()
for x in range(len(NAMES)):
    NAMES[x] = "".join(NAMES[x].split("\n"))

MELEE_WEAPONS = [
    sword.Sword(),
    broadsword.BroadSword(),
    #                 pike.Pike(),
    greatsword.GreatSword()
]
RANGED_WEAPONS = [
    shortbow.ShortBow(),
    longbow.LongBow(),
    throwingknife.ThrowingKnife()
]
ARMOR = [chainmail.ChainMail(), platemail.PlateMail(), scalemail.ScaleMail()]
SHIELDS = [
    roundshield.RoundShield(),
コード例 #6
0
    return 2
  if sel_ldr_path is None:
    print >>sys.stderr, 'No sel_ldr specified.'
    return 3

  if verbosity > 0:
    print 'sel_ldr is at', sel_ldr_path
    print 'nexe prototype(s) are at', nexe_path

  nfa = re.compile(r'LOG_FATAL abort exit$')

  which_nexe = 0

  while iterations != 0:
    nexe_bytes = open(nexe_path[which_nexe % len(nexe_path)]).read()
    nexe_elf = elf.Elf(nexe_bytes)

    fd, path = tempfile.mkstemp()
    try:
      fstream = os.fdopen(fd, 'w')
      fuzzed_bytes = available_fuzzers[fuzzer](nexe_elf)
      fstream.write(fuzzed_bytes)
      fstream.close()

      cmd_arg_list = [ sel_ldr_path,
                       '-F',
                       '--', path]

      p = subprocess.Popen(cmd_arg_list,
                           stdin = subprocess.PIPE,  # no /dev/null on windows
                           stdout = subprocess.PIPE,