Function at 0x402070
Capabilities:
Delete file
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x338
push ebx
push esi
push edi
push 0x7f02
push 0
call dword [sym.imp.USER32.dll_LoadCursorW]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
lea ecx, [ebp - 8]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.Ngs3.dll_public:_void___thiscall_C2bString::constructor_void_]
mov ebx, dword [ebp + 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
push ebx
call edi
mov esi, dword [sym.imp.Ngs3.dll_public:_void___thiscall_C2bString::Empty_void_]
cmp eax, 0xffffffff
je 0x402186
test eax, eax
je 0x402186
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test byte [0x425304], 1
je 0x402141
mov ecx, ebx
lea eax, [ebp - 0x334]
call fcn.00405b00
lea eax, [ebp - 0x334]
push 0x2e
push eax
call dword [sym.imp.MSVCRT.dll_wcsrchr]
add esp, 8
test eax, eax
je 0x402109
xor ecx, ecx
mov word [eax], cx
mov ebx, 0x104
mov ecx, str..bak
lea eax, [ebp - 0x334]
call fcn.00406540
lea edx, [ebp - 0x334]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x334]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
mov ebx, dword [ebp + 0xc]
jmp 0x402186
push ebx
lea ecx, [ebp - 8]
call dword [sym.imp.Ngs3.dll_public:_class_C2bString_const____thiscall_C2bString::operator_wchar_t_const__]
push 0x4202dc
lea ecx, [ebp - 8]
call dword [0x4253c8]
mov edx, dword [ebp - 8]
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
push edx
call edi
cmp eax, 0xffffffff
je 0x402186
test eax, eax
je 0x402186
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 8]
call esi
mov eax, dword [ebp - 8]
cmp word [eax], 0
je 0x4021b2
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call edi
mov ecx, eax
mov dword [ebp - 0xc], ecx
cmp ecx, 0xffffffff
je 0x4021b2
test ecx, ecx
jne 0x40220a
lea ecx, [ebp - 8]
call esi
xor esi, esi
push esi
push 0x80
push 2
push esi
push 1
push 0x40000000
push ebx
call edi
mov dword [ebp - 0xc], eax
cmp eax, 0xffffffff
je 0x4021d8
cmp eax, esi
jne 0x402205
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x4021e7
call fcn.004155d0
lea ecx, [ebp - 8]
call dword [sym.imp.Ngs3.dll_public:_void___thiscall_C2bString::destructor_void_]
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 0xc]
jmp 0x40220c
xor esi, esi
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x58], 0x4203c0
mov dword [ebp - 0x4c], 0xfde9
cmp eax, 0xfdea
je 0x40222a
mov dword [ebp - 0x4c], eax
push 0x200000
mov dword [ebp - 0x50], ecx
mov ecx, dword [0x425630]
push esi
push ecx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x24], 0x200000
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp byte [ebp + 0x10], 0
lea edx, [ebp - 0x10]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x40], esi
mov byte [ebp - 0x48], 0
mov dword [ebp - 0x38], esi
jne 0x40226d
and dword [edi + 0x10], 0xffffff1f
mov eax, dword [ebp - 0x4c]
cmp eax, 0xfde9
je 0x4022ac
cmp eax, 0xfde8
je 0x4022ac
cmp eax, 0xc42c
jb 0x40228c
cmp eax, 0xc435
jbe 0x4022ac
cmp eax, 0xdeaa
jb 0x40229a
cmp eax, 0xdeb3
jbe 0x4022ac
cmp eax, 0xcec8
je 0x4022ac
cmp eax, 0xd698
je 0x4022ac
xor bl, bl
jmp 0x4022ae
mov bl, 1
cmp dword [edi + 0xc], 0x4b0
mov ecx, dword [edi + 8]
mov byte [ebp - 0x3c], bl
jne 0x4022f7
test ecx, ecx
jne 0x4022c8
mov ecx, 0x4202ac
jmp 0x4022d7
cmp ecx, 1
mov ecx, 0x4202e4
je 0x4022d7
mov ecx, 0x4202e8
mov dword [ebp - 0x30], ecx
lea edi, [ecx + 2]
lea ecx, [ecx]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x4022e0
sub ecx, edi
sar ecx, 1
lea eax, [ecx + ecx]
mov dword [ebp - 0x2c], eax
jmp 0x40234e
test ecx, ecx
jne 0x402302
mov ecx, 0x4202ec
jmp 0x402311
cmp ecx, 1
mov ecx, 0x4202f0
je 0x402311
mov ecx, 0x4202f4
mov dword [ebp - 0x30], ecx
lea edi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x402317
sub ecx, edi
mov dword [ebp - 0x2c], ecx
test bl, bl
jne 0x40234e
push 0
push 0
push 0
push 0
push 1
push 0x42044c
push 0x400
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb eax, eax
and eax, 0x400
mov dword [ebp - 0x44], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xc]
cmp ecx, 0x4b0
jne 0x402370
mov edx, dword [ebp - 0x28]
mov ecx, 0xfeff
mov word [edx], cx
mov dword [ebp - 0x20], 2
jmp 0x402398
cmp ecx, 0xfdea
jne 0x402398
mov cx, word [0x420454]
mov edx, dword [ebp - 0x28]
mov word [edx], cx
mov cl, byte [0x420456]
mov edx, dword [ebp - 0x28]
mov byte [edx + 2], cl
mov dword [ebp - 0x20], 3
mov eax, dword [eax + 0x38]
xor edx, edx
cmp byte [ebp + 0x10], dl
lea ecx, [ebp - 0x58]
setne dl
push ecx
push edx
push 0xbce
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [ebp - 0x20]
xor ebx, ebx
cmp eax, ebx
jbe 0x4023e8
cmp byte [ebp - 0x48], bl
jne 0x4023e8
mov edx, dword [ebp - 0x28]
mov esi, dword [ebp - 0xc]
push ebx
lea ecx, [ebp - 0x14]
push ecx
push eax
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
and eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
setb al
or byte [ebp - 0x48], al
jmp 0x4023eb
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp + 8]
cmp dword [eax + 0x34], ebx
jne 0x402400
cmp dword [eax + 0x30], ebx
lea edi, [eax + 0x30]
jne 0x402400
mov dword [ebp - 0x10], ebx
jmp 0x402414
push ebx
push ebx
lea edi, [eax + 0x30]
push edi
push esi
mov dword [ebp - 0x10], 1
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov ecx, dword [ebp - 0x28]
mov edx, dword [0x425630]
push ecx
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp esi, ebx
je 0x402436
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0xc], ebx
mov esi, ebx
mov eax, dword [ebp - 8]
cmp word [eax], bx
mov ebx, dword [ebp + 0xc]
je 0x402453
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, dword [ebp - 8]
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
cmp byte [ebp + 0x10], 0
jne 0x402484
mov eax, dword [ebp - 0x10]
neg eax
sbb eax, eax
not eax
and eax, edi
mov edi, dword [ebp + 8]
push eax
add edi, 0x20
mov eax, ebx
call fcn.0041e160
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
push eax
push ebx
mov edi, 0x4250c0
call fcn.00415d20
cmp dword [ebp - 0x40], 0
je 0x4025d3
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x4025cf
cmp dword [0x42566c], 0
je 0x4025bf
xor ecx, ecx
mov eax, 2
mov edx, 4
mul edx
seto cl
mov dword [ebp - 0x18], 0
neg ecx
or ecx, eax
mov eax, dword [0x425630]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, 2
mov ecx, 0x87
lea edi, [ebp - 0x18]
mov dword [ebp - 0x14], eax
call fcn.0041e340
mov ebx, dword [ebp - 0x14]
mov ecx, dword [ebx + 4]
push 0xd4
push ecx
push 0x420450
push 0x80
lea edi, [ebp - 0x12c]
call fcn.0041a900
mov edx, dword [ebp - 0x38]
mov eax, dword [ebx]
push edx
push eax
mov ecx, edi
push ecx
lea esi, [ebp - 0x6c]
call fcn.0041ab10
add esp, 0xc
push 0xae
lea edx, [ebp - 0x78]
push edx
mov eax, edi
call fcn.0041a9e0
mov esi, dword [ebp + 8]
and dword [ebp - 0xcc], 0xfffffffd
mov eax, 1
mov dword [ebp - 0xc8], eax
mov dword [ebp - 0xac], eax
mov eax, dword [esi + 4]
lea ecx, [ebp - 0x120]
push ecx
lea edx, [ebp - 0x124]
mov dword [ebp - 0xd4], eax
push edx
lea eax, [ebp - 0x128]
push eax
lea ecx, [ebp - 0xd8]
push ecx
mov dword [ebp - 0xc0], 0xffff
call dword [0x42566c]
test eax, eax
js 0x40258e
cmp dword [ebp - 0x128], 0x64
jne 0x40258e
call fcn.00403620
lea esi, [ebp - 0x12c]
call fcn.00401b50
mov edx, dword [0x425630]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push ebx
push 0
push edx
call esi
mov eax, dword [ebp - 0x18]
mov ecx, dword [0x425630]
push eax
push 0
push ecx
call esi
mov esi, dword [ebp - 0xc]
jmp 0x4025cf
push eax
push 0x30
push 0x87
call fcn.00415b10
add esp, 0xc
cmp dword [ebp - 0x40], 0
setne dl
or byte [ebp - 0x48], dl
je 0x4025e8
cmp byte [ebp + 0x10], 0
jne 0x4025e8
mov eax, dword [ebp + 8]
or dword [eax + 0x10], 0x40
cmp byte [ebp - 0x48], 0
lea ecx, [ebp - 8]
sete bl
call dword [sym.imp.Ngs3.dll_public:_void___thiscall_C2bString::destructor_void_]
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
test esi, esi
je 0x40260d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov al, bl
pop ebx
mov esp, ebp
pop ebp
ret 0xc