Function at 0x405970
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x9c
push ebx
push esi
xor esi, esi
push edi
lea eax, [esp + 0x20]
xor ebx, ebx
push eax
mov edi, 1
push 0xb
mov dword [esp + 0x18], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x20], esi
mov dword [esp + 0x28], edi
mov dword [esp + 0x44], esi
mov dword [esp + 0x38], esi
mov byte [esp + 0x17], bl
mov dword [esp + 0x58], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x48], esi
mov byte [esp + 0x1f], bl
mov dword [esp + 0x34], esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x5c], esi
call sub.libnvflash.dll_NvFlashCommandGetOption
add esp, 8
cmp dword [esp + 0x20], esi
jne 0x4059df
mov dword [esp + 0x20], edi
lea ecx, [esp + 0x50]
push ecx
push 0x19
call sub.libnvflash.dll_NvFlashCommandGetOption
add esp, 8
cmp dword [esp + 0x50], edi
jne 0x4059fe
mov dword [0x4c7fc4], 2
push ebp
lea edx, [esp + 0x34]
push edx
push 0xa
call sub.libnvflash.dll_NvFlashCommandGetOption
mov ebp, 0x40
add esp, 8
cmp dword [esp + 0x34], ebp
jne 0x405a27
push ebp
call fcn.0040c3b0
add esp, 4
call fcn.0040c360
cmp dword [esp + 0x24], edi
jne 0x405a90
cmp dword [esp + 0x34], ebp
je 0x405a90
cmp dword [0x4c7fc4], 2
je 0x405a90
lea eax, [esp + 0x40]
push eax
push 0x10
call sub.libnvflash.dll_NvFlashCommandGetOption
mov ecx, dword [esp + 0x48]
push ecx
lea edx, [esp + 0x2c]
push edx
call fcn.004010b0
mov ecx, dword [esp + 0x30]
add esp, 0x10
cmp ecx, esi
je 0x40631f
call fcn.00401260
mov ebx, eax
push ebx
mov dword [esp + 0x4c], ebx
call fcn.0040c3b0
add esp, 4
cmp byte [0x4c91f8], 0
je 0x405a9d
mov eax, dword [esp + 0x20]
push eax
call sub.libnvusbhost.dll_NvUsbDeviceClose
add esp, 4
cmp byte [0x4c91f8], 0
jne 0x405de3
cmp dword [esp + 0x24], edi
jne 0x405de3
cmp dword [esp + 0x34], ebp
je 0x405de3
cmp dword [0x4c7fc4], 2
je 0x405de3
mov ecx, dword [esp + 0x20]
push ebx
push ecx
lea edi, [esp + 0x64]
mov ebp, 3
call fcn.00401130
add esp, 8
test al, al
je 0x40631f
mov edx, dword [esp + 0x5c]
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
push edx
mov edx, dword [esp + 0x6c]
push eax
push ecx
push edx
push str.chip_uid_from_BR_is:_0x_.8x_.8x_.8x_.8x_n
call sub.libnvapputil.dll_NvAuPrintf
lea eax, [esp + 0x50]
push eax
push 0x12
call sub.libnvflash.dll_NvFlashCommandGetOption
mov eax, dword [esp + 0x58]
add esp, 0x1c
test eax, eax
je 0x405b85
push 0
mov ebp, 5
push ebp
lea ecx, [esp + 0x1c]
push ecx
push eax
call fcn.00401290
add esp, 0x10
test al, al
je 0x405b5d
cmp dword [0x4c7fc4], esi
jne 0x405b5d
push str.Sending_Enable_JTAG_command_n
call sub.libnvapputil.dll_NvAuPrintf
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x30]
push edx
push eax
push ecx
call fcn.004011c0
add esp, 0x10
test al, al
je 0x40631f
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x405b85
push 0
push 2
lea edx, [esp + 0x1c]
push edx
push eax
call fcn.00401290
add esp, 0x10
test al, al
jne 0x405beb
mov eax, str.query_rcm_version_parse_from_blob_failed
jmp 0x406310
cmp ebx, 0x30
jne 0x405ba5
lea eax, [esp + 0x14]
push eax
push 0
push ebp
push 0
push 0
push 0
push 0
push 0
push 6
call sub.libnvboothost.dll_NvBootHostRcmCreateMsgFromBuffer
jmp 0x405bde
cmp ebx, 0x40
jne 0x405bc5
lea ecx, [esp + 0x14]
push ecx
push 0
push ebp
push 0
push 0
push 0
push 0
push 0
push 6
call sub.libnvboothost.dll_NvBootHostT12xRcmCreateMsgFromBuffer
jmp 0x405bde
lea edx, [esp + 0x14]
push edx
push 0
push ebp
push 0
push 0
push 0
push 0
push 0
push 6
call sub.libnvboothost.dll_NvBootHostT1xxRcmCreateMsgFromBuffer
mov esi, eax
add esp, 0x24
test esi, esi
jne 0x40630b
cmp dword [0x4c7fc4], 0
jne 0x405c24
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x2c]
push eax
push ecx
push edx
call fcn.004011c0
mov bl, al
mov eax, dword [esp + 0x38]
push eax
push str.rcm_version_0X_x_n
call sub.libnvapputil.dll_NvAuPrintf
add esp, 0x14
test bl, bl
je 0x40631f
mov eax, dword [esp + 0x3c]
xor ebx, ebx
cmp eax, ebx
mov dword [esp + 0x14], ebx
je 0x405c55
push ebx
push 3
lea ecx, [esp + 0x1c]
push ecx
push eax
call fcn.00401290
add esp, 0x10
test al, al
jne 0x405daa
mov eax, str.download_execute_command_parse_from_blob_failed
jmp 0x406310
mov eax, dword [esp + 0x48]
cmp eax, 0x30
jne 0x405c75
mov dword [esp + 0x1c], section..data
mov edi, 0x34400
mov dword [esp + 0x28], 0x4000a000
jmp 0x405ca7
cmp eax, 0x35
jne 0x405c89
mov dword [esp + 0x1c], 0x479400
mov edi, 0x30c00
jmp 0x405c9f
cmp eax, 0x40
jne 0x405e00
mov dword [esp + 0x1c], 0x4aa000
mov edi, 0x15eec
mov dword [esp + 0x28], 0x4000e000
lea edx, [esp + 0x4c]
push edx
push 0x25
call sub.libnvflash.dll_NvFlashCommandGetOption
mov eax, dword [esp + 0x54]
add esp, 8
cmp eax, ebx
je 0x405d56
lea ecx, [esp + 0x38]
push ecx
push 1
push eax
mov dword [esp + 0x28], ebx
call sub.libnvos.dll_NvOsFopen
mov esi, eax
add esp, 0xc
cmp esi, ebx
je 0x405ce6
mov eax, str.file_open_failed
jmp 0x406310
mov eax, dword [esp + 0x38]
lea edx, [esp + 0x94]
push edx
push eax
call sub.libnvos.dll_NvOsFstat
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x405d0b
mov eax, str.file_stat_failed
jmp 0x406310
mov edi, dword [esp + 0x94]
push edi
call sub.libnvos.dll_NvOsAlloc
add esp, 4
cmp eax, ebx
mov dword [esp + 0x1c], eax
jne 0x405d32
mov esi, 6
mov eax, str.file_stat_failed
jmp 0x406310
mov edx, dword [esp + 0x38]
lea ecx, [esp + 0x58]
push ecx
push edi
push eax
push edx
call sub.libnvos.dll_NvOsFread
mov esi, eax
add esp, 0x10
cmp esi, ebx
je 0x405d56
mov eax, str.file_read_failed
jmp 0x406310
mov eax, dword [esp + 0x48]
cmp eax, 0x30
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x28]
jne 0x405d7d
lea eax, [esp + 0x14]
push eax
push ebx
push ebp
push ecx
push edi
push 4
push edx
push ebx
push 4
call sub.libnvboothost.dll_NvBootHostRcmCreateMsgFromBuffer
jmp 0x405d9d
cmp eax, 0x40
lea eax, [esp + 0x14]
push eax
push ebx
push ebp
push ecx
push edi
push 4
push edx
push ebx
push 4
jne 0x405d98
call sub.libnvboothost.dll_NvBootHostT12xRcmCreateMsgFromBuffer
jmp 0x405d9d
call sub.libnvboothost.dll_NvBootHostT1xxRcmCreateMsgFromBuffer
mov esi, eax
add esp, 0x24
cmp esi, ebx
jne 0x40630b
cmp dword [0x4c7fc4], ebx
jne 0x405dd1
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x2c]
push eax
push ecx
push edx
call fcn.004011c0
add esp, 0xc
test al, al
je 0x40631f
mov eax, dword [esp + 0x20]
push eax
call sub.libnvusbhost.dll_NvUsbDeviceClose
add esp, 4
mov edi, 1
push 0x4c7c08
call sub.libnvos.dll_NvOsGetSystemTime
mov esi, eax
add esp, 4
test esi, esi
je 0x405e14
mov eax, str.Getting_system_time_failed
jmp 0x406310
push str.UnKnown_device_found_n
call sub.libnvapputil.dll_NvAuPrintf
add esp, 4
xor bl, bl
jmp 0x4062d5
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x24]
push ecx
push edx
push 0x4c9200
call sub.libnv3p.dll_Nv3pOpen
mov esi, eax
add esp, 0xc
test esi, esi
je 0x405e3b
mov eax, str.connection_failed
jmp 0x406310
cmp byte [0x4c91f8], 0
jne 0x4062d3
cmp dword [esp + 0x24], 2
je 0x4062d3
lea eax, [esp + 0x13]
push eax
push 0x1d
call sub.libnvflash.dll_NvFlashCommandGetOption
add esp, 8
test eax, eax
jne 0x40631f
lea ecx, [esp + 0x50]
push ecx
push edi
call sub.libnvflash.dll_NvFlashCommandGetOption
add esp, 8
test eax, eax
jne 0x40631f
mov eax, dword [esp + 0x50]
cmp dword [eax], 0
je 0x405ea0
mov edx, dword [eax]
push edx
call sub.libnvflash.dll_nvflash_check_cfgtype
add esp, 4
test al, al
jne 0x405ea0
mov al, 1
mov byte [esp + 0x13], al
jmp 0x405ea4
mov al, byte [esp + 0x13]
test al, al
mov byte [0x4c91f4], al
je 0x405eba
push str.Skipping_BoardID_read_at_miniloader_level_n
call sub.libnvapputil.dll_NvAuPrintf
add esp, 4
mov eax, dword [0x4c9200]
push 0
push 0x4c91a0
push edi
push eax
call sub.libnv3p.dll_Nv3pCommandSend
add esp, 0x10
mov esi, eax
call fcn.00401f90
test al, al
jne 0x405ee5
mov eax, str.unable_to_retrieve_platform_info
jmp 0x406310
cmp dword [0x4c91b8], edi
je 0x405ef7
mov eax, str.unknown_bootrom_version
jmp 0x406310
lea ecx, [esp + 0x30]
push ecx
push 0x1f
call sub.libnvflash.dll_NvFlashCommandGetOption
add esp, 8
test eax, eax
je 0x405f23
push str.nvflash_connect
push str._s:_error_getting_NCT_part_info._n
call sub.libnvapputil.dll_NvAuPrintf
add esp, 8
xor bl, bl
jmp 0x4062d5
mov edx, dword [esp + 0x30]
cmp dword [edx], 0
jne 0x405f33
mov byte [0x4bfeed], 0
lea eax, [esp + 0x1b]
push eax
push 9
call sub.libnvflash.dll_NvFlashCommandGetOption
add esp, 8
cmp byte [esp + 0x1b], 0
je 0x40611f
cmp byte [0x4bfeed], 0
je 0x40611f
mov edx, dword [esp + 0x30]
mov eax, dword [edx]
lea ecx, [esp + 0x44]
push ecx
push edi
push eax
call sub.libnvos.dll_NvOsFopen
add esp, 0xc
test eax, eax
jne 0x40611f
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx]
push edx
push str.NCT_file__s_given_in_commandline_n
call sub.libnvapputil.dll_NvAuPrintf
push 0x14
lea eax, [esp + 0x78]
push 0
push eax
call sub.libnvos.dll_NvOsMemset
push 0x14
lea ecx, [esp + 0x98]
push 0
push ecx
call sub.libnvos.dll_NvOsMemset
push 5
lea edx, [esp + 0xa4]
push str.nVCt
push edx
call sub.libnvos.dll_NvOsMemcpy
lea eax, [esp + 0xac]
push edi
mov dword [esp + 0x9c], eax
call sub.libnvflash.dll_NvParseCaseSensitive
mov edx, dword [esp + 0x74]
lea ecx, [esp + 0x9c]
push ecx
push 0
push 0x4013d0
push edx
call sub.libnvflash.dll_nvflash_parser
mov eax, dword [esp + 0x84]
add esp, 0x40
test eax, eax
je 0x405fff
push eax
call sub.libnvos.dll_NvOsFclose
add esp, 4
mov ecx, dword [esp + 0x70]
xor edx, edx
mov dh, byte [ecx + 0x208d]
lea eax, [ecx + 0x208c]
add eax, 4
add eax, 4
add eax, 4
add eax, 4
add eax, 4
mov dl, byte [eax - 0x14]
add eax, 4
add eax, 4
add eax, 4
mov dword [0x4c9260], edx
xor edx, edx
mov dh, byte [eax - 0x1b]
mov dl, byte [eax - 0x1c]
mov dword [0x4c9264], edx
xor edx, edx
mov dh, byte [eax - 0x17]
mov dl, byte [eax - 0x18]
mov dword [0x4c9268], edx
xor edx, edx
mov dh, byte [eax - 0x13]
mov dl, byte [eax - 0x14]
mov dword [0x4c926c], edx
xor edx, edx
mov dh, byte [eax - 0xf]
mov dl, byte [eax - 0x10]
mov dword [0x4c9270], edx
xor edx, edx
mov dh, byte [eax - 0xb]
mov dl, byte [eax - 0xc]
mov dword [0x4c9274], edx
xor edx, edx
mov dh, byte [eax - 7]
mov dl, byte [eax - 8]
mov dword [0x4c9278], edx
xor edx, edx
mov dh, byte [eax - 3]
mov dl, byte [eax - 4]
mov dword [0x4c927c], edx
xor edx, edx
mov dh, byte [eax + 1]
mov dl, byte [eax]
mov eax, dword [esp + 0x74]
cmp eax, 0xa69c
mov dword [0x4c9280], edx
jbe 0x4060c0
xor edx, edx
mov dh, byte [ecx + 0xa69d]
mov dl, byte [ecx + 0xa69c]
mov dword [0x4c9298], edx
cmp eax, 0xa28c
jbe 0x40611f
add ecx, 0xa28c
xor eax, eax
sub ecx, 0x4c9284
jmp 0x4060e0
mov dl, byte [eax + ecx + 0x4c9284]
mov byte [eax + 0x4c9284], dl
add eax, edi
cmp eax, 0x14
jb 0x4060e0
cmp dword [0x4c91dc], 0
jne 0x40611f
mov eax, dword [0x4c9260]
mov ecx, dword [0x4c9268]
mov edx, dword [0x4c9264]
mov dword [0x4c91dc], eax
mov dword [0x4c91e0], ecx
mov dword [0x4c91ec], edx
mov bx, word [0x4c91b0]
cmp bx, 0x30
mov eax, dword [0x4c91b4]
jne 0x40613c
test eax, eax
jne 0x40614b
mov esi, str.development
jmp 0x406150
cmp bx, 0x35
jne 0x40614b
test eax, eax
mov esi, str.development
je 0x406150
mov esi, str.unknown
cmp byte [0x4c91d2], 0
mov edi, str.true
jne 0x406163
mov edi, str.false
cmp byte [0x4c91d8], 0
mov edx, str.enabled
jne 0x406176
mov edx, str.disabled
cmp byte [0x4c91d0], 0
mov ecx, str.enabled
jne 0x406189
mov ecx, str.disabled
cmp byte [0x4c91d1], 0
mov eax, str.enabled
jne 0x40619c
mov eax, str.disabled
mov ebp, dword [0x4c91f0]
push ebp
push dword [0x4c91dc]
push edi
push edx
mov edx, dword [0x4c91a8]
push ecx
mov ecx, dword [0x4c91a4]
push eax
mov eax, dword [0x4c91a0]
push eax
mov eax, dword [0x4c91ac]
push ecx
mov ecx, dword [0x4c91b4]
push edx
movzx edx, byte [0x4c91b3]
push eax
movzx eax, byte [0x4c91b2]
push ecx
push edx
push eax
movzx ecx, bx
push ecx
push esi
push str.System_Information:_n___chip_name:__s_n___chip_id:_0x_x_major:__d_minor:__d_n___chip_sku:_0x_x_n___chip_uid:_0x_.8x_.8x_.8x_.8x_n___macrovision:__s_n___hdcp:__s_n___jtag:__s_n___sbk_burned:__s_n___board_id:__d_n___warranty_fuse:__d_n
call sub.libnvapputil.dll_NvAuPrintf
mov eax, dword [0x4c91d4]
add esp, 0x40
cmp eax, 1
jne 0x406201
mov eax, str.false
jmp 0x406210
cmp eax, 2
mov eax, str.true
je 0x406210
mov eax, str.unknown
push eax
push str.___dk_burned:__s_n
call sub.libnvapputil.dll_NvAuPrintf
mov eax, dword [0x4c91bc]
add eax, 0xffffffff
add esp, 8
cmp eax, 9
ja case.0x40622b.6
jmp dword [eax*4 + 0x406324]
mov eax, str.nand
jmp 0x40626f
mov eax, str.emmc
jmp 0x40626f
mov eax, 0x4335ac
jmp 0x40626f
mov eax, 0x433fbc
jmp 0x40626f
mov eax, str.nand_x16
jmp 0x40626f
mov eax, str.usb3
jmp 0x40626f
mov eax, str.sata
jmp 0x40626f
mov eax, str.snor
jmp 0x40626f
mov eax, str.unknown
push eax
push str.___boot_device:__s_n
call sub.libnvapputil.dll_NvAuPrintf
mov edx, dword [0x4c91cc]
mov eax, dword [0x4c91c8]
mov ecx, dword [0x4c91c4]
push edx
mov edx, dword [0x4c91c0]
push eax
push ecx
push edx
push str.___operating_mode:__d_n___device_config_strap:__d_n___device_config_fuse:__d_n___sdram_config_strap:__d_n
call sub.libnvapputil.dll_NvAuPrintf
push 0x432544
call sub.libnvapputil.dll_NvAuPrintf
mov eax, dword [0x4c91c0]
push 0x4c91a0
mov dword [0x4c7fa8], eax
call fcn.0040c3d0
push str.RCM_communication_completed_n
call sub.libnvapputil.dll_NvAuPrintf
add esp, 0x28
call fcn.004057f0
test al, al
je 0x40631f
mov bl, 1
mov eax, dword [esp + 0x38]
test eax, eax
pop ebp
je 0x4062e7
push eax
call sub.libnvos.dll_NvOsFclose
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4062ff
cmp dword [esp + 0x48], 0
je 0x4062ff
push eax
call sub.libnvos.dll_NvOsFree
add esp, 4
pop edi
pop esi
mov al, bl
pop ebx
add esp, 0x9c
ret
mov eax, str.miniloader_message_create_failed
push esi
push eax
push str._s_NvError_0x_x_n
call sub.libnvapputil.dll_NvAuPrintf
add esp, 0xc
xor bl, bl
jmp 0x4062d5