Esempio n. 1
0
        for line in lines:
            line = line.strip().split(" ")
            for number in line:
                try:
                    fmem.append(chr(int(number, 16)))
                except ValueError:
                    continue
        fmem = fmem
        mem = imm.readMemory(address, len(fmem))
        for a in range(0, len(fmem)):
            try:
                if fmem[a] != mem[a]:
                    imm.setStatusBar(
                        "Unmatched: Check log window for the dump")
                    imm.log("Unmatched at offset: %d" % a)
                    imm.log("  File: %s" % immutils.prettyhexprint(
                        string.joinfields(fmem[a:a + 8], "")))
                    imm.log("  Mem : %s" %
                            immutils.prettyhexprint(mem[a:a + 8]))
                    return 0x0
            except IndexError:
                imm.setStatusBar("Unmatched: Check log window for the dump")
                imm.log(
                    "Unmatch: Different string sizes= File: %d Memory: %d" %
                    (len(fmem), len(mem)))
                return 0x0

        imm.setStatusBar("Match!")
        imm.log("Match!")
    return 0
Esempio n. 2
0
 def Print(self):
     if self.data[-1] == "\x00":
         return immutils.prettyhexprint( self.data[0:-1] )
     else:
         return "'%s'" % self.data
Esempio n. 3
0
 def Print(self):
     if self.data[-1] == "\x00":
         return immutils.prettyhexprint(self.data[0:-1])
     else:
         return "'%s'" % self.data
Esempio n. 4
0
                return 0

    if file and address:
        lines = open(file).readlines()
        fmem = []
        for line in lines:
            line = line.strip().split(" ")
            for number in line:
                try:
                    fmem.append(chr(int(number, 16)))
                except ValueError:
                    continue
        fmem = fmem
        mem = imm.readMemory(address, len(fmem))
        for a in range(0, len(fmem)):
            try:
                if fmem[a] != mem[a]:
                    imm.setStatusBar("Unmatched: Check log window for the dump")
                    imm.log("Unmatched at offset: %d" % a)
                    imm.log("  File: %s" % immutils.prettyhexprint(string.joinfields(fmem[a : a + 8], "")))
                    imm.log("  Mem : %s" % immutils.prettyhexprint(mem[a : a + 8]))
                    return 0x0
            except IndexError:
                imm.setStatusBar("Unmatched: Check log window for the dump")
                imm.log("Unmatch: Different string sizes= File: %d Memory: %d" % (len(fmem), len(mem)))
                return 0x0

        imm.setStatusBar("Match!")
        imm.log("Match!")
    return 0