unique item filter

Threads that no longer serve a purpose. Read-only.
User avatar
void
Shadowgate Totem
1776 | 98
Common Posting Badge
Posted over 1.000 messages
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
DeaTh wrote:
void wrote:anyone can make this into at&t assembly?
it can compile with intel, but its problematic

try this answer on SO.
For naked attribute I use this:

Code: Select all

#ifdef __GNUC__
#define ATTRIBUTE_NAKED __attribute__((naked))
#else
#define ATTRIBUTE_NAKED __declspec(naked)
#endif

ATTRIBUTE_NAKED void __stdcall PATCH_DropFilter() {
...


I started to rewrite the code for gcc, but now a lot of work.

PS unpacked old median txt files if someone need.

:shock: :shock: omg you tried to edit the code too? :shock:
well i tried to compile with intel assembly mode but that gives errors since it seems to have problems to interact with the things in [] brackets, and nothing really seems to help that.
did you too have problems with the ptr file ((##blah##* ##blah##_t) too? and if yes how did you resolve it? i edited away those ## since they seem out of place.

but well, i would like for the assembly to use at&t to see if that allows it to function with the variables/function references(?), because as far as i know there is no way to make it work with intel
DeaTh
Cog
206 | 16
void wrote:did you too have problems with the ptr file ((##blah##* ##blah##_t) too? and if yes how did you resolve it? i edited away those ## since they seem out of place.

You talk about D2Ptrs.h file? I changed D2Func and it's began to compile properly.
► Show Spoiler


well i tried to compile with intel assembly mode but that gives errors since it seems to have problems to interact with the things in [] brackets, and nothing really seems to help that.

Mee too :oops:

Code: Select all

undefined reference to `DROPFILTER_Main'
undefined reference to `D2CLIENT_6FB09087'
undefined reference to `D2CLIENT_6FB09419'

I dunno how to fix it. Now I try to deal with this, but my knowledge is not enough.
User avatar
void
Shadowgate Totem
1776 | 98
Common Posting Badge
Posted over 1.000 messages
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
so essentially we did the same and the results are the same... (except i also updated char* to char const* in some functions to update it to the latest standard and get rid of compiler warnings).
also had to change __asm {} to __asm (); and put "" around the instructions, but im pretty sure you were required to do that too.
but well, either we need to find a way to make it work with intel, or we need to make it into at&t and hope for the best
DeaTh
Cog
206 | 16
@voidy
I was able to compile a dll with this:

Code: Select all

   asm(".intel_syntax           \n\t"
    "cmp dword ptr [esi], 0x04   \n\t"
    "jnz EXIT                    \n\t"
    "mov ecx, esi                \n\t"
    "call %0                     \n\t"
    "cmp eax, 0x00000000         \n\t"
    "je EXIT                     \n\t"
    "                            \n\t"
    "jmp [%1]                    \n\t"
    "                            \n\t"
    "EXIT:                       \n\t"
    "jmp [%2]                    \n\t"
    :: "r" (DROPFILTER_Main), "r" (D2CLIENT_6FB09087), "r" (D2CLIENT_6FB09419));


But this dll crashes diablo when I press alt :mrgreen: Maybe it's the naked attribute. Or not. I will continue to to disassemble this question
User avatar
void
Shadowgate Totem
1776 | 98
Common Posting Badge
Posted over 1.000 messages
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
oooh sweet, looks like you found a way to use the existing code :D
but well, i was able to compile d2template before also (no asm there) and it didnt work, so it doesnt mean just because it compiles and creates a dll, that the dll is going to work unfortunately.
there may be some problems with the edits, namely the ##x##* thing that was removed doesnt do what its supposed to do or that asm doesnt properly access the stuff, or even that its not compiled properly (as far as i can tell there are 2 .cpp files and a bunch of headers and unuseable other files...).
how do you compile it? do you use -shared?

maybe it works if you put __declspec(dllexport)
User avatar
void
Shadowgate Totem
1776 | 98
Common Posting Badge
Posted over 1.000 messages
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
you know, for the sake of dodging the issue with the assembly code i tried to compile the source for d2template, and even with all those changes and using the -s command for compiling it still is a larger file than the original (12kb vs 9kb)
while its true that some of the code was changed, it shouldnt make such a big impact as it does
User avatar
shnurr214
Onyx Knight
600 | 47
Common Popularity Badge
Has a thread with over 10.000 views
Common Love Badge
Earned over 20 cookies
Common Supporter Badge
Donated 1 time
Common Contribution Badge
Has collaborated to our forums, realms or mod
trying to follow this topic is dizzying for us non programmers.. for us simple folk what exactly are you guys trying to do to update the filter?
User avatar
void
Shadowgate Totem
1776 | 98
Common Posting Badge
Posted over 1.000 messages
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
shnurr214 wrote:trying to follow this topic is dizzying for us non programmers.. for us simple folk what exactly are you guys trying to do to update the filter?

we are trying to make the program text into an actual dll by using a different method than downlaoding visual studio, but there are errors while translating it so it doesnt work and we are not experts so we check on google and use as much sense as we can and do what we can do to make the parts that dont work, work. im sure youre not confused anymore but thats essentially it :D
DeaTh
Cog
206 | 16
I don't think that the file size is critical. It is still different compilers and optimization params. Otherwise I dunno how debug in this situation. Again, I am not experienced in this. It seems, will have to switch to Visual Studio or ̶w̶a̶i̶t̶ ̶u̶n̶t̶i̶l̶ ̶y̶o̶u̶ ̶w̶i̶l̶l̶ ̶d̶e̶a̶l̶ ̶w̶i̶t̶h̶ ̶t̶h̶e̶s̶e̶,̶ ̶l̶o̶l̶
User avatar
void
Shadowgate Totem
1776 | 98
Common Posting Badge
Posted over 1.000 messages
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Guide Badge
Created a complete character guide
hm ya the compilers are different, and i know that it doesnt mean that the dll wont work but still from 9 to 12kb is quite remarkable...
DeaTh wrote:w̶a̶i̶t̶ ̶u̶n̶t̶i̶l̶ ̶y̶o̶u̶ ̶w̶i̶l̶l̶ ̶d̶e̶a̶l̶ ̶w̶i̶t̶h̶ ̶t̶h̶e̶s̶e̶,̶ ̶l̶o̶l̶

i dont want to do it, its such a pain :cry:
on the other hand im glad that you were able to figure out a way to get intel to work so im not giving up yet