Raised This Month: $12 Target: $400
 3% 

Solved loop entitys


Post New Thread Reply   
 
Thread Tools Display Modes
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-17-2022 , 23:07   Re: loop entitys
Reply With Quote #61

Quote:
Originally Posted by fysiks View Post
Ok, so I think I have something that supports my assertion that the size of the array is determined at compile time for my method of having the sizeof as the default value of the second argument.

Here is my plugin:

PHP Code:
#include <amxmodx>

public plugin_init( ) 
{
    
myFunction({1,3,5})
    
myFunction({1})
    
myFunction({2,34,334,30,340,34,0})
    
myFunction({2,34,334,30,340,34,0,334,30,340,34,0,334,30,340,34,0})
}

stock myFunction(myArray[], len sizeof myArray)
{
    
#pragma unused myArray
    
server_print("Array Size: %d"len)

If I decompile the plugin_init() function I get this:

Code:
0x8                        PROC              ; public plugin_init()
0xC                       BREAK 
0x10                      BREAK 
0x14                     PUSH.C  0x3        
0x1C                     PUSH.C  0x14       
0x24                     PUSH.C  0x8        
0x2C                       CALL  0xA8        ; stock myFunction(myArray[],len)
0x34                      BREAK 
0x38                     PUSH.C  0x1        
0x40                     PUSH.C  0x20       
0x48                     PUSH.C  0x8        
0x50                       CALL  0xA8        ; stock myFunction(myArray[],len)
0x58                      BREAK 
0x5C                     PUSH.C  0x7        
0x64                     PUSH.C  0x24       
0x6C                     PUSH.C  0x8        
0x74                       CALL  0xA8        ; stock myFunction(myArray[],len)
0x7C                      BREAK 
0x80                     PUSH.C  0x11       
0x88                     PUSH.C  0x40       
0x90                     PUSH.C  0x8        
0x98                       CALL  0xA8        ; stock myFunction(myArray[],len)
0xA0                   ZERO.pri 
0xA4                       RETN
As you can see, the first PUSH.C for each function call is the size of the array passed into the function without having to actually pass that value in the function call. This proves that the size of the array is determined at compile time, not at runtime.

If this doesn't resolve your issue with me saying that the size of the array is determine at compile time then you were arguing about something that I didn't assert.

eh no, what the decompiler did is show you the size of the array{ }, but when it uses size of, it is to use it inside "myfunction" server_print, so every time you use "myfunction", it will get the size of the array to use it in the server_print

As I said, the compiler will show you the data from the array { }, nothing to do when you use server_print, because there you get the size with sizeof

for example, if you try to decompile this, it will return the same data, it is not the same for the decompiler to show you the data, than for the function to obtain the maximum size of the array to be used in the server_print

PHP Code:
#include <amxmodx>

public plugin_init( ) 
{
    
myFunction({1,3,5})
    
myFunction({1})
    
myFunction({2,34,334,30,340,34,0})
    
myFunction({2,34,334,30,340,34,0,334,30,340,34,0,334,30,340,34,0})
}

stock myFunction(myArray[])
{
     
client_print0print_chat"%d"myArray[0] );

** It is one thing for it to show you the size of the array, and another is for the function to obtain the size of the array depending on which array you put **

its make me laugh that you keep trying to prove something you can't

Last edited by MrPickles; 11-17-2022 at 23:13.
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-17-2022 , 23:28   Re: loop entitys
Reply With Quote #62

Quote:
Originally Posted by MrPickles View Post
eh no, what the decompiler did is show you the size of the array{ }, but when it uses size of, it is to use it inside "myfunction" server_print, so every time you use "myfunction", it will get the size of the array to use it in the server_print

As I said, the compiler will show you the data from the array { }, nothing to do when you use server_print, because there you get the size with sizeof

for example, if you try to decompile this, it will return the same data, it is not the same for the decompiler to show you the data, than for the function to obtain the maximum size of the array to be used in the server_print

PHP Code:
#include <amxmodx>

public plugin_init( ) 
{
    
myFunction({1,3,5})
    
myFunction({1})
    
myFunction({2,34,334,30,340,34,0})
    
myFunction({2,34,334,30,340,34,0,334,30,340,34,0,334,30,340,34,0})
}

stock myFunction(myArray[])
{
     
client_print0print_chat"%d"myArray[0] );

** It is one thing for it to show you the size of the array, and another is for the function to obtain the size of the array depending on which array you put **
Not sure what you're going on about in this post. When I decompile your version of the plugin, I get this:

Code:
0x8                        PROC              ; public plugin_init()
0xC                       BREAK 
0x10                      BREAK 
0x14                     PUSH.C  0x14       
0x1C                     PUSH.C  0x4        
0x24                       CALL  0x88        ; stock myFunction(myArray[])
0x2C                      BREAK 
0x30                     PUSH.C  0x20       
0x38                     PUSH.C  0x4        
0x40                       CALL  0x88        ; stock myFunction(myArray[])
0x48                      BREAK 
0x4C                     PUSH.C  0x24       
0x54                     PUSH.C  0x4        
0x5C                       CALL  0x88        ; stock myFunction(myArray[])
0x64                      BREAK 
0x68                     PUSH.C  0x40       
0x70                     PUSH.C  0x4        
0x78                       CALL  0x88        ; stock myFunction(myArray[])
0x80                   ZERO.pri 
0x84                       RETN
This proves that it was showing the argument being passed. It proves that with my function, passing myFunction({1,2,3}) and myFunction({1,2,3}, 3) are the same (and I've proven this with decompiled output too) which is what I said in one of my original posts trying to explain how my suggestion works.

Like I said, you seem to be disputing something I never asserted.

Quote:
Originally Posted by MrPickles View Post
its make me laugh that you keep trying to prove something you can't
I've proven one of my earlier statements that you claimed was wrong. What do you think I'm trying to prove?
__________________
fysiks is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-17-2022 , 23:29   Re: loop entitys
Reply With Quote #63

Quote:
Originally Posted by fysiks View Post
Not sure what you're going on about in this post. When I decompile your version of the plugin, I get this:

Code:
0x8                        PROC              ; public plugin_init()
0xC                       BREAK 
0x10                      BREAK 
0x14                     PUSH.C  0x14       
0x1C                     PUSH.C  0x4        
0x24                       CALL  0x88        ; stock myFunction(myArray[])
0x2C                      BREAK 
0x30                     PUSH.C  0x20       
0x38                     PUSH.C  0x4        
0x40                       CALL  0x88        ; stock myFunction(myArray[])
0x48                      BREAK 
0x4C                     PUSH.C  0x24       
0x54                     PUSH.C  0x4        
0x5C                       CALL  0x88        ; stock myFunction(myArray[])
0x64                      BREAK 
0x68                     PUSH.C  0x40       
0x70                     PUSH.C  0x4        
0x78                       CALL  0x88        ; stock myFunction(myArray[])
0x80                   ZERO.pri 
0x84                       RETN
This proves that it was showing the argument being passed. It proves that with my function, passing myFunction({1,2,3}) and myFunction({1,2,3}, 3) are the same (and I've proven this with decompiled output too) which is what I said in one of my original posts trying to explain how my suggestion works.

Like I said, you seem to be disputing something I never asserted.



I've proven one of my earlier statements that you claimed was wrong. What do you think I'm trying to prove?
Let me make it more clear:

PHP Code:
__int_Array = { 02// here clearly I see that the size of the array is 3 and his values, is the same as the decompiler sees
__int_Array = { 024// here clearly I see that the size of the array is 4 and his values, is the same as the decompiler sees

myFunction( Array[] ) // How will I know the size of the array that will be put here each time that i want to use it?
{
       static 
len 
       len 
sizeof(myArray// I use this function to get the size of the array

I also didn't say that the size of the array was determined at compile time, because that's obvious, an array will always have a defined size.
what i said is that every time you use the function, the function will have to get the size of the array according to the array you put in it, like you did in your previous loop


As I was saying, you keep trying to prove something that you can't

It's obvious that you lowered the size of the arrays, it's not the first time I've used a decompiler, but it seems that you did, even so, if it weren't the case, simply removing sizeof saves a lot of data, which proves my theory

"my earlier statements"

As I said, it is one thing is to obtain the size of the array depending on what you put in it and when you use it, and another is for the decompiler to show you the data of the array that you put in it, as we all see, your declaration has nothing to do with the topic

The main issue was that, every time the function is used, the size of the array has to be obtained, for that the function, and what you say is all that we see with the naked eye, both the decompiler and the source, not when said function is used, because the size will be obtained according to the array when you put it and when that function is used

The only thing you do is prove that I was right, I really have a lot to do, and you definitely have a lot to learn basic things, I'll leave you "high level" XD

Last edited by MrPickles; 11-17-2022 at 23:47.
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-18-2022 , 17:05   Re: loop entitys
Reply With Quote #64

Quote:
Originally Posted by MrPickles View Post
Let me make it more clear:

PHP Code:
__int_Array = { 02// here clearly I see that the size of the array is 3 and his values, is the same as the decompiler sees
__int_Array = { 024// here clearly I see that the size of the array is 4 and his values, is the same as the decompiler sees

myFunction( Array[] ) // How will I know the size of the array that will be put here each time that i want to use it?
{
       static 
len 
       len 
sizeof(myArray// I use this function to get the size of the array

Huh, you're not referencing the code that I posted. The size of the passed array is passed into the function as the second argument.

Quote:
Originally Posted by MrPickles View Post
what i said is that every time you use the function, the function will have to get the size of the array according to the array you put in it, like you did in your previous loop
It does this at compile time as the decompiled code shows.

Quote:
Originally Posted by MrPickles View Post
As I was saying, you keep trying to prove something that you can't
I proved my statement. A bunch of your statements don't make any sense so it's clear you're talking about something that I've never claimed to be true.

Quote:
Originally Posted by MrPickles View Post
It's obvious that you lowered the size of the arrays
What are you talking about? I didn't do anything related to "lowering the size of the arrays", whatever that means.

Quote:
Originally Posted by MrPickles View Post
it's not the first time I've used a decompiler, but it seems that you did, even so, if it weren't the case, simply
removing sizeof saves a lot of data, which proves my theory
Removing sizeof doesn't "save a lot of data", why in the world would you think that? What theory are you trying to prove?

Quote:
Originally Posted by MrPickles View Post
"my earlier statements"

As I said, it is one thing is to obtain the size of the array depending on what you put in it and when you use it, and another is for the decompiler to show you the data of the array that you put in it, as we all see, your declaration has nothing to do with the topic
What?? The decompiler doesn't show you the data in the array. It shows the pointer to the array.

Quote:
Originally Posted by MrPickles View Post
The main issue was that, every time the function is used, the size of the array has to be obtained, for that the function, and what you say is all that we see with the naked eye, both the decompiler and the source, not when said function is used, because the size will be obtained according to the array when you put it and when that function is used
The size of the array is determined at compile time (as proven by the decompiled output) and is used as the function parameter that had the sizeof defined as the default value.

Quote:
Originally Posted by MrPickles View Post
The only thing you do is prove that I was right, I really have a lot to do, and you definitely have a lot to learn basic things, I'll leave you "high level" XD
I'm not proving that you're right. I've proven that my statement about the size of the array being determine at compile time is correct. I'm not sure what you think you're arguing about.

I know plenty of "basic things", maybe you need to learn how to comprehend english.
__________________
fysiks is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-18-2022 , 17:29   Re: loop entitys
Reply With Quote #65

Quote:
Originally Posted by fysiks View Post
Huh, you're not referencing the code that I posted. The size of the passed array is passed into the function as the second argument.



It does this at compile time as the decompiled code shows.



I proved my statement. A bunch of your statements don't make any sense so it's clear you're talking about something that I've never claimed to be true.



What are you talking about? I didn't do anything related to "lowering the size of the arrays", whatever that means.



Removing sizeof doesn't "save a lot of data", why in the world would you think that? What theory are you trying to prove?



What?? The decompiler doesn't show you the data in the array. It shows the pointer to the array.



The size of the array is determined at compile time (as proven by the decompiled output) and is used as the function parameter that had the sizeof defined as the default value.



I'm not proving that you're right. I've proven that my statement about the size of the array being determine at compile time is correct. I'm not sure what you think you're arguing about.

I know plenty of "basic things", maybe you need to learn how to comprehend english.
almenos se hablar ingles, veamos si almenos puedes decir una palabra en espaņol jaja
muchas mentiras en este post, y no seguire perdiendo mi tiempo desmitiendo con argumentos, como lo he venido haciendo desde hace 5 paginas, tengo cosas mejores que hacer
y si, bajarle el tamaņo del array
MrPickles is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-18-2022 , 18:39   Re: loop entitys
Reply With Quote #66

MrPickles please stfu and stop talking nonsense you literally proceeded with this topic for too long over nonsense.

If you are seeking for psychological help go to the Mexican forums.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-18-2022 at 18:42.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-18-2022 , 20:24   Re: loop entitys
Reply With Quote #67

Quote:
Originally Posted by Natsheh View Post
MrPickles please stfu and stop talking nonsense you literally proceeded with this topic for too long over nonsense.

If you are seeking for psychological help go to the Mexican forums.
Another post off topic, don't you read the rules? It seems that the one who needs psychological attention is you, chasing me in every post XD, but keep going like this, every time I would love to leave you in shame again

You haven't even read a page and you talk, you don't even know the basics and you give your opinion, laughter and sorrow

Last edited by MrPickles; 11-18-2022 at 20:26.
MrPickles is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode