Function at 0x41d740
Capabilities:
Check if file exists
Get file attributes
Get file size
Hash data with crc32
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53ebd0
mov eax, dword fs:[0]
push eax
sub esp, 0x274
mov eax, dword [0x58f660]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0x24c], ecx
mov dword [ebp - 4], edi
mov ecx, dword [esi + 0x58]
mov ebx, edx
mov dword [ebp - 0x230], ebx
mov dword [ebp - 0x264], eax
mov dword [ebp - 0x238], esi
mov dword [ebp - 0x22c], 1
mov dword [ebp - 0x234], 0xffffffff
mov dword [ebp - 0x240], edi
mov dword [ebp - 0x23c], edi
cmp ecx, edi
jge 0x41d7c4
mov eax, dword [ebx + 0x1c]
add eax, ecx
jmp 0x41d7c6
mov eax, ecx
cdq
shld edx, eax, 9
shl eax, 9
cmp dword [esi + 0x14], 0x10
mov dword [ebp - 0x248], eax
mov dword [ebp - 0x244], edx
jb 0x41d7e4
mov eax, dword [esi]
jmp 0x41d7e6
mov eax, esi
push 6
push str.sdcard
push eax
call fcn.005159d3
add esp, 0xc
test eax, eax
jne 0x41d814
lea ecx, [esi + 0x1c]
push 0x12
cmp byte [ebx], al
je 0x41d80a
push str.format_res_16G.bin
jmp 0x41d80f
push str.format_res_32G.bin
call fcn.004044c0
cmp dword [esi + 0x14], 0x10
jb 0x41d81e
mov eax, dword [esi]
jmp 0x41d820
mov eax, esi
push 3
push 0x56f10c
push eax
call fcn.005159d3
add esp, 0xc
test eax, eax
jne 0x41d8b9
cmp dword [ebx + 0x10], 1
je 0x41d8b9
push 0x103
lea edx, [ebp - 0x11f]
push edi
push edx
mov byte [ebp - 0x120], al
call fcn.00518380
add esp, 0xc
lea ecx, [ebx + 0x19f4]
lea edx, [ebp - 0x120]
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x41d865
lea eax, [ebp - 0x120]
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x41d876
mov ecx, dword [str.sec_smt.dat]
mov edx, dword [0x56f114]
mov dword [eax], ecx
mov ecx, dword [0x56f118]
mov dword [eax + 4], edx
lea edx, [ebp - 0x120]
push edx
mov dword [eax + 8], ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x41d8b9
push 0xb
lea ecx, [esi + 0x1c]
push str.sec_smt.dat
call fcn.004044c0
push 0x103
lea eax, [ebp - 0x227]
push edi
push eax
mov byte [ebp - 0x228], 0
call fcn.00518380
lea eax, [ebx + 0x19f4]
lea edx, [ebp - 0x228]
add esp, 0xc
sub edx, eax
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x41d8e3
cmp dword [esi + 0x30], 0x10
lea eax, [esi + 0x1c]
mov dword [ebp - 0x230], eax
jb 0x41d8fe
mov eax, dword [eax]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x41d900
lea edi, [ebp - 0x228]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x41d910
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
cmp byte [ebx + 0xe], 0
rep movsb byte es:[edi], byte [esi]
je 0x41d993
push 0x103
lea ecx, [ebp - 0x11f]
push 0
push ecx
mov byte [ebp - 0x120], 0
call fcn.00518380
add esp, 0xc
push 0x104
lea edx, [ebp - 0x120]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x104
lea eax, [ebp - 0x228]
push 0
push eax
call fcn.00518380
add esp, 0xc
xor eax, eax
jmp 0x41d980
mov cl, byte [ebp + eax - 0x120]
mov byte [ebp + eax - 0x228], cl
inc eax
test cl, cl
jne 0x41d980
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
lea ecx, [ebp - 0x228]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x234], eax
cmp eax, 0xffffffff
jne 0x41daee
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebx + 0x18]
cmp byte [edx + 0x54], 0
mov edi, eax
mov eax, dword [ebp - 0x230]
je 0x41da7b
cmp dword [eax + 0x14], 0x10
jb 0x41d9e1
mov eax, dword [eax]
push edi
push eax
push 0x56eec4
jmp 0x41da8a
cmp dword [eax + 0x14], 0x10
jb 0x41da83
mov eax, dword [eax]
push edi
push eax
push str.Failed_to_open_file__s._The_error_code_is__d___Location:06_
push 0x597f50
call fcn.00515b45
movzx eax, word [ebx + 4]
mov ecx, dword [ebx + 8]
mov esi, dword [sym.imp.USER32.dll_SendMessageA]
add esp, 0x10
and eax, 0xff
push 0x597f50
or eax, 0x100
shl eax, 0x10
push eax
push 0x178c
push ecx
call esi
movzx edx, word [ebx + 4]
mov eax, dword [ebx + 8]
and edx, 0xff
push 0x597f50
shl edx, 0x10
or edx, 0x1000001
push edx
push 0x178c
push eax
call esi
mov byte [ebx + 0xd], 1
mov eax, edi
jmp 0x41dffb
cmp byte [ebx + 0xe], 0
je 0x41db2b
mov ecx, dword [ebp - 0x238]
mov eax, dword [ecx + 0x70]
mov edi, dword [ecx + 0x6c]
cdq
mov esi, eax
shld edx, esi, 9
shl esi, 9
shl edi, 9
mov dword [ebp - 0x23c], edx
mov dword [ebp - 0x240], esi
mov dword [ebp - 0x260], edi
mov dword [ebp - 0x25c], 0
jmp 0x41db78
mov edx, dword [ebp - 0x234]
lea ecx, [ebp - 0x27c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebp - 0x27c]
mov edi, eax
push 0
add eax, 0x1ff
mov dword [ebp - 0x25c], ecx
push 0x200
adc ecx, 0
push ecx
push eax
mov dword [ebp - 0x260], edi
call fcn.0051aa20
mov ecx, dword [ebp - 0x238]
mov esi, dword [ebp - 0x240]
mov dword [ecx + 0x54], eax
cmp dword [ecx + 0x60], 0
mov edx, dword [ebp - 0x25c]
mov dword [ebp - 0x258], edi
mov dword [ebp - 0x254], edx
jne 0x41db9a
mov dword [ebp - 0x230], 0xffffffff
movzx eax, word [ebx + 4]
mov ecx, dword [ebx + 8]
and eax, 0xff
push 0x64
shl eax, 0x10
or eax, 2
push eax
push 0x178c
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
jmp 0x41dbc0
mov eax, dword [ebp - 0x254]
test eax, eax
jl 0x41dfc8
jg 0x41dbd8
test edi, edi
je 0x41dfc8
cmp byte [ebx + 0xc], 0
jne 0x41de8f
test eax, eax
jl 0x41dc01
jg 0x41dbf0
cmp edi, 0x400000
jbe 0x41dc01
mov edi, 0x400000
mov dword [ebp - 0x27c], 0
jmp 0x41dc31
mov eax, dword [ebp - 0x254]
mov dword [ebp - 0x27c], eax
test eax, eax
jg 0x41dc31
jl 0x41dc1b
cmp edi, 0x400000
jae 0x41dc31
mov edx, dword [ebp - 0x24c]
push 0x400000
push 0
push edx
call fcn.00518380
add esp, 0xc
mov edx, dword [ebp - 0x234]
mov eax, dword [ebp - 0x23c]
push 0
lea ecx, [ebp - 0x274]
push ecx
push esi
push edx
mov dword [ebp - 0x22c], 0
mov dword [ebp - 0x278], esi
mov dword [ebp - 0x274], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x278], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x278]
cmp ecx, 0xffffffff
jne 0x41dc7f
test eax, eax
jne 0x41dc8d
cmp ecx, 0xffffffff
jne 0x41dc8d
cmp dword [ebp - 0x274], 0
je 0x41dcb7
mov ecx, dword [ebp - 0x24c]
mov edx, dword [ebp - 0x234]
push 0
lea eax, [ebp - 0x22c]
push eax
push edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x41dcb7
cmp dword [ebp - 0x22c], edi
je 0x41dcc7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x41dea6
mov ecx, dword [ebp - 0x27c]
push 0
mov eax, edi
add eax, 0x1ff
push 0x200
adc ecx, 0
push ecx
push eax
call fcn.0051aa20
mov esi, eax
shl esi, 9
cmp byte [ebx + 0xc], 0
jne 0x41df25
mov eax, dword [ebp - 0x248]
mov edx, dword [ebp - 0x244]
push 0
lea ecx, [ebp - 0x26c]
push ecx
mov dword [ebp - 0x26c], edx
mov edx, dword [ebp - 0x264]
push eax
push edx
mov dword [ebp - 0x22c], 0
mov dword [ebp - 0x270], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x270], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x270]
cmp ecx, 0xffffffff
jne 0x41dd48
test eax, eax
jne 0x41dd56
cmp ecx, 0xffffffff
jne 0x41dd56
cmp dword [ebp - 0x26c], 0
je 0x41dd80
mov ecx, dword [ebp - 0x24c]
mov edx, dword [ebp - 0x264]
push 0
lea eax, [ebp - 0x22c]
push eax
push esi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41dd80
cmp dword [ebp - 0x22c], esi
je 0x41dd94
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x22c], eax
test eax, eax
jne 0x41df3c
mov eax, dword [ebp - 0x238]
cmp dword [eax + 0x60], 0
jne 0x41ddf2
mov edx, dword [ebp - 0x24c]
mov eax, dword [ebp - 0x230]
mov ecx, esi
mov dword [ebp - 0x22c], edx
mov edx, ecx
dec ecx
mov dword [ebp - 0x230], ecx
test edx, edx
je 0x41ddec
mov edx, dword [ebp - 0x22c]
movzx edx, byte [edx]
mov ecx, eax
and ecx, 0xff
xor ecx, edx
shr eax, 8
xor eax, dword [ecx*4 + 0x56b4d0]
inc dword [ebp - 0x22c]
mov ecx, dword [ebp - 0x230]
jmp 0x41ddb4
mov dword [ebp - 0x230], eax
add dword [ebp - 0x240], edi
mov edx, dword [ebp - 0x27c]
mov eax, dword [ebp - 0x258]
adc dword [ebp - 0x23c], edx
add dword [ebp - 0x248], esi
mov ecx, dword [ebp - 0x254]
push 0
adc dword [ebp - 0x244], 0
sub eax, edi
sbb ecx, edx
mov edx, dword [ebp - 0x260]
sub edx, eax
mov dword [ebp - 0x258], eax
mov eax, dword [ebp - 0x25c]
push 0x64
sbb eax, ecx
push eax
push edx
mov dword [ebp - 0x254], ecx
call fcn.0051a9e0
mov ecx, dword [ebp - 0x25c]
push ecx
mov ecx, dword [ebp - 0x260]
push ecx
push edx
push eax
call fcn.0051aa20
movzx edx, word [ebx + 4]
and edx, 0xff
push eax
mov eax, dword [ebx + 8]
shl edx, 0x10
or edx, 3
push edx
push 0x178c
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov esi, dword [ebp - 0x240]
mov edi, dword [ebp - 0x258]
jmp 0x41dbc0
mov ecx, dword [ebp - 0x234]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x4c7
jmp 0x41dffb
mov edx, dword [ebp - 0x234]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx + 0x18]
cmp byte [eax + 0x54], 0
push esi
je 0x41dec4
push 0x56ef34
jmp 0x41dec9
push str.Failed_to_read_the_file_data._The_error_code_is__d___Location:07_
push 0x597f50
call fcn.00515b45
movzx ecx, word [ebx + 4]
mov edx, dword [ebx + 8]
mov edi, dword [sym.imp.USER32.dll_SendMessageA]
add esp, 0xc
push 0x597f50
and ecx, 0xff
shl ecx, 0x10
push ecx
push 0x178c
push edx
call edi
movzx eax, word [ebx + 4]
mov ecx, dword [ebx + 8]
and eax, 0xff
push 0x597f50
shl eax, 0x10
or eax, 1
push eax
push 0x178c
push ecx
call edi
mov byte [ebx + 0xd], 1
mov eax, esi
jmp 0x41dffb
mov edx, dword [ebp - 0x234]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x4c7
jmp 0x41dffb
mov eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 0x18]
cmp byte [ecx + 0x54], 0
mov edi, dword [ebp - 0x22c]
push edi
je 0x41df60
push 0x56f19c
jmp 0x41df65
push str.Error_in_writing_to_the_disk._Error_code:_d
push 0x597f50
call fcn.00515b45
movzx edx, word [ebx + 4]
mov eax, dword [ebx + 8]
mov esi, dword [sym.imp.USER32.dll_SendMessageA]
add esp, 0xc
and edx, 0xff
push 0x597f50
or edx, 0x100
shl edx, 0x10
push edx
push 0x178c
push eax
call esi
movzx ecx, word [ebx + 4]
mov edx, dword [ebx + 8]
and ecx, 0xff
push 0x597f50
shl ecx, 0x10
or ecx, 0x1000001
push ecx
push 0x178c
push edx
call esi
mov byte [ebx + 0xd], 1
mov eax, edi
jmp 0x41dffb
mov eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x238]
cmp dword [ecx + 0x60], 0
jne 0x41dfec
mov eax, dword [ebp - 0x230]
not eax
mov dword [ecx + 0x60], eax
mov ecx, dword [ebp - 0x264]
push ecx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00514194
mov esp, ebp
pop ebp
ret 8