-
Posts
1416 -
Joined
-
Last visited
-
Days Won
44
Everything posted by MrGrj
-
Today we are going to go through effective techniques to avoid errors in your C and C++ programming sessions. Errors in programming can affect the stability and functionality of the application, we are going to run through how to avoid that. Memory errors can be broadly classified into Heap Memory Errors and Stack Memory Errors. Some of the challenging memory errors are: Invalid Memory Access in heap and stack Memory leak Mismatched Allocation/Deallocation Missing Allocation Uninitialized Memory Access in heap and stack Cross Stack Access Invalid Memory Access This error occurs when a read or write instruction references unallocated or deallocated memory. char *pStr = (char*) malloc(25); free(pStr); strcpy(pStr, .parallel programming.); // Invalid write to deallocated memory in heap Memory leaks Memory leaks occur when memory is allocated but not released. If such leaks happen often enough and frequently enough, the leaks will eventually cause the application to run out of memory resulting in a premature termination (gracefully or as a crash). char *pStr = (char*) malloc(512); return; Mismatched Allocation/Deallocation This error occurs when a deallocation is attempted with a function that is not the logical counterpart of the allocation function used. char *s = (char*) malloc(5); delete s; To avoid mismatched allocation/deallocation, ensure that the right deallocator is called. In C++, new[] is used for memory allocation and delete[] for freeing up. In C, malloc(), calloc() and realloc() functions are used for allocating memory while the free() function is used for freeing up allocated memory. Similarly, there are APIs in Windows programming to allocate and free memory. Missing allocation This error occurs when freeing memory which has already been freed. This is also called “repeated free” or “double free”. Example: char* pStr = (char*) malloc(20); free(pStr); free(pStr); // results in an invalid deallocation Uninitialized Memory Access This type of memory error will occur when an uninitialized variable is read in your application. char *pStr = (char*) malloc(512); char c = pStr[0]; // the contents of pStr were not initialized void func() { int a; int b = a * 4; // uninitialized read of variable a } To avoid this type of memory error, always initialize variables before using them. Cross Stack Access This occurs when a thread accesses stack memory of a different thread. main() { int *p; ------- CreateThread(., thread #1, .); // Stack Owned CreateThread(., thread #2, .); ------- } Thread #1 { int q[1024]; p = q; q[0] = 1; } Thread #2 { *p = 2; // Stack Cross Accessed } One of the easiest ways to avoid this error is to avoid saving stack addresses to global variables. Using tools to find memory errors There are many memory error checkers available on the market; I used Intel Parallel Inspector to find memory errors. This is an easy and comprehensive tool to pinpoint memory errors in both sequential and multithreaded applications. Intel Parallel Inspector integrates into Visual Studio. Parallel Inspector uses dynamic instrumentation that requires no special builds or compilers. Not all memory checkers available in the market are capable of performing analysis of threaded applications. As shown below, Parallel Inspector finds all types of memory errors and displays source, module and source line number with state of error (fixed/not fixed). One important feature of this tool is that it allows end users to control the depth of analysis. The greater the depth of analysis, the longer the analysis takes and the more memory it uses. 2x-20x – analysis finds memory leaks 10x-40x – analysis identifies the existence of a problem 20x-80x – analysis provides root cause information to fix problems and enhanced dangling pointer check 40x-160x – provides the most comprehensive level of problem (including system libraries check) If a memory error is either not relevant or not going to be fixed, there is an option to suppress the error. Select suppressions from the configuration settings and choose the appropriate option.
-
Jquery e o bibliotec?, nu o libr?rie. Poti pune un portofoliu aici ?
-
Again ?! Man, I understand if you don't know English, but the ASCII is the same for everybody from anywhere. Whatever, this seems to be pointless. I'm out.
-
[WTF] Scuze de OFF, dar poate ma intelegeti: bahahahahahahaha. [/WTF] //ON: I was just trying to be sarcastic. There're no such things as ASQII and ASKII. There's only ASCII. Please review your grammar in your future posts as you cannot teach something if you cannot use the same word three times in a row. Thanks. Bye
-
What about ASQII and ASKII ? Could you please provide some tutorials for those too ?
-
I was incredulous when I read this observation from Reginald Braithwaite: The author he's referring to is Imran, who is evidently turning away lots of programmers who can't write a simple program: Dan Kegel had a similar experience hiring entry-level programmers: Between Reginald, Dan, and Imran, I'm starting to get a little worried. I'm more than willing to cut freshly minted software developers slack at the beginning of their career. Everybody has to start somewhere. But I am disturbed and appalled that any so-called programmer would apply for a job without being able to write the simplest of programs. That's a slap in the face to anyone who writes software for a living. The vast divide between those who can program and those who cannot program is well known. I assumed anyone applying for a job as a programmer had already crossed this chasm. Apparently this is not a reasonable assumption to make. Apparently, FizzBuzz style screening is required to keep interviewers from wasting their time interviewing programmers who can't program. Lest you think the FizzBuzz test is too easy – and it is blindingly, intentionally easy – a commenter to Imran's post notes its efficacy: Maybe it's foolish to begin interviewing a programmer without looking at their code first. At Vertigo, we require a code sample before we even proceed to the phone interview stage. And our on-site interview includes a small coding exercise. Nothing difficult, mind you, just a basic exercise to go through the motions of building a small application in an hour or so. Although there have been one or two notable flame-outs, for the most part, this strategy has worked well for us. It lets us focus on actual software engineering in the interview without resorting to tedious puzzle questions. It's a shame you have to do so much pre-screening to have the luxury of interviewing programmers who can actually program. It'd be funny if it wasn't so damn depressing. I'm no fan of certification, but it does make me wonder if Steve McConnell was on to something with all his talk of creating a true profession of software engineering. Source
-
Ofer un mic ajutor ca sa faceti 2-3 mbtc pe zi (200000-300000 satoshi)
MrGrj replied to giustone's topic in Cosul de gunoi
Nu ma intereseaz? banii t?i sau metodele, dar argumentele sunt de cacat. ?i dac? postezi aici video-ul sau scrii mult vede toat? lumea. Asta doar asa, ca idee. Am si eu o idee prin care s? castigati mult mai mult: puneti mâna si înv?tati -
PCMan FTP Server 2.0.7 - RENAME Command Buffer Overflow
MrGrj replied to Anonym13's topic in Exploituri
s.recv(1024) citeste cel mult 1024 bytes. -
Ai spus de 4 ori aceeasi chestie. Pe chat moderatorii au mâna liber? s? fac? ce vor. in plus, dac? intrerupi vreo discutie legat? de una din temele forumului poti lua ban f?r? drept de apel. Exist? si o regul? cum c? dac? te plângi în leg?tur? cu chatul primesti ban si pe forum. Asteapt?-te la orice si invata din greseli. Cât despre VPS... Poti g?si si la 5$ si la 50$. Totul depinde de ceea ce vrei sa faci si cum stii s? cauti. Baft?
-
Cel mai bun tutorial pe care l-am citit so far. Give it a try: Spolier: So Everything Has A Class? class Customer(object): """A customer of ABC Bank with a checking account. Customers have the following properties: Attributes: name: A string representing the customer's name. balance: A float tracking the current balance of the customer's account. """ def __init__(self, name, balance=0.0): """Return a Customer object whose name is *name* and starting balance is *balance*.""" self.name = name self.balance = balance def withdraw(self, amount): """Return the balance remaining after withdrawing *amount* dollars.""" if amount > self.balance: raise RuntimeError('Amount greater than available balance.') self.balance -= amount return self.balance def deposit(self, amount): """Return the balance remaining after depositing *amount* dollars.""" self.balance += amount return self.balance
-
Interesant da' nu prea. Totusi e bine de stiut. Poate e totusi cineva interesata. Facebook Launches M, Your New Personal Digital Assistant
-
Poti face un script care sa ruleze comanda dir o data la x timp. Ceva de genul: @Echo OFF :START DIR /b /s | sort SLEEP 20 GOTO END // am crezut ca vrei in windows Linux like: watch -n 1 ls -ltr /ceva_director
-
float InvSqrt(float x) { float xhalf = 0.5 f * x; int i = * (int * ) & x; // get bits for floating value i = 0x5f3759df - (i >> 1); // gives initial guess y0 x = * (float * ) & i; // convert bits back to float x = x * (1.5 f - xhalf * x * x); // Newton step, repeating increases accuracy return x; } float xhalf =[COLOR="#FF0000"] 0.5 f[/COLOR] * x; Nu stiu de ce, dar am impresia ca nu compileaza in forma asta Pentru cei care sunt la inceput, ar trebui sa fie: 0.5f //fara spatiu
-
Although Java was modeled after C and C++ languages, it differs from C and C++ in many ways. Java does not i a number of features available in C and C++. For the benefit of C and C++ programmers, we point out here a few major differences between C/C++ and Java language How Java Differs From C: Java and C Java is not lot like C but the major difference between Java and C is that Java is an object-oriented language and has mechanism to define classes and objects. In an effort to build a simple and safe language, the Java team did not include some of the C features in Java. Java does not include the C unique statement keywords sizeof, and typedef. Java does not contain the data type struct and union. Java does not define the type modifiers keywords auto,extern,register,signed, and unsigned. Java does not support an explicit pointer type. Java does not have a preprocessor and therefore we cannot use # define, # include, and # ifdef statements. Java requires that the functions with no arguments must be declared with empty parenthesis and not with the void keyword as done in C. Java adds new operators such as instanceof and >>>. Java adds labelled break and continue statements. Java adds many features required for object-oriented programming. How Java Differs From C++ : Java and C++ Java is a true object-oriented language while C++ is basically C with object-oriented extension. That is what exactly the increment operator ++ indicates. C++ has maintained backward compatibility with C. Is is therefore possible to write an old style C program and run it successfully under C++. Java appears to be similar to C++ when we consider only the “extensions” part of C++. However, some object -oriented features of C++ make the C++ code extremely difficult to follow and maintain. Listed below are some major C++ features that were intentionally omitted from java or significantly modified. Java does not support operator overloading. Java does not have template classes as in C++. Java does not support multiple inheritance of classes. This is accomplished using a new feature called “Interface”. Java does not support global variables. Every variable and method is declared within classes and forms part of that class. Java does not use pointers. Java has replaced the destructor function with a finalize() function. There are no header files in Java. Java also adds some new features. While C++ is a superset of C, Java is neither a superset nor a subset of C or C++. Java may be considered as a first cousin of C++ and a second cousin of C As a personal note, the reason why Java is slower than C/C++ is because it runs on java virtual machine hence portability of apps whilst the latter run on machine directly hence not portable. However, running on some virtual machine means more processing time because the machine has now to communicate with the hardware unlike a c/c++ program which deals with h/w directly.
-
Baga si la mine niste detalii
-
Draga Bogdan, Din moment ce esti un membru nou pe forum, tin sa te anunt ca s-a specificat de multe ori: chat-ul nu are nici o legatura cu forumul. El se afla acolo pur si simplu pentru a comunica liber si a discuta orice subiect se doreste. Mai mult, daca citeai ceea ce scrie imediat cum iti apare chat-ul, aflai ca adminii / moderatorii au voie sa faca ceea ce doresc intrucat si-au meritat intr-un fel sau altul dreptul de a fii in postura anterior mentionata. Banul pe chat iti va fii scos in momentul in care un admin va considera ca e cazul sa ti-l scoata. In cazul in care nu iti place sa frecventezi forumul, du-te pe altul. Aici nu ducem lista de useri. ( totusi recomand sa inveti cate ceva de pe-aici - sunt tutoriale foarte misto si ai ce invata de la multi membrii ) Peace
-
Pointer Cheat Sheet A pointer must always be of the same type as the variable it's pointing at. Declaring a pointer variable does not create the type of variable it points at. It creates a pointer variable. Though pointers are declared with an asterisk they are not always used with an asterisk. The asterisk is the unary * operator. It is not the * multiplication operator. Pointers must be initialized before they can be used. Initialize a pointer by assigning it to a variable; the variable must be of the same type as the pointer. To assign a pointer to a variable, use an ampersand with the variable's name. The address-of unary operator & is not the same as the bitwise & AND operator. m_address = &memory; To assign a pointer to an array, do not use the ampersand: s_address = string; The pointer s_address would be used on the string array's elements. To assign a pointer to an array element, use the ampersand: element = &string[2]; Without an asterisk, an initialized pointer holds a memory address. With an asterisk, an initialized pointer references the value stored at its address. Typical Pointer Setup and Use First, create a pointer of the proper type: float *f; Second assign it to a variable's memory location: f = &boat; Finally, use the pointer: printf("%.0f",*f); Without an asterisk, the pointer references a memory location. With an asterisk, the pointer references the value at that memory location. Always use the same type of pointer as the variables it examines: floats for floats, ints for ints, and so on. Remember: initialize a pointer before you use it! Set the pointer equal to the address of some variable in memory. Pointers, Parenthesis and Math [table=width: 500, class: grid, align: center] [tr] [td]Pointer Thing[/td] [td]Memory Address[/td] [td]Memory Contents[/td] [/tr] [tr] [td]p[/td] [td]Yep[/td] [td]Nope[/td] [/tr] [tr] [td]*p[/td] [td]Nope[/td] [td]Yep[/td] [/tr] [tr] [td]*p++[/td] [td]Incremented after value is read[/td] [td]Unchanged[/td] [/tr] [tr] [td]*(p++)[/td] [td]Incremented after value is read[/td] [td]Unchanged[/td] [/tr] [tr] [td](*p)++ [/td] [td]Unchanged[/td] [td]Incremented after it's used[/td] [/tr] [tr] [td]*++p[/td] [td]Incremented before value is read[/td] [td]Unchanged[/td] [/tr] [tr] [td]*(++p)[/td] [td]Incremented before value is read[/td] [td]Unchanged[/td] [/tr] [tr] [td]++*p[/td] [td]Unchanged[/td] [td]Incremented before it's used[/td] [/tr] [tr] [td]++(*p)[/td] [td]Unchanged[/td] [td]Incremented before it's used[/td] [/tr] [tr] [td]p*++[/td] [td]Not a pointer[/td] [td]Not a pointer[/td] [/tr] [tr] [td]p++*[/td] [td]Not a pointer[/td] [td]Not a pointer[/td] [/tr] [/table] The ++ operator is used above, though any math operation can be substituted. A tip: Use parenthesis to isolate part of the pointer problem and the answer will always work out the way you intended. Pointers and array brackets [table=width: 500, class: grid, align: left] [tr] [td]Array Notation[/td] [td]Pointer Equivalent[/td] [/tr] [tr] [td]array[0][/td] [td]*a[/td] [/tr] [tr] [td]array[1][/td] [td]*(a+1)[/td] [/tr] [tr] [td]array[2][/td] [td]*(a+2)[/td] [/tr] [tr] [td]array[3][/td] [td]*(a+3)[/td] [/tr] [tr] [td]array[x][/td] [td]*(a+x)[/td] [/tr] [/table] Ugly ** notation [table=width: 500] [tr] [td]Doodad[/td] [td]What It Is[/td] [td]Seen by The Compiler[/td] [/tr] [tr] [td]array+1[/td] [td]An address[/td] [td]A pointer[/td] [/tr] [tr] [td]*(array+1)[/td] [td]Contents of address[/td] [td]A string[/td] [/tr] [tr] [td]*(*(array+1)) [/td] [td]Contents of a character array [/td] [td]A character[/td] [/tr] [tr] [td]**(array+1)[/td] [td]Same as above[/td] [td]Same as above[/td] [/tr] [/table]
- 1 reply
-
- 1
-
A apropos : Search Help manual pages (man -k) apt-get : Search for and install software packages (Debian/Ubuntu) aptitude : Search for and install software packages (Debian/Ubuntu) aspell : Spell Checker awk : Find and Replace text, database sort/validate/index B basename : Strip directory and suffix from filenames bash : GNU Bourne-Again SHell bc : Arbitrary precision calculator language bg : Send to background break : Exit from a loop builtin : Run a shell builtin bzip2 : Compress or decompress named file(s) C cal : Display a calendar case : Conditionally perform a command cat : Concatenate and print (display) the content of files cd : Change Directory cfdisk : Partition table manipulator for Linux chgrp : Change group ownership chmod : Change access permissions chown : Change file owner and group chroot : Run a command with a different root directory chkconfig : System services (runlevel) cksum : Print CRC checksum and byte counts clear : Clear terminal screen cmp : Compare two files comm : Compare two sorted files line by line command : Run a command – ignoring shell functions • continue : Resume the next iteration of a loop • cp : Copy one or more files to another location cron : Daemon to execute scheduled commands crontab : Schedule a command to run at a later time csplit : Split a file into context-determined pieces cut : Divide a file into several parts D date : Display or change the date & time dc : Desk Calculator dd : Convert and copy a file, write disk headers, boot records ddrescue : Data recovery tool declare : Declare variables and give them attributes • df : Display free disk space diff : Display the differences between two files diff3 : Show differences among three files dig : DNS lookup dir : Briefly list directory contents dircolors : Colour setup for `ls’ dirname : Convert a full pathname to just a path dirs : Display list of remembered directories dmesg : Print kernel & driver messages du : Estimate file space usage E echo : Display message on screen • egrep : Search file(s) for lines that match an extended expression eject : Eject removable media enable : Enable and disable builtin shell commands • env : Environment variables ethtool : Ethernet card settings eval : Evaluate several commands/arguments exec : Execute a command exit : Exit the shell expect : Automate arbitrary applications accessed over a terminal expand : Convert tabs to spaces export : Set an environment variable expr : Evaluate expressions F false : Do nothing, unsuccessfully fdformat : Low-level format a floppy disk fdisk : Partition table manipulator for Linux fg : Send job to foreground fgrep : Search file(s) for lines that match a fixed string file : Determine file type find : Search for files that meet a desired criteria fmt : Reformat paragraph text fold : Wrap text to fit a specified width. for : Expand words, and execute commands format : Format disks or tapes free : Display memory usage fsck : File system consistency check and repair ftp : File Transfer Protocol function : Define Function Macros fuser : Identify/kill the process that is accessing a file G gawk : Find and Replace text within file(s) getopts : Parse positional parameters grep : Search file(s) for lines that match a given pattern groupadd : Add a user security group groupdel : Delete a group groupmod : Modify a group groups : Print group names a user is in gzip : Compress or decompress named file(s) H hash : Remember the full pathname of a name argument head : Output the first part of file(s) help : Display help for a built-in command history : Command History hostname : Print or set system name I iconv : Convert the character set of a file id : Print user and group id’s if : Conditionally perform a command ifconfig : Configure a network interface ifdown : Stop a network interface ifup : Start a network interface up import : Capture an X server screen and save the image to file install : Copy files and set attributes J jobs : List active jobs join : Join lines on a common field K kill : Stop a process from running killall : Kill processes by name L less : Display output one screen at a time let : Perform arithmetic on shell variables ln : Create a symbolic link to a file local : Create variables locate : Find files logname : Print current login name logout : Exit a login shell look : Display lines beginning with a given string lpc : Line printer control program lpr : Off line print lprint : Print a file lprintd : Abort a print job lprintq : List the print queue lprm : Remove jobs from the print queue ls : List information about file(s) lsof : List open files M make : Recompile a group of programs man : Help manual mkdir : Create new folder(s) mkfifo : Make FIFOs (named pipes) mkisofs : Create an hybrid ISO9660/JOLIET/HFS filesystem mknod : Make block or character special files more : Display output one screen at a time mount : Mount a file system mtools : Manipulate MS-DOS files mtr : Network diagnostics (traceroute/ping) mv : Move or rename files or directories mmv : Mass Move and rename (files) N netstat : Networking information nice Set : the priority of a command or job nl Number : lines and write files nohup : Run a command immune to hangups notify-send : Send desktop notifications nslookup : Query Internet name servers interactively O open : Open a file in its default application op : Operator access P passwd : Modify a user password paste : Merge lines of files pathchk : Check file name portability ping : Test a network connection pkill : Stop processes from running popd : Restore the previous value of the current directory pr : Prepare files for printing printcap : Printer capability database printenv : Print environment variables printf : Format and print data • ps : Process status pushd : Save and then change the current directory pwd : Print Working Directory Q quota : Display disk usage and limits quotacheck : Scan a file system for disk usage quotactl : Set disk quotas R ram : ram disk device rcp : Copy files between two machines read : Read a line from standard input readarray : Read from stdin into an array variable readonly : Mark variables/functions as readonly reboot : Reboot the system rename : Rename files renice : Alter priority of running processes remsync : Synchronize remote files via email return : Exit a shell function rev : Reverse lines of a file rm : Remove files rmdir : Remove folder(s) rsync : Remote file copy (Synchronize file trees) S screen : Multiplex terminal, run remote shells via ssh scp : Secure copy (remote file copy) sdiff : Merge two files interactively sed : Stream Editor select : Accept keyboard input seq : Print numeric sequences set: Manipulate shell variables and functions sftp : Secure File Transfer Program shift : Shift positional parameters shopt : Shell Options shutdown : Shutdown or restart linux sleep : Delay for a specified time slocate : Find files sort : Sort text files source : Run commands from a file `.’ split : Split a file into fixed-size pieces ssh : Secure Shell client (remote login program) strace : Trace system calls and signals su : Substitute user identity sudo : Execute a command as another user sum : Print a checksum for a file suspend : Suspend execution of this shell symlink : Make a new name for a file sync : Synchronize data on disk with memory T tail : Output the last part of file tar : Tape ARchiver tee : Redirect output to multiple files test : Evaluate a conditional expression time : Measure Program running time times : User and system times touch : Change file timestamps top : List processes running on the system traceroute : Trace Route to Host trap : Run a command when a signal is set(bourne) tr : Translate, squeeze, and/or delete characters true : Do nothing, successfully tsort : Topological sort tty : Print filename of terminal on stdin type : Describe a command U ulimit : Limit user resources umask : Users file creation mask umount : Unmount a device unalias : Remove an alias uname : Print system information unexpand : Convert spaces to tabs uniq : Uniquify files units : Convert units from one scale to another unset : Remove variable or function names unshar : Unpack shell archive scripts until : Execute commands (until error) uptime : Show uptime useradd : Create new user account userdel : Delete a user account usermod : Modify user account users : List users currently logged in uuencode : Encode a binary file uudecode : Decode a file created by uuencode V v : Verbosely list directory contents (`ls -l -b’) vdir : Verbosely list directory contents (`ls -l -b’) vi : Text Editor vmstat : Report virtual memory statistics W wait : Wait for a process to complete watch : Execute/display a program periodically wc : Print byte, word, and line counts whereis : Search the user’s $path, man pages and source files for a program which : Search the user’s $path for a program file while : Execute commands who : Print all usernames currently logged in whoami : Print the current user id and name (`id -un’) wget : Retrieve web pages or files via HTTP, HTTPS or FTP write : Send a message to another user x xargs : Execute utility, passing constructed argument list(s) xdg-open : Open a file or URL in the user’s preferred application.
-
Exista destule software-uri care pot detecta malicious macro.
-
Exista diferite tipuri de a detecta virusii: - antivirusul se uita la binary markup-ul fisierului pentru a face match in baza de date ce contine virusi si troiani. - verifica ce face programul respectiv + vede daca el face ceva similar virusilor - analizeaza sursa programului si cauta bucati de cod malitioase ( asta este de multe ori foarte dificil si de obicei doar antivirusii foarte avansati folosesc aceasta metoda + este foarte lenta)
-
A team of security researchers from Georgia Tech were awarded $100,000 prize for their work in the security of C++ programs. The team comprising of Ph.D students, Byoungyoung Lee and Chengyu Song, along with Professors Taesoo Kim and Wenke Lee from Georgia Tech were awarded the cash prize for discovering new browser-based susceptibilities and for inventing a detection tool that deals with the vulnerabilities. Developed by Facebook, the “Internet Defense Prize” is a scheme to reward researchers for projects and prototypes that encourage the safety of the Internet. A part of Facebook’s “Internet Defense Prize“, the cash prize is given at the USENIZ Security Symposium in Washington, D.C. Most importantly, the payout has doubled from last year’s inaugural payout of $50,000, which was awarded to German researchers. The won the prize for their work on using static analysis to identify “second-order vulnerabilities” in applications used to compromise users after being stored in web servers before time. In a blog post on Thursday, Facebook Security Engineering Manager Ioannis Papagiannis said due to the success of last year, the social media giant partnered again with USENIX in a call for submissions for the prize, won this year by a team from Georgia Tech in Atlanta, Georgia. The Georgia Tech group discovered a new class of C++ vulnerabilities that are browser-based. The research paper, titled “Type Casting Verification: Stopping an Emerging Attack Vector,” inspects in detail a variety of security problems in C++, which is used in applications such as the Chrome and Firefox browser. As explained by Papagiannis, This, in turn can lead to bad-casting or type-confusion susceptibilities. Hence, the group also developed CaVeR, a runtime based bad-casting detection tool. The findings and introduction of the new tool are further detailed in their research paper. The researchers while describing their detection tool CaVeR wrote, “It performs program instrumentation at compile time and uses a new runtime type tracing mechanism—the type hierarchy table—to overcome the limitation of existing approaches and efficiently verify type casting dynamically.” In the team’s experiments, CAVER detected 11 previously unknown vulnerabilities — nine in GNU libstdc++ and two in Firefox, which have now been patched by the vendors. The prize was awarded at the 24th USENIX Security Symposium. Papagiannis said:
-
You don't have to know to be able to allocate some dynamic memory. It's basic and I strongly reccommend you to learn how to use pointers ( also have a look at dynamic allocated memory - malloc() / calloc() / realloc() / free()) / data structures etc before starting such a project. Now, what I think it will solve your issue: #include "stdafx.h" #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int length = strlen(argv[1]); // argv[1] it's just an example char *chrome = (char*)malloc(length + 1); // +1 for null terminator char *dll = "C:\\Users\\Emi\\Desktop\\akrikaht.dll"; GetEnvironmentVariable("programfiles",chrome,sizeof(chrome)); strcat(chrome,"Google\\Chrome\\Application\\chrome.exe"); //shows error at strcat, opens strcat.asm strcpy(dll,lpCmdLine); STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory(&si,sizeof(si)); ZeroMemory(?,sizeof(pi)); HANDLE baseAddress = VirtualAllocEx (pi.hProcess,NULL, 265, MEM_COMMIT,PAGE_READWRITE) ; WriteProcessMemory(pi.hProcess,baseAddress,dll,sizeof(dll),NULL); CreateRemoteThread(pi.hProcess, NULL,0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle("kernel32"),"LoadLibraryA"),baseAddress,0,NULL); Sleep(100) ; TerminateThread(pi.hThread,0); printf("Injected \n"); getchar(); return 0; } Now obviously something is missing but I won't tell you everything. Just look up on the internet for dynamic memory allocation in c and you'll be ok.