| |

VerySource

 Forgot password?
 Register
Search
View: 1295|Reply: 2

How to open a data file (non-text format) and edit the data in the specified location?

[Copy link]

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-11-26 17:30:01
| Show all posts |Read mode
Now there is a data file. I have used uedit to find the location that needs to be modified. Now I want to implement it in vb. What should I do?

Can I use binReader binWriter? The main reason is that I don't know how to move to the specified hexadecimal position.
Reply

Use magic Report

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-11-26 17:45:01
| Show all posts
found it

Dim bTmp as Byte
Open "C:\save\file.sav" For Binary As #1
  Get #1,&H01 + 1, bTmp'Read a single byte, if you want double bytes, change it to Integer, and 4 bytes to Long
  Put #1,&H766A + 1,&H09'Save the address of 09 (hexadecimal) in 766A, remember: all addresses in VB must be +1

Close #1

This is for a modifier, which is about the same as what I need.
Reply

Use magic Report

0

Threads

18

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-11-26 18:30:02
| Show all posts
Get #1,&H01 + 1, bTmp'Read a single byte, if you want double bytes, change it to Integer, and 4 bytes to Long
//It is also possible to use byte arrays!!

  Put #1,&H766A + 1,&H09'Save the address of 09 (hexadecimal) in 766A, remember: all addresses in VB must be +1
Reading and writing the above 2 codes is enough! Put #1,&H766A + 1, a(0)
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list