Function at 0x1000f850
Capabilities:
Create directory
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x644
mov eax, dword [0x100530a0]
xor eax, esp
mov dword [esp + 0x640], eax
mov eax, dword [esp + 0x648]
push esi
mov esi, dword [esp + 0x650]
push 0x10040a90
push eax
lea eax, [esp + 0xc]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen_s]
add esp, 0xc
test eax, eax
jne 0x1000facb
push esi
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wchdir]
add esp, 4
test eax, eax
jne 0x1000facb
push ebx
push ebp
mov ebp, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
lea eax, [esp + 0x14]
push edi
push dword [esp + 0x10]
push 1
push 0x1e
push eax
call ebp
add esp, 0x10
cmp eax, 1
jne 0x1000fabb
mov ebx, dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wmkdir]
cmp dword [esp + 0x18], 0x4034b50
mov edi, 0x2f
jne 0x1000fabb
cmp word [esp + 0x20], 0
jne 0x1000fabb
push dword [esp + 0x10]
movzx eax, word [esp + 0x36]
movzx esi, word [esp + 0x36]
push eax
lea eax, [esp + 0x248]
push 1
push eax
call ebp
add esp, 0x10
cmp eax, esi
jne 0x1000fabb
lea eax, [esi + esi]
cmp eax, 0x208
jae 0x1000fae1
xor ecx, ecx
mov word [esp + eax + 0x240], cx
lea eax, [esp + 0x240]
push eax
lea eax, [esp + 0x3c]
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
mov cx, word [esp + 0x44]
lea eax, [esp + 0x44]
add esp, 0xc
test cx, cx
je 0x1000f96b
movzx edx, cx
cmp dx, 0x5c
jne 0x1000f95d
mov word [eax], di
movzx ecx, word [eax + 2]
add eax, 2
mov edx, ecx
test cx, cx
jne 0x1000f954
lea eax, [esp + 0x38]
push 0x2f
push eax
call sub.VCRUNTIME140.dll_wcschr
mov edi, eax
add esp, 8
test edi, edi
je 0x1000f9d8
lea eax, [esp + 0x38]
mov esi, edi
sub esi, eax
sar esi, 1
push esi
push eax
lea eax, [esp + 0x450]
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
add esi, esi
add esp, 0x10
cmp esi, 0x208
jae 0x1000fae1
xor eax, eax
mov word [esp + esi + 0x448], ax
lea eax, [esp + 0x448]
push eax
call ebx
lea eax, [edi + 2]
push 0x2f
push eax
call sub.VCRUNTIME140.dll_wcschr
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x1000f980
mov ax, word [esp + 0x34]
test ax, ax
je 0x1000f9fd
push 1
movzx eax, ax
push eax
push dword [esp + 0x18]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
add esp, 0xc
test eax, eax
jne 0x1000fabb
movzx eax, word [esp + 0x32]
cmp word [esp + eax*2 + 0x23e], 0x2f
je 0x1000fa94
push 0x10040a98
lea eax, [esp + 0x244]
push eax
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen_s]
add esp, 0xc
test eax, eax
jne 0x1000fabb
mov eax, dword [esp + 0x2e]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.1003c33a
push dword [esp + 0x14]
mov esi, eax
push dword [esp + 0x36]
push 1
push esi
call ebp
mov ecx, dword [esp + 0x42]
add esp, 0x14
cmp eax, ecx
jne 0x1000fab0
push dword [esp + 0x14]
push ecx
push 1
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, dword [esp + 0x2e]
jne 0x1000fab0
push 2
push esi
call fcn.1003c33a
push dword [esp + 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0xc
push dword [esp + 0x10]
lea eax, [esp + 0x1c]
push 1
push 0x1e
push eax
call ebp
add esp, 0x10
cmp eax, 1
jne 0x1000fabb
jmp 0x1000f8cb
push 2
push esi
call fcn.1003c33a
add esp, 8
push dword [esp + 0x10]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x644]
pop esi
xor ecx, esp
call fcn.1003b4ee
add esp, 0x644
ret
call fcn.1003c33a
int3