Function at 0x4aedf0
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4cd6de
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x50f880]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax + 0xd8]
cmp eax, 4
je 0x4af228
lea esi, [esp + 0x10]
call fcn.004aed60
xor esi, esi
mov dword [esp + 0x58], esi
xor edi, edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], esi
push esi
push 0x80
push 4
push esi
push esi
mov byte [esp + 0x6c], 1
mov ecx, dword [esp + 0x24]
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
or ebx, 0xffffffff
cmp eax, ebx
jne 0x4aeeb9
call fcn.0041a760
cmp eax, esi
je 0x4aeebf
cmp eax, 0xb7
je 0x4aeebf
mov dword [esp + 0x58], ebx
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
lock xadd dword [edx], ebx
dec ebx
test ebx, ebx
jg 0x4af228
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov edi, eax
mov dword [esp + 0x2c], edi
push 2
lea ecx, [esp + 0x2c]
push ecx
push esi
push edi
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, ebx
jne 0x4aeedf
call fcn.0041a760
lea edx, [esp + 0x48]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x44], eax
cmp eax, ebx
jne 0x4aef1f
call fcn.0041a760
cmp eax, esi
jge 0x4aef1f
cmp edi, esi
je 0x4aef07
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x58], ebx
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebx
dec ebx
jmp 0x4aee92
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
lea ecx, [esp + 0x28]
push ecx
push 4
lea edx, [esp + 0x20]
push edx
push edi
mov dword [esp + 0x28], esi
call ebx
cmp eax, esi
jne 0x4aef42
call fcn.0041a760
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x14]
mov ecx, dword [eax - 0xc]
push 0
lea edx, [esp + 0x28]
push edx
add ecx, ecx
push ecx
push eax
push edi
call ebx
test eax, eax
jne 0x4aef62
call fcn.0041a760
push 0
lea edx, [esp + 0x28]
push edx
push 2
lea eax, [esi + 0x74]
push eax
push edi
call ebx
test eax, eax
jne 0x4aef7b
call fcn.0041a760
lea ecx, [esi + 0x18]
call fcn.0048f560
lea ecx, [esi + 0x28]
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], edx
call fcn.0048f560
push 0
mov dword [esp + 0x40], eax
lea eax, [esp + 0x28]
push eax
push 8
lea ecx, [esp + 0x40]
push ecx
push edi
mov dword [esp + 0x54], edx
call ebx
test eax, eax
jne 0x4aefb5
call fcn.0041a760
push 0
lea edx, [esp + 0x28]
push edx
push 8
lea eax, [esp + 0x48]
push eax
push edi
call ebx
test eax, eax
jne 0x4aefcf
call fcn.0041a760
push 0
lea ecx, [esp + 0x28]
push ecx
push 8
lea edx, [esi + 0x38]
push edx
push edi
call ebx
test eax, eax
jne 0x4aefe8
call fcn.0041a760
push 0
lea eax, [esp + 0x28]
push eax
push 8
lea ecx, [esi + 0x40]
push ecx
push edi
call ebx
test eax, eax
jne 0x4af001
call fcn.0041a760
push 0
lea edx, [esp + 0x28]
push edx
push 4
lea eax, [esi + 0x48]
push eax
push edi
call ebx
test eax, eax
jne 0x4af01a
call fcn.0041a760
push 0
lea ecx, [esp + 0x28]
push ecx
push 4
lea edx, [esi + 0x4c]
push edx
push edi
call ebx
test eax, eax
jne 0x4af033
call fcn.0041a760
mov eax, dword [esi + 8]
push 0
lea ecx, [esp + 0x28]
push ecx
push 4
lea edx, [esp + 0x24]
push edx
push edi
mov dword [esp + 0x2c], eax
call ebx
test eax, eax
jne 0x4af054
call fcn.0041a760
push 0
lea eax, [esp + 0x28]
push eax
push 4
lea ecx, [esi + 0xc]
push ecx
push edi
call ebx
test eax, eax
jne 0x4af06d
call fcn.0041a760
push 0
lea edx, [esp + 0x28]
push edx
push 4
lea eax, [esi + 0x10]
push eax
push edi
call ebx
test eax, eax
jne 0x4af086
call fcn.0041a760
push 0
lea ecx, [esp + 0x28]
push ecx
push 8
lea edx, [esi + 0x88]
push edx
push edi
call ebx
test eax, eax
jne 0x4af0a2
call fcn.0041a760
mov eax, dword [esi]
lea esi, [esp + 0x24]
call fcn.004a74d0
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 8]
mov byte [esp + 0x58], 2
mov eax, dword [eax]
lea esi, [esp + 0x20]
call fcn.004a74d0
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
mov ecx, dword [edx - 0xc]
mov eax, dword [eax]
push 0
lea edx, [esp + 0x20]
push edx
add ecx, ecx
push ecx
push eax
push edi
call ebx
test eax, eax
jne 0x4af0e6
call fcn.0041a760
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4af106
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x58], 1
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4af12b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 8]
push 0
lea ecx, [esp + 0x28]
push ecx
push 2
add eax, 0x74
push eax
push edi
call ebx
test eax, eax
jne 0x4af147
call fcn.0041a760
mov esi, dword [ebp + 8]
push 0
lea edx, [esp + 0x28]
push edx
push 4
lea eax, [esi + 0x98]
push eax
push edi
call ebx
test eax, eax
jne 0x4af166
call fcn.0041a760
push 0
lea ecx, [esp + 0x28]
push ecx
push 8
add esi, 0x90
push esi
push edi
call ebx
test eax, eax
jne 0x4af182
call fcn.0041a760
lea edx, [esp + 0x28]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x24], eax
cmp eax, 0xffffffff
jne 0x4af1d0
call fcn.0041a760
test eax, eax
jns 0x4af1cc
test edi, edi
je 0x4af1ab
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x58], 0xffffffff
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x4aee94
mov eax, dword [esp + 0x24]
sub eax, dword [esp + 0x44]
lea ecx, [esp + 0x2c]
mov dword [esp + 0x14], eax
cdq
neg eax
adc edx, 0
neg edx
push edx
push eax
push ecx
mov edx, 1
call fcn.00442360
test eax, eax
js 0x4af214
sub dword [esp + 0x14], 4
push 0
lea edx, [esp + 0x28]
push edx
push 4
lea eax, [esp + 0x20]
push eax
push edi
call ebx
test eax, eax
jne 0x4af214
call fcn.0041a760
test edi, edi
je 0x4af21f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x10]
call fcn.00406510
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4