Archive

Archive for November, 2012

Cracking .NET Software

November 30, 2012 1 comment

Are you familiar with this picture ?

image

If you are not then you have to visit this cool website regulary. If you have already, congrats. then you are a cool person to. 😀

This is what exactly we will do in this blog post. I always thought that to crack software is really hard at university. A couple a days ago i found that actually that’s pretty simple and i believe that you can do it also. Of course i’m not want you to be pirate. Let’s just do it for fun. 🙂

Don’t worry we don’t have to deep dive into assembly or machine language thing in this stuff. I will.. maybe next time, if i have a chance to do it. But today it’s only a simple start for you to get your hands dirty.

I know all this stuff because previously i want to crack my friends software because it can be run in Windows 8. I try to find out why the license mechanism is not working on my Machine.

My first try is to get a the coolest software decompiler  in .NET world. Reflector. If you don’t have one, please go get it and use the trial version to get the feel how great it is. I see the license routine and found out where i can leverage the weakness of this software. Just drag the assembly to reflector and open the related method. Very simple to use. Turns out that this assembly hasn’t been obsfucated first.

You definitely have to obfuscate your assembly if it’s not open source project.

 

image

Here’s another assembly that has been obfuscated. You can still see the code, but i bet it will hurt your eyes, just give up and buy the license.

image 

I include the assembly in my project, create a simple main program in my software. I try to do reflection because some of the assembly is internal. So another best practice again is…

image

For a really critical and high privacy class, you should keep the access at least as possible. don’t create all class public by default. that’s just plain stupid !!! If you don’t want everyone get access to it try to make it internal.

There is a very good book that will support my statement. You can check this cool book.

image

 

After a couple of headaches i finally found a very nice reflector add ins that help me to crack that software. Have you ever heard about reflexil ? That cool tools can modify an IL (intermediate language) and save the result. That’s exactly what we’re looking for. Just go download the latest version.

image

Extract the file and then add to reflector.
image

image

And now you can find the interesting method and see the IL 

image

If you are not into IL, don’t worry. You can just modify the method directly and insert the relevant code. Very simple. Just right click in instruction window and choose this one

image

And all you have to do is replace the whole class with yours. You have to make it compile-able. Compile and click ok. Your evil IL will be inserted.

image

Now you can save the modified assembly by right clicking the assembly, choose reflxil and save as…

image

And then replace the original assembly with this one. And you are done. Right next door to hell because of cracking other people software. 🙂

 

Use this information to protect your software only. Of course that’s depend on your heart right ?

 

http://sourceforge.net/projects/reflexil/?source=dlp
http://geekswithblogs.net/MarkPearl/archive/2010/09/01/crack-.net-applications-101-ndash-part-2.aspx
http://geekswithblogs.net/MarkPearl/archive/2010/08/31/crack-.net-applications-101-ndash-part-1.aspx
http://stackoverflow.com/questions/451453/how-to-get-a-static-property-with-reflection

Cheers

Advertisement
Categories: Uncategorized

TypeScript for Realtime Demo

November 29, 2012 1 comment

Today i’ve just using TypeScript for our html 5 realtime streaming experiment.

My boss told me to create a HTML 5 client to demonstrate the result of our messaging infrastructure research. At first i don’t think this will be fun because i have to touch HTML and Javascript. I’m very lack in that area. I’m a backend engineer… what should i do here.

But i think why not make this fun ? So i use TypeScript for this task. And voila. Very simple code for not so simple experiment. 🙂

 

image

I couldn’t imagine how i can code javascript for this kind of task.

Have you install TypeScript for Your Visual Studio ??

You SHOULD

 

Cheers

Categories: Uncategorized

Waiting for HTML 5 Websocket Books….

November 28, 2012 Leave a comment

Lately I’ve been involved intensively with WebSocket. I found there’s an incoming book for this stuff. Currently my guide is RFC which is boring and confusing sometimes. Open-mouthed smile

 

Please … release this book soon. I’m dying to read it !

 

image

Categories: Uncategorized

Team Leadership Books to read

November 25, 2012 Leave a comment

No one work in isolation. Team is a very precious thing that will made your software dream comes true. Need to read those book to create and maintain a great team. Here is my bucket list reading .. when i have a free time…

image image image

image image image

image image image

 

Definitely need some very good time to read it !

Categories: Uncategorized

TypeScript : Large Scale Javascript Development made easy

November 24, 2012 1 comment

Beberapa tahun belakangan ini javascript sudah menjadi first class language yang tidak hanya digunakan untuk aplikasi web saja tetapi juga di sisi server. Anda dapat melihat framework sepertiNode.js, framework for single page apps, bahkan video streaming and conference jg memanfaatkan kekuatan dari javascript dan HTML 5. Jangan lupa juga bahwa microsoft menggunakan javascript sebagai salah satu language yg dapat membuat aplikasi windows store apps (windows 8). Perkembangan library javascript dengan kehadiran HTML 5 juga sangat mengesankan. Sepertinya hampir tidak ada hal yang tidak bisa dilakukan dengan javascript .

Tetapi sudah bukan rahasia lagi bahwa pembangunan aplikasi dengan memanfaatkan javascript apalagi hal tersebut memiliki skala besar sangat painful. Hal ini disebabkan lemahnya dukungan dari tools dan javascript merupakan scripting language yang memiliki nature dynamic typing. Anda dapat melihat banyak buku yang akan membahas lengkap bagaimana kita bisa membuat code base kita lebih maintanable dan hal tersebut dapat dilakukan tetapi tidak mudah. Anda dapat melihat sebagian kecil dari buku yang membahas hal tersebut.

 

image image image

imageimageimage

 

Jika anda membaca buku diatas terutama buku yang terakhir (membahas tdd, refactoring dan pattern), anda akan merasakan bahwa sulit untuk melakukan hal tersebut dengan benar. 

Anda mungkin pernah mendengar mengenai CoffeScript yang menawarkan kemudahan dan ada beberapa project serupa. Dan akhirnya microsoft pun membuat bahasanya sendiri yaitu TypeScript. Seperti beberapa project yang lain typescript akan menghasilkan javascript code. Dan creatornya adalah Anders Hejlsberg yang merupakan Architect dari c#. Wow. Sintaks yang digunakan pada TypeScript juga mirip c# dan java. You will love this one. Anda juga dapat memanfaatkan VIsual Studio sebagai IDE , melakukan debugging dsb. Static typing jadi anda akan mendapat bantuan dari compiler mengenai sintaks error dsb. Awesome right ?? Ok enough marketing speech. let’s write some code.

First Cup with TypeScript

  1. Anda dapat menginstall typescript plugin untuk visual studio dari sini.

    image

  2. Setelah anda melakukan instalasi anda dapat menemukan template baru pada visual studio. Berikan nama dan create project.

    image

  3. Anda akan mendapati file .ts (typescript) dan .js (javascript). Secara otomatis file typescript akan dicompile menjadi javascript.

    image

  4. Jika anda membuka file .ts dan jika background programming anda adalah java atau c# maka hal ini sangat familar sekali bagi anda. clean and beautiful.

    image
    apakah anda bisa bayangkan bagaimana membuat code tersebut dengan javascript. Silahkan anda buka sendiri file javascriptnya. very messy and hurt your eyes. guaranteed!!

    image

  5. Sekarang mari kita jalankan. Pastikan dulu bahwa browser yg terpilih untuk menjalankan aplikasi ini adlah Internet Explorer, karena sebelumnya saya tidak dapat melakukan debugging dengan Chrome.

    image 

  6. Jika anda ingin mengetes fitur debugging pada bagian ini anda dapat menset breakpoint. Saya membuatnya pada constructor.

    image

  7. Tekan F5  untuk menjalankannya. Anda akan mendapat pesan seperti berikut ini karena dia akan dijalakan di IIS. Tekan saja OK.

    image

    Internet explorer akan terbuka untuk menampilkan hasilnya. Voila aplikasi kita dijalankan dan aplikasi berhenti pada breakpoint. Anda juga akan mendapatkan fitur debugging yang diberikan oleh visual studio.

     image

  8. Tekan F5 untuk melanjutkan aplikasi lagi. Akan ditampilkan page seperti berikut ini.

    image 

Websocket dengan TypeScript

  1. Sekarang mari kita membuat code sederhana. Saya penasaran bagaimana dengan dukungan HTML 5 pada typescript. Dan fitur yang saya cari adalah ??? the most powerful one from HTML 5. WEBSOCKET !!. Let’s do it. Saya akan menggunakan server websocket yang dapat diakes disni http://www.websocket.org/echo.html.

    image

    Anda dapat melihat alamat websocketnya adalah ws://echo.websocket.org. Hanya merupakan simple reply dari server. Anda dapat mencoba terlebih dahulu demo nya untuk memastikan dukungan websocket pada browser anda dan juga tidak ada masalah dengan firewall dan NAT.

  2. Tambahkan code yang telah di highlight berikut ini.

    image

    Perhatikan pendeklarasian variable dengan static type, intellisense pada websocket dan penggunaan lambda expression untuk callback. Sangat indah sekali.

  3. Langsung saja kita jalankan dengan menekan F5. Anda akan mendapat pesan bahwa koneksi websocket telah dibuat ke server.

    image

    Tekan OK dan message anda akan dibalas oleh server.

    image 

  4. Anda dapat melihat presentasi mengenai javascript langsung dari pembuatnya dari dua video berikut ini.

image image

    Have fun with TypeScript !!!

    Cheers

    Categories: Uncategorized