21.07.2011, 14:34
Atleast it seems so. The only thing here is to see what perspective it gives, but as for now, so that you can take a look at it :
This results for me like this :
Notes for this : string has been corrupted, printing an multi-dimensional array (basically the next dimension after normal strings) as %d results in somewhat... pointer?
Why can I say that I have really hacked pawn memory - I put a string of >10 chars into an array with the size of 1.
Note when testing code : I haven't really figured out where it gets error.
Just to add, it seems that it's able to drift off into other variables, and right now it'd be good to figure this out.
If it has been done, please explain why does this crash, and corrupt memory!
pawn Код:
enum cmp {
a[34],
b[54],
c[54]
};
new Obj[cmp];
main(){
new String[10];
String="HACKED";
//x=&String;
new y[1][1];
new z[1][1];
//Next level :
new v[1][1][1];
hack2(y,String);
hack2(z,y[0]);
hack2(v[0],z[0]);
//hack2(Obj[a][0],String);
printf("HACK : %s >> %s",Obj,String);
printf("HACK * : %d ||%s _ %s ;;",y,y,y[0],String);
printf("HACK * : %d ||%s _ %s ;;",z,z,z[0],String);
printf("HACK ** : %d %d ||%s _ %s _ %s ;;",v,v[0],v,v[0],v[0][0]);
//Obj=String;
}
hack2(vect1[][],vect2[]) {
format(vect1[0],32768,"[I can hack pawn!] : %s",vect2);
return 0;
}
Код:
[17:40:48] HACK : >> n hack pawn!] : [I can hack pawn!] : [I can hack pawn!] : HACKED [17:40:48] HACK * : 99 ||can hack pawn!] : [I can hack pawn!] : [I can hack pawn!] : HACKED _ [17:40:48] HACK * : 73 ||I can hack pawn!] : [I can hack pawn!] : [I can hack pawn!] : HACKED _ [17:40:48] HACK ** : 4 4 ||[I can hack pawn!] : [I can hack pawn!] : [I can hack pawn!] : HACKED _ [I can hack pawn!] : [I can hack pawn!] : [I can hack pawn!] : HACKED _ [I can hack pawn!] : [I can hack pawn!] : [I can hack pawn!] : HACKED ;; [17:40:48] Script[gamemodes/tert.amx]: Run time error 6: "Invalid instruction"
Why can I say that I have really hacked pawn memory - I put a string of >10 chars into an array with the size of 1.
Note when testing code : I haven't really figured out where it gets error.
Just to add, it seems that it's able to drift off into other variables, and right now it'd be good to figure this out.
If it has been done, please explain why does this crash, and corrupt memory!