Latest News
Showing posts with label cpp. Show all posts
Showing posts with label cpp. Show all posts

Recursive File Search in C | Source Code

Posted by genesisdatabase on Saturday, 5 March 2011 , under , , , , , , , , , , , , , , | comments (2)



This source code below is written by se7en from LeetCoders.  It is capable of running through the enter C drive in 8 seconds on my computer finding more than 230,000 files.  Although the downside of it is that it costs quite an amount of CPU usage during its process.  You might try to optimize it by placing Sleep function or something that is possible in reducing the CPU usage.

HTTP File Downloader for Linux and Windows in C | Source Code

Posted by genesisdatabase on Friday, 4 March 2011 , under , , , , , , , , , , , , , , , | comments (1)



A member in HackForums by the handle Jakash3 has posted a source code on how to download files from the Internet that can be compiled in both Linux and Windows.  Another great feature is that it supports IPv6.

The official way of writing a crypter in C | Source Code

Posted by genesisdatabase on Tuesday, 22 February 2011 , under , , , , , , , , , , , , , , , , , , , | comments (1)



mindlessdeath, a member from HackForums have posted a thread regarding how to write a crypter in C!  I find this source code a very good example for people that are trying to learn to write their own crypter.  Compared to any other source codes that are posted on the internet, the author of this source code gave a very detailed information on each line on what the statements does.  In order to use this source code without much trouble, there are some prerequisites that was mentioned by the author himself. 

Clone or Copy File in C

Posted by genesisdatabase on Tuesday, 1 February 2011 , under , , , , , , , , , , , , , , , , , , | comments (0)



Generally there was someone in one of the forums i am on was asking how to duplicate a file.  So basically this little post i made up was to help this guy.  There are fundamentally few ways so i will write them up in code tags below.

Learning to make your own DirectX game in C and C++

Posted by genesisdatabase on Monday, 31 January 2011 , under , , , , , , , , | comments (0)



This is a tutorial that was given by one of the professor in my university that my friend was studying.  He is in the gaming course so basically he learned some flash programming and now 3d programming too.  Some of the subjects include DirectX so the professor gave them a website that guides you from the basics.  This website is called DirectX Tutorial.com and the website is as below.  Although i am not fancy of writing anything related to graphics i find that it is quite an interesting subject.  By learning how to write with D3D (Direct 3D), a C or C++ programmer may find it useful for their future projects.  To jump start the tutorial, visit here.

Homepage: http://directxtutorial.com/

Note: If you are looking for the DirectX SDK it is here.

Listing processes for all users in C

Posted by genesisdatabase on Saturday, 29 January 2011 , under , , , , , , , , , | comments (0)



While i was searching online for a way to display processes for all users, i came across this source code which was coded profesionally.  The source code can be found here.  Be sure to check their homepage here too for more source codes.

Win32 samples

Posted by genesisdatabase on , under , , , , , , , | comments (0)



Today i came across a very interesting website while searching for a method to display processes for all users!   This website, http://win32.mvps.org/ provides alot of useful information coded in C!  As a C/C++ programmer, it is highly suggested to give this website a visit!  As for the source code i was looking for (displaying processes for all users), it is here!

Visit it for a better you here.

Creating your own driver loader in C | Driver Loader | Source Code | Rootkit




Technically, there's 2 way of loading a rootkit according to Greg Hoglund when he wrote Rootkits: Subverting the Windows Kernel book.  One is called The Quick-And-Dirty Way to Load a Driver.  This method allows you to "load a driver into the kernel without having to create any registry keys.  "Pageable" refers to memory that can be swapped to disk. If a driver is pageable, any part of the driver could be paged out (that is, swapped from memory to disk). Sometimes when memory is paged out, it cannot be accessed; an attempt to do so will result in the infamous Blue Screen of Death (a system crash)" by using an undocumented API call. 

Placing an image file in an executable in C




If you ever wanted to place an image file into the executable or store any resources in it, this post will be able to help you.  If you have previously read Builder & Stub | How to create your own builder and stub in C (using Resource), you will be able to understand this post easily.  We are using the similar method by placing the image in the resource data.  In this post, i am creating an application that extracts the image that has been placed in the resource data and place it in a file and execute the file. 

Builder & Stub | How to create your own builder and stub in C (using Resource)

Posted by genesisdatabase on Tuesday, 11 January 2011 , under , , , , , , , , , , , , , , , , , , | comments (0)



If you are looking to build it using EOF, look here.

As i have already created a similar post which creates your own builder using the File I/O (Input/Output) operation, some have came across a problem where they need their stub application to be placed and ran in memory instead of normal execution.  In order to counter this problem, the solution that can come into mind is to use the resource data in the file.  Even if your file is ran in the memory, the resource data is also loaded with it.  Be aware that the terms used may confuse you so read the synonym section.  Take a look at the concept below.

Builder & Stub | How to create your own builder and stub in C (using Resource)




If you are looking to build it using Resource, look here.

This question is often seen in one of the forum that i hang around.  Although the programming language is different, the idea and concept is one.  I have already prepared a source code for this project but i will explain a little or less about how it works.  Understand that the term stub i am using refers to the application that is going to read a message that has been injected from an application called builder.  Be aware that the term injected also refers to implanted or appended.  In this article, i will be showing the concept on how a builder and stub works, what will you need before coding it and your preparations as well as pseudocode to ease understanding of the concept.  Apart from that you can download the project in case you are not sure what to do with the source code given due to certain complexity.

WLM / Firefox / No-IP / DynDNS Recovery in C | Source Code

Posted by genesisdatabase on Wednesday, 29 December 2010 , under , , , | comments (0)



As mentioned in one of my previous posts i will be releasing the function to retrieve passwords of WLM, Firefox, No-IP and DynDNS.

Download WLM Recovery source code.

Download Firefox Recovery source code.

Download No-IP Recovery source code.

Download DynDNS Recovery source code.

Binary to Hex Converter

Posted by genesisdatabase on Friday, 24 December 2010 , under , , , , , , , , , , , , , , | comments (0)



This source code below converts a text file with binaries into a text file with hexadecimals. Imagine we have a file of binaries called "hello.bin", we are going to convert it into hexadecimals and write it into a file called "hello.com".

hello.bin

[code]
10110100 00001001
10111010 00001001 00000001
11001101 00100001
11001101 00100000
01101000 01100101 01101100 01101100 01101111 00100100
[/code]

Concept (in terms of ASM)

[code]
mov ah,09
mov dx,0109
int 21
int 20
db "hello$"
[/code]

hello.com

[code]
B4 09 BA 09 01 CD 21 CD 20 68 65 6C 6C 6F 24
[/code]

where you can see how the binaries, hexadecimals and ASM are linked.

[code]
10110100 = B4 = mov ah
00001001 = 09 = 09
[/code]

What "hello.com" does when ran is it prints the word "hello" and exits. Generally this code is a converter but it has given me a further insight of what assembly would look like and how the machine language works now. The source code is as below and it is done in C language (but you would need to write the filename as .cpp instead of .c since the program was not programmed according the C proper structure whereby it should be defining variables before statements).

Source code

[code]
#include <stdio.h>
#include <stdlib.h>

void help(char* fname) {
printf(
"Code programs in binary - by Jakash3\n"
"Usage: %s outfile infile"
"Notes:\n"
" infile = Text file containing ascii 1's and 0's.\n"
" 8 bits per byte, all other characters\n"
" and whitespace ignored.\n"
" outfile = Name of program to create and write to.\n",
fname
);
exit(1);
}

int main(int argc, char** argv) {
if (argc!=3) help(argv[0]);
FILE *dst, *src;
dst = fopen(argv[1],"wb");
if (!dst) { printf("Could not create or truncate %s\nQuitting...",argv[1]); return 1;}
src = fopen(argv[2],"r");
if (!src) { printf("Could not open %s\nQuitting...",argv[2]); return 1;}
char c, byte=0;
int i=0, count=0;
while (!feof(src)) {
if (i==8) { fwrite(&byte,1,1,dst); byte=0; i=0; count++; }
fread(&c,1,1,src);
switch (c) {
case '1':
byte |= ((c=='1') << (7-i));
case '0':
i++;
}
}
fclose(src);
if (!fclose(dst))
printf("Wrote %d bytes to %s\n",count,argv[1]);
return 0;
}
[/code]

Download binary (.exe).

This code was written by jakash3 from Leetcoders.org
* Original link here.

Microsoft Detours

Posted by genesisdatabase on Friday, 3 December 2010 , under , , , , , , , , , , , , , , , , , | comments (0)



Detours is a library for instrumenting arbitrary Win32 functions on x86, x64, and IA64 machines. Detours intercepts Win32 functions by rewriting the in-memory code for target functions. The Detours package also contains utilities to attach arbitrary dynamic-link libraries (DLLs) and data segments (called payloads) to any Win32 binary.