Skip to content

Latest commit

 

History

History
50 lines (42 loc) · 1.37 KB

README.md

File metadata and controls

50 lines (42 loc) · 1.37 KB

dlink-wdk

Python API for D-Link WDK

Tested on D-Link DIR 100 D1

Python 2.7.x (not 3.x)

Installation

sudo python setup.py install

Usage

Log in to device

import wdk
dev = wdk.Device('192.168.0.1')
dev.Login()

Note, login will be automatically be performed if a request fails. Username and password can be specified when instantiating the Device class (default: admin:). If a login has been previously been performed against that Device, those credentials will be used.

Dump CDB (Configuration DataBase)

import wdk
dev = wdk.Device('192.168.0.1')
dev.ExecuteGet('$')

Note, this will succeed on versions before B13_fam2 without using login, using $sys_lang-bypass, if the bypass-flag is set when instantiating the class (default False). Furthermore, this will only return the "public" parts of the CDB, some CDB variables are hidden from this view but can be returned when explicitly requested .

Memory read

import wdk
dev = wdk.Device('192.168.0.1')
dev.MemRead(0x80000000)

Note, this will use the $sys_lang-bypass if the bypass-flag is set. Also, be careful when reading memory, accessing the wrong regions might crash the device.

Memory write

import wdk
dev = wdk.Device('192.168.0.1')
dev.MemWrite(0x80000000,[0]*8])