Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7878763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:45:08+00:00 2026-06-03T03:45:08+00:00

For a class assignment, I’m analyzing how Amazon’s Kindle digital rights management implementation works

  • 0

For a class assignment, I’m analyzing how Amazon’s Kindle digital rights management implementation works as well as how to defeat it. In my research, I came across a set of Python scripts that extract out the book data from the encryption. It fits my needs for explaining the encryption-cracking part of my paper.

Problem is, I’m not fluent in Python or have any experience other than print 'Hello World'.

When working my way through the source code, I came across this snippet

def __init__(self, infile):
    # initial sanity check on file
    self.data_file = file(infile, 'rb').read()
    self.mobi_data = ''
    self.header = self.data_file[0:78]

    if self.header[0x3C:0x3C+8] != 'BOOKMOBI' and self.header[0x3C:0x3C+8] != 'TEXtREAd':
        raise DrmException("invalid file format")

    self.magic = self.header[0x3C:0x3C+8]
    self.crypto_type = -1

My interpretation of the code goes like this:

  1. self.data_file is a byte array that is returned by read() on the file(infile, 'rb') call.
  2. self.header is the value of the first 79 bytes of the data file

The problem I’m having is just what does self.header[0x3C:0x3C+8] mean?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:45:10+00:00Added an answer on June 3, 2026 at 3:45 am

    It’s a normal slicing, like self.data_file[0:78], except uses hex literal as the offset. 0x3C is 60 in base10, so it’s the same as self.header[60:60+8].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a class assignment in C#, I came across a program crash without
Can I optimize the class assignment here at all? I have to do this
For this assignment I had to create my own string class. I initially wrote
As part of the last assignment in a beginner python programing class, I have
I'm doing an assignment for my Data Structures class. we were asked to to
I have to do an assignment for my class and it says not to
This is an assignment i am working on for class. To make a long
I have completed the assignment (yes it is for a programming class), but I
So I've been given an assignment in my Mobile apps class: make a color
We just got our first major Perl CGI assignment in my CS class. Our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.