Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Problems with importing libraries.

Ask for help
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Problems with importing libraries.

Post by Seinken »

import pymysql

will return

Code: Select all

ValueError: source code string cannot contain null bytes
Originally, I thought source had null bytes. Looking in Notepad++ and regex replace null byte does not resolve the issue. Is there a problem with importlib machinery?
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

try to
from py_stealth import * or from py_stealth import py_stealth
and launch your script not through the stealth.

what is a python version you are using?
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

3.6, i will try that in another IDE.

This error only happens when I run a script inside stealth.
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

Tested in PyCharm, script loads fine. Any idea why I get the error in Stealth?
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

it the problem is in py34.py. Not a correct modify of the python import system. i will fix soon
Last edited by nah nah on 27.03.2018 10:10, edited 1 time in total.
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

I have updated to 8.7.4, and now, no python executes.

print('test') == no console result, only 'Found Python Version'
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

what py version, 32 or 64,
what filename? if it is test.py - this should not works, cause python have test module in standart library
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

https://i.imgur.com/d5x340z.png

Figure a picture says more than words.

Py version 64 bit, testing.py.
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

python x64, but 32 was found :roll:

if you use the stealth code editor, you need to define an ansi encoding.
try this
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

Now python works, but print is cutting characters off

print('test') = return 'est'
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

show me your py_stealth\_datatypes.py line:65
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

Code: Select all

 fmt = 'I' + str(len(data)) + 's'
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

hm... it must works fine. with those stealth and py_stealth packet it must works fine, without missing symbol. by the way, you can use AddToSystemJournal instead print function. it will fix the empty line after using a print.
for example

Code: Select all

print = AddToSystemJournal
print(1, '2', [3], key1='value', sep='my separator', end='end of line')
Seinken
Neophyte
Neophyte
Posts: 16
Joined: 23.02.2018 3:07

Re: Problems with importing libraries.

Post by Seinken »

Even changing function print to addtosystemjournal has the missing character problem, additionally now tracebacks will not show where the error occured.
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: Problems with importing libraries.

Post by nah nah »

its not pythonic way to use scripts from stealth. this was added for supporting a old and simple pyhin scripts. but anyway, it does not work. will fix this, but you should use external scripts
Post Reply