Function at 0x496630
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x594ccc]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov ebx, ecx
lea eax, [ebx + 4]
push edi
push eax
mov dword [ebp - 0xe8], ebx
mov dword [ebp - 0x110], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0x180]
mov ecx, dword [eax + 4]
lea esi, [ebx + 0x168]
push ecx
mov ecx, esi
call fcn.004447a0
mov eax, dword [esi + 0x18]
mov dword [eax + 4], eax
mov eax, dword [esi + 0x18]
xor edi, edi
mov dword [esi + 0x1c], edi
mov dword [eax], eax
mov esi, dword [esi + 0x18]
mov dword [esi + 8], esi
lea ecx, [ebp - 0xe4]
mov dword [ebx + 0x1c], edi
call fcn.0048ed10
mov edx, dword [ebx + 0x20]
push edx
lea ecx, [ebp - 0xe4]
call fcn.00496020
lea ecx, [ebp - 0xe4]
mov dword [ebp - 0xf0], edi
call fcn.00495050
mov esi, eax
cmp esi, edi
je 0x4967fd
mov eax, dword [esi + 0x14]
mov eax, dword [eax]
mov edi, dword [esi]
mov ebx, eax
mov dword [ebp - 0x100], eax
mov dword [ebp - 0xf8], ebx
test edi, edi
jne 0x496795
call fcn.0051f89a
xor ecx, ecx
mov eax, ebx
cmp eax, dword [ecx + 0x14]
jne 0x4966f9
call fcn.0051f89a
mov eax, dword [ebp - 0x100]
mov ecx, dword [eax + 8]
mov dword [ebp - 0x100], ecx
mov edx, dword [esi + 0x14]
mov eax, dword [esi]
mov dword [ebp - 0x108], edx
test edi, edi
je 0x496715
cmp edi, eax
je 0x49671a
call fcn.0051f89a
cmp ebx, dword [ebp - 0x108]
je 0x4967aa
test edi, edi
jne 0x49679c
call fcn.0051f89a
xor eax, eax
cmp ebx, dword [eax + 0x14]
jne 0x49673b
call fcn.0051f89a
mov eax, dword [ebp - 0x100]
sub eax, dword [ebx + 8]
push 0
cdq
push 0x15180
push edx
push eax
call fcn.0051ef60
mov ecx, dword [ebp - 0xe8]
mov ebx, dword [ecx + 0x190]
xor ecx, ecx
cmp edx, ecx
jg 0x4967a4
jl 0x49676b
cmp eax, ebx
jae 0x4967a4
test edi, edi
jne 0x4967a0
call fcn.0051f89a
xor eax, eax
mov ebx, dword [ebp - 0xf8]
cmp ebx, dword [eax + 0x14]
jne 0x496786
call fcn.0051f89a
mov edx, dword [ebx]
mov dword [ebp - 0xf8], edx
mov ebx, edx
jmp 0x496702
mov ecx, dword [edi]
jmp 0x4966e9
mov eax, dword [edi]
jmp 0x496731
mov eax, dword [edi]
jmp 0x496776
mov ebx, dword [ebp - 0xf8]
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x108], eax
mov eax, dword [esi]
test edi, edi
je 0x4967bd
cmp edi, eax
je 0x4967c2
call fcn.0051f89a
cmp ebx, dword [ebp - 0x108]
je 0x4967eb
mov eax, dword [esi + 0x14]
mov ecx, dword [esi]
push eax
push ecx
push ebx
push edi
lea ecx, [ebp - 0x10c]
push ecx
mov ecx, esi
call fcn.004505c0
mov dword [ebp - 0xf0], 1
lea edx, [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [ebp - 0xe8]
xor edi, edi
mov eax, dword [ebx + 0x20]
cmp dword [eax - 0xc], edi
jne 0x496830
lea ecx, [ebp - 0xe4]
call fcn.0048eac0
mov eax, dword [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051d23b
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0xe8], edi
cmp dword [ebp - 0xf0], edi
je 0x4969c0
cmp dword [esi + 0x18], edi
jbe 0x4969c0
push edi
push 0x80
push 4
push edi
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x49699e
call fcn.00414c40
cmp eax, edi
jne 0x4969c0
mov edx, dword [ebp - 0xe8]
push edi
lea ecx, [ebp - 0xf8]
push ecx
push edi
push edx
mov dword [ebp - 0xfc], edi
mov dword [ebp - 0xf8], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x4968ae
call fcn.00414c40
cmp eax, edi
jge 0x4968ae
jne 0x4969af
mov edx, dword [ebp - 0xe8]
push edi
lea eax, [ebp - 0x100]
push eax
push 0x64
lea ecx, [ebx + 0x24]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4968da
call fcn.00414c40
cmp eax, edi
jne 0x4969af
push edi
push 0x64
lea ecx, [ebp - 0xe8]
call fcn.0041aa10
test eax, eax
jne 0x4969af
lea ecx, [ebp - 0xe8]
call fcn.004150e0
mov eax, dword [esi + 0x14]
mov eax, dword [eax]
mov edi, dword [esi]
mov byte [ebp - 0xe9], 1
mov dword [ebp - 0xf4], edi
mov dword [ebp - 0xf0], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [esi]
mov dword [ebp - 0x108], ecx
test edi, edi
je 0x496928
cmp edi, eax
je 0x49692d
call fcn.0051f89a
mov edx, dword [ebp - 0x108]
cmp dword [ebp - 0xf0], edx
je 0x4969ad
mov dword [ebp - 0x100], 0xffffffff
test edi, edi
jne 0x4969a9
call fcn.0051f89a
mov eax, dword [ebp - 0xf0]
cmp eax, dword [edi + 0x14]
jne 0x49695e
call fcn.0051f89a
mov eax, dword [ebp - 0xf0]
lea ecx, [ebp - 0xe9]
push ecx
lea edx, [ebp - 0x100]
push edx
push 0
add eax, 8
push eax
mov ecx, ebx
call fcn.00484770
push 0
lea ecx, [ebp - 0xfc]
push ecx
lea ecx, [ebp - 0xf4]
call fcn.004443f0
mov edi, dword [ebp - 0xf4]
jmp 0x496915
mov dword [ebp - 0xe8], eax
jmp 0x496878
mov edi, dword [edi]
jmp 0x49694e
xor edi, edi
mov eax, dword [ebp - 0xe8]
cmp eax, edi
je 0x4969c0
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0xe4]
call fcn.0048eac0
mov edx, dword [ebp - 0x110]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.0051d23b
mov esp, ebp
pop ebp
ret