Function at 0x4996e2
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x105c
call fcn.004a98b0
mov eax, dword [0x4dd52c]
push ebx
xor ebx, ebx
push esi
mov esi, dword [ebp + 8]
cmp byte [esi + 0x9785], 1
push edi
mov edi, dword [esi + 0x3ea8]
mov dword [ebp - 4], eax
mov dword [ebp - 0x1028], ebx
mov dword [ebp - 0x102c], ebx
mov dword [ebp - 0x1048], ebx
mov dword [ebp - 0x1058], ebx
mov dword [ebp - 0x105c], ebx
mov byte [ebp - 0x1019], bl
mov dword [ebp - 0x1044], ebx
mov dword [ebp - 0x1038], ebx
mov dword [ebp - 0x1034], ebx
mov dword [ebp - 0x1040], ebx
je 0x499755
cmp byte [esi + 0x978c], 1
jne 0x499777
push 0x16
push esi
call fcn.004a5597
test eax, eax
jne 0x499777
mov ecx, dword [esi + 0x3ea8]
inc eax
mov dword [ebp - 0x1038], eax
mov dword [ebp - 0x1040], ecx
dec edi
jmp 0x49977a
xor eax, eax
inc eax
cmp byte [esi + 0x977e], 1
je 0x49978c
cmp byte [esi + 0x978c], 1
jne 0x4997b8
push 0x16
push esi
call fcn.004a5597
test eax, eax
jne 0x4997b5
mov eax, dword [esi + 0x3ea8]
sub eax, dword [ebp - 0x1038]
mov dword [ebp - 0x1044], 1
mov dword [ebp - 0x1034], eax
dec edi
xor eax, eax
inc eax
cmp word [esi + 0x8f60], 3
jne 0x4997ca
cmp edi, eax
je 0x499b94
push 2
pop ecx
cmp word [esi + 0x1bf2a], cx
jne 0x4997fd
cmp dword [esi + 0x1f79c], eax
jbe 0x4997e6
mov dword [ebp - 0x102c], eax
jmp 0x4997f5
xor edx, edx
mov dx, word [esi + 0x8a36]
mov dword [ebp - 0x102c], edx
mov dword [ebp - 0x1024], eax
jmp 0x499823
cmp word [esi + 0x1bf28], 4
jne 0x499817
mov dx, word [esi + 0x8a36]
mov word [ebp - 0x1024], dx
jmp 0x49981d
mov dword [ebp - 0x1024], eax
mov dword [ebp - 0x102c], eax
mov dx, word [esi + 0x8f60]
cmp dx, ax
jne 0x49987a
mov eax, dword [ebp - 0x1044]
mov ecx, dword [ebp - 0x1038]
or dword [ebp - 0x104c], 0xffffffff
mov dword [ebp - 0x1044], ecx
mov ecx, dword [ebp - 0x1040]
mov dword [ebp - 0x1038], eax
mov eax, dword [ebp - 0x1034]
mov dword [ebp - 0x1050], edi
mov dword [ebp - 0x1020], ebx
mov dword [ebp - 0x1028], eax
mov dword [ebp - 0x1034], ecx
mov dword [ebp - 0x1040], eax
jmp 0x4998bd
cmp dx, cx
mov ebx, ecx
mov dword [ebp - 0x104c], ecx
jne 0x499897
mov dword [ebp - 0x1050], eax
mov eax, edi
cdq
idiv ebx
cmp edx, 1
jmp 0x4998ac
xor edx, edx
cmp edi, eax
setg dl
mov eax, edi
inc edx
mov dword [ebp - 0x1050], edx
cdq
idiv ebx
test edx, edx
je 0x4998af
dec edi
mov dword [ebp - 0x1020], edi
add dword [ebp - 0x1020], ecx
xor ebx, ebx
push ebx
push ebx
push ebx
push dword [esi + 0x8148]
call fcn.004809d9
mov edi, dword [esi + 0x3eb8]
push edi
lea eax, [ebp - 0x1058]
push eax
lea eax, [ebp - 0x1048]
push eax
lea eax, [ebp - 0x102c]
push eax
push esi
call fcn.00486ef4
cmp word [ebp - 0x1048], bx
jne 0x49990b
push ebx
lea eax, [ebp - 0x1028]
push eax
push edi
push dword [esi + 0x8148]
push esi
call fcn.00498dbc
cmp word [ebp - 0x102c], bx
mov dword [ebp - 0x1030], ebx
jle 0x499b49
cmp dword [ebp - 0x1044], ebx
je 0x49996b
cmp word [ebp - 0x1024], bx
jle 0x49996b
mov eax, dword [ebp - 0x1034]
movzx ebx, word [ebp - 0x1024]
lea edi, [esi + eax*8 + 0x3eb0]
mov eax, dword [ebp - 0x1034]
mov eax, dword [esi + eax*8 + 0x3eb8]
sub eax, dword [edi]
push eax
push 0
push dword [edi + 4]
push dword [edi]
push dword [esi + 0x8148]
push esi
call fcn.00499285
dec ebx
jne 0x499943
xor ebx, ebx
mov eax, dword [ebp - 0x1050]
cmp eax, dword [ebp - 0x1020]
mov dword [ebp - 0x1054], eax
je 0x499a96
lea edi, [esi + eax*8 + 0x3eb0]
cmp word [ebp - 0x1024], bx
jle 0x499a73
movzx eax, word [ebp - 0x1024]
mov dword [ebp - 0x103c], eax
push ebx
mov dword [ebp - 0x1018], ebx
push dword [edi + 4]
push dword [edi]
push dword [esi + 0x8148]
call fcn.004809d9
mov ebx, dword [edi + 8]
sub ebx, dword [edi]
lea eax, [ebp - 0x1018]
push eax
push 1
lea eax, [ebp - 0x1028]
push eax
push ebx
push dword [esi + 0x8148]
push esi
call fcn.00499356
mov ax, word [ebp - 0x1030]
cmp ax, word [ebp - 0x1058]
jl 0x499a49
mov eax, dword [edi + 8]
mov ecx, dword [edi + 0xc]
sub eax, 1
push 0
sbb ecx, 0
push ecx
push eax
push dword [esi + 0x8148]
call fcn.004809d9
push 0
lea eax, [ebp - 0x105c]
push eax
push 1
lea eax, [ebp - 0x1019]
push eax
push dword [esi + 0x8148]
mov byte [ebp - 0x1019], 1
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x1028]
xor ecx, ecx
add eax, dword [edi]
push 0
adc ecx, dword [edi + 4]
push ecx
push eax
push dword [esi + 0x8148]
call fcn.004809d9
sub ebx, dword [ebp - 0x1028]
push 0
lea eax, [ebp - 0x1028]
push eax
push ebx
push dword [esi + 0x8148]
push esi
call fcn.00498dbc
xor ebx, ebx
dec dword [ebp - 0x103c]
jne 0x4999a4
mov eax, dword [ebp - 0x104c]
add dword [ebp - 0x1054], eax
shl eax, 3
add edi, eax
mov eax, dword [ebp - 0x1054]
cmp eax, dword [ebp - 0x1020]
jne 0x49998a
cmp dword [ebp - 0x1038], ebx
je 0x499aea
cmp word [ebp - 0x1024], bx
jle 0x499aea
mov eax, dword [ebp - 0x1040]
lea ebx, [esi + eax*8 + 0x3eb8]
lea edi, [esi + eax*8 + 0x3eb0]
movzx eax, word [ebp - 0x1024]
mov dword [ebp - 0x103c], eax
mov eax, dword [ebx]
sub eax, dword [edi]
push eax
push 0
push dword [edi + 4]
push dword [edi]
push dword [esi + 0x8148]
push esi
call fcn.00499285
dec dword [ebp - 0x103c]
jne 0x499ac8
xor ebx, ebx
cmp word [ebp - 0x1048], bx
je 0x499b18
movsx eax, word [ebp - 0x1058]
movsx ecx, word [ebp - 0x1030]
dec eax
cmp ecx, eax
jne 0x499b18
push dword [esi + 0x3eb8]
push dword [ebp - 0x1048]
push esi
call fcn.00486dfa
mov eax, dword [esi + 0x1f7a4]
push dword [eax + 0x1e7ec]
push eax
push esi
call fcn.00483231
cmp al, 2
je 0x499b49
inc dword [ebp - 0x1030]
mov ax, word [ebp - 0x1030]
cmp ax, word [ebp - 0x102c]
jl 0x49991e
mov eax, dword [esi + 0x3ea8]
push ebx
push dword [esi + eax*8 + 0x3ebc]
push dword [esi + eax*8 + 0x3eb8]
push dword [esi + 0x8148]
call fcn.004809d9
mov ecx, dword [esi + 0x3eb0]
push ebx
lea eax, [ebp - 0x1028]
push eax
mov eax, dword [esi + 0x3ea8]
sub ecx, dword [esi + eax*8 + 0x3eb8]
push ecx
push dword [esi + 0x8148]
push esi
call fcn.00498dbc
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.004a9585
leave
ret 8