Function at 0x402b70
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x28
push ebx
push ebp
mov ebp, dword [esp + 0x34]
push esi
push edi
mov ecx, 9
xor eax, eax
lea edi, [esp + 0x14]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x14]
mov dword [esp + 0x10], 0
push eax
push ebp
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
test eax, eax
je 0x402c04
mov eax, dword [0x4069ec]
test eax, eax
jne 0x402bc3
push 1
call sub.libwpwr.dll_wpwrVerboseModeSet
add esp, 4
push 0x406730
call sub.libwpwr.dll_wpwrLogMsg
add esp, 4
mov esi, dword [sym.imp.MSVCRT.dll__errno]
or edi, 0xffffffff
call esi
mov ecx, dword [eax]
push ecx
call dword [sym.imp.MSVCRT.dll_strerror]
add esp, 4
test eax, eax
jne 0x402be3
mov eax, 0x406688
push eax
push ebp
push 0x406718
call sub.libwpwr.dll_wpwrLogErr
add esp, 0xc
call esi
mov dword [eax], 0x10022
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov eax, dword [esp + 0x28]
push 1
mov edi, eax
inc eax
push eax
call dword [sym.imp.MSVCRT.dll_calloc]
mov ebx, dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [esp + 0x3c], eax
push 0x406714
push ebp
call ebx
mov edx, dword [esp + 0x44]
add esp, 8
mov esi, eax
push esi
push edi
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
mov edi, eax
add esp, 0x10
cmp edi, 0xffffffff
jne 0x402ca2
mov eax, dword [0x4069ec]
test eax, eax
jne 0x402c67
push 1
call sub.libwpwr.dll_wpwrVerboseModeSet
add esp, 4
push 0x406730
call sub.libwpwr.dll_wpwrLogMsg
add esp, 4
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [sym.imp.MSVCRT.dll__errno]
add esp, 4
mov dword [esp + 0x10], 0xffffffff
call esi
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCRT.dll_strerror]
add esp, 4
test eax, eax
jne 0x402c96
mov eax, 0x406688
push eax
push ebp
push 0x406718
jmp 0x402e79
mov ebp, dword [sym.imp.MSVCRT.dll_fclose]
push esi
call ebp
mov ecx, dword [esp + 0x1e]
mov edx, dword [esp + 0x44]
add esp, 4
and ecx, 0xffff
push ecx
push edx
call dword [sym.imp.MSVCRT.dll__creat]
mov esi, eax
add esp, 8
test esi, esi
jge 0x402d22
mov eax, dword [0x4069ec]
test eax, eax
jne 0x402ced
push 1
call sub.libwpwr.dll_wpwrVerboseModeSet
add esp, 4
push 0x406730
call sub.libwpwr.dll_wpwrLogMsg
add esp, 4
mov esi, dword [sym.imp.MSVCRT.dll__errno]
mov dword [esp + 0x10], 0xffffffff
call esi
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCRT.dll_strerror]
add esp, 4
test eax, eax
jne 0x402d12
mov eax, 0x406688
mov ecx, dword [esp + 0x40]
push eax
push ecx
push 0x4066f8
jmp 0x402e79
mov edx, dword [esp + 0x40]
push 0x180
push edx
call dword [sym.imp.MSVCRT.dll__chmod]
add esp, 8
test eax, eax
je 0x402d9c
mov eax, dword [0x4069ec]
test eax, eax
jne 0x402d59
push 1
call sub.libwpwr.dll_wpwrVerboseModeSet
add esp, 4
push 0x406730
call sub.libwpwr.dll_wpwrLogMsg
add esp, 4
mov esi, dword [sym.imp.MSVCRT.dll__errno]
call esi
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCRT.dll_strerror]
add esp, 4
test eax, eax
jne 0x402d76
mov eax, 0x406688
mov ecx, dword [esp + 0x40]
push eax
push ecx
push 0x4066d4
call sub.libwpwr.dll_wpwrLogErr
add esp, 0xc
call esi
mov dword [eax], 0x10022
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push esi
call dword [sym.imp.MSVCRT.dll__close]
mov edx, dword [esp + 0x44]
add esp, 4
push 0x406714
push edx
call ebx
mov esi, eax
add esp, 8
test esi, esi
jne 0x402e0d
mov eax, dword [0x4069ec]
test eax, eax
jne 0x402ddb
push 1
call sub.libwpwr.dll_wpwrVerboseModeSet
add esp, 4
push 0x406730
call sub.libwpwr.dll_wpwrLogMsg
add esp, 4
mov esi, dword [sym.imp.MSVCRT.dll__errno]
mov dword [esp + 0x10], 0xffffffff
call esi
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCRT.dll_strerror]
add esp, 4
test eax, eax
jne 0x402e00
mov eax, 0x406688
mov ecx, dword [esp + 0x40]
push eax
push ecx
push 0x406718
jmp 0x402e79
mov edx, dword [esp + 0x3c]
push esi
push edi
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
cmp eax, edi
je 0x402e8b
mov eax, dword [0x4069ec]
test eax, eax
jne 0x402e43
push 1
call sub.libwpwr.dll_wpwrVerboseModeSet
add esp, 4
push 0x406730
call sub.libwpwr.dll_wpwrLogMsg
add esp, 4
push esi
call ebp
mov esi, dword [sym.imp.MSVCRT.dll__errno]
add esp, 4
mov dword [esp + 0x10], 0xffffffff
call esi
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCRT.dll_strerror]
add esp, 4
test eax, eax
jne 0x402e6e
mov eax, 0x406688
mov ecx, dword [esp + 0x40]
push eax
push ecx
push 0x4066b8
call sub.libwpwr.dll_wpwrLogErr
add esp, 0xc
call esi
mov dword [eax], 0x10022
jmp 0x402e91
push esi
call ebp
add esp, 4
mov edx, dword [esp + 0x3c]
push edx
call dword [sym.imp.MSVCRT.dll_free]
mov edi, dword [esp + 0x14]
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret