-
Posts
18725 -
Joined
-
Last visited
-
Days Won
706
Everything posted by Nytro
-
Nu stiu Assembly si din cate vad nici tu nu sti. Deci nu are rost sa se chinuie cineva sa iti raspunda. Datele se pun pe stiva, parametrii, folosind "push", apoi se apeleaza functia din C++ de exemplu, daca asta vrei, apoi se scot datele depe stiva cu "pop". #include <stdio.h> char format[] = "%s %s\n"; char hello[] = "Hello"; char world[] = "world"; void main( void ) { [URL="http://www.codeguru.com/forum/showthread.php?t=308575"]__asm[/URL] { mov eax, offset world push eax mov eax, offset hello push eax mov eax, offset format push eax call printf pop ebx pop ebx pop ebx } } Inca o data, nu stiu Assembly...
-
Cum faci un program care asambleaza/rescrie pe un altul ?
Nytro replied to Krisler12™'s topic in Programare
Un executabil e format din mai multe sectiuni. Aceste sectiuni contin anumite tipuri de date. Exista sectiuni pentru cod masina, codul executabil propriu-zis, sectiuni pentru date initializate si sectiuni pentru date neinitializate. Daca incepi sa modifici un executabil trebuie sa sti ce faci pe acolo. NOP-urile nu cred ca sunt chiar degeaba. Daca vrei sa faci un crack ceva, cred ca cel mai simplu ar fi, desi nu stiu daca se poate, sa modifici un jmp. Probabil executabilul contine ceva de genyl: if(!serial_corect) zii_ca_nui_bun();. In Assembly, asta probabil este un jnz (jump not zero) si decat pui jz (jump zero). Bine, sunt cam paralel cu asta si probabil spun prostii. Insa ideea e sa lasi tu astea si sa incepi sa inveti lucrurile de baza. Daca chiar vrei, invata mai intai C++, cred ca e necesar, apoi Assembly, mai citestid espre structura PE si esti boss. -
Arduino: Citesc, dar nu pe calculator. Trebuia sa citesc 30 de pagini cu metodologia de la ATM, si nu am putut nici astea sa le citesc pe PC, mi le-am scos la imprimanta. Si asta e problema pentru toata lumea.
-
Proasta idee. Nu le citeste nici dracu. Tu cate carti ai citit pe net?
-
Babi Minune - Sa vina toti nebunii mei
-
Bindat: http://i49.tinypic.com/8z301t.png Ban.
-
Am scapat. A fost cam nasol la mate si la romana nu am putut copia. Acum la info am facut, vreau minim 9. Bine, am dat si neintensiv, T2. Dar sa zicem ca nu a fost exagerat de usor, dar nici greu nu a fost. Sper la o medie generala de 7,66: 8, 6, 9.
-
Eu nu foloseam nici la scoala Borlandul, foloseam CodeBlocks. PS: Nu am testat asta pe Windows, pe Linux merge bine. Puneti si voi #include<iostream.h> si decat cout in loc de std::cout. A, si daca doriti, void main() fara return.
-
Eu cred ca voi pune void, desi in practica folosesc int. Si va trebui sa pui "cout" probabil, desi ma tenteaza mai mult printf-ul... Si pentru siruri strcpy, strcat, nu std::string. Iar pentru citire si scriere din fisiere fstream nu fopen, fread, fclose. Bine, cred ca poti folosi si astea, normal ar fi sa folosesti ce vrei tu.
-
Poate va ajuta pe cei care dati maine bacul la informatica. E in "debug mode", poate asa intelegeti mai bine ce se intampla. Lui n sa ii dati valorile 2 si 3, nu mai mult ca nu are rost. Nu stiu daca comentarile sunt bune, nu prea am inteles nici eu backtrackingul asta. Bine, nici nu m-a interesat, doar azi m-am uitat putin peste el. Pastebin: http://pastebin.com/GjygyUSY Codul: #include <iostream> int sol[10], k, n; // Afiseaza lista void tipar() { for(int i = 1; i <= n; i++) std::cout<<sol[i]<<" "; std::cout<<"\n"; } // Verifica daca s-a ajuns la ultimul element int solutie(int k) { if(k == n+1) { std::cout<<"* BUN *: ["<<k<<"] :"; return 1; } else { std::cout<<"Solutie: ["<<k<<"] :"; tipar(); return 0; } } // Initializeaza elementul void init(int k) { std::cout<<"Init: ["<<k<<"] :"; tipar(); sol[k] = 0; } // Verifica daca am ajuns la ultimul element, incrementeaza valoarea daca nu int succesor(int k) { std::cout<<"Succesor: ["<<k<<"] :"; tipar(); if(sol[k] < n) { sol[k]++; return 1; } else return 0; } // Verifica daca elementul se mai afla in lista int valid(int k) { std::cout<<"Valid: ["<<k<<"] :"; tipar(); for(int i = 1; i < k; i++) { if(sol[i] == sol[k]) return 0; } return 1; } // Apeleaza functiile de mai sus void back(int k) { std::cout<<"Back ["<<k<<"] :"; tipar(); if(solutie(k)) tipar(); else { init(k); while(succesor(k)) if(valid(k)) back(k+1); } } /* * Backtracking nerecursiv, nu stiu daca e bun void back() { k=1;init(k); while(k>0) { while(succesor(k)) { if(valid(k)) if(solutie(k)) tipar(); else { k++; init(k); } } k--; } } */ int main(int argc, char** argv) { std::cout<<"n="; std::cin>>n; back(1); return 0; } Doar afiseaza functia apelata si valoarea lui k in paranteza, poate va ajuta.
-
90% din ce am facut la mate a fost din capul meu. Decat 6 de la I si 2b de la II am copiat. Tinand cont ca cea mai mare medie a mea la mate a fost 6...
-
Eu dau la info, sper ca macar acolo sa iau un 9-10. Oricum nu prea stiu nici acolo, ca anul asta am facut numai FoxPro. PS: Perle de la Bacalaureat :: Libertatea.ro
-
Ellimist: Mandriva 2010. Arduino: Am pus thumbnail, dar nu ii vad rostul. Nu mai sunt viteze de 50 de kb/s sa fie probleme cu cateva imagini. begood: Ce face romana din Desktop
-
Tara are datorii. Multe. Ce vrei, sa se mareasca salariile si pensiile, adica tara sa dea si mai multi bani deci tara sa aibe niste datorii si mai mari? E nevoie de bani la buget. Nu spun ca banii se cheltuiesc cu cap, daca platim pe un kilometru de autostrada de 10 ori mai mult decat e un km in Germania, suntem mai smecheri noi... Si multe astfel de prostii.
-
Bag pula in ea de matematica, nu sunt facut pentru asa ceva. Oricum un 5 tot trebuie sa iau. Eu sper chiar la un 6... Ne-au lasat sa "miscam", faceam schimb de ciorne, dar nu am avut de la cine copia, tot noi astia paraleli ne-am ajutat intre noi, cum am putut si noi... Am facut mult de la mine, am stiut sa fac singur de 5, cred. Macar am scapat de porcaria asta...
-
In primul rand iti recomand sa te clamezi. Si daca vrei sa stai pe aici trebuie sa te obisnuiesti cu cei care se baga in seama fara rost si spun numai tampenii. In al doilea rand, nu cred ca are rost sa te agiti. Nu cred ca va cumpara nimeni, toti vor gratis.
-
Stati sa dau bacu la mate, sa nu fac, apoi sar cu banurile pe voi
-
Nu toti s-au nascut experti ca tine. Nu toti sunt "1337".
-
Cine are nevoie de conturi de filelist, metin sau hi5? Ce altceva ati mai pune acolo?
-
A, nu va legati de grafica
-
Din topul de pe imdb: 1. Toy Story 3 2. Grown Ups 3. Knight and Day 4. The Karate Kid 8. Prince of Persia: The Sands of Time 10. Jonah Hex
-
Cheats with ELF: Code Injecting into ELF Headers |=-----------------------------------------------------------------------=| |=---------------------------[ HELLCODE RESEARCH ]-----------------------=| |=-----------------------------------------------------------------------=| |=--------=[ Cheats with ELF: Code Injecting into ELF Headers ]=--------=| |=-----------------------------------------------------------------------=| |=-----------------------=[ murderkey@hellcode.net ]=--------------------=| |=-----------------------------------------------------------------------=| --[ Index 0x0 - Introduction 0x1 - Requirements 0x2 - Basic ELF Structure 0x3 - Last Wordz 0x4 - Greetz --[ 0x0 - Introduction Hi Reader, In this paper, I will explain uncommon/unknown techniques to affect ELF headers directly or helping of compiler and assembly linkers. I've discovered this technique while thinking about injecting code to elf32 headers and i became succesful in my research 3 years ago..you can use this technique for different ideas, anyway i've tested it for IDS by-passing and as an anti-anti-debug technique. --[ 0x1 - Requirements You should know the topics which are below to understand this paper, because probably, you can't understand this paper if you don't have high-level knowledge about topics. -> Unix Assembly (AT&T) -> C/C++ -> ELF Structure -> Time and Brain if you know --[ 0x2 - Basic ELF Structure An elf32 file structure always include header, data and instruction segments.In this part, we will create executable files, play/change their sizes and createfiles with minimum sizes. Lets start to show that on "merv.asm" (Seni seviyorum Merve ; ------------merv.asm----------------- BITS 32 section .data merv db " murderkey ownz jo !" GLOBAL MAIN SECTION .text main: ;write() mov eax, 4 mov ebx, 1 mov ecx, merv mov edx, 28 int 0x80 ; exit() mov eax, 1 mov ebx, 0 int 0x80 -------------merv.asm----------------- As you see above, that is a simple assembly code. It prints " murderkey ownz jo !" to screen and ending via "exit call".Compiling it with "nasm" and giving link with "ld". h4x0r elf32 # nasm -felf merv.asm -o merv.o h4x0r elf32 # ld merv.o -o merv ld: warning: cannot find entry symbol _start; defaulting to 00000000080480a0 yeah, the warning is so important here! dont forget that! the program gave us "_start sectioun is not defined for elf32 in .text segment" error.even so , we are running the binary. h4x0r elf32 # ./merv murderkey ownz jo ! h4x0r elf32 # Good! there is not any problem for now so lets look at the size of program. h4x0r elf32 # wc -c merv 892 merv It is 892, we will match this value with the next code that we will write. --------------merv2.asm------------------- BITS 32 section .data merv db " murderkey ownz jo !" SECTION .text GLOBAL _start _start mov eax, 4 mov ebx, 1 mov ecx, merv mov edx, 28 int 0x80 mov eax, 1 mov ebx, 0 int 0x80 ----------------merv2.asm------------------------ Now, compiling, linking and running the program again. h4x0r elf32 # nasm -felf merv2.asm h4x0r elf32 # ld merv2.o -o merv2 h4x0r elf32 # ./merv2 murderkey ownz jo ! and lets look at the size of file h4x0r elf32 # wc -c merv2 848 merv2 h4x0r elf32 # 848! There is not a clear changing at the size. We will see this in a better way with details now. compiling "merv2.asm"; h4x0r elf32 # nasm -f elf merv2.asm h4x0r elf32 # gcc -Wall -s merv2.o merv2.o(.data+0x13): In function `_start': : multiple definition of `_start' /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/../../../crt1.o(.text+0x0): first defined here /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/../../../crt1.o(.text+0x18): In function `_start': : undefined reference to `main' collect2: ld returned 1 exit status h4x0r elf32 # The error is so interesting at the above. "/crt1.o(.text+0x0): first defined here." This error means that _start symbol is defined in "crt1.o elf32 startup script" and also we defined a _start symbol too. So these overlaps and it causes this error :)For blocking this, We are giving a command to gcc compiler to not running "startup" script when our code is compiled.We are doing it with (gcc) "-nostartfiles" option. h4x0r elf32 # gcc -Wall -s -nostartfiles merv2.o -o merv2 h4x0r elf32 # ./merv2 Segmentation fault h4x0r elf32 # UPPSSS we comiled our code but there is a (segmentation fault) memory crash! What is the problem here? Let's find! When we call _start image symbol in our assembly code ,it must be ended via _exit() call but we gave "-nostartfiles" option to it so it can not find _exit()How can we defeat it? Of course, defining the _exit as EXTERN and calling it in our code. Lets write the code again... ----------------- merv2.asm ------------------ BITS 32 section .data merv db " murderkey ownz jo !" EXTERN _exit section.text global _start _start mov eax, 4 mov ebx, 1 mov ecx, merv mov edx, 28 int 0x80 call _exit ------------------- merv2.asm ---------------------- Now, compiling again and linking... h4x0r elf32 # nasm -f elf merv2.asm h4x0r elf32 # gcc -Wall -s -nostartfiles merv2.o -o merv2 h4x0r elf32 # ./merv2 murderkey ownz jo ! WE ARE THE CHAMPION !! As you see, our function was run! Now , looking the size of our code; h4x0r elf32 # wc -c merv2 1392 merv2 h4x0r elf3 1392 <----- Now you understand well the difference of sizes. Now, we will practice a deceit with a different option. Watch here carefully! ---------------- merv3.asm--------------------- BITS 32 section .data merv db " murderkey ownz jo !" GLOBAL _start SECTION .text _start mov eax, 4 mov ebx, 1 mov ecx, merv mov edx, 28 int 0x80 mov eax, 1 mov ebx, 0 int 0x80 ------------------ merv3.asm ----------------------- Compiling and linking the code; h4x0r elf32 # nasm -f elf merv3.asm h4x0r elf32 # gcc -Wall -s -nostdlib merv3.o -o merv3 Run it; h4x0r elf32 # ./merv3 murderkey ownz jo ! So nice, we are wondering of size. h4x0r elf32 # wc -c merv3 524 merv3 h4x0r elf32 # 524, what did we do here? we gave -nostdlib option to compiler and canceled _exit(). We used this code instead of it; mov eax, 1 mov ebx, 0 int 0x80 and runned "_exit call" directly... ----------------------------------------------------------------------------- Shortly I want to say that we can cancel elf32 file headers, we can inject sections and can change size of fileshow we want.. or we can bypass anti-debug protections. That provide convenience us while developing unix worms.because any ids or any antivirus can not check elf32 file headers in this way.You can exceed every obstacle via this method. It's up to your imagination and creativity. Also I want to refer an issue here. While an elf32 executable image is being mapped to memory, it is mapped at "0x00000000080480a0" 32-bit hexadecimal address as a default in unix systems. If you dont define _start in elf32 , linker will give an error like below; ... /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/../../../../i386-pc-linux-gnu/bin/ld: warning: cannot find entry symbol _start; defaulting to 00000000080480a0 ... so kernel maps image to memory as default. If you run your head! , you can map this image to another place!I am changing this address and making it "0x08048000" !! Lets compile the code which is below as a bin format look its' starting place.. P.S: You should know details of elf32 file structure for this part. ------------------- lame-elf32.asm---------------------------------- BITS 32 org 0x08048000 ehdr: ; Elf32_Ehdr db 0x7F, "ELF", 1, 1, 1 ; e_ident times 9 db 0 dw 2 ; e_type dw 3 ; e_machine dd 1 ; e_version dd _start ; e_entry dd phdr - $$ ; e_phoff dd 0 ; e_shoff dd 0 ; e_flags dw ehdrsize ; e_ehsize dw phdrsize ; e_phentsize dw 1 ; e_phnum dw 0 ; e_shentsize dw 0 ; e_shnum dw 0 ; e_shstrndx ehdrsize equ $ - ehdr phdr: ; Elf32_Phdr dd 1 ; p_type dd 0 ; p_offset dd $$ ; p_vaddr dd $$ ; p_paddr dd filesize ; p_filesz dd filesize ; p_memsz dd 5 ; p_flags dd 0x1000 ; p_align phdrsize equ $ - phdr section .data merv db "murderkey own jo!" _start: mov eax, 4 mov ebx, 1 mov ecx, merv mov edx, 28 int 0x80 ; exit() call mov eax, 1 mov ebx, 0 int 0x80 filesize equ $ - $$ ----------------------------lame-elf32.asm------------------------------- Now lets link our code in bin format and run it.. h4x0r elf32 # nasm -f bin lame-elf32.asm -o lame-elf32 h4x0r elf32 # chmod +x lame-elf32 h4x0r elf32 # ./lame-elf32 murderkey own jo! --[ 0x3 - Last Wordz I want to finish my paper now. After learning basic things in paper, we can play with elf32 headers how we want..you can distribute elf32 worm to systems via bypassing all IDS with this oh-day technique! Thats up to only your creativity.You should have deep assembly and elf32 file system knowledge to do that.. This paper has been written to be a basic for this bypassing methods etc.. Used linux source codes and elf headers as references in this paper.. /usr/include/linux/elf.h <--------- this header gives us all details about elf structure. --[ 0x4 - Greetz karak0rsan, l4m3r, n00b (dont forget about misdirection lol'd), GOBBLES, PHC and all blackhat community...hey man, you should contact me because someone is watchin' u, i know you hate "contributors" and still im waiting you ! someone offered me money to give information about you but i didn't accept coz im not like the others...dont forget ! © Offensive Security 2010
-
Nasol examen. Nu stiam nimic legat de basm. Nu stiam nici de cine e scris, si credeam ca e "Harap Alb si merele de aur", credeam ca e si cu zmeu si cu span. Dar mi-am adus aminte cateva lucruri... Noroc cu fata care a fost in fata mea, super de treaba, orice o intrebam ma ajuta, si am copiat de la ea de pe foaie. Noua ne-au zis din start ca ne lasa sa vorbim dar nu ne lasa sa copiem. Si cineva statea la catedra si cineva in spate si se plimbau cam mereu prin banci. Nici nu aveam basmul pe foi, nu ma gandeam ca pica porcaria asta. La alte clase am inteles ca i-a prins cu foi, dar le-au luat foile si nu i-au dat afara. Si nu ma oftic ca nu am facut, ma enerveaza ca am stat sa citesc 10 rezumate si comentarii + 2 nuvele... La mate sa vedem ce va fi. Daca imi da cineva trebuie sa imi dea exercitiul cap-coada, degeaba imi zice ideea de rezolvare sau alte prostii. Plm, ce o fi o fi.