Results 1 to 10 of 10

Thread: Reading value from hex address in QT

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2016
    Posts
    6
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Question Reading value from hex address in QT

    Hello guys, newbie QT programmer here stuck and in need of help

    Case scenario is as follows: I have a binary file that i've managed to write data at specific address using the following piece of code:
    Qt Code:
    1. QFile file ("example.dat";
    2. QString data = "30";
    3.  
    4. file.open(QIODevice::ReadWrite);
    5. QByteArray fileData(settings.readAll());
    6.  
    7. QByteArray data_write = QByteArray::fromHex(data.toLatin1());
    8. fileData.replace(0x00000008,1,data_write);
    9.  
    10. file.seek(0);
    11. file.write(fileData);
    12. file.flush();
    13. file.close();
    To copy to clipboard, switch view to plain text mode 

    This piece of code works perfectly by writing 30 to 0x00000008 address.

    Now, what i fail to do, is reading the data back from 0x00000008 address for further manipulation. So, how can i manage to read the data from that specific binary file address? I'm searching on the web for 4 days already and still no solution. Hope you guys can help me out.

    Thanks in advance!
    Last edited by JohnnyUSA; 13th October 2016 at 12:02.

Similar Threads

  1. getting IP-address
    By jefklak in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2010, 09:19
  2. IP Address Validation
    By rk0747 in forum Qt Programming
    Replies: 5
    Last Post: 10th June 2010, 08:18
  3. how can i get IP address
    By dognzhe in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2009, 05:27
  4. IP Address
    By rajveer in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2008, 08:30
  5. validation on an IP address
    By rajveer in forum Qt Programming
    Replies: 15
    Last Post: 24th August 2008, 00:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.