2013年8月6日星期二

HI WIFI smart router firmware crack

open https://cloud.turboer.com/api/latest_rom?model=HC6361

{"id":820,"model":"HC6361","level":0,"branch":"","version":"0.775.784s 130802-131633","url":"http://updaterom.ikcd.net/upgrade_file/HC6361-0.775.784s_130802-131633-96d56f0c","md5":"a7fc5f5374061942b723b600e2ba66b0","size":7667716,"changelog":"<style type=\"text/css\">.tks{color:red;}</style><br>BUGFIX<br>1. 解决了50M以上入户带宽下载性能问题(<span class=\"tks\">感谢网友:Haroldzheng,kutin,dingctai</span>)<br>2. 解决了接入网络条件不好的情况下,上网页面容易出现502的问题<br>3. 解决了无线驱动与部分网卡的兼容性问题(<span class=\"tks\">感谢网友:xxmmmy</span>)<br>4. 解决了小极无法访问11对战平台战绩中心的问题(<span class=\"tks\">感谢网友:月巴月戎</span>)<br>5. 解决了小极无法访问坦克盒子战绩中心的问题(<span class=\"tks\">感谢网友:syy2153750</span>)<br><br><br>FEATURE<br>1. 无线中继支持自动连接历史连接节点(<span class=\"tks\">感谢网友:solwolf</span>)”}

dd if=HC6361-0.684.672s_130620-161916-2b3404e2  of=header   bs=1k count=1408
dd if=HC6361-0.684.672s_130620-161916-2b3404e2  of=tail_rootfs   bs=1k count=5832704 skip=1408

unsquashfs -dest squashfs-root  tail_rootfs 
open ash
yarshure@ubuntu:~$ vi squashfs-root/etc/inittab 

::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
ttyATH0::askfirst:/bin/ash --login

check  SQUASHFS
$unsquashfs -s tail_rootfs

Found a valid SQUASHFS 4:0 superblock on tail_rootfs.
Creation or last append time Thu Jun 20 01:19:33 2013
Filesystem size 5668.60 Kbytes (5.54 Mbytes)
Compression xz
Block size 262144
Filesystem is exportable via NFS
Inodes are compressed
Data is compressed
Fragments are compressed
Always_use_fragments option is not specified
Xattrs are not stored
Duplicates are removed
Number of fragments 43
Number of inodes 1551
Number of ids 1

$cd squashfs-root/etc/rc.d
$ln -s ../init.d/dropbear S50dropbear

yarshure@ubuntu:~$ mksquashfs squashfs-root rootfs-squashfs_enable_ash9.xz.img -b 262144 -comp xz -noappend -all-root
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on rootfs-squashfs_enable_ash9.xz.img, block size 262144.
[===============================================================================================================================================================-] 1173/1173 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
        compressed data, compressed metadata, compressed fragments, compressed xattrs
        duplicates are removed
Filesystem size 5723.95 Kbytes (5.59 Mbytes)
        31.90% of uncompressed filesystem size (17943.77 Kbytes)
Inode table size 12962 bytes (12.66 Kbytes)
        25.12% of uncompressed inode table size (51606 bytes)
Directory table size 15296 bytes (14.94 Kbytes)
        47.01% of uncompressed directory table size (32538 bytes)
Number of duplicate files found 19
Number of inodes 1552
Number of files 1157
Number of fragments 43
Number of symbolic links  253
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 142
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)

cat header rootfs-squashfs_enable_ash9.xz.img >HC6361-0.684.672s_130620-161916-2b3404e2_console_ssh.1

rmbp:testkk yarshure$ ls -l HC6361-0.684.672s_130620-161916-2b3404e2
-rw-r--r--  1 yarshure  staff  7274500  7 13 14:33 HC6361-0.684.672s_130620-161916-2b3404e2

>>> (7274500-4)/65536
111
rmbp:testkk yarshure$ ls -l HC6361-0.684.672s_130620-161916-2b3404e2_console_ssh.1
-rw-r--r--  1 yarshure  staff  7303168  7 15 14:58 HC6361-0.684.672s_130620-161916-2b3404e2_console_ssh.1

>>> 7303168/65536.0
111.4375
>>> 112*65536
7340032
>>> hex(7340032)
'0x700000'

>>> 7340032-7303168
36864

add  36864 0xff  padding to tail 

echo -ne '\xde\xad\xc0\xde' >> HC6361-0.684.672s_130620-161916-2b3404e2_console_ssh.1

mv HC6361-0.684.672s_130620-161916-2b3404e2_console_ssh.1 HC6361-0.684.672s_130620-161916-2b3404e2_enable_console_ssh.bin、

####################################
刷机做假dns 欺骗即可,刷机有风险,操作需谨慎
###################################
目前已经激活console ,开启opensshserver, 上图

2013年5月12日星期日

[UPDate]connect Retina MacBook Pro 15' LCD 2880x1800 to iMac as external display


Teardown

http://www.ifixit.com/Teardown/MacBook+Pro+Retina+Display+Teardown/9493/1

MacBook Pro 15" A1398  two module:  LSN154YL01-001    LP154WT1-SJA1 

how to use this LCD Screen
http://www.ifixit.com/Answers/View/92815/What+is+the+model+number+of+the+2880x1800+LCD


I have buy one Retina MacBook Pro upper kit, then plug it to my MBP, it's work fine.
But if i plug it as second Screen, must teardown the connect cable, so I buy a LCD screen.

connect to my Retina MacBook Pro


identity as a Color LCD
rmbp:~ yarshure$ ioreg -lw0 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6
Color LCD
Color LCD

but can't show modes,  and the machine is very hot, I must shutdown it.

I have another Mac ,iMac 27 2011, so the connect the screen to iMac.

System Information screen
 Display Menu screen shot

System Preferences setting arrangement

my cable 


note:
1 cable + LCD, no LED back light kit,  I have buy some LED light, When arrive , I will test it, use My Retina MBP LCD as a light kit is too bad.

update 2013.9.18
 connect rMBP LCD to rMBP  use dp2mbpr http://dp2mbpr.rozsnyo.com
RDM(retina display menu) show two LCD running in HiDPI mode on Mac OS X Mountain Lion
on Mac OS X Mavericks Beta8 external LCD can't running in HiDPI mode, scale 1.0 very fine.

 System info:
 Detail infomation
 Setting:


2013年4月23日星期二

iOS Animation 001

Animation is Easy, today We learning basic Animation use  UIImageView(just like play film).
First need prepare a set of image frames, you can use PhotoShop or any other image edit tool do this.

Second Open Xcode , setup a project from "Single view Application" template.

Three some type 

2013年3月31日星期日

Auto Layout Demo code

UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    [button setTranslatesAutoresizingMaskIntoConstraints:NO];
    
    [button setTitle:@"action" forState:UIControlStateNormal];
    [self.view addSubview:button];
    
    NSLayoutConstraint *btnCon=[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:[button superview] attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-20.0];
    
    NSLayoutConstraint *btnCon2=[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:[button superview] attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20.0];
    [self.view addConstraint:btnCon2];
    [self.view addConstraint:btnCon];

2013年3月19日星期二

Facebook iOS position interview question

   last week Facebook recruit found me in LinkedIn, so he ask me if you would be interested in iOS opportunities within Facebook. I currently live in Shanghai,China, if have a chance go to bay area wok is biggest change in my life.  So I accept his request.
   next is recruiter test question :

 Question 1: When running out of memory, how does the system give your app one last chance to prevent being killed?
a) Autorelease
b) Jetsam
c) Memory Warning
d) UIApplicationWillTerminateNotification
 Question 2: What is the difference between a UIView's 'frame' and its 'bounds'
a) 'frame' defines the view's position and size; 'bounds' defines its clipping rect
b) 'frame' defines the view's clipping rect; 'bounds' defines its position and size
c) 'frame' defines position and size in the coordinate space of its superview; 'bounds' defines position and size in the coordinate space of the view itself
d) They are equal
 Question 3: The delegation pattern is often used to:
a) Report value changes from a Model to a Controller
b) Communicate messages back from one object to its owning object
c) Broadcast messages from a singleton object (e.g. NS User Defaults) to its listener
d) All of the above
Question 4: Which of the following cannot be retained:
a) NSString literal
b) NSNull
c) NSInteger
d) NSNotification
 Question 5: A block cannot:
a) Be subclassed
b) Be retained or released
c) Access 'self' from the scope in which it is declared
d) Be passed as an argument
another question : what does KVO stand for?

   yesterday Facebook Engineer give me a Skype interview:




@interface UIControl: UIView
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;
@end
@implementation UIControl
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents
{
  // How would you implement this?
}
// A UIControlEventTouchUpInside just happened. Let every interested target know…
- (void)_fireTargetsAndActionsForEvent:(UIControlEvents)controlEvent
{
  // ???
}
 
[myButton addTarget:self action:@selector(didTapButton:) forControlEvents:UIControlEventTouchUpInside];


  others question:
how runloop work and autorelease object?
will lead to myButton retain target self?
_fireTargetsAndActionsForEvent complexity?

Today morning, I receive recruiter mail, he told I don't get  chance to next round interview.
I'm very sad, maybe there have many candidates who are best than me.  So I don't have chance work for the company, the interview experience is good for me.

2013年1月19日星期六

Fix external SSD file system on Mac OS X

I use Retina MacBook Pro, the internal SSD capacity is 256G, no enough for me.
so I usual attach a usb SSD driver, usb 3.0 speed is very good for SSD, but the SSD driver file system crash 
three times.

some time can you Disk Utility.app  fix it, but today ,the tool give me
rMBP:~ yarshure$ sudo fsck_hfs -ry  /dev/disk1s2
** /dev/rdisk1s2
   Executing fsck_hfs (version diskdev_cmds-557.3~1).
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
** Rebuilding catalog B-tree.
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 220)
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** Repairing volume.
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 220)
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** Repairing volume.
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 220)
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume VM could not be repaired after 3 attempts.

 the file system too weak, I search the web, found DiskWarrior.app.
It help me fixed the crash system.