ov3rcl0ck 25 Junior Poster

You should use modules like pickle or marshal to serialize and load your datas...

I really agree with jice, but keep in mind the Pickle module shouldn't be used for anything that would requires good security, theres a good amount of exploitable loop holes that will most likely never be fixed, and are extremely easy to exploit.

ov3rcl0ck 25 Junior Poster

I neither encourage nor discourage GUI use. I simply present it as an option. The user should choose what is best based on their confidence level and skill. I love the command line, but I admit that it's not for everybody. Nothing wrong with that.

I just think that if you start using the GUI you'll depend on GUIs too much, and the truth is theres alot of things in Linux that don't have GUIs, and some that are better(more flexible) without a GUI.

I really think that command line is easier in some aspects especially the apt-get and aptitude commands that come with Debian/Ubuntu, because you can use "aptitude search [software]" to find software instead of scrolling through an endless list.

ov3rcl0ck 25 Junior Poster

Using a standard library may allow your software to be cross-platform or easier to port to another platform. I'd say stick with the standard library, it'll be much easier and keep everything OO.

Ancient Dragon commented: agree. +25
ov3rcl0ck 25 Junior Poster

Pygame and py2exe don't get along well, you have to do a few things to get it working. Take a look: http://www.moviepartners.com/blog/2009/03/20/making-py2exe-play-nice-with-pygame/

A great idea is to make a list of the modules you need.

ov3rcl0ck 25 Junior Poster

sudo apt-get remove "packageName"

or you could easily use of of the GUI tools to do it as well. If you want to know more about the options available in apt-get try:

man apt-get

and you'll get the manual page which lists the options for the package manager.

Don't encourage GUI use, the best way to learn is command line.

you can use "sudo apt-get remove [package]"
or to remove it completely(all the config files) use "sudo apt-get purge [package]"

ov3rcl0ck 25 Junior Poster

I'm using codepad.org to host my code so I can work on it at home, school or where ever theres a computer.

Check it out:
http://savethehouse.codepad.org/

All my pastes are currently private, so you won't see much, but I'll be opening it publicly soon.

ov3rcl0ck 25 Junior Poster

TKinter doesn't give a very native look or feel, I recommend WXpython, it can use GTK themes, or have a windows look.

But if you insist on using TKinter I can help you with that also, but I recommend that you check this out http://www.wxpython.org/tutorial.php

Right now I'm working on a python based, crossplatform(and portable) remake of rsync. It will give the ability to back up permissions, owner, zip/gzip/tar the files for more compact storage, and provide multiprocessor support.

ov3rcl0ck 25 Junior Poster

You can use the PIL(python image library) to convert an image to a string and store the string in your database.

ov3rcl0ck 25 Junior Poster

Hot damn, why such and odd Variable name? Just name it weight or something simple, I'm pretty sure you can't use "{" or "}" in a variable name.

ov3rcl0ck 25 Junior Poster

What are you aiming to get out of this? What is your end result?

ov3rcl0ck 25 Junior Poster

I dought DOSbox has an API for displaying jpgs. Just convert all the image files to raw images, or just pixel paint some images.

ov3rcl0ck 25 Junior Poster

You can call APIs in your OS to display images, or you can link up to some C libraries, maybe just link to some OpenGL libraries.

ov3rcl0ck 25 Junior Poster

I'll check it out. Maybe help out with the multiprocessor support.

ov3rcl0ck 25 Junior Poster

... since Mac are realy running shiny Linux/BSD it should work there to.

Mac OS X is based around Darwin UNIX, a version of UNIX that derived from NEXTSTEP, which derived from BSD. OS X Contains no BSD code nor NEXTSTEp code anymore.

ov3rcl0ck 25 Junior Poster

If you set up some sort of source code repos I'd be happy to help, otherwise I could just post some code here or PM it to you.

ov3rcl0ck 25 Junior Poster

Maybe instead of using rsync, you can implement your own crossplatform version of rsync. You could also multithread is and/or use the multiprocessing module to provide multiple CPU support so copying can go much faster.

Another good idea is to make a daemon out of it, and have it backup to a certain source at given times every so often. Consider using wxpython for GUI, and docking the daemon on the system tray. It would be pretty sweet.

ov3rcl0ck 25 Junior Poster

still need errors..

ov3rcl0ck 25 Junior Poster

In my opinion if you optimize the code enough it will make it pointless to decompile because the decompiled code will be just as confusing as the bytecode.

If you are really desprite you could take a packing approach, compile your swf encrypt it, make a small flash app that contains the encrypted swf and decrypts it upon execution, it will be written to live memory but it will make it at least twice as hard to decompile.

Don't bother asking me how to do this in AS, because I've never touched Actionscript, I'm not even sure if its low level enough to do this. Its actually a technique used to protect maleware from detection; packing and encryption.

ov3rcl0ck 25 Junior Poster

Looks like I'm gonna change my career path now!

ov3rcl0ck 25 Junior Poster

Can you give me an example? Maybe something like wildcard characters, because the HTML I am trying to strip is dynamic and everchanging so I have to find a way to strip the parameters as well.

ov3rcl0ck 25 Junior Poster

I'm trying to strip HTML tags and replace certain tags with newlines and tabs. I just can't figure out a function to do this, any ideas? I'd prefer to use regex instead of a library.

ov3rcl0ck 25 Junior Poster

Recoding never hurts, usually the first things I do to optimize codes is replace all range() funstions with xrange(), then I look for loops that can be replaced with lambda, then I look for if statments that can be changed to elif so it doesn't have to go over unnecessary if statments, then i look for regex functions that can be replaced with faster string functions, and finally i see if i can compact the code into less lines and less characters to allow faster interpreting and making it more sleek and compact.

ov3rcl0ck 25 Junior Poster

lets say we want to use the C library "stdio.h", we need to use the extern and call instructions. Like so:

extern _printf ;allows you to access the printf functions from stdio.h;
...
mov ecx,5
push ecx ;push ecx on the stack for stdio;
push YOURTEXT ;replace YOURTEXT respectively, this will pass the arguement to printf;
call printf ;calls the functionl;
...

you still have to call an interupt, but thats just a basic example, but now you have to compile the C/C++ library then link it to your assembly program. Alternativly you can use Inline Assembly inside your C++ code which is a bit easier especially when it comes to compiling.

For compiling it might be easiest to use GCC for both C and ASM, but keep in mind GCC accepts "main", not "_start".

ov3rcl0ck 25 Junior Poster

Right now i have used time for my input. Could you please give a bit more info on used memory and mouse movement?

Fetching memory usage and mouse input are OS dependent. There isn't a library to fetch memory usage, but you can use the "mem" command on windows to fetch it, and the "ps" or "free" command on UNIX to fetch it, but keep in mind you might need to use a little regex or at least some string functions. For mouse input you can use pyHook for windows, and xlib for UNIX(OS X supports X11, and any Unix distro worth using supports it).

If you need me to I can post some examples of pyHook, xlib, and memory fetching.

ov3rcl0ck 25 Junior Poster

Its going to be platform dependant, for windows you're going to have to use the win32 library and for Linux(and some unix flavors) you're going to have to use xlib, unfortunatly xlib for python is horribly documented.

ov3rcl0ck 25 Junior Poster

Not quite sure what to mean...

ov3rcl0ck 25 Junior Poster

open it in binary mode. In unix however binary mode isn't needed but using 'wb' or 'rb' instead of 'w' or 'r' doesn't hurt. This should copy the file contents of a file to another no matter the content:

fi=open("filein", 'rb').read()
fo=open("fileout",'wb')
fo.write(fi)
fo.close()

In windows you just gotta use the 'rb'/'wb' flags to read the file contents as binary.

ov3rcl0ck 25 Junior Poster

Well there are several algorithms to generate random number, simplest to my knowledge being Linear congruential generator(LCG).

The general formula for LCG is X_{n+1} = \left( a X_n + c \right)~~\bmod~~m . The recommended value for a, m, c are given in Wikipedia page. It is recommended use those combinations of a, m, c for more randomness. Start with any value of X and for different random numbers everytime you run code choose X using system time.

To get number in particular range, eg [L, H) apply this to every random number generated(say Y) : Z = L + Y%(H-L)

Probably the best inputs is date/time, used memory, random user input, and my favorite mouse movement(truecrypt uses this).

ov3rcl0ck 25 Junior Poster

Buddy you are not using enough functions, if you need everything in one function(sometimes teachers require this) you can declare functions within a function but it gets pretty messy.

ov3rcl0ck 25 Junior Poster

This is because most of the viruses are .exe files which are not executable in Linux Operating system. In other words the OS does not understand what the files are.

Well exe files are windows binarys, not compiled for linux. There are 4 main reasons linux doesn't need a AV:

  1. Linux uses file permissions, you can only execute a file if you have a "+x" permission.
  2. A typical linux user only has write access to his/her home folder limiting the virus to a small area that contains no important system components
  3. Root users are(by default) the only user that has write access outside its home folder(/root); The root user is only used to make changes to the system, which normal users cant. No one in the right mind ever runs as root to do everyday tasks. A user with sudo privledges can use the "sudo" command to run a single process or command as Root user.
  4. Patches, Linux is the most rapidly developed software on earth. Patches come out very rapidly and there are so many contributors that a loop hole will only last a few days

Not too mention there are security addons for linux such as Apparmor, SELinux, and many more which provide "Mandatory Access Control".

ov3rcl0ck 25 Junior Poster

You basically just give it a password and your done, you could read the manual that came with it, try a google search. It would give you a better answer than anyone here could.

ov3rcl0ck 25 Junior Poster

Sounds like a error in the SMTP library not your code, I have no idea why they'd limit it to 1000 emails. Alternatively if you're running linux you can output the "sendmail" command to the system, or you could get into sockets and make your own SMTP client, or if you really want to you could try and tinker with the SMTP lib and hack it to do what you want.

ov3rcl0ck 25 Junior Poster

Not a bad idea, however as you said, not very secure. So if used for legit uses it could compromise the clients privacy, however SSL/TSL could fix this.

ov3rcl0ck 25 Junior Poster

WEP is very unsecure, it can be cracked in minutes, sometimes seconds. You should really go with WPA/2.

ov3rcl0ck 25 Junior Poster

There are modules for python that allow you to execute javascript, but this might be messy. You could fetch the Jscript with urllib, run the javascript and fetch whatever is returned. Browser macros would be easier, but if you want to distribute this program then i wouldn't recommend macros.

ov3rcl0ck 25 Junior Poster

Facebook has its own API, googles appengine wouldn't be the right way to go in my opinion. You're gonna need a program running on the users computer that will submit the status, because browser scripts cannot do this without exploiting some sort of flaw(which isn't good). I think you should look into urllib2, you can use that to post a status on facebook without using appengine or facebooks API, should be fairly simple. As for fetching iTunes current song, I have no idea, I'd assume theres an exposed API.

ov3rcl0ck 25 Junior Poster

This seems more like a POP sever error than a python error. I don't think this is the right forum, but if you tell me what server you're using to host POP I might be able to help.

ov3rcl0ck 25 Junior Poster

Well it looks like you may be opening the file wrong, i don't know why is raising that error, you're not even using a list object. Try this:

import MySQLdb, csv, sys
conn = MySQLdb.connect (host = "localhost",user =
"a", passwd = "b",db = "c")
c = conn.cursor()
csv_data = csv.reader(file('TxtFile1.txt'))
for row in csv_data: print row
row = csv_data.next()
c.execute("INSERT INTO a (Category, Value) VALUES (%s, %s)", row)
#c.commit()
#c.close()

I believe this should work, if not post back and we can try something else.

ov3rcl0ck 25 Junior Poster

Pygame is rather simple, but only supports 2D unless you use opengl with it. Panda3D(if we are talking the same engine) is a robust 3D engine designed by disney. If you want 3D go panda, 2D go pygame.

ov3rcl0ck 25 Junior Poster

Wow thats a mess of code, try sorting some stuff into functions to make a little more clear first off, I can take a look at it later. Also I'd move the portion where you select your player name out before the loop so you don't have to set it again after every loop.

ov3rcl0ck 25 Junior Poster

I want to send it via email, but I haven't really played with the smptlib.
I might just use raw sockets instead. FTP was another way I thought, but I don't really know much about it. I don't have access to the internet too often, and when I do its for class. So research is mostly limited to the docs that came with python lol.

FTP is quite simple, you can make a 15 line program to upload the logs to a FTP server.

ov3rcl0ck 25 Junior Poster

I did something similar except I made 2 versions, one put the logs on a FTP server, one emailed the log. You could also try your hands at a linux keylogger, jut use xorg's xlib.

ov3rcl0ck 25 Junior Poster
import sys
f=sys.arg[2]

my bad

ov3rcl0ck 25 Junior Poster

bcz its all port are close and no hacker can attack on this

Yeah, sorry but you're completely wrong. All ports are closed on any OS. However Linux has a builtin firewall(netfilter/IPtables), you can use it to stealth your ports, great thing about IPtables is it uses netfilter which is built into the kernel. part of the reason linux doesn't need an AV is you need to be root user to have write acess to anything outside your home folder(unless you change that). Another thing that helps is file permissions, not allowing a file to execute unless given the proper permission through CHMOD(system call, or shell command).

ov3rcl0ck 25 Junior Poster

Use the magic wand tool to select all the white you want out, GIMP is a good choice

ov3rcl0ck 25 Junior Poster

oh no,you just cant understand, ok,i explain once again when you run py program its open ONE console, and i want to open ONE ---ANOTHER--- CONSOLE.

well then try this for windows, remember to launch it in its own process/thread though:

import os
os.system("python YOURSCRIPT.py")

or try this for linux:

import os
os.system("xterm python YOURSCRIPT.py")

for linux you need to launch a new terminal/shell otherwise it is run in the background.

ov3rcl0ck 25 Junior Poster

If theres a firewall its going to be on the network gateway which means any device connected to that network must go through the firewall. It makes no sense that the cell phone is able to do this, but it is possible that you have a firewall set up on your computer and you just haven't allowed the port for torrenting.

ov3rcl0ck 25 Junior Poster

Either you can learn to photoshop it out, or you can see if your game engine supports transparency of white backgrounds(like pygames does).

ov3rcl0ck 25 Junior Poster

I recommend starting out with packet capturing on TCP/IP and UDP protocols.

ov3rcl0ck 25 Junior Poster

Wrong forum, i suggest you move it to Networking Hardware Configuration.