Data logging menu

User Tag List

Thread: Data logging

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Data logging

    I'm using C++ for my detour on sendpacket. I have my app filtering the headers on the packets, and modifying offsets in the packets, but I need a way to log them. Can anyone provide some insight on how to do this? Whenever I just generically try to get the bytes and use a << operator, it tries to convert the numbers I want into their ASCII codes. I googled but couldn't find anything besides a class on codeproject.

    Data logging
  2. #2
    tanis2000's Avatar Active Member
    Reputation
    39
    Join Date
    Feb 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sprintf? not the fastest solution but it should do what you need

  3. #3
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ehh, I'll try it. This will convert the raw bytes to text? So if the bytes are {0xF1, 0x3F}, the char* will be "F13F"?

  4. #4
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    char buffer[128];
    sprintf_s(buffer, "%s", BYTES);
    Now you have the string.


  5. #5
    BoogieManTM's Avatar Active Member
    Reputation
    52
    Join Date
    May 2008
    Posts
    193
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by suicidity View Post
    Code:
    char buffer[128];
    sprintf_s(buffer, "%s", BYTES);
    Now you have the string.

    He wants the hexdecimal representation of the bytes.

    You'll need to loop through BYTES, pulling off one byte at a time and converting it appropriately (or at least up to 4 bytes at a time, as %x/X expects an integer)


    so it would be sprintf_s(buffer, "%X", BYTES[x]);

    of course, make sure the end buffer is twice the size of BYTES.

  6. #6
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, thanks. Things like this are very annoying =/

  7. #7
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there an easier way to convert the packet back to little-endian than converting each part of the packet one-by-one in my code?

  8. #8
    tanis2000's Avatar Active Member
    Reputation
    39
    Join Date
    Feb 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First result in Google when searching for "c++ convert little endian" .. :-P

    convert from BIG-ENDIAN to LITTLE-ENDIAN

  9. #9
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you propose to convert an entire packet from big endian to little endian if you don't do it piece-by-piece? Is the application supposed to automagically know which parts of the packet are 32-bit ints, which parts are 32-bit floats, and which parts are 64-bit GUIDs (or whatever), and reverse them each individually? No, you have to know the packet structure and reverse each individually, which is the only conclusion that makes any sense at all.

    By the way:
    Code:
    char * sPacket = new char[PacketLength * 3];
    for (int i = 0; i < PacketLength; i++)
        snprintf((char *)(sPacket + i * 3), 3, "%02X ", packet[i]);
    
    printf(sPacket);
    delete sPacket;
    Last edited by Shynd; 06-10-2009 at 09:14 PM.

  10. #10
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I realized this after I read a little more. This should be great fun reversing all these packets...

  11. #11
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Btw, I settled on making the buffer on CDataStore public and just ripping my char* from there. It works pretty well.

  12. #12
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Btw, I settled on making the buffer on CDataStore public and just ripping my char* from there. It works pretty well.
    FYI it has a Buffer() function to return a pointer to it.

  13. #13
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It didn't seem to be working right =/ So I just improvised :P

  14. #14
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    With that class be sure that its assertions are being evaluated. It relies on it!

  15. #15
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not really sure what that means Lol.

Page 1 of 2 12 LastLast

Similar Threads

  1. Data Logging
    By lanman92 in forum Programming
    Replies: 0
    Last Post: 06-07-2009, 12:45 AM
  2. im missing files in my Data Folder all i got is textures.mpq
    By Zosteer in forum World of Warcraft General
    Replies: 1
    Last Post: 12-09-2006, 04:10 PM
  3. Stay logged in forever without third party afk-bot(Warrior,Druid only)
    By CatLikeRetard in forum World of Warcraft Exploits
    Replies: 5
    Last Post: 11-01-2006, 08:33 AM
  4. Cant Log On?
    By Amedis in forum World of Warcraft General
    Replies: 4
    Last Post: 10-08-2006, 03:19 PM
  5. Never log out
    By Matt in forum World of Warcraft Exploits
    Replies: 5
    Last Post: 05-25-2006, 01:06 PM
All times are GMT -5. The time now is 04:40 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search