Jump to content

mrgrj

Active Members
  • Posts

    1422
  • Joined

  • Last visited

  • Days Won

    45

Everything posted by mrgrj

  1. 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]
  2. 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.
  3. 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:
  4. 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.
  5. Use dynamic memory allocation ( malloc() should be enough ) for your variable and it should work. Don't forget to also free() to deallocate the allocated memory
  6. mrgrj

    Windows 10

    Meam, 8 pagini despre Windows 10. L-am incercat si eu. Nu are suficiente avantaje pentru a ma face sa renunt la Debian based things.
  7. Launched in 2009, Shodan is more of a prying eye across the world through the IoT rather than just a simple search engine. John Matherly, its creator, named his project after the villainous computer in the video game System Shock. As in present, Shodan is living up to his name. Already designated as ‘world’s scariest search engine’, it is commonly called the hacker search engine. Shodan shows you what Google doesn’t. Designed with an aim to link all the devices connected to the Internet, it took no time to become a play zone for hackers and experimenters. Shodan works by collecting and stacking HTTP addresses from various devices linked over the Internet across the world. The indexing is done on the basis such as country, OS and brand. Shodan’s scanning power can be assumed from the fact that it can detect the traffic lights, security cameras, control systems for gas stations, power grids, and even nuclear power plants. Most of these public services use little measures for online security and once exposed to hackers or terrorist organizations, the results could be disastrous. If you have installed telnet enabled security cameras in your home for “security”, then you might want to put them away. Hackers can breach into your system if your IoT hub is exposed on the Internet using this hacker search engine. It won’t be easy, however, it is not impossible either. There are a number of devices out there that still run on their default passwords or no passwords at all. Shodan crawls through the Internet for such accessible devices and you are shown 50 of those if you have an account on Shodan. If you could give the website the reason to check these devices with their fees, you would get information of all the devices. Though, even if you can, we highly recommend you to not misuse Shodan, the hacker search engine. Source
  8. Daca faci rost de ceva mirrored, da-mi si mie un tag in post-ul asta te rog
  9. Cel mai simplu e sa testezi si sa vezi daca e adevarat. Insa pot garanta ca e putin probabil. Actiunile de la bursa fluctueaza cum nu iti inchipui. Ce predictii ai putea face cu niste retele neuronale ? Dezvolta:
  10. 1. Merge si pe managed si pe unmanaged. 2. Momentan suporta doar emulator insa vor face update-uri si pentru device din cate am citit.
  11. Today is the Visual Studio 2015 and .NET 4.6 release day. These software from the house of Microsoft have finally graduated exiting the preview stage and are now ready for download for Windows, Linux, and Mac. Microsoft’s flagship development environment Visual Studio has got a major update in the form of Visual Studio 2015. Around the world, millions of developers use Visual Studio to make cross-platform platform applications for iOS, Windows, and Android. Apart from the Studio, Microsoft’s .NET framework too has got an update. The fully-featured Visual Studio IDE comes free for non-enterprise development. Microsoft has also revealed that there has been about 5 million downloads of Visual Studio Community- the fastest ever in the history of a Visual Studio product. The new Visual Studio 2015 and .NET 4.6 has brought hundreds of new features useful for developing desktop, web, mobile, cloud and more. This release also underlines the fact that now developers can write Windows 10 universal apps and recompile them before submitting to the Windows app store. For those who aren’t aware, universal apps mean that now developers can target apps in Xbox One, Windows Phone, HoloLens, and Windows 10 PC with a single codebase. For Android developers, Visual Studio 2015 also include an Android emulator. Talking about the cross-platform functionality of Visual Studio 2015, the team has integrated Apache Cordova to achieve it. Now developers can build iOS and Android apps using JavaScript, CSS, and HTML. They are now equipped with the ability to import their C++ language skills and build components common to Windows, Android and iOS apps. Visual Studio 2015 supports C# 6 and VB.NET along with the improved support for C++, Python, and TypeScript. New diagnostic and debugging tools too have been included in this iteration of VS. Now Visual Studio 2015 is out and available for buying. Timing of this release is perfect i.e. 9 days ahead of the official Windows 10 launch. Know more about the Visual Studio 2015 and .NET 4.6 here. Download links are here: Visual Studio 2015 & .NET 4.6 sursa
  12. O sa am rabdare. Poti sa imi dai ceva detalii de challenge-uri ? Nu am apucat sa ma uit inca, insa vreau sa incerc weekend-ul asta cripto si RE.
  13. Ar fi frumos ca la finalul competitiei, cineva sa posteze chall-urile aici pe RST si eventual, dupa X timp, daca nu reuseste nimeni sa rezolve, acesta sa posteze un mini-tutorial cu rezolvarea. Asa mai invatam si noi cate ceva unul de la celalalt. Pana la urma, asta e scopul, nu ?
  14. Sa fie primit! Oricum se posteaza random in 90% din cazuri + oricum ar incerca moderatorii sa redenumeasca sectiunile, nu va avea un efect major pt. ca exista in general odurereinimaginabilaincur. Sa speram totusi ca lumea isi va reveni intr-un viitor cat mai apropiat.
  15. Nici o problema. Daca nu lasa doar in registrii, schimbi calculatorul
  16. @Silviu
  17. mrgrj

    .

    Scuze, am dat dislike din greseala. Voiam sa dau like. Foarte misto video-urile
  18. 66
  19. Mersi pentru informatii. Stii cumva vreo diferenta intre cele doua ? cibernetica - informatica economica ? Ai mai multe avantaje daca o faci pe una sau pe cealalta ? Si daca da, in ce domenii ? ( de exemplu, ca ce te poti angaja daca termini intr-o parte sau in cealalta ) Ms
  20. Da-mi si mie ceva detalii despre facultatea asta ca am un prieten care vrea sa se inscrie aici si nu stie daca sa aleaga info sau cibernetica. Se face programare hardcore ? Profii sunt ok ? Mersi
  21. Tocmai am dat peste acest thread si pot spune ca poate deschide ochii multor copii de pe aici. Enjoy your reading.
  22. https://github.com/fffaraz/awesome-cpp
  23. E python Inainte sa pui intrebari de genul, intereseaza-te putin. Raspunsul dat de pr00f este ironic. Nu te apuca sa faci scrappere in Pascal.
  24. Am nevoie de ceva bani pentru a achizitiona un produs si din pacate nu imi ajung asa ca pot realiza aplicatii (cu GUI sau CLI based) in urmatoarele limbaje contra unei sume stabilite ulterior: C C++ C# Python / Django Bash / Batch Perl Desigur, impreuna cu tot ce implica acestea (Baze de Date - MySQL / NoSQL / PostgreSQL, diferite API-uri ETC) Plata o puteti face pe PP, BTC sau Payoneer. (avans 20%) Un moderator poate intermedia tranzactiile, daca se doreste, pentru a nu exista conflicte. Va rog, fara comentarii inutile. Eventual da-ti un PM sau un tag in threadul asta. Mersi
×
×
  • Create New...