xctf problem in re supporting knowledge

About the usage of ida:

You can right function name to search directly main function

Some of the function of the ida pseudocode:

Sprintf 1. ()
sprintf refers to string formatting command, function is declared int sprintf (char * string, char * format [, argument, ...]) ;, the main function is writing data formatted in a character stream, i.e., the transmission formatted output string to the string pointed. sprintf function parameter is changed. For the number of characters written using sprintf buffer is no limit, which exists the possibility of buffer overflow. To solve this problem, consider using snprintf function, which can make a limit on the number of characters written

  • String - This is a pointer to a character array of pointers, the array stores a character string C.
  • Format- - This is a string that contains the text to be written into the string str. It can contain embedded tag format, format tag value may be assigned additional parameters subsequent replacement, and demand-driven format. tag is attribute format% [flags] [width] [ . precision] [length] specifier
  • [argument] ...: Depending on the format string, the function may need a series of additional parameters, each containing a value to be inserted, replacing the format specified in the parameter% each tag. The number of parameters to be equal to the number of tags%.
  • Function to write a string formatted data buffer.

After the problem is to present the characters behind, into the form of character hexadecimal value, such as: v4 is '0' -> '0x30' is such a format

2. strcat()

  • Chinese name: string concatenation function
  • Yuan_xing: externs char * strcat (char * dest, const char * src);
  • Function : src points to a string (including "\ 0") copied to the string pointed to by dest (delete dest end of the original "\ 0"). To ensure dest long enough to accommodate the incoming copy * src. * src any original characters intact. Returns a pointer pointing to dest.

In this problem is the single character that is applied to the v10, equivalent: flag + = s [i]

in python function:

  • CHR () function is the ASCII code characters into a number representing
    Here Insert Picture Description
    the corresponding,
  • ord () function can output an ASCII character
    Here Insert Picture Description
  • hex () loaded into the decimal hexadecimal characters
    Here Insert Picture Description
  • oct () converts the decimal to octal character
    Here Insert Picture Description
  • bin () to decimal installed for the binary character
    Here Insert Picture Description
  • Note that the character is str
    Here Insert Picture Description
    These are the built-in functions

For this python bytes, is a sequence of bytes, one byte is a count, may be combined with the concept of address to be appreciated, can remember, char is one byte, int is 4, a word section eight bits;
simple terms:
for example, I define a s = b'0123 '
is actually one byte 0, ... 1 of one byte and the byte does not support the type of modification

And there are many in the official help, there are 385 rows of bytes for the bytes of the method,
Here Insert Picture Description
it is said, you know;

  • bytes.fromhex ()
    directly to illustrate it with examples

bytes.fromhex ( "3034")
result b'04 '

Then for

  • hex ()
    bytes.hex (b'hello ')
    The result is' 68656c6c6f' 68-> h 65-> e 6c-> l 6f-> o

For other questions ... are complementary

Published 29 original articles · won praise 13 · views 2756

Guess you like

Origin blog.csdn.net/zmx2473162621/article/details/103416005