![]() |
|
Find String Offsets in a file easily! (VB.Net) - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: Find String Offsets in a file easily! (VB.Net) (/Thread-Find-String-Offsets-in-a-file-easily-VB-Net) |
Find String Offsets in a file easily! (VB.Net) - Killpot - 02-09-2016 Yo. So this is just something I whipped up and threw together to get this working, I imagine this could be much more efficient however I'm not worrying about parsing massive files so efficiency isn't a huge deal as long as it works relatively quickly. It works by converting the inputted string into a Unicode encoded string, then from there converts it to a list of Hex bytes. After that it loops through the desired file and will return the starting offset, and the ending offset once it finds all of the Hex bytes in a row. Super simple and amazingly useful for patching, I'll be personally using this in Ven0m to patch dll's before they're sent to the client. Screenshot of it implemented: Below is an example of a DLL opened in HxD and a simple console I made to scan for the desired Hex pattern. HxD has the string found and selected, and from there we can compare my function's starting and ending addresses vs. what HxD found. As you see they match. ![]() Function: [hide] Quote:Function findOffset(ByVal filename As String, ByVal sourcesrc As String) As String It will return a response like: {StartingOffset}|{EndingOffset} [/hide] RE: Find String Offsets in a file easily! (VB.Net) - Red_SF - 02-09-2016 Vouch this user is a god at HTML
RE: Find String Offsets in a file easily! (VB.Net) - Killpot - 02-09-2016 (02-09-2016, 04:03 AM)Red Wrote: Vouch this user is a god at HTML I fucking hate html, I'd rather code in ASM RE: Find String Offsets in a file easily! (VB.Net) - Red_SF - 02-09-2016 (02-09-2016, 04:17 AM)Killpot Wrote: I fucking hate html, I'd rather code in ASM I would rather code in brainfuck (search it up honestly made me laugh) |