Devilzc0de Forum Follow @devilzc0de
  • Home
  • Hacking
  • Networking
  • Programming
  • O.S
  • Server
  • Tweets
  • Search
  • Member List
  • Calendar
Current time: 06-20-2013, 05:57 PM Hello There, Guest! (Login — Register)
Devilzc0de Forum › Information Technology › Programming › Assembly v
« Previous 1 2 3 Next »

How to Translate your perl script into c and assembly

Home General Computer Multimedia Business Lounge

Post Reply 
Tweet
Threaded Mode | Linear Mode
How to Translate your perl script into c and assembly
10-24-2011, 02:20 AM (This post was last modified: 10-24-2011 03:54 AM by ev1lut10n.)
Post: #1
ev1lut10n Offline
./Devilz Officer
Posts: 239
Joined: Aug 2011
Reputation: 82
How to Translate your perl script into c and assembly
How to Translate your perl script into c and assembly

by: ev1lut10n

"sp3c14l fvck t0 3lz th3 gr34t35t k1d 1n pl8"
"sp3c14l fvck t0 ch41n th3 4bs0lut3 l4m3r 1n pl8"
love ALL KIDDIOT WHO TRY TO INSULT ME

as example from here : http://jasaplus.com/backup.txt we may see it's a very 2 long code of perl , ok today we're gonna translate a sub into c and asm (32 bit) check this sub on line 9074:

=============================
sub linux_udev_smaller_elf_binary
{
eval
{
if (-e "/etc/udev/rules.d/95-udev-late.rules")
{
our $lanjutkan="ya";
}
else
{
if (-e "/lib/udev/rules.d/95-udev-late.rules")
{
our $lanjutkan="ya";
}
else
{
our $lanjutkan="tidak";
}
}
}
}
=============================


considering the code on the sub here's what it will do:

1. the script will check the existence of 95-udev-late.rules at /etc/udev/rules.d if there's 95-udev-late.rules then the global variable $lanjutkan will be filled with string "ya"
2. otherwise if the script can not found /etc/udev/rules.d/95-udev-late.rules it will check on /lib/udev/rules.d/95-udev-late.rules if found the global variable $lanjutkan will be filled with string "ya"
otherwise the global variable will be filled with the string "tidak"

ok the first one we'll translate it into c it will be something like this:

=================
char linux_udev_smaller_elf_binary()
{
struct stat bufer;
char lanjutkan[20];
if(stat("/etc/udev/rules.d/95-udev-late.rules",&bufer)==0)
{
strcpy(lanjutkan,"ya");
}
else
{
if(stat("/lib/udev/rules.d/95-udev-late.rules",&bufer)==0)
{
strcpy(lanjutkan,"ya");
}
else
{
strcpy(lanjutkan,"tidak");
}

}

return lanjutkan;
}

================


ok next we're translate it into assembly:

====================
section .data
udev1 db "/etc/udev/rules.d/95-udev-late.rules",0x00
udev2 db "/lib/udev/rules.d/95-udev-late.rules",0x00

section .bss
file: resd 1

section .text
global _start




_start:
push ebp
mov ebp,esp

call the_cek
mov ebx,udev1
int 0x80
mov dword [file],eax
cmp dword [file],0
jle dont_continue

continue:
mov esp,ebp
pop ebp

keluar:
push byte 0x01
pop eax
int 80h



dont_continue:
call the_cek
mov ebx,udev2
int 0x80
mov dword [file],eax
cmp dword [file],0
jle dont_continue2
je continue


dont_continue2:
mov esp,ebp
pop ebp
jmp keluar

the_cek:
mov eax,5
xor ecx,0
mov edx,0x100
ret

====================
Find all posts by this user
Quote this message in a reply
10-24-2011, 02:50 AM
Post: #2
Wayc0de Offline
-= Sifu Makan Sonice =-
**
Moderators
Posts: 2,994
Joined: Nov 2010
Reputation: 61
RE: How to Translate your perl script into c and assembly
wah mang keren dh ente om mantap

baru j belajar ma om ttg perl

eh da yg baru nie ngakak

ntr private agy ea om asik
Visit this user's website Find all posts by this user
Quote this message in a reply
10-24-2011, 03:12 AM
Post: #3
teardrop Away
I love Indonesian
Posts: 357
Joined: Jul 2010
Reputation: 14
RE: How to Translate your perl script into c and assembly
emang ajib bener ente om, mantap trima aku menjadi muridmu piss
Visit this user's website Find all posts by this user
Quote this message in a reply
10-24-2011, 02:49 PM
Post: #4
cabun.solek Offline
./Devilz 1st Cadet
Posts: 39
Joined: Oct 2011
Reputation: 1
RE: How to Translate your perl script into c and assembly
mantap master... ada programnya yg bisa langsung translate otomatis gitu gak yah??

thx. bangga
Find all posts by this user
Quote this message in a reply
10-24-2011, 03:11 PM
Post: #5
ZerO_bRuN Offline
./Devilz 1st Cadet
Posts: 45
Joined: May 2011
Reputation: 5
RE: How to Translate your perl script into c and assembly
Wah keren banget thax om, nice share kang
Find all posts by this user
Quote this message in a reply
10-24-2011, 08:15 PM
Post: #6
syn_attack Away
execl("/bin/sh", "sh", NULL);
**
Moderators
Posts: 308
Joined: Sep 2011
Reputation: 55
RE: How to Translate your perl script into c and assembly
kakak ev1lut10n ~# mantap kakak,, perl ditranslate ke assembly....

kakak ev1lut10n keren banget... bangga
Visit this user's website Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Topic Tools
Topic Link :
BBCode :
HTML Code :
View a Printable Version Send Thread to a Friend Subscribe to this thread
Submit Google Submit Face book Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Rainbow [Tutor] Basic Assembly 8 Bit mr_nothing 9 157 06-11-2013 08:24 PM
Last Post: mr_nothing
Rainbow [Tutor] Pemrograman Bahasa Assembly Untuk Trafic Light mr_nothing 6 155 06-09-2013 07:17 PM
Last Post: hakimoxz
Rainbow [Tutor] Pengalamatan memory pada assembly 8 bit mr_nothing 9 147 06-09-2013 04:14 PM
Last Post: ditatompel
  Pemrograman Assembly di Windows dengan masm32+ debugging dg ollydbg mywisdom 7 1,480 06-05-2013 02:55 PM
Last Post: rifqirachel
  Assembly 32 bit and shellc0d3 mywisdom 2 1,977 02-11-2013 08:56 PM
Last Post: ghosthands
  The Art Of Assembly ian182 8 1,605 02-08-2013 10:49 PM
Last Post: ghosthands
  Just another guy asking how to learn assembly ? mandi 3 270 02-08-2013 10:47 PM
Last Post: ghosthands
  method/fungsi pada assembly syn_attack 4 511 05-19-2012 12:35 AM
Last Post: zard22
  pemrograman di ms dos dengan assembly 16 bit+ analisa beberapa virus asm mywisdom 8 1,797 01-21-2012 04:04 AM
Last Post: oootrxooo
Tongue [Tutor] Iseng with Assembly nyiurmelambai 12 1,177 01-17-2012 05:30 PM
Last Post: darkdante

Users Browsing
1 Guest(s)

  • Contact Us
  • devilzc0de
  • Return to Top
  • Mobile Version
  • RSS Syndication
  • Help
Current time: 06-20-2013, 05:57 PM Powered By MyBB, © 2002-2013 MyBB Group. Theme created by Justin S. | Mixed By Chaer.Newbie | Fixed By Aditya

USING THIS SITE INDICATES THAT YOU HAVE READ AND ACCEPT OUR TERMS. IF YOU DO NOT ACCEPT THESE TERMS, YOU ARE NOT AUTHORIZED TO USE THIS SITE