in Education by
So I've been reading this tutorial on how to use Frida: https://www.frida.re/docs/functions/ and I've encountered the following: $ ./client 127.0.0.1 connect() is at: 0x400780 Here's the serv_addr buffer: 02 00 13 88 7f 00 00 01 30 30 30 30 30 30 30 30 Press ENTER key to Continue The tutorial states that the bytes represent 0x1388 or 5000 so clearly its not in hex or decimal. I tried using base64 converters to convert the string to see if 0x1388 or 5000 comes up but no luck. What format is this exactly in? I haven't done low level programming lately and if i recall, bytes are groups of 8 bits 1s and 0s. EDIT: Yup, the tutorial states this represents a struct. But how did he know that it represents 0x1388? If I received a string like this is there a way for me to understand that it represents a particular value without being the author of the code that sent the message? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The relevant parts of the code is this: printf ("\nHere's the serv_addr buffer:\n"); b = (unsigned char *) &serv_addr; for (i = 0; i != sizeof (serv_addr); i++) printf ("%s%02x", (i != 0) ? " " : "", b[i]); What it is doing is simply printing the raw data from the structure serv_addr (which is of type struct sockaddr_in). There's no "string" here (in the sense of a C null-terminated byte string). The 0x1388 is the value of serv_addr.sin_port, which is printed as the third and fourth byte (13 and 88, in network (big endian) byte order). Knowing that the output is the raw data of a sockaddr_in structure, we can decipher the data easily 02 00 This is the sin_family member, with the value 2 (decimal). This value corresponds to AF_INET. This is in host byte order. 13 88 This is (as already mentioned) the network byte order of the port in sin_port. 7f 00 00 01 This is the sin_addr member, and corresponds to the IP address 127.0.0.1 (7f is 127). This is also in network byte order. The rest, 30 30 30 30 30 30 30 30, is "garbage" that fills the structure up to a common size for struct sockaddr, which is 16 bytes long.

Related questions

0 votes
    So I've been reading this tutorial on how to use Frida: https://www.frida.re/docs/functions/ and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I had a program working good (without prompting errors) using references, but I decided to use a pointer-to-pointer array ... that it is there because I have put two flags (cout...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    Applications developed by programming languages like ____ and ______ have this common buffer-overflow error. (a) C, Ruby ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    There are situations in which it is necessary to write back the block to disk, even though the buffer ... Buffer in chapter Storage and File Structures of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Locks on buffer blocks are unrelated to locks used for concurrency-control of transactions, and releasing ... Management topic in portion Recovery System of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    In java, can we use the string buffer functions for string chapter ? Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    WHICH TYPE OF CHART IS USED FOR REPRESENTING HUGE AMOUNT OF DATA. (i) BAR (ii) LINE (iii) SCATTER Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    BCDEFGHIJKLMNOPQRSTUVWXYZ Riddle What word or Phrase or letter is it representing abcdefghijklmnopqrstvwxyz...
asked Feb 10, 2021 in Education by JackTerrance
0 votes
    Sorted Column store would provide higher compression ratio by representing each column as ________ compared to the preceding one....
asked Jan 26, 2021 in Technology by JackTerrance
0 votes
    I want to get this format : 2019-03-24 15:05:20 Here is what I have tried: var today = ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I want to get this format : 2019-03-24 15:05:20 Here is what I have tried: var today = ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I want to get this format : 2019-03-24 15:05:20 Here is what I have tried: var today = ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    Which of this class can be used to format dates and times? (a) Date (b) SimpleDate (c) DateFormat (d ... Regular Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    ALL I am confused about the date field returned by microsoft academic rest api: JSON Example: { " ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email in an ... is used in this) Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
...