Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> from ctypes import *
- >>> dll = CDLL('libhuapi.so')
- >>> ctx = c_void_p()
- >>> dll.hu_GlobalCtxCreateDefault(byref(ctx))
- 0
- >>> ctx
- c_void_p(2030254944)
- >>> dll.hu_RegisterSbg56(ctx)
- 0
- >>> dll.hu_RegisterSystemSeed(ctx)
- 0
- >>> dll.hu_InitSbg56(ctx)
- 0
- >>> params = c_void_p()
- >>> dll.hu_AESParamsCreate(1, 128, None, None, byref(params), ctx)
- 0
- >>> params
- c_void_p(2039413424)
- >>> key = c_void_p()
- >>> dll.hu_AESKeySet(params, len('M02cnQ51Ji97vwT4')*8, b'M02cnQ51Ji97vwT4', byref(key), ctx)
- 0
- >>> key
- c_void_p(2039415368)
- >>> plain = b'`Twas brillig, and the slithy toves did gyre and gimble in the wabe.'
- >>> len(plain) % 16
- 4
- >>> plain += b'\x0c' * 12
- >>> plain
- b'`Twas brillig, and the slithy toves did gyre and gimble in the wabe.\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c'
- >>> out = create_string_buffer(len(plain))
- >>> out
- <ctypes.c_char_Array_80 object at 0x790fdb70>
- >>> iv = create_string_buffer(16)
- >>> iv
- <ctypes.c_char_Array_16 object at 0x790fdb20>
- >>> len(iv)
- 16
- >>> dll.hu_AESEncryptMsg(params, key, 16, iv, len(plain), plain, out, ctx)
- 0
- >>> bytes(out)
- b"\x04\xd1\xff\xb2N:\xc8\xbezC\xef\xb7F\xcd\xa0%\x7f|eYm\xd90j`\xb1\x0c\xb8\x83=\x91n\xbf\xf8D\xdcD\xe4\x82'\xcc\xba\xef\xd1=\xa9\xdb!5\x18D\xc7&\xfeR\xa6\xfb\x7f\x00\x13\xbfj\xd2\x96zL\xba\xc4\xb2\x9a\xe2\x99\xde\xb8y\xa5\xe0\x7f\xef\x9f"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement