Function at 0x422790
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x43c
mov eax, dword [0x4a99f8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov eax, dword [edi + 8]
sub eax, dword [edi + 0xc]
mov ebx, edx
sar eax, 4
inc eax
mov dword [ebp - 0x418], edi
mov dword [ebp - 0x42c], eax
test ebx, ebx
jne 0x4227e6
mov ebx, str.Filename_is_null_
mov esi, edi
call fcn.0041e2b0
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468a81
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.DLL_MultiByteToWideChar]
mov esi, eax
mov dword [ebp - 0x430], esi
test esi, esi
jle 0x422842
lea eax, [esi + esi + 2]
push eax
call fcn.0046aa8c
add esp, 4
push esi
mov edi, eax
push edi
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.DLL_MultiByteToWideChar]
dec esi
xor ecx, ecx
mov word [edi + esi*2], cx
mov dword [ebp - 0x414], edi
mov edi, dword [ebp - 0x418]
mov dword [ebp - 0x430], esi
jmp 0x42284c
mov dword [ebp - 0x414], 0
push ebx
push 0x49407c
push edi
call fcn.0041e340
mov edx, dword [ebp - 0x414]
add esp, 0xc
push 0
push 0x8000080
push 3
push 0
push 1
push SysReAllocStringLen
push edx
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [ebp - 0x410], eax
test eax, eax
je 0x422bfd
jmp 0x422890
cmp eax, 0xffffffff
je 0x422bfd
mov eax, dword [ebp - 0x414]
lea ecx, [eax + esi*2 - 8]
push 0x494088
push ecx
call fcn.0046c258
add esp, 8
test eax, eax
jne 0x422b4b
mov ecx, dword [ebp - 0x410]
mov ebx, dword [sym.imp.KERNEL32.DLL_ReadFile]
push eax
lea edx, [ebp - 0x424]
push edx
push 3
lea eax, [ebp - 0x420]
push eax
push ecx
call ebx
cmp dword [ebp - 0x424], 3
jne 0x422901
cmp byte [ebp - 0x420], 0xef
jne 0x422901
cmp byte [ebp - 0x41f], 0xbb
jne 0x422901
cmp byte [ebp - 0x41e], 0xbf
je 0x422b4b
mov edx, dword [ebp - 0x410]
push 0
push 0
push edx
call dword [sym.imp.KERNEL32.DLL__llseek]
mov ecx, dword [ebp - 0x410]
lea eax, [ebp - 0x424]
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov esi, eax
lea edx, [esi + 1]
push edx
mov dword [ebp - 0x428], esi
call fcn.0046aa8c
mov edi, eax
add esp, 4
mov dword [ebp - 0x434], edi
test edi, edi
je 0x422b09
mov ecx, dword [ebp - 0x410]
push 0
lea eax, [ebp - 0x424]
push eax
push esi
push edi
push ecx
call ebx
mov edx, dword [ebp - 0x410]
push edx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, dword [ebp - 0x428]
mov byte [edi + eax], 0
mov eax, dword [ebp - 0x428]
cmp dword [ebp - 0x424], eax
jne 0x422b2c
push 0
push 0
push eax
push edi
push 0
push 0
mov dword [ebp - 0x41c], eax
call dword [sym.imp.KERNEL32.DLL_MultiByteToWideChar]
mov esi, eax
test esi, esi
jle 0x4227d0
lea ecx, [esi + esi + 2]
push ecx
call fcn.0046aa8c
mov edx, dword [ebp - 0x41c]
add esp, 4
push esi
mov ebx, eax
push ebx
push edx
push edi
push 0
push 0
mov dword [ebp - 0x438], ebx
call dword [sym.imp.KERNEL32.DLL_MultiByteToWideChar]
cmp dword [ebp - 0x41c], 0
jge 0x4229da
dec esi
xor eax, eax
mov word [ebx + esi*2], ax
test ebx, ebx
je 0x4227d0
push eax
push eax
push eax
push eax
push esi
push ebx
push eax
push 0xfde9
mov dword [ebp - 0x41c], esi
call dword [sym.imp.KERNEL32.DLL_WideCharToMultiByte]
mov edi, eax
test edi, edi
jle 0x422a41
lea ecx, [edi + 1]
push ecx
call fcn.0046aa8c
mov edx, dword [ebp - 0x41c]
add esp, 4
push 0
push 0
push edi
mov esi, eax
push esi
push edx
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.DLL_WideCharToMultiByte]
cmp dword [ebp - 0x41c], 0
jge 0x422a39
dec edi
mov byte [esi + edi], 0
mov ebx, esi
jmp 0x422a43
xor ebx, ebx
mov eax, dword [ebp - 0x438]
push eax
call fcn.0046aa52
add esp, 4
test ebx, ebx
je 0x4227d0
mov ecx, dword [ebp - 0x414]
push 0
push 0x8000080
push 2
push 0
push 0
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov esi, eax
test esi, esi
je 0x4227d0
push 0
lea edx, [ebp - 0x428]
push edx
push 3
push 0x494094
push esi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
push 0
lea eax, [ebp - 0x428]
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push ebx
call fcn.0046aa52
mov ecx, dword [ebp - 0x434]
add esp, 4
push ecx
call fcn.0046aa52
mov edx, dword [ebp - 0x414]
add esp, 4
push 0
push 0x8000080
push 3
push 0
push 1
push SysReAllocStringLen
push edx
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov edi, dword [ebp - 0x418]
mov dword [ebp - 0x410], eax
test eax, eax
je 0x422bfd
mov esi, dword [ebp - 0x430]
jmp 0x422890
mov eax, dword [ebp - 0x410]
push eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468a81
mov esp, ebp
pop ebp
ret
push edi
call fcn.0046aa52
add esp, 4
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468a81
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x414]
push ecx
call fcn.0046aa52
mov esi, dword [edi + 8]
mov eax, dword [esi - 8]
sub esi, 0x10
add esp, 4
cmp eax, 4
je 0x422bb1
cmp eax, 7
jne 0x422b7a
mov eax, dword [esi]
cmp dword [eax + 8], 0
jne 0x422b7a
lea esi, [eax + 0x18]
jmp 0x422bb6
call fcn.00431f20
test eax, eax
jne 0x422b8d
mov edi, dword [ebp - 0x418]
xor esi, esi
jmp 0x422bb6
mov esi, dword [ebp - 0x418]
mov eax, dword [esi + 0x10]
mov edx, dword [eax + 0x44]
cmp edx, dword [eax + 0x40]
jb 0x422ba5
mov eax, esi
call fcn.00431cf0
mov esi, dword [esi + 8]
mov edi, dword [ebp - 0x418]
sub esi, 0x10
mov esi, dword [esi]
add esi, 0x10
lea eax, [ebp - 0x410]
push eax
mov eax, esi
mov edx, 0x422680
mov ecx, edi
call fcn.0041ecf0
mov ecx, dword [ebp - 0x410]
add esp, 4
push ecx
mov ebx, eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, dword [ebp - 0x42c]
mov esi, edi
call fcn.0041da40
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468a81
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x42c]
mov eax, edi
call fcn.004226c0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00468a81
mov esp, ebp
pop ebp
ret