Created
December 12, 2022 19:31
-
-
Save shapr/11e41ca59fb60f8dc98b3ff145932ef0 to your computer and use it in GitHub Desktop.
Inside Termux: apt install ghc, adb push Main.hs $(dest dir); ghc --make -package base Main.hs ; LD_PRELOAD=$PWD/libchallenge_bypass_ristretto_ffi.so ./Main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ForeignFunctionInterface #-} | |
module Main where | |
import Foreign.C.String | |
import Foreign.Ptr | |
data C_Token | |
foreign import ccall "lib.h token_random" tokenRandom :: IO (Ptr C_Token) | |
foreign import ccall "lib.h token_encode_base64" tokenEncodeBase64 :: (Ptr C_Token) -> IO CString | |
main :: IO () | |
main = do | |
tr <- tokenRandom | |
btr <- tokenEncodeBase64 tr | |
res <- peekCAString btr | |
print res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment