In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of how to hide process command line parameters in c language under linux, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to hide process command line parameters in c language under linux. Let's take a look.
Override argv parameters
This scheme is only successfully verified in the c language under linux, because win32api is used to obtain command line parameters under window, but this is not set. It is estimated that window does not support this kind of coquettish operation.
The program is to modify the argv content when executing the program, the following source code, for reference only.
# include # include # include int main (int argc,char * argv []) {int iLab j; for (iSome1 / [j] = 'xwoods;}} getchar (); return 0;}
As shown in the following figure, the command line arguments are hidden. In a normal program, you can copy argv to memory variables, and then copy argv immediately. At this time, you can either use command-line parameters normally or hide parameters.
Get standard input
See how easy it is to hide parameters in C language, but I failed to validate C language under window, and you can still see it by executing wmic process where caption= "a.exe" get caption,commandline / value or command line arguments.
So I thought of getting the parameters passed by the program by reading standard input, but I need to type the parameters after running the program, but using echo can solve this problem perfectly.
Since C language has not been used for a long time, let's write an example program in go language. By the way, go gets the command line parameter source code, but I can't modify the value, including window and linux.
Use go's flag library to get a line of standard input to parse command-line parameters, as shown below. The source code is as follows:
Package main import ("bufio", "flag", "fmt", "os", "strings"time") func main () {fs: = flag.newflagset (os.args [0], flag.exitonerror) s: = fs.string ("s", "", "string") I: = fs.int ("I", 123, "int") argv _: = bufio.newreader (os.stdin) .readstring ('\ n') fs.parse (strings.fields (argv)) fmt.println (* s, * I) time.sleep (time.minute)}
Test under linux:
Test under window:
This is the end of the article on "how to hide process command line parameters in c language under linux". Thank you for reading! I believe you all have a certain understanding of "how to hide process command line parameters in c language under linux". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.