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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1009fcbb
mov eax, dword fs:[0]
push eax
sub esp, 0xd4
mov eax, dword [0x100a60a4]
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 ebx, ecx
mov dword [ebp - 0xb0], ebx
mov dword [ebp - 0xe0], ebx
mov edi, dword [ebp + 8]
cmp byte [ebx + 0x38], 0
je 0x100466f0
mov eax, dword [ebx]
push 1
mov esi, dword [eax + 0xc]
mov ecx, esi
call dword [0x100ac510]
mov ecx, ebx
call esi
mov dword [ebp - 4], 0
xor esi, esi
mov dword [ebp - 0xb8], esi
mov ecx, dword [edi + 4]
cmp esi, ecx
jae 0x100464a0
lea eax, [edi + esi]
push 0
lea edx, [ebp - 0xa8]
push edx
sub ecx, esi
push ecx
push eax
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10046734
add esi, dword [ebp - 0xa8]
jmp 0x1004646a
lea eax, [ebp - 0x94]
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0x9c], 0
mov dword [ebp - 0x98], 0x80
mov byte [ebp - 4], 1
cmp byte [ebx + 0x39], 0
je 0x100466c5
cmp dword [ebp - 0x98], 8
jae 0x1004654a
push 0x28
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
je 0x1004675d
mov dword [ebp - 0xbc], eax
mov ecx, eax
and ecx, 0x1f
mov edx, 0x20
sub edx, ecx
lea edi, [eax + edx]
mov dword [ebp - 0xbc], edi
mov dword [edi - 4], edx
mov dword [ebp - 0xc0], edi
push dword [ebp - 0x9c]
push dword [ebp - 0xa0]
push edi
call sub.msvcrt.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x94]
mov ecx, dword [ebp - 0xa0]
cmp ecx, eax
je 0x10046542
test ecx, ecx
je 0x10046542
sub ecx, dword [ecx - 4]
je 0x10046542
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0xa0], edi
jmp 0x10046550
mov edi, dword [ebp - 0xa0]
mov ecx, 8
mov dword [ebp - 0x9c], ecx
xor esi, esi
mov dword [ebp - 0xac], esi
cmp esi, ecx
jae 0x100465a2
lea eax, [edi + esi]
push 0
lea edx, [ebp - 0xa8]
push edx
sub ecx, esi
push ecx
push eax
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10046782
add esi, dword [ebp - 0xa8]
mov dword [ebp - 0xac], esi
mov ecx, dword [ebp - 0x9c]
mov edi, dword [ebp - 0xa0]
jmp 0x10046563
mov ebx, dword [edi + 4]
cmp ebx, dword [ebp - 0x98]
jbe 0x10046655
test ebx, ebx
je 0x10046606
lea eax, [ebx + 0x20]
test eax, eax
je 0x100465d6
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, eax
test edx, edx
jne 0x100465d8
mov dword [ebp - 0xcc], eax
jmp 0x100467ab
xor edx, edx
mov dword [ebp - 0xa4], edx
mov eax, edx
and eax, 0x1f
mov ecx, 0x20
sub ecx, eax
lea eax, [edx + ecx]
mov dword [ebp - 0xa4], eax
mov dword [eax - 4], ecx
mov edx, eax
mov ecx, dword [ebp - 0x9c]
mov edi, dword [ebp - 0xa0]
jmp 0x10046610
xor eax, eax
mov dword [ebp - 0xa4], eax
xor edx, edx
mov dword [ebp - 0xcc], eax
test edx, edx
je 0x100467ab
push ecx
push edi
push edx
call sub.msvcrt.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x94]
mov ecx, dword [ebp - 0xa0]
cmp ecx, eax
je 0x10046649
test ecx, ecx
je 0x10046649
sub ecx, dword [ecx - 4]
je 0x10046649
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edi, dword [ebp - 0xa4]
mov dword [ebp - 0xa0], edi
mov dword [ebp - 0x9c], ebx
cmp ebx, 8
jb 0x100467c6
cmp esi, ebx
jae 0x100466a9
lea eax, [edi + esi]
push 0
lea ecx, [ebp - 0xdc]
push ecx
sub ebx, esi
push ebx
push eax
mov eax, dword [ebp - 0xb0]
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100467e1
add esi, dword [ebp - 0xdc]
mov dword [ebp - 0xac], esi
mov ebx, dword [ebp - 0x9c]
mov edi, dword [ebp - 0xa0]
jmp 0x10046664
mov ebx, dword [ebp - 0xb0]
mov eax, dword [ebx]
push edi
mov esi, dword [eax]
mov ecx, esi
call dword [0x100ac510]
mov ecx, ebx
call esi
jmp 0x100464c4
mov byte [ebp - 4], 0
lea eax, [ebp - 0x94]
mov ecx, dword [ebp - 0xa0]
cmp ecx, eax
je 0x100466e9
test ecx, ecx
je 0x100466e9
sub ecx, dword [ecx - 4]
je 0x100466e9
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 4], 0xffffffff
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.1009ebb0
mov esp, ebp
pop ebp
ret 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10046746
movzx eax, ax
or eax, 0x80070000
mov dword [ebp - 0xb4], eax
push 0x100a5080
lea eax, [ebp - 0xb4]
push eax
call sub.msvcrt.dll__CxxThrowException
mov dword [ebp - 0xc0], 0
mov dword [ebp - 0xc4], 0x8007000e
push 0x100a5080
lea eax, [ebp - 0xc4]
push eax
call sub.msvcrt.dll__CxxThrowException
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10046794
movzx eax, ax
or eax, 0x80070000
mov dword [ebp - 0xc8], eax
push 0x100a5080
lea eax, [ebp - 0xc8]
push eax
call sub.msvcrt.dll__CxxThrowException
mov dword [ebp - 0xd0], 0x8007000e
push 0x100a5080
lea eax, [ebp - 0xd0]
push eax
call sub.msvcrt.dll__CxxThrowException
mov dword [ebp - 0xd4], 0x80004005
push 0x100a5080
lea eax, [ebp - 0xd4]
push eax
call sub.msvcrt.dll__CxxThrowException
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x100467f3
movzx eax, ax
or eax, 0x80070000
mov dword [ebp - 0xd8], eax
push 0x100a5080
lea eax, [ebp - 0xd8]
push eax
call sub.msvcrt.dll__CxxThrowException
int3