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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50f105
mov eax, dword fs:[0]
push eax
sub esp, 0x64
mov eax, dword [0x550144]
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 - 0x64], eax
mov esi, dword [eax + 0x20]
lea ebx, [esi + 4]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [esi + 0x20]
mov esi, dword [esi + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub edi, esi
cmp edi, 4
jb 0x48034d
push 0xe
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x38]
push str.dr_padcket.dat
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0xf
mov byte [ebp - 0x38], 0
call fcn.0044c0b0
lea eax, [ebp - 0x38]
mov dword [ebp - 4], 0
push eax
lea eax, [ebp - 0x50]
push eax
call fcn.00480370
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x24]
cmp edx, 0x10
jb 0x4800f9
mov ecx, dword [ebp - 0x38]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4800ef
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x480369
push edx
push ecx
call fcn.004de45a
add esp, 8
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
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x48031d
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x54], eax
cmp eax, 0x100000
jbe 0x480147
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x48031d
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0xf023
call fcn.004de42a
add esp, 4
test eax, eax
je 0x480369
lea edi, [eax + 0x23]
and edi, 0xffffffe0
push 0xf000
push 0
push edi
mov dword [ebp - 0x70], edi
mov dword [edi - 4], eax
call fcn.004e0230
add esp, 0xc
push 0
call fcn.004e7e60
mov dword [ebp - 0x6c], eax
add esp, 4
mov eax, dword [ebp - 0x64]
mov dword [ebp - 0x68], edx
mov eax, dword [eax + 0x20]
mov dword [ebp - 0x5c], eax
add eax, 4
push eax
mov dword [ebp - 0x58], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x5c]
xor esi, esi
mov ecx, dword [eax + 0x1c]
mov edx, dword [eax + 0x20]
cmp ecx, edx
je 0x4801d3
mov esi, dword [ecx]
lea eax, [ecx + 4]
sub edx, eax
push edx
push eax
push ecx
call fcn.004dfcb0
mov eax, dword [ebp - 0x5c]
add esp, 0xc
add dword [eax + 0x20], 0xfffffffc
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
je 0x4802fb
cmp dword [esi + 0xc], 0
je 0x4802a3
mov edx, dword [esi]
mov ecx, edx
mov eax, dword [esi + 4]
add ecx, 0x15180
mov dword [ebp - 0x58], eax
adc eax, 0
cmp dword [ebp - 0x68], eax
jg 0x4802a3
jl 0x480215
cmp dword [ebp - 0x6c], ecx
jae 0x4802a3
mov eax, dword [ebp - 0x58]
lea ecx, [esi + 0x14]
mov dword [ebp - 0x1c], eax
lea eax, [edi + 0xf000]
sub eax, edi
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 edi
call fcn.0047ebd0
test al, al
je 0x4802a3
push 0
lea eax, [ebp - 0x60]
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 0x48026a
mov ecx, dword [ecx]
push 0
lea eax, [ebp - 0x60]
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 - 0x60]
push eax
movzx eax, word [ebp - 0x14]
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
movzx edx, word [ebp - 0x18]
movzx eax, word [ebp - 0x14]
add edx, 0x10
add eax, dword [ebp - 0x54]
add eax, edx
mov dword [ebp - 0x54], eax
push ecx
mov ecx, esi
call fcn.0047dec0
cmp dword [ebp - 0x54], 0x100000
ja 0x4802fb
mov eax, dword [ebp - 0x64]
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
mov ecx, dword [edi + 0x20]
cmp eax, ecx
je 0x4802e6
mov esi, dword [eax]
lea edx, [eax + 4]
sub ecx, edx
push ecx
push edx
push eax
call fcn.004dfcb0
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 - 0x70]
test esi, esi
jne 0x4801e4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi - 4]
sub edi, ecx
lea eax, [edi - 4]
cmp eax, 0x1f
ja 0x480369
push 0xf023
push ecx
call fcn.004de45a
add esp, 8
mov edx, dword [ebp - 0x3c]
cmp edx, 0x10
jb 0x48034d
mov ecx, dword [ebp - 0x50]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x480343
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x480369
push edx
push ecx
call fcn.004de45a
add esp, 8
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.004de46d
mov esp, ebp
pop ebp
ret
call fcn.004e364a
int3