Tag: Programming

[Bài dịch] Hướng dẫn tạo Loader trong .NET

Xin chào các bạn,

Đây là bài viết tiếp theo trong loạt bài dịch .NET của tôi. Bản gốc tiếng Anh do tôi viết, cách đây không lâu , các bạn có thể tìm thấy ở đây. Còn trong topic này là bản dịch của bài viết đó. Các kiến thức tuy không mới, nhưng hi vọng sẽ hữu ích với các bạn.

Trong bài viết này, tôi sẽ hướng dẫn các bạn cách tạo 1 loader bằng C#, để patch một chương trình viết băng .NET mà không làm ảnh hưởng đến chương trình gốc.

Bài viết

Link tải crackme được sử dụng trong bài viết : DOWNLOAD MEDIAFIRE

Enjoy and best regards,

Levis

[Relax] How to become a ‘Superb programmer’?

Some small lines for a funny summer. After reading this, let me know you opinion, and also sorry about my bad English 🙂

 

These days i read a really childish question, but somehow it’s interesting :”How to become a superb programmer?”. Many newbies who have just started to learn about information technology/programming always have a doubt and ask some question like this, and they wish to become to a billionaire and big man likes Bill Gates, or so. But hey, in my opinion, Bill Gates is not a professional and experienced programmer, he just be called as a succeeded business man. If we talk about some excellent programmers, the name of Linus Torvalds or Dennis Ritchie, should be mentioned.

Back to our main topic about the question:”How to become a superb programmer?”. At the beginning and til now, i still think that this question is really crazy and the misunderstood of the guy who asked this about programmer (as i mentioned above). But then i re-think about it and:”Aw, not bad. There should be some interesting thing to discuss about”. so i decided to write this note, not to show you the way to become a guy like Bill Gates – when he never count his money by each bill, he just count by each bag, but to show you determine your road to learn to become a professional – even you will become famous or not, just keep reading. Another point that i have to notice, is, in this note, i will not discuss about programming languages, because each language has its own advantages and disadvantages, and non of them is perfect, so i only show you and give advices, according to my experiences, and my knowledges, also my point of view (although i’m a student who is learning about banking and financial, not about information technology). So, are you ready? Let’s get started.

My chosen way:
Programming -> Debugging -> System programming -> Hacking and security

I will describe each part, separately below:

1. Programming
You can be a superb programmer without knowing programming, do you?Haha, it’s not. So you have to know and become fluent, in at least 1 language. Then you should start to write the code, from small applications to big projects. at first just to fit you needs, and then to help others. For e,g, some applications to hook girls, to scare your friends, then come to some bigger and more realistic, like accounting and management softwares, or some graphic emulator/manipulator program (if you could make some, like photoshop, autocad or premier, it’s great). And along side with the language you fluent the most, spend time to learn and research about other languages, as much as possible, but beware and take care, because you can get complicated. By keeping on programming, you will have good knowledges about programming languages and also about algorithms, coding styles and way to build an application.

2. Debugging
Debugging is a part of programming, but i still divided it into a standalone section, because it’s very important to us. Many students (especially rookies) think that “debug is just debug, and the main purpose is help us to run program without error after F9/F5 key pressed”. but personally i think that debug is more useful. By doing debugging, i can learn about the way that computer works, for each line of code compiled. I can see that how the program make a call to a function, push and pop data from stack, the change of registers and flags in cpu, stored data of each block in memory, or simply how the assembly code look like when compiled from a high level language,… all are amazing. I always debug all the program, even if it has bugs or not, just to watch those things. Gathered knowledge are very helpful, to me for a better result in programming. Then i can stop asking some stupid question like “What is 32 bit?/ What is 64 bit”, after asked that i will receive many good answers with full information, but all are just theory and no realistic, and i still don’t understand. So debugging will helps us to have a deeper look inside the computer, to see how it works, not only finding bugs and fix them.
P/s in this section: Sometimes i tried to use some debuggers which are integrated in some modern IDEs, and found that this task is too boring, because debugger only allows us to watch and trace by monitoring data in variables. In some cases, we could get more, but it’s not enough. I still like to use some wicked tools like Olly or gdb, they’re much more interesting. Seem that people is stuck with debugging in IDEs too long, so now they don’t have a correct opinion about debugging (especially made it as a not important task).

3. System Programming / Kernel Programming

The hardcoded part started from here. After you got a lot of knowledge about computer system and programming, so you should start with this section. You might have an question after reading this :” So what’s the difference between part 1 and part 3?”. Let me explain to you:
As you see in the first part, i highly recommended you to write application which is needed to help your daily tasks, also other people, just call it as “Application Programming”, then what you’ve done is just make a bridge for normal users to get closer to the computer, and make the computer to be a handy and powerful tool to get the job done. But system programming, is really different. You have to become a “friend” of the computer, listen to it, and determine and recognize its abilities, and make it become full-controlled, by your hand. Seem like too complicated, eh? In normal way, what you have to do is try to make program which can interact with computer, control them and make them work as you want to. I,e, write some drivers for external devices, create your own compiler/debugger, write and submit some code patches for linux kernel, start coding on embedded system,… More over is create your own operating system. These tasks is really hard to do, because, along side with programming skills, the knowledge about the way that computer works, knowledge about operating system, you have to have good knowledge about hardware structure (and a part, just not a few part, about electronic). when you reached this, i’m sure that you’re “demigod”, not a newbie anymore, haha.

4. Hacking and security
This is the last section. In fact, it’s only the sub-section of three parts above, but it’s the highest skills which are “must have” skills for a programmer. A talented programmer, is seem to be a good hacker. But, there are many opinions about hacking and security theory, because these opinions were created in many different conditions, so they’re not the same. In programming, i just set that “hacking and security” is stand for 2 purposes, which are most important and highly required, of a programmer. They are:
– The stability and high performance of code and programs
– The safety/ security of code and programs
There is a fake story like this
When i was at university…
I created a small application, a chat client for me and my girlfriend, to have quick and easy chat. Everything is fine, in night time, me and her made many conversations, and sent a lot of love messages, they’re sick and romantic. But at a period of time, my girlfriend complained that her computer is really slow and laggy, whenever she makes a chat with me. Then i thought that my program has an problem. Rechecked my code, all are fine, the program run without any error with all the features worked well. But with a bit deeper check, i realized that my program consumed a lot amount of RAM Memory also CPU usage. Ah, so this is the issue which caused my girlfriend computer to slow down and lag. So i have to find a way to modify the code, to make it run smoother with lesser RAM and CPU required. the task to make the program become more optimized, is I’m “hacking” into the code to make it suit my needs (also my girlfriend needs, to). I rebuilt program, applied many better algorithms, also created new flexible methods, and finally i completed the task. Then, me and my girlfriend keep connection every night, again.

But sometimes, the love story should be hidden, to avoid other people. They may gossip and make a joke about it (especially with my friends, if they know that i have girlfriend, they would force me to pay for a small party to cheering about that). So both me and my girlfriend didn’t mention about it with anybody, except us, we were waiting for a suitable moment to announce that. The time didn’t come yet, but my friends discovered. And my poor wallet, it’s never become fat, after the party, it turned into a skeleton with empty hole. I asked “Why did they know about my girlfriend?”, then i started to figure it out. Ah, they saw me every night i always sit in front of the computer, keep tapping the keyboard, sometimes i have stupid smiles. They started to capture packets at my machine when it connected to the internet, and grabbed a lot of my love messages included in these packets, in plain text mode. Those messages are not encrypted after sending, so it’s too easy for my friend to find out my secret story. So, my program is not safe and make information to be leaked. And the result is my empty wallet and after that, my girl get shamed because sometimes my friends teased her using that love story. The secret was discovered, but i still want to make my program become more optimized and safety. I added encrypted algorithm to protect my messages, after my girlfriend received encrypted messages, there will be a decryption function to turn them to plain text, so my girlfriend will be able to read them. When i tested new program by capturing packets, i only got some packets which contains encrypted messages and they can not be read. Phew, now my program is safe.

The story above, is just a demonstration for a very, very small part of “Hacking and security”. To do hacking and security in typical way, you need a lot of knowledges, from programming, computer system to networking and hardware. To increase the performance and security of a product is very hard and cost a lot of time, also requires a lot of knowledge, and the most important is you have to fully understand about all the dependencies. Write true code, make a program runnable, make a working system are not enough, you have to tweak them to give a best performance also best security state. And the tweaking task is not once, you have to repeat it, time to time. Each completed tweak, the program should become more stable. That’s why hacking and security is the highest skill for a programmer, in my opinion.

And for the last words, “the guy who makes a most stable program, is the best programmer, no matter how he did it”.

A cheap, (and) simple keygen for a memorable time

Hello all mates,

Just walking around the internet, and i found this site:

http://www.zhangduo.com/

which has a small utility named “Windriver Ghost”. That makes me remember the first day when i came into the Reverse Engineering World. I did a keygen for it when i was a young boyt (13,14 years old). Haha, it’s very joyful and i’m so happy that time. It was my first keygen, coded in vb.net.

And now, many years passed, today i analyzed it again and see no change in this software. Still the same algorithm and i decided to make a keygen for it (again), for fun :).

There are no explain words on analyzing and coding, just post the raw code here (in C#), for who interested. This is keygen for Enterprise Version or Windriver Ghost:

/*
 * Created by SharpDevelop.
 * User: Levis
 * Date: 21/03/2014
 * Time: 9:56 PM
 *
 * For further information or any question, contact me: [email protected] or Skype: levintaeyeon
 * My personal Blog: http://www.ltops9.wordpress.com
 ^ Team REPT Official Website: http://www.team-rept.com
 */
using System;

namespace windrvghost_kg
{
	class Program
	{
		public static void Main(string[] args)
		{
			Console.Write("Win Driver Ghost 3.02 Enterprise Edition Keygen\n Created by Levis\n Please input you name: ");
			string name = Console.ReadLine();
			string output,serial=null;
			if(name.Length ==0)
			{
				output = "Your name is not valid! Chosse another!";
			}
			else
			{
				Gen_key(name,ref serial);
				output = "Your serial is: " + serial;
			}
			Console.WriteLine(output);
			Console.ReadKey(true);
		}
		public static void Gen_key(string name, ref string serial)
		{
			serial = "WDW21" + (name.Length + 2222).ToString() + "-";
			for(int i=0;i<name.Length;i++)
			{
				serial += String.Format("{0:X}",Convert.ToByte(name[i]));
			}
		}
	}

[ASM] Silences Programming Tour with MASM32

Here’s what my friend, Silence – another member of REPT, did as a gift for this christmas :). A Nice collection about Programming with Assembly.
Silence is back with a new tutorial tour! This time with a
brand new tutorial-serie of 11 parts(!) about programming
in windows x32.
In this serie I will learn you how to code in masm32.
Everything is very well explained, each line, each word &
each API.

This tour is called “General Edition” simply because I will
learn you general masm32 programming. In example I will
learn you how to code a simple messagebox up to a
mp3 music player

Note: This tour doesn’t contain any illegal content

Title: Silences Programmings Tour – MASM32 (General Edition)
Total Duration: 267,68 minutes
Format: swf
Content: (including source)

1. Introduction, Setup & Skeleton of Exe (18:04)
2. Our first MessageBox (12:49)
3. Our first DialogBox (18:57)
4. DialogBox in Detail (27:56)
5. Default toolbar controls part 1 (RichEdit, Trackbar,
Radiobutton & Checkbox) (27:27)
6. Default toolbar controls part 2 (Progressbar & Tabs) (25:00)
7. Default toolbar controls part 3 (Listbox) (19:15)
8. Default DialogBoxes (Color, Font, Open, Save, Print,
Page-Setup, Find-Text, Find-Replace) (38:00)
9. Simple file management (29:27)
10. Showing Bitmap image & Playing mp3 files (25:30)
11. Windows Registry + Final words (27:03)

Link download (Direct link – REPT’s ZONE):
DOWNLOAD DIRECT LINK BY REPT
Mirror link (tuts4you):
DOWNLOAD VIA TUTS4YOU
and the Password to extract is: HAPPYxMAS
Merry christmas (again) and Happy new Year!!!

Best regards,
Levis/REPT

[.NET] Create a NFO Viewer in C#

Just a small piece in programming world :). I feel that it’s very exciting.

The tutorial written by DarkTyranno. will show you the way to create a nfo viewer with many effects (region-window, scrolling text, music, etc…).
This tutorial i grabbed at CodeProject, so you can see it by this link:

http://www.codeproject.com/Articles/505994/Creating-a-NFO-Viewer-in-Csharp-as-a-beginner

 

Enjoy and best regards,

Levis/REPT

.NET CLR Injection: Modify IL Code on Run-time (codeproject)

Introduction

Modifying .NET methods’ MSIL codes during run-time is very cool, it helps to implement hooking, software protection, and other amazing stuff. That’s why I want it, but there is a big challenge on the road — the MSIL code could have been complied to native code by JIT-complier before we have a chance to modify them; also the .NET CLR implantation is not documented and it changes during each version, we need a reliable and stable way without dependency to the exact memory layout.

Anyway, after more than one week research, finally I made it! Here is a simple method in the demo problem:

Created by Jerry. Wang
I think this article is very interesting. Just read and apply it yourself
Read this article at CodeProject.com
Link:
.NET CLR Injection: Modify IL Code on Run-time

Enjoy and best regards,
Levis/REPT

[SITE RIP] DelphiZeus’s tutorials about API Programming with Delphi

Hello all mates,

I know this site :
http://www.angelfire.com/hi5/delphizeus/

has many good tutorial about Delphi Programming with API.
So i decided to rip all the site and save them as PDF files, which easier to download and store them in our drive.
In my opinion, all tutorials are very good and well explained, very useful for Delphi coders.

Contents Index:

1. – Creating a .dpr program
Explains using only the Program (.dpr) unit to create an application
1a. – Reading the C code in Win32 API Help
Tips for Pascal coders to help read the Microsoft C-Code in the API Help.
2. – Making a API window and message loop program
Shows how to create a Windows GUI program with windows and a message loop
3. – More Messages and Changing Windows Properties
Explores changing the message parameters, and a window’s properties.
3a. – SmallUtils Unit an Alternative to SysUtil
A utilities unit so you don’t have to use SysUtils and add 20 Kb to your program
4. – PChar, it’s a Pointer
Gives some examples for using the PChar in API parameters
5. – Fonts and using HDC
Explains some basic graphical concepts, the Device Context and Font creation
6. – Brushes and Pens, with intro to timers
More examples of DC Drawing functions with Brushes and Pens and a Timer
7. – Buttons and Edit Controls
Shows how to use options and subclassing to get Buttons and Edits to do more
8. – Using Dialogs
Instructions for creating REAL dialogs in delphi, using the DIALOG resource creation
9. – Non-Modal Dialogs and Scroll Bars
Outlines the creation of Non-Modal Dialogs and shows how to use Scroll Bars.
10. – Menus and Listboxes
Gives information about creating and using Menus and Listboxes
11. – Code In Units, Combo Boxes
A program that divides the code into Units, and uses Combo Boxes.
12. – Programs with XP Themes
How to have your programs use the XP Theme Control Drawing.
13. – MakeApp a Universal Unit
The MakeApp.pas is a Reusable Code Unit, that can be used in many programs.
13a. – Example code for MakeApp Unit
Code Examples for the MakeApp Unit and do Drag and Drop with DragAcceptFiles.
13b. – A Visual “Graphic” Control Unit
The GrafCtrl.pas Unit has code for making Non-Windowed “image only” controls.
13c. – Example code for GrafCtrl Unit
converted by Web2PDFConvert.com Code Examples for the GrafCtrl Unit using the G Controls.
14. – Using System Open and Save Dialogs
How to create and use the standard system Open and Save Dialog Boxs.
15. – Reading and Writing Disk Files
How to Create and Access Files on Disk to Read and Write File Data.
15a. – Program Code for Using Files
Code for the UseFiles Program, to show methods to use Disk Files.
16. – More Top Level “PopUp” Windows
How to create and use Pop-Up windows, methods for docking and animation.
16A. – A Unit for Modal Message Windows
Methods to have pop-up Modal Windows that block code progression.
17. – Tray Icons in your Program
A program that places a Tray Icon in the task bar’s status area.
18. – a Text Editing Program (like Notepad)
A compleate text editing program like Notepad, with Registry data and printing
19. – A Note Posting Program with List Box
A program that displays a yellow Post Note and shows how to use List Boxes
20. – Using MuliMedia and Thread Timers
An Animation program that displays text scrolling and a moving ball
The next pages are for things not directly related to API programming instruction.
21. – A Delphi Unit used to save Icons to file
Has functions to save Icon files in 256 and Full Color Formats
22. – Builing Custom Files with TFileStream
Tells you how to create files with TFileStream that contain several different Data segments
23. – Creating HTML Dialog Boxes
Shows you how to produce an IE Browser Window Dialog Box.
23. – Web Links to Delphi Sites

All credits go to site’s author : Wes Turner.
Download link:
UPPIT LINK

box.com:
BOX.COM LINK

Minus.com:
MINUS.COM LINK

Dropbox:
DROPBOX LINK

Enjoy and Best Regards,
Levis