[Defy General] royale1223:
Disassembling FBFlash.dll

I was trying to disassemble FBFlash.dll from RSDlite. I think this might be interesting.

​

1. EfuseBlow

; Exported entry 1. EfuseBlow

public EfuseBlow
EfuseBlow proc near

var_48= byte ptr -48h
var_44= dword ptr -44h
arg_0= dword ptr 4

sub esp, 48h
lea ecx, [esp+48h+var_48]
push esi
push edi
call sub_10006830
mov edi, offset aOemProd_fuse ; "oem prod_fuse"
or ecx, 0FFFFFFFFh
xor eax, eax
lea edx, [esp+50h+var_44]
repne scasb
not ecx
sub edi, ecx
push 0 ; int
mov eax, ecx
mov esi, edi
mov edi, edx
mov edx, [esp+54h+arg_0]
shr ecx, 2
rep movsd
mov ecx, eax
push 0 ; int
and ecx, 3
push 0 ; int
rep movsb
push 2710h ; int
push 0 ; int
lea ecx, [esp+64h+var_44]
push 0 ; hFile
push ecx ; int
push edx ; int
lea ecx, [esp+70h+var_48]
call sub_10006B40
lea ecx, [esp+50h+var_48]
mov esi, eax
call sub_10006860
mov eax, esi
pop edi
pop esi
add esp, 48h
retn
EfuseBlow endp

2. FastBootErase

; Exported entry 2. FastBootErase

public FastBootErase
FastBootErase proc near

var_48= byte ptr -48h
Dest= byte ptr -44h
arg_0= dword ptr 4
arg_8= dword ptr 0Ch
arg_C= dword ptr 10h

sub esp, 48h
lea ecx, [esp+48h+var_48]
push esi
call sub_10006830
mov eax, [esp+4Ch+arg_8]
lea ecx, [esp+4Ch+Dest]
push eax
push offset aEraseS ; "erase:%s"
push ecx ; Dest
call ds:sprintf
mov edx, [esp+58h+arg_C]
add esp, 0Ch
mov ecx, [esp+4Ch+arg_0]
lea eax, [esp+4Ch+Dest]
push 0 ; int
push 0 ; int
push 0 ; int
push edx ; int
push 0 ; int
push 0 ; hFile
push eax ; int
push ecx ; int
lea ecx, [esp+6Ch+var_48]
call sub_10006B40
lea ecx, [esp+4Ch+var_48]
mov esi, eax
call sub_10006860
mov eax, esi
pop esi
add esp, 48h
retn
FastBootErase endp

3. FastBootFlash

; Exported entry 3. FastBootFlash

; int __cdecl FastBootFlash(int, int, int, LPCSTR lpFileName, int)
public FastBootFlash
FastBootFlash proc near

arg_0= dword ptr 4
arg_4= dword ptr 8
arg_8= dword ptr 0Ch
lpFileName= dword ptr 10h
arg_10= dword ptr 14h

mov eax, [esp+arg_10]
mov ecx, [esp+lpFileName]
mov edx, [esp+arg_8]
push 0 ; int
push eax ; int
mov eax, [esp+8+arg_4]
push ecx ; lpFileName
mov ecx, [esp+0Ch+arg_0]
push edx ; int
push eax ; int
push ecx ; int
call sub_10004480
add esp, 18h
retn
FastBootFlash endp

4. FastBootMultiFlash

; Exported entry 4. FastBootMultiFlash

; int __cdecl FastBootMultiFlash(int, int, int, LPCSTR lpFileName, int)
public FastBootMultiFlash
FastBootMultiFlash proc near

arg_0= dword ptr 4
arg_4= dword ptr 8
arg_8= dword ptr 0Ch
lpFileName= dword ptr 10h
arg_10= dword ptr 14h

mov eax, [esp+arg_10]
mov ecx, [esp+lpFileName]
mov edx, [esp+arg_8]
push 1 ; int
push eax ; int
mov eax, [esp+8+arg_4]
push ecx ; lpFileName
mov ecx, [esp+0Ch+arg_0]
push edx ; int
push eax ; int
push ecx ; int
call sub_10004480
add esp, 18h
retn
FastBootMultiFlash endp

5. FastBootOEMCommand

; Exported entry 5. FastBootOEMCommand

public FastBootOEMCommand
FastBootOEMCommand proc near

var_48= byte ptr -48h
Dest= byte ptr -44h
arg_0= dword ptr 4
arg_8= dword ptr 0Ch

sub esp, 48h
lea ecx, [esp+48h+var_48]
push esi
call sub_10006830
mov eax, [esp+4Ch+arg_8]
lea ecx, [esp+4Ch+Dest]
push eax
push offset aOemS ; "oem %s"
push ecx ; Dest
call ds:sprintf
add esp, 0Ch
mov eax, [esp+4Ch+arg_0]
lea edx, [esp+4Ch+Dest]
lea ecx, [esp+4Ch+var_48]
push 0 ; int
push 0 ; int
push 0 ; int
push 2710h ; int
push 0 ; int
push 0 ; hFile
push edx ; int
push eax ; int
call sub_10006B40
lea ecx, [esp+4Ch+var_48]
mov esi, eax
call sub_10006860
mov eax, esi
pop esi
add esp, 48h
retn
FastBootOEMCommand endp

6. FastBootReboot

; Exported entry 6. FastBootReboot

public FastBootReboot
FastBootReboot proc near

var_48= byte ptr -48h
var_44= dword ptr -44h
arg_0= dword ptr 4
arg_8= dword ptr 0Ch

sub esp, 48h
lea ecx, [esp+48h+var_48]
push esi
push edi
call sub_10006830
mov eax, [esp+50h+arg_8]
lea edx, [esp+50h+var_44]
test eax, eax
mov edi, offset aRebootBootload ; "reboot-bootloader"
jnz short loc_10004944

mov edi, offset aReboot ; "reboot"

loc_10004944:
or ecx, 0FFFFFFFFh
xor eax, eax
repne scasb
not ecx
sub edi, ecx
push 0 ; int
mov eax, ecx
mov esi, edi
mov edi, edx
mov edx, [esp+54h+arg_0]
shr ecx, 2
rep movsd
mov ecx, eax
push 0 ; int
and ecx, 3
push 0 ; int
rep movsb
push 3E8h ; int
push 0 ; int
lea ecx, [esp+64h+var_44]
push 0 ; hFile
push ecx ; int
push edx ; int
lea ecx, [esp+70h+var_48]
call sub_10006B40
lea ecx, [esp+50h+var_48]
mov esi, eax
call sub_10006860
mov eax, esi
pop edi
pop esi
add esp, 48h
retn
FastBootReboot endp