Search code examples
dosreverse-engineeringpascalidadisassembly

Unclear behavior DOS application's function


I'm trying to reverse some DOS application. It's uses *.VAR file like database (perhaps encoding this file). That's application looks like system for testing students. The application shows random questions from the DB-file and get your answer. In this place programm read VAR-file length, then open the file and assign it to "newFilePtr_256_byte" var (yes, it's lenght 256 byte). Next, going call of SUBJ FUNCTION (first screenshot). After there is FileCounter check and do this call again (until all file would be read).

How the function is being called

The function, i can't explain for, on second screenshot. It's read a symbol from newFilePtr_256_byte and write it to console (nothing on console in real life working)? Or it's do something else?

I can't recognize function behavior, coz i don't know, where i can get fully description Pascal functions in assembler listing.

How the function looks like

I don't put in my question listing of caller function, coz it's really big.


Solution

  • As i can recognize, this function encode file content, by xoring with 0CDh constant, and then write it to buffer in memory.