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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d9e40
mov eax, dword fs:[0]
push eax
sub esp, 0x6c
mov eax, dword [0x511070]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x58], eax
mov edi, dword [eax + 0x20]
lea ebx, [edi + 4]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [edi + 0x20]
sub esi, dword [edi + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp esi, 4
jb 0x4816f6
push 0xe
push str.dr_padcket.dat
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x24], 0xf
mov dword [ebp - 0x28], 0
mov byte [ebp - 0x38], 0
call fcn.00438c00
lea eax, [ebp - 0x38]
mov dword [ebp - 4], 0
push eax
lea eax, [ebp - 0x50]
push eax
call fcn.00481720
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x24]
cmp eax, 0x10
jb 0x481511
inc eax
lea ecx, [ebp - 0x38]
push eax
push dword [ebp - 0x38]
call fcn.00433760
cmp dword [ebp - 0x3c], 0x10
lea eax, [ebp - 0x50]
push 0
cmovae eax, dword [ebp - 0x50]
push 0x80
push 4
push 0
push 0
push 0xc0000000
push eax
mov dword [ebp - 0x24], 0xf
mov dword [ebp - 0x28], 0
mov byte [ebp - 0x38], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4816e1
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [ebp - 0x5c], edi
cmp edi, 0x100000
jbe 0x481574
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4816e1
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ecx
lea ecx, [ebp - 0x74]
call fcn.00482f10
push 0
call fcn.004af30d
mov ecx, dword [ebp - 0x58]
add esp, 4
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], edx
mov ecx, dword [ecx + 0x20]
call fcn.0047f700
mov esi, eax
test esi, esi
je 0x4816d2
nop
cmp dword [esi + 0xc], 0
je 0x481670
mov edx, dword [esi]
mov ecx, edx
mov eax, dword [esi + 4]
add ecx, 0x15180
mov dword [ebp - 0x68], eax
adc eax, 0
cmp dword [ebp - 0x60], eax
jg 0x481670
jl 0x4815e1
cmp dword [ebp - 0x64], ecx
jae 0x481670
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x74]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x70]
sub eax, ecx
mov dword [ebp - 0x20], edx
dec eax
mov word [ebp - 0x14], ax
movzx eax, word [esi + 0x40]
mov word [ebp - 0x18], ax
movzx eax, word [esi + 0x48]
mov word [ebp - 0x16], ax
lea eax, [ebp - 0x14]
push eax
push ecx
lea ecx, [esi + 0x14]
call fcn.004800b0
test al, al
je 0x481670
push 0
lea eax, [ebp - 0x54]
push eax
push 0x10
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esi + 0x44], 0x10
lea ecx, [esi + 0x30]
jb 0x481636
mov ecx, dword [ecx]
push 0
lea eax, [ebp - 0x54]
push eax
movzx eax, word [ebp - 0x18]
push eax
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x54]
push eax
movzx eax, word [ebp - 0x14]
push eax
push dword [ebp - 0x74]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
movzx ecx, word [ebp - 0x18]
movzx eax, word [ebp - 0x14]
add eax, edi
lea edi, [ecx + 0x10]
add edi, eax
mov dword [ebp - 0x5c], edi
mov ecx, esi
call fcn.0047ec30
push 0x50
push esi
call fcn.004a579e
add esp, 8
cmp edi, 0x100000
ja 0x4816d2
mov eax, dword [ebp - 0x58]
mov edi, dword [eax + 0x20]
lea eax, [edi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x1c]
xor esi, esi
cmp eax, dword [edi + 0x20]
je 0x4816bd
mov ecx, dword [edi + 0x20]
lea edx, [eax + 4]
mov esi, dword [eax]
sub ecx, edx
push ecx
push edx
push eax
call fcn.004a7690
add esp, 0xc
add dword [edi + 0x20], 0xfffffffc
lea eax, [edi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [ebp - 0x5c]
test esi, esi
jne 0x4815b0
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x74]
call fcn.00422540
mov eax, dword [ebp - 0x3c]
cmp eax, 0x10
jb 0x4816f6
inc eax
lea ecx, [ebp - 0x50]
push eax
push dword [ebp - 0x50]
call fcn.00433760
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004a578d
mov esp, ebp
pop ebp
ret