Function at 0x46b540
Capabilities:
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6a4b3d
mov eax, dword fs:[0]
push eax
sub esp, 0xccc
mov eax, dword [0x7e2670]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0xcc0], ecx
cmp dword [ebp + 8], 0
je 0x46b586
mov eax, dword [ebp - 0xcc0]
cmp dword [eax + 0x104], 0
jg 0x46b59b
push str.param_error_filepath_or_com_is_null.
call fcn.0066610b
add esp, 4
or eax, 0xffffffff
jmp 0x46c0d6
mov ecx, dword [ebp - 0xcc0]
mov edx, dword [ebp + 8]
mov dword [ecx + 0x10c], edx
mov eax, dword [ebp - 0xcc0]
mov ecx, dword [eax + 0x10c]
push ecx
push 0x6f2528
push 0x6f2534
call fcn.0066610b
add esp, 0xc
mov edx, dword [ebp - 0xcc0]
mov eax, dword [edx + 0x104]
push eax
push 0x6f253c
push 0x6f2540
call fcn.0066610b
add esp, 0xc
mov byte [ebp - 0x414], 0
push 0x3ff
push 0
lea ecx, [ebp - 0x413]
push ecx
call fcn.006665c0
add esp, 0xc
mov byte [ebp - 0x79c], 0
push 0x103
push 0
lea edx, [ebp - 0x79b]
push edx
call fcn.006665c0
add esp, 0xc
mov byte [ebp - 0x584], 0
push 0x103
push 0
lea eax, [ebp - 0x583]
push eax
call fcn.006665c0
add esp, 0xc
mov byte [ebp - 0x68c], 0
push 0x103
push 0
lea ecx, [ebp - 0x68b]
push ecx
call fcn.006665c0
add esp, 0xc
mov dword [ebp - 0x694], 0xffffffff
mov byte [ebp - 0x8b4], 0
push 0x103
push 0
lea edx, [ebp - 0x8b3]
push edx
call fcn.006665c0
add esp, 0xc
lea eax, [ebp - 0x8b4]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov byte [ebp - 0x68d], 0
mov dword [ebp - 0x8b8], 0
jmp 0x46b6b7
mov ecx, dword [ebp - 0x8b8]
add ecx, 1
mov dword [ebp - 0x8b8], ecx
cmp dword [ebp - 0x8b8], 3
jg 0x46c0c3
push 0x400
push 0
lea edx, [ebp - 0x414]
push edx
call fcn.006665c0
add esp, 0xc
push 0x104
push 0
lea eax, [ebp - 0x584]
push eax
call fcn.006665c0
add esp, 0xc
push 0x104
push 0
lea ecx, [ebp - 0x68c]
push ecx
call fcn.006665c0
add esp, 0xc
push 0x104
push 0
lea edx, [ebp - 0x79c]
push edx
call fcn.006665c0
add esp, 0xc
push 0x104
lea eax, [ebp - 0x79c]
push eax
call fcn.0049f360
add esp, 8
lea ecx, [ebp - 0x79c]
push ecx
lea ecx, [ebp - 0x8bc]
call fcn.0040dbe0
mov dword [ebp - 4], 0
push 0x6f2548
lea edx, [ebp - 0x8bc]
push edx
call fcn.0040e0f0
add esp, 8
push 0
lea ecx, [ebp - 0x8bc]
call fcn.004018a0
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push str._binMH1905
lea eax, [ebp - 0x79c]
push eax
call fcn.00666bb0
add esp, 8
push str.Meghunt_Flash_Tool.exe
lea ecx, [ebp - 0x79c]
push ecx
call fcn.00666bb0
add esp, 8
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x584]
push eax
call fcn.00666ba0
add esp, 8
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x68c]
push edx
call fcn.00666ba0
add esp, 8
mov byte [ebp - 0xcbc], 0
push 0x3ff
push 0
lea eax, [ebp - 0xcbb]
push eax
call fcn.006665c0
add esp, 0xc
mov ecx, dword [ebp - 0x8b8]
mov dword [ebp - 0xcc4], ecx
cmp dword [ebp - 0xcc4], 3
ja case.default.0x46b7fb
mov edx, dword [ebp - 0xcc4]
jmp dword [edx*4 + 0x46c0f4]
push 0x6f2578
lea eax, [ebp - 0x584]
push eax
call fcn.00666bb0
add esp, 8
push 0x6f2588
lea ecx, [ebp - 0x68c]
push ecx
call fcn.00666bb0
add esp, 8
mov edx, dword [ebp - 0xcc0]
mov eax, dword [edx + 0x104]
push eax
lea ecx, [ebp - 0x68c]
push ecx
lea edx, [ebp - 0x584]
push edx
lea eax, [ebp - 0x79c]
push eax
push str._s__d___s___x___s___p_COM_d__b_115200__t_NAND__c_otp_read__r
lea ecx, [ebp - 0x414]
push ecx
call fcn.0066926d
add esp, 0x18
push str.download_fdl_SIG.bin_pax_secure_config.xml_otp_read_r_n
lea edx, [ebp - 0xcbc]
push edx
call fcn.00666ba0
add esp, 8
push str.dlcid30___r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp case.default.0x46b7fb
push 0x6f2628
lea eax, [ebp - 0x584]
push eax
call fcn.00666bb0
add esp, 8
push str.pax_secure_config.xml
lea ecx, [ebp - 0x68c]
push ecx
call fcn.00666bb0
add esp, 8
mov edx, dword [ebp - 0xcc0]
mov eax, dword [edx + 0x104]
push eax
lea ecx, [ebp - 0x68c]
push ecx
lea edx, [ebp - 0x584]
push edx
lea eax, [ebp - 0x79c]
push eax
push str._s__d___s___x___s___p_COM_d__b_115200__t_NAND__c_otp_write__r
lea ecx, [ebp - 0x414]
push ecx
call fcn.0066926d
add esp, 0x18
push str.download_fdl_SIG.bin_pax_secure_config.xml_otp_write_r_n
lea edx, [ebp - 0xcbc]
push edx
call fcn.00666ba0
add esp, 8
push str.dlcid50___r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp case.default.0x46b7fb
push 0x6f26d8
lea eax, [ebp - 0x584]
push eax
call fcn.00666bb0
add esp, 8
mov ecx, dword [ebp - 0xcc0]
mov edx, dword [ecx + 0x104]
push edx
lea eax, [ebp - 0x584]
push eax
lea ecx, [ebp - 0x79c]
push ecx
push str._s__d___s___p_COM_d__b_115200__t_NAND__c_download__r
lea edx, [ebp - 0x414]
push edx
call fcn.0066926d
add esp, 0x14
push str.download_fdl_SIG.bin_r_n
lea eax, [ebp - 0xcbc]
push eax
call fcn.00666ba0
add esp, 8
push str.dlcid75___r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp case.default.0x46b7fb
movzx ecx, byte [ebp - 0x68d]
cmp ecx, 1
jne 0x46bbb3
push 0x64
push 0
lea edx, [ebp - 0x47c]
push edx
call fcn.006665c0
add esp, 0xc
lea eax, [ebp - 0x7ac]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx ecx, word [ebp - 0x7a8]
test ecx, ecx
jne 0x46b9ed
mov dword [ebp - 0xcc8], 7
jmp 0x46b9fa
movzx edx, word [ebp - 0x7a8]
mov dword [ebp - 0xcc8], edx
mov ax, word [ebp - 0xcc8]
mov word [ebp - 0x7a8], ax
lea ecx, [ebp - 0x7ac]
push ecx
mov ecx, dword [ebp - 0xcc0]
call fcn.0046b280
movzx edx, word [ebp - 0x7a8]
push edx
movzx eax, word [ebp - 0x7a0]
push eax
movzx ecx, word [ebp - 0x7a2]
push ecx
movzx edx, word [ebp - 0x7a4]
push edx
movzx eax, word [ebp - 0x7a6]
push eax
movzx ecx, word [ebp - 0x7aa]
push ecx
movzx eax, word [ebp - 0x7ac]
cdq
mov ecx, 0x64
idiv ecx
push edx
push 0x6f2748
lea edx, [ebp - 0x47c]
push edx
call fcn.0066926d
add esp, 0x24
lea eax, [ebp - 0x47c]
push eax
push 0x6f2768
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
push str.promptcid_flag_off_r_n
call fcn.0066610b
add esp, 4
push str.promptPlease_close_the_MH1905_short_point_r_n
call fcn.0066610b
add esp, 4
push str.tips:_sleep_3s_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x64
push 0
lea ecx, [ebp - 0x47c]
push ecx
call fcn.006665c0
add esp, 0xc
lea edx, [ebp - 0x7ac]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [ebp - 0x7a8]
test eax, eax
jne 0x46bb0d
mov dword [ebp - 0xccc], 7
jmp 0x46bb1a
movzx ecx, word [ebp - 0x7a8]
mov dword [ebp - 0xccc], ecx
mov dx, word [ebp - 0xccc]
mov word [ebp - 0x7a8], dx
lea eax, [ebp - 0x7ac]
push eax
mov ecx, dword [ebp - 0xcc0]
call fcn.0046b280
movzx ecx, word [ebp - 0x7a8]
push ecx
movzx edx, word [ebp - 0x7a0]
push edx
movzx eax, word [ebp - 0x7a2]
push eax
movzx ecx, word [ebp - 0x7a4]
push ecx
movzx edx, word [ebp - 0x7a6]
push edx
movzx eax, word [ebp - 0x7aa]
push eax
movzx eax, word [ebp - 0x7ac]
cdq
mov ecx, 0x64
idiv ecx
push edx
push 0x6f27d0
lea edx, [ebp - 0x47c]
push edx
call fcn.0066926d
add esp, 0x24
lea eax, [ebp - 0x47c]
push eax
push 0x6f27f0
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
push str._fdl_SIG.bin
lea ecx, [ebp - 0x584]
push ecx
call fcn.00666bb0
add esp, 8
push str.program_pax.xml
lea edx, [ebp - 0x68c]
push edx
call fcn.00666bb0
add esp, 8
mov eax, dword [ebp - 0xcc0]
mov ecx, dword [eax + 0x104]
push ecx
lea edx, [ebp - 0x68c]
push edx
lea eax, [ebp - 0x584]
push eax
lea ecx, [ebp - 0x79c]
push ecx
push str._s__d___s___s___s___p_COM_d__b_115200__t_NAND__c_download__r
lea edx, [ebp - 0x414]
push edx
call fcn.0066926d
add esp, 0x18
push str.download_fdl_SIG.bin_program_pax.xml_download_r_n
lea eax, [ebp - 0xcbc]
push eax
call fcn.00666ba0
add esp, 8
push str.dlcid85___r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
push 0
lea ecx, [ebp - 0x584]
push ecx
call fcn.0066a29a
add esp, 8
cmp eax, 0xffffffff
jne 0x46bc9f
lea edx, [ebp - 0x584]
push edx
push 0x6f28a0
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov dword [ebp - 0x694], 0xffffffff
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x8bc]
call fcn.004014d0
jmp 0x46c0c3
push 0
lea eax, [ebp - 0x68c]
push eax
call fcn.0066a29a
add esp, 8
cmp eax, 0xffffffff
jne 0x46bcfb
lea ecx, [ebp - 0x584]
push ecx
push str.error:file__s_is_not_exists._r_n
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov dword [ebp - 0x694], 0xffffffff
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x8bc]
call fcn.004014d0
jmp 0x46c0c3
lea edx, [ebp - 0xcbc]
push edx
lea eax, [ebp - 0x414]
push eax
mov ecx, dword [ebp - 0xcc0]
call fcn.0046c120
mov dword [ebp - 0x694], eax
cmp dword [ebp - 0x694], 0
je 0x46bd3a
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x8bc]
call fcn.004014d0
jmp 0x46c0c3
cmp dword [ebp - 0x8b8], 1
je 0x46bd4c
cmp dword [ebp - 0x8b8], 0
jne 0x46bd5d
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
cmp dword [ebp - 0x8b8], 0
jne 0x46bec9
mov ecx, dword [ebp - 0xcc0]
mov edx, dword [ecx + 0x110]
mov dword [ebp - 0xcd0], edx
cmp dword [ebp - 0xcd0], 4
ja case.default.0x46bd8f
mov eax, dword [ebp - 0xcd0]
jmp dword [eax*4 + 0x46c104]
mov dword [ebp - 0x694], 0xffffffff
push 0x6f28e0
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp 0x46be94
push str.Tips:SECURE_STAGE:_WAFER_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp 0x46be94
push str.Tips:SECURE_STAGE:_CHIP_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp 0x46be94
push str.Tips:SECURE_STAGE:_DEVICE_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
jmp 0x46be94
push str.Tips:SECURE_STAGE:_SECURE_r_n
call fcn.0066610b
add esp, 4
push str.Tips:already_otp_write_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov byte [ebp - 0x68d], 1
mov ecx, dword [ebp - 0x8b8]
add ecx, 1
mov dword [ebp - 0x8b8], ecx
jmp 0x46be94
mov dword [ebp - 0x694], 0xffffffff
push str.ReadSecureStagefail_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov edx, dword [ebp - 0xcc0]
cmp dword [edx + 0x110], 0
je 0x46beb2
mov eax, dword [ebp - 0xcc0]
cmp dword [eax + 0x110], 4
jle 0x46bec9
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x8bc]
call fcn.004014d0
jmp 0x46c0c3
push 0x64
push 0
lea ecx, [ebp - 0x47c]
push ecx
call fcn.006665c0
add esp, 0xc
lea edx, [ebp - 0x7ac]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [ebp - 0x7a8]
test eax, eax
jne 0x46bf00
mov dword [ebp - 0xcd4], 7
jmp 0x46bf0d
movzx ecx, word [ebp - 0x7a8]
mov dword [ebp - 0xcd4], ecx
mov dx, word [ebp - 0xcd4]
mov word [ebp - 0x7a8], dx
lea eax, [ebp - 0x7ac]
push eax
mov ecx, dword [ebp - 0xcc0]
call fcn.0046b280
movzx ecx, word [ebp - 0x7a8]
push ecx
movzx edx, word [ebp - 0x7a0]
push edx
movzx eax, word [ebp - 0x7a2]
push eax
movzx ecx, word [ebp - 0x7a4]
push ecx
movzx edx, word [ebp - 0x7a6]
push edx
movzx eax, word [ebp - 0x7aa]
push eax
movzx eax, word [ebp - 0x7ac]
cdq
mov ecx, 0x64
idiv ecx
push edx
push 0x6f299c
lea edx, [ebp - 0x47c]
push edx
call fcn.0066926d
add esp, 0x24
lea eax, [ebp - 0x47c]
push eax
push 0x6f29bc
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
push str.Tips:Sleep_3s_r_n
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x64
push 0
lea ecx, [ebp - 0x47c]
push ecx
call fcn.006665c0
add esp, 0xc
lea edx, [ebp - 0x7ac]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [ebp - 0x7a8]
test eax, eax
jne 0x46c006
mov dword [ebp - 0xcd8], 7
jmp 0x46c013
movzx ecx, word [ebp - 0x7a8]
mov dword [ebp - 0xcd8], ecx
mov dx, word [ebp - 0xcd8]
mov word [ebp - 0x7a8], dx
lea eax, [ebp - 0x7ac]
push eax
mov ecx, dword [ebp - 0xcc0]
call fcn.0046b280
movzx ecx, word [ebp - 0x7a8]
push ecx
movzx edx, word [ebp - 0x7a0]
push edx
movzx eax, word [ebp - 0x7a2]
push eax
movzx ecx, word [ebp - 0x7a4]
push ecx
movzx edx, word [ebp - 0x7a6]
push edx
movzx eax, word [ebp - 0x7aa]
push eax
movzx eax, word [ebp - 0x7ac]
cdq
mov ecx, 0x64
idiv ecx
push edx
push 0x6f29d8
lea edx, [ebp - 0x47c]
push edx
call fcn.0066926d
add esp, 0x24
lea eax, [ebp - 0x47c]
push eax
push str.time:_s_r_n
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x8bc]
call fcn.004014d0
jmp 0x46b6a8
lea ecx, [ebp - 0x8b4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [ebp - 0x694]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.006665ac
mov esp, ebp
pop ebp
ret 4