Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Python3 - string replace weird behavior

Hey,

I'm trying to replace substrings in files.
But it is replacing everything on the file, possibly every letter by the hash I want to put instead.
I don't know why, maybe this is a charset issue.

Here is the suspect code :



Called :
Code
ListReplaceInFile(infilepath, hash_list_by_old_function_name, "func")

Target file before :



Target file after :



If you know how to fix this, please let me know.
44 people viewed this message but none of them would tell me this mistake is because the first argument of str.replace is empty ...


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by trucoJan 3, 2022 04:07 AM 2 258 Jan 3, 2022 04:07 AM
Last Post: truco
[Python] by 0u1lawAug 28, 2020 01:22 PM 6 356 Aug 28, 2020 01:22 PM
Last Post: Pernat1y
[Python] by 4rmaged0nDec 22, 2019 04:44 AM 3 320 Dec 22, 2019 04:44 AM
Last Post: Emp3hack