Function at 0x40a8b0
Capabilities:
Access peb ldr_data
Create directory
Get ntdll base address
Resolve function by parsing pe exports
Set file attributes

Disassembly:
push 0xffffffffffffffff
push 0x4a7180
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2e8
push ebx
push ebp
push esi
lea eax, [esp + 0x4c]
push edi
mov ebp, ecx
push eax
mov dword [esp + 0x28], ebp
call sub.MFC42.DLL_CTime::GetTickCount
mov ecx, dword [eax]
mov dword [esp + 0x30], ecx
lea ecx, [esp + 0x3c]
call sub.MFC42.DLL_CString::CString_1
push 0
lea ecx, [esp + 0x34]
mov dword [esp + 0x304], 0
call sub.MFC42.DLL_CTime::GetLocalTm
mov esi, dword [eax + 0x14]
push 0
lea ecx, [esp + 0x34]
add esi, 0x76c
call sub.MFC42.DLL_CTime::GetLocalTm
mov edi, dword [eax + 0xc]
push 0
lea ecx, [esp + 0x34]
call sub.MFC42.DLL_CTime::GetLocalTm
mov eax, dword [eax + 0x10]
push esi
inc eax
push edi
push eax
lea edx, [esp + 0x48]
push str._02d__02d__d
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0x14
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString_1
lea ecx, [esp + 0x14]
mov byte [esp + 0x300], 1
call sub.MFC42.DLL_CString::CString_1
lea ecx, [esp + 0x34]
mov byte [esp + 0x300], 2
call sub.MFC42.DLL_CString::CString_1
lea ecx, [esp + 0x28]
mov byte [esp + 0x300], 3
call sub.MFC42.DLL_CString::CString_1
lea ecx, [esp + 0x48]
mov byte [esp + 0x300], 4
call sub.MFC42.DLL_CString::CString_1
push str._n
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 5
call fcn.004a5764
lea eax, [esp + 0x10]
push str.Machine:
lea ecx, [esp + 0x24]
push eax
push ecx
call sub.MFC42.DLL_operator_1
lea edx, [ebp + 0x3d6c]
mov byte [esp + 0x300], 6
push edx
push eax
lea eax, [esp + 0x24]
push eax
call sub.MFC42.DLL_operator
mov bl, 7
push 0x4e00a0
lea ecx, [esp + 0x1c]
push eax
mov byte [esp + 0x308], bl
push ecx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 8
call fcn.004a5776
lea ecx, [esp + 0x18]
mov byte [esp + 0x300], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x300], 6
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x20]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
lea edx, [esp + 0x38]
push str._H:_M:_S
push edx
lea ecx, [esp + 0x38]
call sub.MFC42.DLL_CTime::Format
mov esi, eax
lea eax, [esp + 0x10]
push str.LogTime:
lea ecx, [esp + 0x1c]
push eax
push ecx
mov byte [esp + 0x30c], 9
call sub.MFC42.DLL_operator_1
push esi
lea edx, [esp + 0x20]
push eax
push edx
mov byte [esp + 0x30c], 0xa
call sub.MFC42.DLL_operator
push 0x4e00a0
push eax
lea eax, [esp + 0x28]
mov bl, 0xb
push eax
mov byte [esp + 0x30c], bl
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 0xc
call fcn.004a5776
lea ecx, [esp + 0x20]
mov byte [esp + 0x300], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x300], 0xa
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
mov byte [esp + 0x300], 9
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x38]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
xor edi, edi
mov esi, 0x4e5bd4
lea ecx, [esp + 0x10]
push str.________________________________n
lea edx, [esp + 0x3c]
push ecx
push edx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 0xd
call fcn.004a5776
lea ecx, [esp + 0x38]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
cmp dword [esi], 0
jne 0x40ab4a
inc edi
lea eax, [esp + 0x14]
push edi
push str.Port_02d:_No_Device_n
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::operator_1
jmp 0x40b013
lea eax, [edi + 1]
lea edx, [esp + 0x14]
push eax
push str.Port_02d:_Connected_n
push edx
mov dword [esp + 0x24], eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x70]
push edi
push ecx
mov ecx, ebp
call fcn.0040b320
mov edi, eax
lea edx, [esp + 0x10]
push str.CtlType:
lea eax, [esp + 0x58]
push edx
push eax
mov byte [esp + 0x30c], 0xe
call sub.MFC42.DLL_operator_1
push edi
lea ecx, [esp + 0x20]
push eax
push ecx
mov byte [esp + 0x30c], 0xf
call sub.MFC42.DLL_operator
push 0x4e00a0
lea edx, [esp + 0x24]
push eax
push edx
mov byte [esp + 0x30c], 0x10
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 0x11
call fcn.004a5776
lea ecx, [esp + 0x20]
mov byte [esp + 0x300], 0x10
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x300], 0xf
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x54]
mov byte [esp + 0x300], 0xe
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x70]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
mov eax, dword [esi]
lea edx, [esp + 0x14]
mov ecx, dword [eax + 0x9c]
push ecx
push str.Flash:__s_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
mov edx, dword [esi]
mov eax, dword [edx + 0xb8]
test eax, eax
je 0x40ad4e
lea ecx, [esp + 0x10]
push str.Status:_Fail_n
lea edx, [esp + 0x70]
push ecx
push edx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 0x12
call fcn.004a5776
lea ecx, [esp + 0x6c]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
lea eax, [esp + 0x10]
push str.ElapsedTime:
lea ecx, [esp + 0x50]
push eax
push ecx
call sub.MFC42.DLL_operator_1
mov edx, dword [esi]
mov byte [esp + 0x300], 0x13
add edx, 0xb0
push edx
push eax
lea eax, [esp + 0x4c]
push eax
call sub.MFC42.DLL_operator
push 0x4e00a0
lea ecx, [esp + 0x54]
push eax
push ecx
mov byte [esp + 0x30c], 0x14
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 0x15
call fcn.004a5776
lea ecx, [esp + 0x50]
mov byte [esp + 0x300], 0x14
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x44]
mov byte [esp + 0x300], 0x13
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x4c]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
mov edx, dword [esi]
lea ecx, [esp + 0x14]
mov eax, dword [edx + 0xb8]
push eax
push str.ErrorCode:_0x_08X_n
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea edx, [esp + 0x14]
lea ecx, [esp + 0x10]
push edx
call sub.MFC42.DLL_CString::operator_1
mov edi, dword [esp + 0x18]
jmp 0x40b013
mov ecx, 0x80
xor eax, eax
lea edi, [esp + 0xf8]
rep stosd dword es:[edi], eax
lea eax, [esp + 0xf8]
mov ecx, dword [edx + 0x1c]
push eax
push 1
push 0
push 0
push 0
push 0
push 0
push 1
push 0x51
push 0x82
push ecx
call fcn.00482460
movzx ax, byte [esp + 0x130]
movzx cx, byte [esp + 0x132]
xor edx, edx
xor ebx, ebx
mov dh, byte [esp + 0x131]
mov bh, byte [esp + 0x133]
or edx, eax
or ebx, ecx
mov ecx, 8
xor eax, eax
lea edi, [esp + 0xc4]
mov ebp, edx
rep stosd dword es:[edi], eax
mov ecx, 0x10
lea edi, [esp + 0xe4]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x126]
mov ecx, dword [esp + 0x127]
and eax, 0xff
and ecx, 0xff
xor edx, edx
add esp, 0x2c
lea edi, [ecx + eax + 0x16]
mov dword [esp + 0x74], edx
mov dword [esp + 0x78], edx
push 9
lea eax, [esp + edi + 0xfc]
lea ecx, [esp + 0x78]
mov dword [esp + 0x80], edx
push eax
push ecx
mov dword [esp + 0x8c], edx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea edx, [esp + 0x74]
lea ecx, [esp + 0x34]
push edx
call fcn.004a5764
lea ecx, [esp + 0x34]
call sub.MFC42.DLL_CString::TrimRight
add edi, 8
push 0x11
lea ecx, [esp + 0x9c]
lea eax, [esp + edi + 0xfc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea edx, [esp + 0x98]
lea ecx, [esp + 0x28]
push edx
call fcn.004a5764
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CString::TrimRight
mov eax, dword [esp + 0x178]
xor edi, edi
and eax, 0xff
sub eax, 2
cdq
sub eax, edx
sar eax, 1
test eax, eax
jle 0x40ae97
lea ecx, [esp + 0x17a]
mov dl, byte [ecx]
add ecx, 2
mov byte [esp + edi + 0xb8], dl
inc edi
cmp edi, eax
jl 0x40ae86
lea eax, [esp + 0xb8]
lea ecx, [esp + 0x48]
push eax
call fcn.004a5764
lea ecx, [esp + 0x10]
push str.Status:_OK_n
lea edx, [esp + 0x44]
push ecx
push edx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x304], 0x16
call fcn.004a5776
lea ecx, [esp + 0x40]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
mov eax, dword [esi]
lea edx, [esp + 0x14]
mov ecx, dword [eax + 0xac]
shr ecx, 0xb
push ecx
push str.Capacity:__d_MB_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
and ebx, 0xffff
and ebp, 0xffff
push ebx
push ebp
lea ecx, [esp + 0x1c]
push str.VID_PID:__04X__04X_n
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0x10
lea edx, [esp + 0x14]
lea ecx, [esp + 0x10]
push edx
call sub.MFC42.DLL_CString::operator_1
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
push eax
push ecx
lea edx, [esp + 0x1c]
push str.Inquiry:__s__s_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0x10
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
mov ecx, dword [esp + 0x48]
lea edx, [esp + 0x14]
push ecx
push str.Serial_Number:__s_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
mov ecx, dword [esi]
xor edx, edx
mov al, byte [ecx + 0xa0]
test al, al
setne dl
inc edx
lea eax, [esp + 0x14]
push edx
push str.Operating_Mode:__d_Channel_n
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::operator_1
mov edx, dword [esi]
lea ecx, [esp + 0x14]
mov eax, dword [edx + 0xa8]
push eax
push str.Total_Bad_Block:__d_n
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea edx, [esp + 0x14]
lea ecx, [esp + 0x10]
push edx
call sub.MFC42.DLL_CString::operator_1
mov eax, dword [esi]
lea edx, [esp + 0x14]
mov ecx, dword [eax + 0xb0]
push ecx
push str.Elapsed_Time:__s_n_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator_1
mov edi, dword [esp + 0x18]
mov ebp, dword [esp + 0x24]
add esi, 4
cmp esi, 0x4e5c14
jl 0x40aae7
lea esi, [ebp + 0x3dc4]
push 0x4dff44
lea ecx, [esp + 0x28]
push esi
push ecx
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
mov edi, dword [sym.imp.SHLWAPI.dll_PathIsDirectoryA]
push eax
call edi
test eax, eax
lea ecx, [esp + 0x24]
sete bl
call sub.MFC42.DLL_CString::CString
test bl, bl
mov ebx, dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
je 0x40b07b
push 0x4dff44
lea edx, [esp + 0x28]
push esi
push edx
call sub.MFC42.DLL_operator_1
mov eax, dword [eax]
push 0
push eax
call ebx
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString
mov eax, dword [ebp + 0x3d70]
lea esi, [ebp + 0x3d70]
push eax
call edi
test eax, eax
jne 0x40b095
mov eax, dword [esi]
push 0
push eax
call ebx
lea ecx, [esp + 0x2c]
call sub.MFC42.DLL_CString::CString_1
push 0x4df2e0
lea eax, [esp + 0x48]
mov bl, 0x17
push esi
push eax
mov byte [esp + 0x30c], bl
call sub.MFC42.DLL_operator_1
lea ecx, [esp + 0x3c]
lea edx, [esp + 0x4c]
push ecx
push eax
push edx
mov byte [esp + 0x30c], 0x18
call sub.MFC42.DLL_operator
push str..log
push eax
lea eax, [esp + 0x48]
mov byte [esp + 0x308], 0x19
push eax
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x30]
mov byte [esp + 0x304], 0x1a
call fcn.004a5776
lea ecx, [esp + 0x40]
mov byte [esp + 0x300], 0x19
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x4c]
mov byte [esp + 0x300], 0x18
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x44]
mov byte [esp + 0x300], bl
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x2c]
push 0x80
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea ecx, [esp + 0x84]
call fcn.004a5908
lea ecx, [esp + 0x58]
mov byte [esp + 0x300], 0x1b
call sub.MFC42.DLL_CException::CException
lea ecx, [esp + 0x68]
mov byte [esp + 0x300], 0x1c
call sub.MFC42.DLL_CString::CString_1
mov edi, 0x4ae3a0
or esi, 0xffffffff
push 0
lea ecx, [esp + 0x6c]
mov byte [esp + 0x304], 0x1d
mov dword [esp + 0x5c], edi
mov dword [esp + 0x64], 0
mov dword [esp + 0x68], esi
call fcn.004a5764
mov eax, dword [esp + 0x2c]
lea edx, [esp + 0x58]
push edx
push 0x7002
push eax
lea ecx, [esp + 0x90]
mov byte [esp + 0x30c], 0x1e
call sub.MFC42.DLL_CStdioFile::Open
mov edx, dword [esp + 0x84]
push 2
push 0
lea ecx, [esp + 0x8c]
call dword [edx + 0x30]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x84]
push eax
call sub.MFC42.DLL_CStdioFile::WriteString
lea ecx, [esp + 0x84]
call sub.MFC42.DLL_CStdioFile::Close
mov dword [esp + 0x58], edi
lea ecx, [esp + 0x68]
mov byte [esp + 0x300], 0x1f
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x84]
mov dword [esp + 0x58], 0x4ae35c
mov byte [esp + 0x300], bl
call sub.MFC42.DLL_CStdioFile::CStdioFile
lea ecx, [esp + 0x2c]
mov byte [esp + 0x300], 5
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x48]
mov byte [esp + 0x300], 4
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x28]
mov byte [esp + 0x300], 3
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x34]
mov byte [esp + 0x300], 2
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x300], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov byte [esp + 0x300], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x3c]
mov dword [esp + 0x300], esi
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x2f8]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2f4
ret