Hacker literature?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Stucky101
Posts: 141
Joined: Tue Mar 27, 2007 4:17 am UTC
Location: Park City, Utah, USA, North America, Earth, Sol, Orion Arm, The Milky Way, Universe A

Hacker literature?

Postby Stucky101 » Fri Nov 27, 2009 5:00 am UTC

I'm a novice, self-taught programmer looking to get into the hacking scene. I realize I could easily look up a few free tutorials online that'll get me started on the right path; however, I would much prefer an in-depth book on the subject. So I'm wondering if any experienced hackers here could recommend me a good "Introduction to Basics," generalized book for would be hackers.

Thanks!
"The earth is the cradle of humankind, but one cannot live in the cradle forever."
~Konstantin Tsiolkovsky, 1895

User avatar
phlip
Restorer of Worlds
Posts: 7573
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Hacker literature?

Postby phlip » Fri Nov 27, 2009 5:14 am UTC

This is always a good start.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Stucky101
Posts: 141
Joined: Tue Mar 27, 2007 4:17 am UTC
Location: Park City, Utah, USA, North America, Earth, Sol, Orion Arm, The Milky Way, Universe A

Re: Hacker literature?

Postby Stucky101 » Fri Nov 27, 2009 5:17 am UTC

phlip wrote:This is always a good start.

Looks great, but I'd still really prefer a book. I'll bookmark it just in case.
"The earth is the cradle of humankind, but one cannot live in the cradle forever."

~Konstantin Tsiolkovsky, 1895

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Hacker literature?

Postby Berengal » Fri Nov 27, 2009 5:45 am UTC

Gödel, Escher, Bach
Hackers: Heroes of the Computer Revolution
Structure and Interpretation of Computer Programs
The Tao of Programming
The Illuminatus! Trilogy
Principia Discordia
The Soul of a New Machine
The Cuckoo's Egg
The Cathedral and the Bazaar

I think the jargon file has a list of litterature as well.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

Isaac356
Posts: 9
Joined: Wed Dec 02, 2009 11:32 pm UTC

Re: Hacker literature?

Postby Isaac356 » Fri Dec 04, 2009 4:34 am UTC

I've read Hacking: The Art of Exploitation 2nd edition, and I liked it a lot. It covers a lot of ground: overflows, printf format attacks, shellcode, and even wep packet injection, to name a few.

You'll also come out of it with some good C and ASM knowledge. (It touches perl a little bit too, but just for generating large strings)
Spoiler:

Code: Select all

class Foo
  def x
    return 1
  end
  def bar
    puts x
    x = 0 if false
    puts x
    x = 2
    puts x
  end
end

Ctrl+Alt+Shift+PgDown

User avatar
Stucky101
Posts: 141
Joined: Tue Mar 27, 2007 4:17 am UTC
Location: Park City, Utah, USA, North America, Earth, Sol, Orion Arm, The Milky Way, Universe A

Re: Hacker literature?

Postby Stucky101 » Fri Dec 04, 2009 5:33 am UTC

Isaac356 wrote:I've read Hacking: The Art of Exploitation 2nd edition, and I liked it a lot. It covers a lot of ground: overflows, printf format attacks, shellcode, and even wep packet injection, to name a few.

You'll also come out of it with some good C and ASM knowledge. (It touches perl a little bit too, but just for generating large strings)

Yeah I was looking that up on Amazon. Looks like my best option I think I'll get it. Thanks for the recommendation.
"The earth is the cradle of humankind, but one cannot live in the cradle forever."

~Konstantin Tsiolkovsky, 1895

User avatar
MHD
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: Denmark

Re: Hacker literature?

Postby MHD » Fri Dec 04, 2009 4:00 pm UTC

Hakell is utterly awesome.

this is a litle stack based calculator I made. 101 lines... with comments and nicely spaced code...

Code: Select all

import Data.Maybe (isJust, isNothing, fromJust)
import Control.Monad ((>=>), mplus)

-----------------
-- The stack type
-----------------
type Stack = [Double]

--------------------------
-- The error handler monad
--------------------------
data Try a = Ok a | Err String deriving (Show, Read)

instance Monad Try where
   (Ok x) >>= k = k x
   (Err s) >>= k = (Err s)
   return x = Ok x
   fail s = Err s

instance Functor Try where
   fmap f (Ok x) = Ok (f x)
   fmap f (Err s) = Err s

raise :: Try a -> a
raise (Err s) = error s
raise (Ok x) = x

------------------
-- Number handling
------------------
numparse :: String -> Maybe (Stack -> Try Stack)
numparse s =
   case reads s :: [(Double, String)] of
      [(n, "")] -> Just (\l -> Ok (n : l))
      _ -> Nothing

--------------------
-- Operator handling
--------------------
testargs :: Int -> Stack -> Try Stack
testargs n s = if g n s then Ok s else Err "Not enough arguments."
   where
      g 0 _ = True
      g _ [] = False
      g n (x:xs) = g (n - 1) xs

operator :: String -> Maybe (Stack -> Try Stack)
operator s =
   let
      mkop :: Int -> (Stack -> Stack) -> Stack -> Try Stack
      mkop n f = \s -> do testargs n s; return $ f s ++ drop n s
   in case s of
      "add" -> Just $ mkop 2 (\(x:y:_) -> [x + y])
      "sub" -> Just $ mkop 2 (\(x:y:_) -> [x - y])
      "mul" -> Just $ mkop 2 (\(x:y:_) -> [x * y])
      "div" -> Just $ mkop 2 (\(x:y:_) -> [x / y])
      "exp" -> Just $ mkop 2 (\(x:y:_) -> [x ** y])
      "neg" -> Just $ mkop 1 (\(x:_) -> [- x])
      "swp" -> Just $ mkop 2 (\(x:y:_) -> [y, x])
      "dup" -> Just $ mkop 1 (\(x:_) -> [x, x])
      "sum" -> Just $ Ok . (:[]) . foldr (+) 0.0
      "prd" -> Just $ Ok . (:[]) . foldr (*) 1.0
      _ -> Nothing

----------
-- Parsing
----------
parse :: String -> Stack -> Try Stack
parse "" = Ok
parse s =
   foldr (>=>) Ok [
      let
         t = numparse w `mplus` operator w
      in
         if isNothing t
         then (\s -> Err "Unrecognized token.")
         else fromJust t
      | w <- words s
   ]

----------
-- Running
----------
runStacker :: String -> String
runStacker s =
   case parse s [] of
      (Ok s) -> concat (map ((++ " ") . showNum) $ reverse s)
      (Err s) -> s
   where
      showNum :: Double -> String
      showNum n = if n == (fromIntegral $ round n) then show $ round n else show n

-------
-- Main
-------
main = f
   where
      f = do
         x <- getLine
         putStrLn $ "= " ++ runStacker x
         f
EvanED wrote:be aware that when most people say "regular expression" they really mean "something that is almost, but not quite, entirely unlike a regular expression"


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests