mirror of
https://github.com/Kaisaan/lostkefin.git
synced 2025-06-18 16:45:40 -04:00
Add string.py
This commit is contained in:
parent
24820eea0f
commit
2ce030e959
@ -106,7 +106,7 @@ fileptrend = 0x18E7C0
|
|||||||
|
|
||||||
fileptr = fileptrstart
|
fileptr = fileptrstart
|
||||||
|
|
||||||
logfile.write("\nDATA.BIN Files\n\n")
|
logfile.write("\nDATA0.BIN Files\n\n")
|
||||||
|
|
||||||
while fileptr < fileptrend:
|
while fileptr < fileptrend:
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ def pointer(address):
|
|||||||
text = text[:text.find(terminator)]
|
text = text[:text.find(terminator)]
|
||||||
|
|
||||||
return f"address {address:X}\tvalue {ptr:X}\tpointer {trueptr:X}\ttext {text}"
|
return f"address {address:X}\tvalue {ptr:X}\tpointer {trueptr:X}\ttext {text}"
|
||||||
|
#return(f"{text}")
|
||||||
|
|
||||||
startptr = 0x2298E0
|
startptr = 0x2298E0
|
||||||
read = startptr
|
read = startptr
|
||||||
@ -39,12 +39,13 @@ log.write("Characters:\n")
|
|||||||
|
|
||||||
while read < endptr:
|
while read < endptr:
|
||||||
|
|
||||||
print(f"{read:X}")
|
#print(f"{read:X}")
|
||||||
if (pointer(read) == "invalid"):
|
if (pointer(read) == "invalid"):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
log.write(f"{pointer(read)}\t{index:X}\n")
|
log.write(f"{pointer(read)}\t{index:X}\n")
|
||||||
|
#log.write(f"|`${index:X}`|{pointer(read)}| |\n")
|
||||||
|
|
||||||
index += 0x1
|
index += 0x1
|
||||||
read += 0x4
|
read += 0x4
|
||||||
|
47
string.py
Normal file
47
string.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import unicodedata
|
||||||
|
|
||||||
|
length = 0
|
||||||
|
counter = 0
|
||||||
|
string = ''
|
||||||
|
|
||||||
|
print("Type/Paste your text and then Enter")
|
||||||
|
|
||||||
|
while (line := input()):
|
||||||
|
string += line
|
||||||
|
|
||||||
|
#string = (input("Enter a string ").replace('\n', " "))
|
||||||
|
|
||||||
|
length = len(string)
|
||||||
|
|
||||||
|
#for char in string:
|
||||||
|
# status = unicodedata.east_asian_width(char)
|
||||||
|
# if status == 'F':
|
||||||
|
# print(char)
|
||||||
|
# length += 1
|
||||||
|
|
||||||
|
length = length + string.count(",")
|
||||||
|
|
||||||
|
counter = string.count("[PAUSE]")
|
||||||
|
|
||||||
|
if (counter > 0):
|
||||||
|
print(f"{counter} pause")
|
||||||
|
length = length - (counter * 5)
|
||||||
|
counter = 0
|
||||||
|
|
||||||
|
counter = string.count("<")
|
||||||
|
|
||||||
|
if (counter > 0):
|
||||||
|
print(f"{counter} <")
|
||||||
|
length = length - (counter * 4)
|
||||||
|
counter = 0
|
||||||
|
|
||||||
|
counter = string.count("[LINE]")
|
||||||
|
|
||||||
|
if (counter > 0):
|
||||||
|
print(f"{counter} line")
|
||||||
|
length = length - (counter * 5)
|
||||||
|
counter = 0
|
||||||
|
|
||||||
|
char = chr(length)
|
||||||
|
|
||||||
|
print(f"The string will have a converted length of {length} in hex is {length:X} its character is {char}")
|
Loading…
Reference in New Issue
Block a user