Different results from .dll

Started by Memor-X, November 01, 2011, 01:12:40 am

Previous topic - Next topic

Memor-X

a while a go i made this post
http://forum.chaos-project.com/index.php/topic,10100.msg149048.html#msg149048

i implemented the .dll and it works, however i got a problem, for some reason when i use the .dll in RMXP to encrypt a .txt file using the encrypt file function, the contents of the .txt file was different from that of the same file but encrypted though Game Maker, i even decrypted the RMXP file in Game Maker and it didn't return to the original text

the code i used to create the functions is

class GMCrypt
 
  ENCRYPT = Win32API.new 'GM_Crypt.dll', 'encryptFileXOR', ['p', 'p', 'i'], 'i'
  DECRYPT = Win32API.new 'GM_Crypt.dll', 'decryptFileXOR', ['p', 'p', 'i'], 'i'
 
  def self.encrypt(file, key, strength)
    ENCRYPT.call(file, key, strength)
  end
 
  def self.decrypt(file, key, strength)
    DECRYPT.call(file, key, strength)
  end
 
end


have i done something wrong in the code or is it possible that Ruby (or RMXP) could use the .dll in a completely different way to Game Maker