difficult to understand algorithm

ZXNet echo conference «code.zx»

From psb To All 11 April 2006

Hello, All there is a task: to write a simple program so that when you poke around in it there will be It's sooo hard to understand what she's doing. for example, xorka. if we write it down in its usual form, then we can easily see what she does and how she does it (it’s just a cycle!). if you play tricks with the code, like, say, jumping from address to address (using the stack), then this is also not effective: just sit and you can understand what is being done. it doesn’t have to be Xorka, it can be any algorithm... the main thing is that it is It's very difficult to understand how it works. the only thing that comes to my mind is creation virtual processor, with its own instruction system and its emulation. but even then, having disassembled the kernel, it will be possible to compile a list of commands and it will be easy to understand algorithms (example - Speck's calculator in ROM.. you won't see anything disasm, but knowing the commands you can figure it out (albeit a relatively long time)). Maybe someone knows how to make the algorithm even more difficult to read? maybe 2 virtual processors?;)

From Slavik Tretiak To All 11 April 2006

Hello Titus quite simple: you write your own assembler, which can assemble each command in different variations. let's say: LD HL,100 ┌─- code ─── PUSH DE PUSH BC EX AF,AF' PUSH AF LD B,15 LD HL,85 L0 ADD A,(HL) SUB B INC HL DJNZ L0 POP AF EX AF,AF' POP B.C. POP DE └── code ─── and so on 4-8 options for each team. It will slow down and the amount of code will increase, but you will have to really understand it long time ;)

From Konstantin Zhukov To All 11 April 2006

Hello Titus Don't waste time on nonsense. The time when it was possible to protect on the Spectrum the program came and went. A more or less reliable option for protecting program code is using a hardware key of the type that is inserted into LPT on IBMs. But also there will be craftsmen here, albeit in smaller numbers, who will hack it. By the way, what are you planning to defend? Is the object even worthwhile?

From Igor Afonkin To All 11 April 2006

Hello Titus I remember back in school I wrote a program like a tricky scroller, the trick was memory optimization, i.e. required to be crammed into a minimum volume, in As an optimizer, a bunch of conditional and unconditional transitions were used. When a friend sat down to disassemble it “for parts” to see how it works, the next day he came up with the phrase: “It shouldn’t work, because it’s nonsense, but it WORKS”... ;) I didn’t even think about any kind of protection then...

From Andrey Alexandrovich Titov To All 11 April 2006

Hello, psb Why such perversions? They will still crack :v2_wink2: (if necessary)

From Andrey Alexandrovich Titov To All 11 April 2006

Hello, psb psb> no, of course they will crack if they really NEED IT :) but you need to have the desire to CRACK psb> missing;) It’s unlikely to disappear, they’ll quit on principle :) Although why crack if now in any emulator you can stop the program and that’s it ready.

From psb To All 11 April 2006

Hello Titus Tit> Why such perversions? Tit> They will still crack (if necessary) no, of course they will crack if it is absolutely NECESSARY :) but it is necessary that the desire to CRACK disappears;)

From psb To All 11 April 2006

Hello Sinus Sin> write your own assembler... wow, this is even interesting! :))) damn, it’s a cool idea :)) that’s practically what necessary :)

From Vladimir Kladov To All 11 April 2006

Hello new art You write your own assembler... For such perversions there are MACROES and DEFINE's. B normal assemblers, at least.

From Vyacheslav Kalinin To All 11 April 2006

Hello, Jukov Juk> Don't waste time on nonsense. The time when it was possible on the Spectrum Juk> protect the program was and gone. A less reliable protection option Juk> program code, this is the use of a hardware key like those Juk> is inserted into LPT on IBMs. But there are craftsmen here too, though already in Juk> in smaller numbers that will hack it. Juk> By the way, what are you going to defend? Is the object even worthwhile? Nobody seemed to be talking about Spectrum...

From Orionsoft To All 12 April 2006

Hello, psb psb> but it is necessary that the desire to CRACK disappear it's indestructible!

From SMT To All 12 April 2006

Hello, Vladimir Kladov Vla> You write your own assembler... For such perversions there are MACROS and Vla> DEFINE's. In normal assemblers, at least. won't help. how will he choose different versions of the same macro.. and the hacker quickly compile a table of correspondence between pieces of code and initial macros, i.e. will spend less time than the creator of the protection. actually, in the virmaker's logs of all kinds of code mutation engines - tons

From van Yu Shinn To All 12 April 2006

Hello, psb Chernov - About one method of masking programs http:/www.citforum.ru/security/articles/mask/

From Nikolay Istomin To All 12 April 2006

Hello Orionsoft On the PC there is quite popular software for which there are no cracks. Nobody argues that In principle, you can hack anything, but you can cause such hemorrhoids that the one who breaks it will suffer and decide “well, screw it.”

From Nikolay Istomin To All 12 April 2006

Hello Orionsoft On the PC there is quite popular software for which there are no cracks. Nobody argues that In principle, you can hack anything, but you can cause such hemorrhoids that the one who breaks it will suffer and decide “well, screw it.”

From psb To All 12 April 2006

Hello Sinus Well.. generally speaking, I don’t need this in relation to the Spectrum.. and not for PROTECTION programs.. this is of course, those days are already gone.. and I take into account emulators. yes That’s the crap, that even with an emulator, stupid debugging capabilities, quacking, etc., it was difficult to understand what was there and how it was calculated.. so that it would be easier to _guess_ the essence of what is happening than to get into the code and understand. I won’t tell you why exactly yet, but maybe I will when I do;)

From Slavik Tretiak To All 12 April 2006

Hello, Electrician you won't be tormented. It’s just that no one needs such software (reading is not needed for those who can break it)

From Slavik Tretiak To All 12 April 2006

Hello, psb Well, here’s a normal option for you: by riveting a ton of macros or ASM, write which will do the same, only he will also choose at random. and if there are also left-handed pieces of code (that don’t really do anything), insert such an asm would be, then he wouldn’t have had a price. True, then you yourself will hesitate to debug your own code ;)

From Slavik Tretiak To All 12 April 2006

Hello, Jukov It won't work in this version, it will work in the next one. I also know one funny little thing that 90% of emuls will not swallow, well so what?

From psb To All 12 April 2006

Hello Sinus in general, I roughly figured out what could be done :) thanks everyone :)

From Konstantin Zhukov To All 12 April 2006

Hello, psb For any emulator there is a hole. They are not so ideal, I know one Fenka, which will work on any real world, but will not work on UNREALE.

From Robus To All 12 April 2006

Hello, psb psb> there is a task: write a simple program so that when poking around in it psb> it was sooo hard to understand what she was doing. psb> psb> for example, xorka. if we write it down in its usual form, then we psb> we can easily see what it does and how it does it (it's just a cycle!). if psb> do tricks with the code, like, say, jump from address to psb> address (using the stack), then this is also not effective: enough psb> sit and you can understand what is being done. psb> psb> this is not necessarily Xorka, it can be any algorithm... the main thing is psb> so that it is very difficult to understand how it works. comes to mind psb> only creating a virtual processor, with its own command system and psb> its emulation. but even then, having disassembled the kernel, it will be possible to compose psb> list of commands and it is already easy to understand the algorithms (example - Spekov psb> calculator in ROM.. you won’t see anything with dissam, but knowing the commands you can psb> figure it out (even if it takes a relatively long time)). psb> psb> Maybe someone knows how to make the algorithm even more difficult to read? psb> maybe 2 virtual processors?;) I once loved this very much... And I made two of my defenses... the first was in program http://zxaaa.narod.ru/DEMO/ZXCLUB.ZIP it is simple, but the second one was based on insanely confusing code http://www.entire.nm.ru/speccy/PITON.SCL ... As a result, the game takes up 9 kilobytes the game itself, and 10 kilobytes are occupied by protection. This game was a bet with my friend Fine Soft, I wrote a “fak” on it and he had to remove it... So this is didn't happen...

From Vladimir Kladov To All 12 April 2006

Hello SMT SMT> will not help. how it will select different variants of one macro.. and SMT> a hacker will quickly create a table of correspondence between pieces of code and the original ones SMT> macros, i.e. will spend less time than the creator of the protection. SMT> actually, in the virusmaker logs of all kinds of code mutation engines - SMT> tons I didn't understand something. Among other things, the macro can include the generation of the following random number (call nested macro), and based on this number select any branch from those implemented. All that remains is to set the starting number for the build in a pseudo-random sequence.

From Slavik Tretiak To All 13 April 2006

Hello Titus Titus wow ;) instructions: after launching, randomly and quickly press the mouse buttons. if the lower part of the curb is repainted from black to some other color, then you are real or a good emulsion. unreal doesn't work. I haven’t tested zemu yet (although in theory it should work) PS Perhaps old DOS emuls will work. Zyy. Glitches are possible in real life if the mouse is with a controller. ┌─- code ─── ORG #8000 LD BC,#FADF LD H,0 LOOP HALT LD DE,1000 IN A,(C) AND 7 OUT(#FE),A LD L,A LOOP0 IN A,(C) AND 7 OUT(#FE),A DEC DE LD A,D OR E JP NZ,LOOP0 IN A,(C) AND 7 SUB L ORH LD H,A OUT(#FE),A XOR A IN A,(#FE) OR#E0 INC A JP Z,LOOP RET └── code ─── Zyyy. It's not all funny stuff

From Andrey Alexandrovich Titov To All 14 April 2006

Hello, Vladimir Kladov Vla> An elementary trick (I didn’t watch this one, maybe this is it): in Vla> in real life, pressing the keyboard occurs at any time, not just Vla> at the frame boundary, and there is also contact bounce. Is it necessary? Vla> In my opinion, this is completely useless. Why look, it’s clear that this is it: v2_smile:

From Slavik Tretiak To All 14 April 2006

Hello Titus Of course, no one needs this. I just answered Comrade Zhukov that there are chips that emulators do not emulate tons, and the most basic ones at that. you can emulate everything with 100% accuracy for software that will work on emulated machine (not a fact that it will be 100% for the viewer ;)). But really, is it necessary? PS if anyone really wants to run emuls for airborne surveys, then here more correct option ┌─- code ─── ORG #8000 LD BC,#FADF LD H,0 LOOP HALT LD DE,800 IN A,(C) AND 7 OUT(#FE),A LD L,A LOOP0 IN A,(C) AND 7 OUT(#FE),A SUB L ORH LD H,A DEC DE LD A,D OR E JP NZ,LOOP0 LD A,H OUT(#FE),A XOR A IN A,(#FE) OR#E0 INC A JP Z,LOOP RET └── code ───

From Andrey Alexandrovich Titov To All 14 April 2006

Hello Sinus Sin> of course no one needs this. Sin> I just answered Comrade Zhukov that chips that do not emulate Sin> there are tons of emulators, and the most basic ones. So share tons. Everything is clear about frame polling of the periphery, but besides that Is there anything worthwhile? :v2_wink2:

From Robus To All 14 April 2006

Hello Titus I have a question, and if I post my emulator, will you agree with it? test? I have a glitch somewhere, but I can’t identify it... I’ll attach it games that don't work on it. Or you yourself add your works to TRD, which will not work and you will be able to identify the mess. Since I've already a hundred times I went through command after command, but never found a flaw. It works under XP, but video mode selects 51 hertz, I did not make other options, since this is not corresponds to the present Speccy. Well, agree to spend your time on identifying errors?

From Andrey Alexandrovich Titov To All 15 April 2006

Hello Robus Rob> Well, would you like to spend your time identifying errors? Isn’t it destiny to try zxall? :v2_blush:

From Robus To All 15 April 2006

Hello Titus Tit> Isn’t it fate to try zxall? I don’t understand... What did you mean??? zxall is some kind of emulsion? program?

From Andrey Alexandrovich Titov To All 15 April 2006

Hello Robus Rob> I don’t understand... What did you mean??? zxall is some kind of emulsion? Rob> program ? zexall [http://www.mdfsnet.f9.co.uk/Software/Z80/Exerciser/Spectrum/] And also read the document emuls-z80test.zip in the topic 'command bit n,(hl)',','... Titus aka Andrey Aleksandrovich Titov

From Dmitry Krapivin To All 26 May 2006

Hello Robus Rob> This game was a dispute with my friend Fine Soft, I wrote to him Rob> "fak" familiar story...they planted a protected file on me that needed to be broken without Shadow RAM, as far as I remember there were two nested Xorka cycles (in total about 56000 passes) with the R register... but there was also IM2, the handler of which considered the checksum of the main program... and seems to have used it as xorka parameter. I puffed for five hours, but in the end I honestly hacked it, selling it some semblance of a Trojan. I haven’t seen better protection, more boring - yes, old Alcatraz...

From Yuri Potapov To All 27 May 2006

Hello Dimasty it's different... it's not difficult to understand - it's crap... Robus is cooler